Questions

UIView frame, bounds and center

I would like to know how to use these properties in the right manner. As I understand, `frame` can be used from the container of the view I am creating. It sets the view position relative to the cont...

31 Jul at 05:27

getString Outside of a Context or Activity

I've found the `R.string` pretty awesome for keeping hardcoded strings out of my code, and I'd like to keep using it in a utility class that works with models in my application to generate output. For...

How do I query between two dates using MySQL?

The following query: ``` SELECT * FROM `objects` WHERE (date_field BETWEEN '2010-09-29 10:15:55' AND '2010-01-30 14:15:55') ``` returns nothing. I should have more than enough data to for the que...

21 Aug at 16:21

What is the difference between require_relative and require in Ruby?

What is the difference between `require_relative` and `require` in Ruby?

17 Jan at 15:37

How do I parse JSON with Ruby on Rails?

I'm looking for a simple way to parse JSON, extract a value and write it into a database in Rails. Specifically what I'm looking for, is a way to extract `shortUrl` from the JSON returned from the bi...

28 Oct at 08:33

What is the difference between active and passive FTP?

Can someone tell me what is the difference between active and passive FTP? Which one is preferable?

7 Apr at 13:2

Compare object instances for equality by their attributes

I have a class `MyClass`, which contains two member variables `foo` and `bar`: ``` class MyClass: def __init__(self, foo, bar): self.foo = foo self.bar = bar ``` I have two inst...

19 Oct at 10:11

Python string.join(list) on object array rather than string array

In Python, I can do: ``` >>> list = ['a', 'b', 'c'] >>> ', '.join(list) 'a, b, c' ``` Is there any easy way to do the same when I have a list of objects? ``` >>> class Obj: ... def __str__(sel...

31 Jan at 00:6

How do I overload the [] operator in C#

I would like to add an operator to a class. I currently have a `GetValue()` method that I would like to replace with an `[]` operator. ``` class A { private List<int> values = new List<int>(); ...

16 Aug at 14:48

Angular File Upload

I'm a beginner with Angular, I want to know how to create Angular 5 , I'm trying to find any tutorial or doc, but I don't see anything anywhere. Any idea for this? And I tried [ng4-files](https://git...

7 Jul at 06:0

.NET Core vs Mono

What is the difference between .NET Core and Mono? I found a statement on the official site that said: "Code written for it is also portable across application stacks, such as Mono." My goal is to u...

26 Mar at 23:6

onchange event on input type=range is not triggering in Firefox while dragging

When I played with `<input type="range">`, Firefox triggers an onchange event only if we drop the slider to a new position where Chrome and others triggers onchange events while the slider is dragged....

12 Jul at 16:46

How do you add swap to an EC2 instance?

I'm currently running an ec2 micro instance and i've been finding that the instance occasionally runs out of memory. Other than using a larger instance size, what else can be done?

What is “assert” in JavaScript?

What does `assert` mean in JavaScript? I’ve seen something like: ``` assert(function1() && function2() && function3(), "some text"); ``` And would like to know what the method `assert()` does.

31 May at 22:50

What does "hashable" mean in Python?

I tried searching internet but could not find the meaning of `hashable`. When they say objects are `hashable` or `hashable objects` what does it mean?

10 Sep at 11:6

Assertion failure in dequeueReusableCellWithIdentifier:forIndexPath:

So I was making an rss reader for my school and finished the code. I ran the test and it gave me that error. Here is the code it's referring to: ``` - (UITableViewCell *)tableView:(UITableView *)tabl...

5 Aug at 20:9

Generic deep diff between two objects

I have two objects: `oldObj` and `newObj`. The data in `oldObj` was used to populate a form and `newObj` is the result of the user changing data in this form and submitting it. Both objects are deep, ...

20 Jun at 09:12

What is the purpose of a stack? Why do we need it?

So I am learning MSIL right now to learn to debug my C# .NET applications. I've always wondered: - - - I'm trying to grasp this to help me understand [CIL](http://en.wikipedia.org/wiki/Common_...

17 Apr at 21:52

Maven: Failed to read artifact descriptor

I am hoping someone can help me with a problem I am struggling with. When I try to build my project from the terminal I get this error: ``` Failed to read artifact descriptor for com.morrislgn.merch...

23 Jun at 04:30

How to print Boolean flag in NSLog?

Is there a way to print value of Boolean flag in NSLog?

5 Aug at 20:19

BeautifulSoup getting href

I have the following `soup`: ``` <a href="some_url">next</a> <span class="class">...</span> ``` From this I want to extract the href, `"some_url"` I can do it if I only have one tag, but here there a...

29 Nov at 21:21

The opposite of Intersect()

Intersect can be used to find matches between two collections, like so: ``` // Assign two arrays. int[] array1 = { 1, 2, 3 }; int[] array2 = { 2, 3, 4 }; // Call Intersect extension method. var inter...

20 Sep at 11:22

How to place and center text in an SVG rectangle

I have the following rectangle: ``` <rect x="0px" y="0px" width="60px" height="20px"/> ``` I would like to center the word "Fiction" inside of it. For other rectangles, does SVG word wrap to stay wit...

7 Dec at 16:46

Reading a key from the Web.Config using ConfigurationManager

I am trying to read the keys from the `Web.config` file in a different layer than the web layer (Same solution) Here is what I am trying: ``` string userName = System.Configuration.ConfigurationMana...

31 Aug at 15:36

Serialize an object to XML

I have a C# class that I have inherited. I have successfully "built" the object. But I need to serialize the object to XML. Is there an easy way to do it? It looks like the class has been set up for ...

13 May at 21:33