Questions

How do I convert a PDF document to a preview image in PHP?

What libraries, extensions etc. would be required to render a portion of a PDF document to an image file? Most PHP PDF libraries that I have found center around creating PDF documents, but is there a...

7 Mar at 15:2

Drawing an SVG file on a HTML5 canvas

Is there a default way of drawing an SVG file onto a HTML5 canvas? Google Chrome supports loading the SVG as an image (and simply using `drawImage`), but the developer console does warn that `resource...

23 May at 12:3

jQuery check if <input> exists and has a value

I have the following example: ``` <input type="text" class="input1" value="bla"/> ``` Is there a way to check if this element exists and has a value in one statement? Or, at least, anything shorter...

13 Jan at 18:27

How to get JSON response from http.Get

I'm trying read JSON data from web, but that code returns empty result. I'm not sure what I'm doing wrong here. ``` package main import "os" import "fmt" import "net/http" import "io/ioutil" import ...

11 Aug at 14:36

Regex expressions in Java, \\s vs. \\s+

What's the difference between the following two expressions? ``` x = x.replaceAll("\\s", ""); x = x.replaceAll("\\s+", ""); ```

16 Nov at 23:33

Is there a way to word-wrap long words in a div?

I know Internet Explorer has a word-wrap style, but I'd like to know if there is a cross-browser method of doing so to text in a div. Preferably CSS but JavaScript snippets would work ok too. I'm refe...

24 Dec at 09:9

How to redirect the output of DBMS_OUTPUT.PUT_LINE to a file?

I need to debug in pl/sql to figure times of procedures, I want to use: ``` SELECT systimestamp FROM dual INTO time_db; DBMS_OUTPUT.PUT_LINE('time before procedure ' || time_db); ``` but I don't un...

Compare two List<T> objects for equality, ignoring order

Yet another list-comparing question. ``` List<MyType> list1; List<MyType> list2; ``` I need to check that they both have the same elements, regardless of their position within the list. Each objec...

7 Jan at 16:56

Determine if char is a num or letter

How do I determine if a `char` in C such as `a` or `9` is a number or a letter? Is it better to use: ``` int a = Asc(theChar); ``` or this? ``` int a = (int)theChar ```

4 Jun at 20:0

"Permission Denied" trying to run Python on Windows 10

Seems as though an update on Windows 10 overnight broke Python. Just trying to run `python --version` returned a "Permission Denied" error. None of the three updates; KB4507453, KB4506991, or KB45090...

How to configure postgresql for the first time?

I have just installed postgresql and I specified password x during installation. When I try to do `createdb` and specify any password I get the message: > createdb: could not connect to database pos...

Using the passwd command from within a shell script

I'm writing a shell script to automatically add a new user and update their password. I don't know how to get passwd to read from the shell script instead of interactively prompting me for the new pas...

17 Feb at 06:7

Running Windows batch file commands asynchronously

Say, if I have - - - How do I run all of them from a batch file asynchronously, i.e. without waiting for the previous program to stop?

9 Nov at 15:25

"Parser Error Message: Could not load type" in Global.asax

I'm working on an MVC3 project and receive the following error: > Parser Error Message: Could not load type 'GodsCreationTaxidermy.MvcApplication'. Source Error: > Line 1: `<%@ Application Codebeh...

22 Aug at 19:32

Converting string "true" / "false" to boolean value

I have a JavaScript string containing `"true"` or `"false"`. How may I convert it to boolean without using the `eval` function?

7 Sep at 13:1

How do I autoindent in Netbeans?

In eclipse you can click + at any line, and it'll automatically indent the line or group of lines according to the indentation scheme you chose in the settings. I'm really missing this feature in Net...

21 Jul at 08:40

What does the percentage sign mean in Python

In the tutorial there is an example for finding prime numbers: ``` >>> for n in range(2, 10): ... for x in range(2, n): ... if n % x == 0: ... print(n, 'equals', x, '*', n//x)...

7 Jul at 10:35

Is there a JavaScript function that can pad a string to get to a determined length?

I am in need of a JavaScript function which can take a value and pad it to a given length (I need spaces, but anything would do). I found this, but I have no idea what the heck it is doing and it does...

24 Sep at 10:46

Creating Scheduled Tasks

I am working on a C# WPF project. I need to allow the user to create and add a scheduled task to the Windows Task Scheduler. How could I go about doing this and what using directives and references ...

10 Jan at 06:46

How to use stringstream to separate comma separated strings

I've got the following code: ``` std::string str = "abc def,ghi"; std::stringstream ss(str); string token; while (ss >> token) { printf("%s\n", token.c_str()); } ``` The output is: > abc def,gh...

20 Jun at 09:12

javascript remove "disabled" attribute from html input

How can I remove the "disabled" attribute from an HTML input using javascript? ``` <input id="edit" disabled> ``` at onClick I want my input tag to not consist of "disabled" attribute.

22 Aug at 03:33

What is the difference between __dirname and ./ in node.js?

When programming in Node.js and referencing files that are located somewhere in relation to your current directory, is there any reason to use the `__dirname` variable instead of just a regular `./`? ...

25 Mar at 14:19

anchor jumping by using javascript

I have a question that will be found very often. The problem is that nowhere can be found an explicit solution. I have two problems regarding anchors. The main goal should be to get a nice clean url...

6 Aug at 05:17

How to filter a dictionary according to an arbitrary condition function?

I have a dictionary of points, say: ``` >>> points={'a':(3,4), 'b':(1,2), 'c':(5,5), 'd':(3,3)} ``` I want to create a new dictionary with all the points whose x and y value is smaller than 5, i.e....

20 Nov at 22:23

CSS: fixed to bottom and centered

I need my footer to be fixed to the bottom of the page and to center it. The contents of the footer may change at all time so I can't just center it via margin-left: xxpx; margin-right: xxpx; The pro...

9 Jun at 16:28