Questions

Converting double to string

I am not sure it is me or what but I am having a problem converting a double to string. here is my code: ``` double total = 44; String total2 = Double.toString(total); ``` Am i doing something wro...

28 Jul at 15:43

pull out p-values and r-squared from a linear regression

How do you pull out the p-value (for the significance of the coefficient of the single explanatory variable being non-zero) and R-squared value from a simple linear regression model? For example... `...

7 Apr at 21:7

How to print register values in GDB?

How do I print the value of `%eax` and `%ebp`? ``` (gdb) p $eax $1 = void ```

14 Jun at 23:30

Java associative-array

How can I create and fetch associative arrays in Java like I can in PHP? For example: ``` $arr[0]['name'] = 'demo'; $arr[0]['fname'] = 'fdemo'; $arr[1]['name'] = 'test'; $arr[1]['fname'] = 'fname'; ...

3 Jul at 11:28

Why would one use nested classes in C++?

Can someone please point me towards some nice resources for understanding and using nested classes? I have some material like Programming Principles and things like this [IBM Knowledge Center - Nested...

20 Apr at 12:36

How to simulate a button click using code?

How can I trigger a button click event using code in Android? I want to trigger the button click programmatically when some other event occurs. Same Problem I am Facing ``` public void onDateSelect...

21 May at 15:37

What are the advantages of using getters and setters instead of functions or simply public fields in PHP?

I'm not a PHP developer, so I'm wondering what the advantages and disadvantages are in PHP to using explicit getter/setters, in a pure OOP style, with private fields (the way I like): ``` class MyClas...

5 Sep at 11:18

Is it possible to do a sparse checkout without checking out the whole repository first?

I'm working with a repository with a very large number of files that takes hours to checkout. I'm looking into the possibility of whether Git would work well with this kind of repository now that it s...

Which selector do I need to select an option by its text?

I need to check if a `<select>` has an option whose text is equal to a specific value. For example, if there's an `<option value="123">abc</option>`, I would be looking for "abc". Is there a selecto...

8 Jul at 06:21

How can I get an element's ID value with JavaScript?

Is there another way to get an DOM element's ID? ``` element.getAttribute('id') ```

9 Nov at 17:55

Generate the ERD for an existing database

I have a PostgreSQL database. I want to generate ERD from that database. Are there any built-in tools to do it or maybe some third-party tools?

23 Dec at 02:9

Determine the line of code that causes a segmentation fault?

How does one determine where the mistake is in the code that causes a [segmentation fault](https://stackoverflow.com/questions/2346806/what-is-a-segmentation-fault)? Can my compiler (`gcc`) show the ...

26 Jan at 22:43

Get value from SimpleXMLElement Object

I have something like this: ``` $url = "http://ws.geonames.org/findNearbyPostalCodes?country=pl&placename="; $url .= rawurlencode($city[$i]); $xml = simplexml_load_file($url); echo $url."\n"; $cityC...

30 May at 22:35

How to add ID property to Html.BeginForm() in asp.net mvc?

I want to validate my form using jquery but it doesn't have an `ID` property as of now how to add it to the form in asp.net mvc? I am using this... ``` <% using (Html.BeginForm()) {%> ``` and my jq...

18 May at 04:44

Maximum packet size for a TCP connection

What is the maximum packet size for a TCP connection or how can I get the maximum packet size?

11 Dec at 09:4

What is an MvcHtmlString and when should I use it?

The [documentation](http://msdn.microsoft.com/en-us/library/system.web.mvc.mvchtmlstring%28VS.100%29.aspx) for `MvcHtmlString` is not terribly enlightening: > Represents an HTML-encoded string that s...

19 Feb at 00:49

How to select records from last 24 hours using SQL?

I am looking for a `where` clause that can be used to retrieve records for the last 24 hours?

7 Nov at 16:8

What is the difference between a JavaBean and a POJO?

I'm not sure about the difference. I'm using Hibernate and, in some books, they use JavaBean and POJO as an interchangeable term. I want to know if there is a difference, not just in the Hibernate con...

6 Mar at 14:26

Struct inheritance in C++

Can a `struct` be inherited in C++?

15 Dec at 19:42

PHP Pass variable to next page

It seems pretty simple but I can't find a good way to do it. Say in the first page I create a variable ``` $myVariable = "Some text"; ``` And the form's action for that page is "Page2.php". So in ...

18 Jul at 19:15

ORDER BY the IN value list

I have a simple SQL query in PostgreSQL 8.3 that grabs a bunch of comments. I provide a list of values to the `IN` construct in the `WHERE` clause: ``` SELECT * FROM comments WHERE (comments.id IN (...

5 Mar at 00:26

Ruby: How to turn a hash into HTTP parameters?

That is pretty easy with a plain hash like ``` {:a => "a", :b => "b"} ``` which would translate into ``` "a=a&b=b" ``` But what do you do with something more complex like ``` {:a => "a", :b ...

15 Mar at 11:33

How do I see the extensions loaded by PHP?

It's got to be somewhere in the phpinfo() dump, but I just don't know where. Is it supposed to be under the "Additional Modules" section? Somewhere else? I'm trying to figure out why some extension...

6 Jan at 16:35

How do I set the selected item in a comboBox to match my string using C#?

I have a string "test1" and my comboBox contains `test1`, `test2`, and `test3`. How do I set the selected item to "test1"? That is, how do I match my string to one of the comboBox items? I was thinki...

1 Jul at 19:13

Is there a WinSCP equivalent for Linux?

I love [WinSCP](https://en.wikipedia.org/wiki/WinSCP) for Windows. What is the best equivalent software for Linux? I tried to use sshfs to mount the remote file system on my local machine, but it is ...

12 Oct at 19:5