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...
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...
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...
- Modified
- 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 ...
Regex expressions in Java, \\s vs. \\s+
What's the difference between the following two expressions? ``` x = x.replaceAll("\\s", ""); x = x.replaceAll("\\s+", ""); ```
- Modified
- 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...
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...
- Modified
- 16 May at 03:43
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...
- Modified
- 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 ```
- Modified
- 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...
- Modified
- 26 Apr at 01:39
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...
- Modified
- 10 Jul at 12:59
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...
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?
- Modified
- 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...
- Modified
- 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?
- Modified
- 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...
- Modified
- 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)...
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...
- Modified
- 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 ...
- Modified
- 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...
- Modified
- 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.
- Modified
- 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 `./`? ...
- Modified
- 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...
- Modified
- 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....
- Modified
- 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...
- Modified
- 9 Jun at 16:28