Questions

Handling very large numbers in Python

I've been considering fast poker hand evaluation in Python. It occurred to me that one way to speed the process up would be to represent all the card faces and suits as prime numbers and multiply them...

9 Mar at 07:34

How to get the correct range to set the value to a cell?

I want to set text or number in Google Sheet from script. I want to set `Hello` or number `9` in cell `F2`. I found this code so far: ``` SpreadsheetApp.getActiveRange().setValue('hello'); ``` ...

25 Nov at 06:45

Retrieving Android API version programmatically

Is there any way to get the API version that the phone is currently running?

15 May at 18:36

How to avoid 'cannot read property of undefined' errors?

In my code, I deal with an array that has some entries with many objects nested inside one another, where as some do not. It looks something like the following: ``` // where this array is hundreds of ...

16 Jul at 07:32

Export SQL query data to Excel

I have a query that returns a very large data set. I cannot copy and paste it into Excel which I usually do. I have been doing some research on how to export directly to an Excel sheet. I am running S...

10 Feb at 06:49

Working with a List of Lists in Java

I'm trying to read a CSV file into a list of lists (of strings), pass it around for getting some data from a database, build a new list of lists of new data, then pass that list of lists so it can be ...

18 Sep at 00:1

How to set the 'selected option' of a select dropdown list with jquery

I have the following jquery function: ``` $.post('GetSalesRepfromCustomer', { data: selectedObj.value }, function (result) { alert(result[0]); $('select[name^="salesrep"]').val(result[0])...

25 Jul at 11:35

How to use shared memory with Linux in C

I have a bit of an issue with one of my projects. I have been trying to find a well documented example of using shared memory with `fork()` but to no success. Basically the scenario is that when th...

15 Mar at 03:53

Deleting all files from a folder using PHP?

For example I had a folder called `Temp' and I wanted to delete or flush all files from this folder using PHP. Could I do this?

9 Aug at 22:9

How do I get a Cron like scheduler in Python?

I'm looking for a library in Python which will provide `at` and `cron` like functionality. I'd quite like have a pure Python solution, rather than relying on tools installed on the box; this way I ru...

15 Nov at 11:41

What are POD types in C++?

I've come across this term POD-type a few times. What does it mean?

19 Apr at 13:44

Python recursive folder read

I have a C++/Obj-C background and I am just discovering Python (been writing it for about an hour). I am writing a script to recursively read the contents of text files in a folder structure. The pro...

17 May at 20:4

changing source on html5 video tag

I'm trying to build a video player that works everywhere. so far I'd be going with: ``` <video> <source src="video.mp4"></source> <source src="video.ogv"></source> <object data="flowplayer...

18 Mar at 04:40

Bootstrap Dropdown with Hover

OK, so what I need is fairly straightforward. I have set up a navbar with some dropdown menus in it (using `class="dropdown-toggle" data-toggle="dropdown"`), and it works fine. The thing is it works...

Way to ng-repeat defined number of times instead of repeating over array?

Is there a way to `ng-repeat` a defined number of times instead of always having to iterate over an array? For example, below I want the list item to show up 5 times assuming `$scope.number` equal to...

Get everything after the dash in a string in JavaScript

What would be the cleanest way of doing this that would work in both IE and Firefox? My string looks like this `sometext-20202` Now the `sometext` and the integer after the dash can be of varying leng...

16 Feb at 09:10

How to show "if" condition on a sequence diagram?

I was wondering, how can one represent "`if`" statement on a sequence diagram? ``` if (somethingShouldBeDone) { // Do it } else { // Do something else } ``` Can it be represented at a...

13 Nov at 21:11

Spring Boot: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean

I am totally new to Spring and started to do the official guides from this site: [https://spring.io/guides](https://spring.io/guides) I'd like to do this guide: [https://spring.io/guides/gs/schedulin...

19 Oct at 12:1

Why can't I define a static method in a Java interface?

Here's the example: ``` public interface IXMLizable<T> { static T newInstanceFromXML(Element e); Element toXMLElement(); } ``` Of course this won't work. But why not? One of the possible i...

20 May at 12:42

Python "extend" for a dictionary

What is the best way to extend a dictionary with another one while avoiding the use of a `for` loop? For instance: ``` >>> a = { "a" : 1, "b" : 2 } >>> b = { "c" : 3, "d" : 4 } >>> a {'a': 1, 'b': 2} ...

27 Aug at 21:44

Excel Date to String conversion

In a cell in Excel sheet I have a Date value like: ``` 01/01/2010 14:30:00 ``` I want to convert that Date to Text and also want the Text to look exactly like Date. So a Date value of `01/01/2010 1...

29 Mar at 06:48

Get the key corresponding to the minimum value within a dictionary

If I have a Python dictionary, how do I get the key to the entry which contains the minimum value? I was thinking about something to do with the `min()` function... Given the input: ``` {320:1, 321...

22 Apr at 14:21

How to convert number to words in java

We currently have a crude mechanism to convert numbers to words (e.g. using a few static arrays) and based on the size of the number translating that into an english text. But we are running into issu...

12 Oct at 05:41

MongoDB: Is it possible to make a case-insensitive query?

Example: ``` > db.stuff.save({"foo":"bar"}); > db.stuff.find({"foo":"bar"}).count(); 1 > db.stuff.find({"foo":"BAR"}).count(); 0 ```

8 Dec at 05:18

Mockito. Verify method arguments

I've googled about this, but didn't find anything relevant. I've got something like this: ``` Object obj = getObject(); Mockeable mock= Mockito.mock(Mockeable.class); Mockito.when(mock.mymethod(obj )...

1 Jul at 16:12