How do I convert Long to byte[] and back in java
How do I convert a `long` to a `byte[]` and back in Java? I'm trying convert a `long` to a `byte[]` so that I will be able to send the `byte[]` over a TCP connection. On the other side I want to take...
- Modified
- 28 Feb at 17:5
Change the Right Margin of a View Programmatically?
Can this attribute be changed dynamically in Java code? ``` android:layout_marginRight ``` I have a `TextView`, that has to change its position some pixels to the left dynamically. How to do it p...
Setting href attribute at runtime
What is the best way to set the `href` attribute of the `<a>` tag at run time using jQuery? Also, how do you get the value of the `href` attribute of the `<a>` tag using jQuery?
- Modified
- 10 Oct at 13:13
horizontal scrollbar on top and bottom of table
I've a very large `table` on my page. So I decided to put a horizontal scrollbar on the bottom of the table. But I would like this scrollbar to be also on top on the table. What I have in the templat...
- Modified
- 28 Jan at 15:16
How to open a local disk file with JavaScript?
I tried to open file with ``` window.open("file:///D:/Hello.txt"); ``` The browser does not allow opening a local file this way, probably for security reasons. I want to use the file's data in the ...
- Modified
- 18 Apr at 18:13
Reading CSV files using C#
I'm writing a simple import application and need to read a CSV file, show result in a `DataGrid` and show corrupted lines of the CSV file in another grid. For example, show the lines that are shorter ...
LINQ Contains Case Insensitive
This code is case sensitive, how to make it case insensitive? ``` public IQueryable<FACILITY_ITEM> GetFacilityItemRootByDescription(string description) { return this.ObjectContext.FACILITY_ITEM....
Entity framework linq query Include() multiple children entities
This may be a really elementry question but whats a nice way to include multiple children entities when writing a query that spans THREE levels (or more)? i.e. I have 4 tables: `Company`, `Employee`,...
- Modified
- 28 Apr at 13:9
Android emulator-5554 offline
I'm having a problem with emulator-5554, it keeps telling me it is offline. When I do a `adb devices` from the command line it says `emulator-5554 offline` Even after a fresh restart, I try that c...
- Modified
- 19 Aug at 18:34
How to detect if a property exists on an ExpandoObject?
In javascript you can detect if a property is defined by using the undefined keyword: ``` if( typeof data.myProperty == "undefined" ) ... ``` How would you do this in C# using the dynamic keyword...
- Modified
- 19 Jul at 19:22
C# Double - ToString() formatting with two decimal places but no rounding
How do I format a `Double` to a `String` in C# so as to have only two decimal places? If I use `String.Format("{0:0.00}%", myDoubleValue)` the number is then rounded and I want a simple truncate wit...
?? Coalesce for empty string?
Something I find myself doing more and more is checking a string for empty (as in `""` or null) and a conditional operator. A current example: ``` s.SiteNumber.IsNullOrEmpty() ? "No Number" : s.Site...
- Modified
- 20 Jun at 08:7
How to show Page Loading div until the page has finished loading?
I have a section on our website that loads quite slowly as it's doing some intensive calls. Any idea how I can get a `div` to say something similar to "loading" to show while the page prepares itself ...
- Modified
- 22 Jun at 09:25
How do I implement onchange of <input type="text"> with jQuery?
`<select>` has this API. What about `<input>`?
Assign same value to multiple variables in single statement
Is there any way (just out of curiosity because I came across multiple same-value assignments to multiple variables today) in C# to assign one value to multiple variables at once in a single statement...
- Modified
- 4 Nov at 13:18
On localhost, how do I pick a free port number?
I'm trying to play with inter-process communication and since I could not figure out how to use named pipes under Windows I thought I'll use network sockets. Everything happens locally. The server is ...
How do I compare two strings in Perl?
How do I compare two strings in Perl? I am learning Perl, I had this basic question looked it up here on StackOverflow and found no good answer so I thought I would ask.
- Modified
- 24 Jul at 01:36
How do pointer-to-pointers work in C? (and when might you use them?)
How do pointers-to-pointers work in C? When might you use them?
Add 2 hours to current time in MySQL?
Which is the valid syntax of this query in MySQL? ``` SELECT * FROM courses WHERE (now() + 2 hours) > start_time ```
- Modified
- 26 Feb at 09:34
Deleting multiple elements from a list
Is it possible to delete multiple elements from a list at the same time? If I want to delete elements at index 0 and 2, and try something like `del somelist[0]`, followed by `del somelist[2]`, the sec...
Have a reloadData for a UITableView animate when changing
I have a UITableView that has two modes. When we switch between the modes I have a different number of sections and cells per section. Ideally, it would do some cool animation when the table grows o...
- Modified
- 4 Mar at 16:43
NTFS performance and large volumes of files and directories
How does Windows with NTFS perform with large volumes of files and directories? Is there any guidance around limits of files or directories you can place in a single directory before you run into per...
- Modified
- 26 Nov at 10:45
Open multiple Eclipse workspaces on the Mac
How can I open multiple Eclipse workspaces at the same time on the Mac? On other platforms, I can just launch extra Eclipse instances, but the Mac will not let me open the same application twice. Is ...
Display date/time in user's locale format and time offset
I want the server to always serve dates in UTC in the HTML, and have JavaScript on the client site convert it to the user's local timezone. Bonus if I can output in the user's locale date format.
- Modified
- 2 Dec at 19:22