Questions

How do I convert struct System.Byte byte[] to a System.IO.Stream object in C#?

How do I convert struct `System.Byte` `byte[]` to a `System.IO.Stream` object in ?

19 Apr at 17:55

How to comment and uncomment blocks of code in the Office VBA Editor

In the VBA editor of Office ( + ), how do you comment or uncomment a block of code?

2 Apr at 18:5

How to get the primary IP address of the local machine on Linux and OS X?

I am looking for a command line solution that would return me the primary (first) IP address of the localhost, other than 127.0.0.1 The solution should work at least for Linux (Debian and RedHat) and...

11 Aug at 15:7

What's the best way to determine the location of the current PowerShell script?

Whenever I need to reference a common module or script, I like to use paths relative to the current script file. That way, my script can always find other scripts in the library. So, what is the best...

21 Oct at 23:3

List all files in one directory PHP

What would be the best way to list all the files in one directory with PHP? Is there a $_SERVER function to do this? I would like to list all the files in the usernames/ directory and loop over that r...

2 Apr at 21:23

Check status of one port on remote host

I need a command line that can check the port status on a remote host. I tried `ping xxx.xxx.xxx.xxx:161` but it doesn't recognize the "host". I thought it was a "good" answer until I did the same c...

12 Oct at 20:35

How to add bootstrap to an angular-cli project

We want to use bootstrap 4 (4.0.0-alpha.2) in our app generated with angular-cli 1.0.0-beta.5 (w/ node v6.1.0). After getting bootstrap and its dependencies with npm, our first approach consisted in ...

Refresh a page using JavaScript or HTML

How can I refresh a page using JavaScript or HTML?

6 Sep at 11:15

Laravel 4: how to "order by" using Eloquent ORM

Simple question - how do I order by 'id' descending in Laravel 4. The relevant part of my controller looks like this: ``` $posts = $this->post->all() ``` As I understand you use this line: ``` ->...

9 Jul at 16:13

How to change spinner text size and text color?

In my Android application, I am using spinner, and I have loaded data from the SQLite database into the spinner, and it's working properly. Here is the code for that. ``` Spinner spinner = (Spinner) ...

26 Nov at 23:54

What is the naming convention in Python for variable and function?

Coming from a C# background the naming convention for variables and method names are usually either camelCase or PascalCase: ``` // C# example string thisIsMyVariable = "a" public void ThisIsMyMethod...

sklearn error ValueError: Input contains NaN, infinity or a value too large for dtype('float64')

I am using sklearn and having a problem with the affinity propagation. I have built an input matrix and I keep getting the following error. ``` ValueError: Input contains NaN, infinity or a value to...

Export html table data to Excel using JavaScript / JQuery is not working properly in chrome browser

I have a HTML table in velocity template. I want to export the html table data to excel using either java script or jquery, comatibale with all browser. I am using below script ``` <script type="te...

SQL to find the number of distinct values in a column

I can select all the distinct values in a column in the following ways: - `SELECT DISTINCT column_name FROM table_name;`- `SELECT column_name FROM table_name GROUP BY column_name;` But how do I get ...

5 Apr at 21:38

Formatting a number with leading zeros in PHP

I have a variable which contains the value `1234567`. I would like it to contain exactly 8 digits, i.e. `01234567`. Is there a PHP function for that?

10 Aug at 04:0

How do I create an HTML table with a fixed/frozen left column and a scrollable body?

I need a simple solution. I know it's similar to some other questions, like: - [HTML table with fixed headers and a fixed column?](https://stackoverflow.com/questions/684211/html-table-with-fixed-hea...

29 Oct at 06:49

How to convert JSON object to JavaScript array?

I need to convert JSON object string to a JavaScript array. This my JSON object: ``` {"2013-01-21":1,"2013-01-22":7} ``` And I want to have: ``` var data = new google.visualization.DataTable(); d...

8 Nov at 10:6

How to dynamically change a web page's title?

I have a webpage that implements a set of tabs each showing different content. The tab clicks do not refresh the page but hide/unhide contents at the client side. Now there is a requirement to change...

9 Aug at 13:47

How to change the style of alert box?

I need to change the style of the "OK" Button in an box. ``` <head> <script type="text/javascript"> function show_alert() { alert("Hello! I am an alert box!"); } ...

21 Oct at 14:39

How to use java.String.format in Scala?

I am trying to use a `.format` method of a string. But if I place %1, %2, etc. in the string, java.util.UnknownFormatConversionException is thrown pointing to a confusing Java source code piece: ``` ...

25 Jul at 19:7

Is there a 'foreach' function in Python 3?

When I meet the situation I can do it in javascript, I always think if there's an `foreach` function it would be convenience. By foreach I mean the function which is described below: ``` def foreach(...

27 May at 13:57

How to decompile a whole Jar file?

Does anyone know of a free decompiler that can decompile an entire Jar file instead of a single class? I have a problem with sub classes like name$1.class name$2.class name.class

5 Aug at 12:0

CURL Command Line URL Parameters

I am trying to send a `DELETE` request with a url parameter using CURL. I am doing: ``` curl -H application/x-www-form-urlencoded -X DELETE http://localhost:5000/locations` -d 'id=3' ``` However, t...

14 Nov at 00:30

window.close and self.close do not close the window in Chrome

The issue is that when I invoke `window.close()` or `self.close()` it doesn't close the window. Now there seems to be a belief that in Chrome you can't close by script any window that is not script cr...

How to wait in a batch script?

I am trying to write a batch script and trying to wait 10 seconds between 2 function calls. The command: ``` sleep 10 ``` Does not make the batch file wait for 10 seconds. I am running Windows XP...

2 Feb at 09:14