Questions

Update a submodule to the latest commit

I have a project A which is a library and it is used in a project B. Both projects A and B have a separate repository on github BUT inside B we have a submodule of A. I edited some classes on the li...

28 May at 02:3

How to get the CPU Usage in C#?

I want to get the overall total CPU usage for an application in C#. I've found many ways to dig into the properties of processes, but I only want the CPU usage of the processes, and the total CPU like...

27 Dec at 16:12

Storage permission error in Marshmallow

In Lollipop, the download functionality works fine in my app, but when I upgraded to Marshmallow, my app crashes and gives this error when I try to download from the internet into the SD card: ``` N...

How do I check when a UITextField changes?

I am trying to check when a text field changes, equivalent too the function used for textView - `textViewDidChange` so far I have done this: ``` func textFieldDidBeginEditing(textField: UITextField)...

27 Sep at 10:16

SyntaxError: import declarations may only appear at top level of a module

I am trying to use a plugin called "Simplebar" found on GitHub, [GitHub SimpleBar](https://github.com/Grsmto/simplebar) but after downloading the scripts and looking at the simple.js script, it looks ...

11 Dec at 15:5

What do the python file extensions, .pyc .pyd .pyo stand for?

What do these python file extensions mean? - `.pyc`- `.pyd`- `.pyo` What are the differences between them and how are they generated from a *.py file?

27 Dec at 16:47

VBA array sort function?

I'm looking for a decent sort implementation for arrays in VBA. A Quicksort would be preferred. Or any other [sort algorithm](http://web.archive.org/web/20180224071555/http://www.cs.ubc.ca:80/~harriso...

16 Oct at 23:43

How can I send an HTTP POST request to a server from Excel using VBA?

What VBA code is required to perform an HTTP POST from an Excel spreadsheet?

5 Jul at 20:30

How can I loop through ALL DOM elements on a page?

I'm trying to loop over ALL elements on a page, so I want to check every element that exists on this page for a special class. So, how do I say that I want to check EVERY element?

10 Feb at 14:27

Angular ng-repeat Error "Duplicates in a repeater are not allowed."

I am defining a custom filter like so: ``` <div class="idea item" ng-repeat="item in items" isoatom> <div class="section comment clearfix" ng-repeat="comment in item.comments | range:1:2"> ...

16 Jun at 16:29

Is it possible to ping a server from Javascript?

I'm making a web app that requires that I check to see if remote servers are online or not. When I run it from the command line, my page load goes up to a full 60s (for 8 entries, it will scale linear...

9 Sep at 12:56

How do I create a list of random numbers without duplicates?

I tried using `random.randint(0, 100)`, but some numbers were the same. Is there a method/module to create a list unique random numbers?

18 Dec at 17:51

How to change Apache Tomcat web server port number

How to change Apache Tomcat web server default port number? --- I am developing a web application in JSP, in that for some purpose I need to change tomcat accessing port. Is there any possibility? ...

5 Feb at 11:22

Remove blank lines with grep

I tried `grep -v '^$'` in Linux and that didn't work. This file came from a Windows file system.

4 Oct at 09:7

Execute Insert command and return inserted Id in Sql

I am inserting some values into a SQL table using C# in MVC 4. Actually, I want to insert values and return the 'ID' of last inserted record. I use the following code. ``` public class MemberBasicData...

3 Jul at 16:41

Error "undefined reference to 'std::cout'"

Shall this be the example: ``` #include <iostream> using namespace std; int main() { cout << "Hola, moondo.\n"; } ``` It throws the error: ``` gcc -c main.cpp gcc -o edit main.o main.o: In func...

3 Apr at 15:7

Convert time.Time to string

I'm trying to add some values from my database to a `[]string` in Go. Some of these are timestamps. I get the error: > cannot use U.Created_date (type time.Time) as type string in array element Can...

4 Sep at 14:49

Get Character value from KeyCode in JavaScript... then trim

This is what I have now: ``` $("input").bind("keydown",function(e){ var value = this.value + String.fromCharCode(e.keyCode); } ``` If the `e.keyCode` may not be an ASCII character (, , , , etc....

How to convert FormData (HTML5 object) to JSON

How do I convert the entries from a HTML5 `FormData` object to JSON? The solution should not use jQuery. Also, it should not simply serialize the entire `FormData` object, but only its key/value entri...

31 Dec at 13:36

How to create a session using JavaScript?

How to create session in `JavaScript`? I try like this: ``` <script type="text/javascript" > { Session["controlID"] ="This is my session"; } </script> ``` Why I looking for session? I make a re...

5 Aug at 09:6

Call a Vue.js component method from outside the component

Let's say I have a main Vue instance that has child components. Is there a way of calling a method belonging to one of these components from outside the Vue instance entirely? Here is an example: ``...

11 Feb at 10:46

Open text file and program shortcut in a Windows batch file

I have two files in the same folder that I'd like to run. One is a `.txt` file, and the other is the program shortcut to an `.exe`. I'd like to make a batch file in the same location to open the text ...

Getting HTTP code in PHP using curl

I'm using CURL to get the status of a site, if it's up/down or redirecting to another site. I want to get it as streamlined as possible, but it's not working well. ``` <?php $ch = curl_init($url); cu...

13 Jul at 16:15

One line if statement not working

``` <%if @item.rigged %>Yes<%else%>No<%end%> ``` I was thinking of something like this? ``` if @item.rigged ? "Yes" : "No" ``` But it doesn't work. Ruby has the `||=` but I"m not even sure how to...

2 Jul at 07:18

Left function in c#

what is the alternative for Left function in c# i have this in ``` Left(fac.GetCachedValue("Auto Print Clinical Warnings").ToLower + " ", 1) == "y"); ```

2 Feb at 13:35