Questions

Cannot set property 'innerHTML' of null

Why do I get an error or Uncaught TypeError: Cannot set property 'innerHTML' of null? I thought I understood innerHTML and had it working before. ``` <!DOCTYPE HTML> <html> <head> <meta http-equiv="C...

14 Aug at 19:1

Recursively look for files with a specific extension

I'm trying to find all files with a specific extension in a directory and its subdirectories with my bash (Latest Ubuntu LTS Release). This is what's written in a script file: ``` #!/bin/bash direc...

1 May at 14:24

How to check if a file contains a specific string using Bash

I want to check if a file contains a specific string or not in bash. I used this script, but it doesn't work: ``` if [[ 'grep 'SomeString' $File' ]];then # Some Actions fi ``` What's wrong in m...

8 May at 19:51

How to have the cp command create any necessary folders for copying a file to a destination

When copying a file using `cp` to a folder that may or may not exist, how do I get `cp` to create the folder if necessary? Here is what I have tried: ``` [root@file nutch-0.9]# cp -f urls-resume /no...

13 Sep at 21:1

How do I make function decorators and chain them together?

How do I make two decorators in Python that would do the following? ``` @make_bold @make_italic def say(): return "Hello" ``` Calling `say()` should return: ``` "<b><i>Hello</i></b>" ```

MySQL root access from all hosts

I've installed MySQL server on a remote Ubuntu machine. The `root` user is defined in the `mysql.user` table this way: ``` mysql> SELECT host, user, password FROM user WHERE user = 'root'; +---------...

16 Oct at 06:47

How to get first 5 characters from string

How to get first 5 characters from string using php ``` $myStr = "HelloWordl"; ``` result should be like this ``` $result = "Hello"; ```

30 Sep at 04:47

Set opacity of background image without affecting child elements

Is it possible to set the opacity of a background image without affecting the opacity of child elements? # Example All links in the footer need a custom bullet (background image) and the opacity ...

21 Jan at 18:8

Select top 10 records for each category

I want to return top 10 records from each section in one query. Can anyone help with how to do it? Section is one of the columns in the table. Database is SQL Server 2005. I want to return the top 1...

How do I decompile a .NET EXE into readable C# source code?

I wrote a C# application for a client a couple of years ago, but I no longer have the source code. All I have is the EXE that I deployed on the client's PC. Is there a way I can generate C# source c...

How do I do a not equal in Django queryset filtering?

In Django model QuerySets, I see that there is a `__gt` and `__lt` for comparative values, but is there a `__ne` or `!=` ()? I want to filter out using a not equals. For example, for ``` Model: bo...

How do I commit only some files?

I have two projects. One is the "official" project and the second is a light modification (some files added). I created new branch and I put new files to them. But in during development some files com...

5 Apr at 19:43

Generic htaccess redirect www to non-www

I would like to redirect `www.example.com` to `example.com`. The following htaccess code makes this happen: ``` RewriteCond %{HTTP_HOST} ^www\.example\.com [NC] RewriteRule ^(.*)$ http://example.com/...

How to get Git to clone into current directory

I'm doing: ``` git clone ssh://user@host.com/home/user/private/repos/project_hub.git ./ ``` I'm getting: > Fatal: destination path '.' already exists and is not an empty directory. I know path ...

25 Mar at 22:39

Android Studio SDK location

I see there a lot of similar topics pertaining to this issue but I did not find a solution for me among those posts. I just installed Android Studio v0.8.14 and it won't let me create a new project be...

4 Nov at 15:38

How to get height of entire document with JavaScript?

Some documents I can't get the height of the document (to position something absolutely at the very bottom). Additionally, a padding-bottom on seems to do nothing on these pages, but do on the pages ...

15 Apr at 20:31

Eclipse error ... cannot be resolved to a type

I have a dynamic web project that I am working on to migrate a jsp/servlet app from JRun to Tomcat. I am getting the error: `com.ibm.ivj.eab.dab.DatastoreJDBC` cannot be resolved to a type. I have ...

11 May at 10:47

How do I connect to a terminal to a serial-to-USB device on Ubuntu 10.10 (Maverick Meerkat)?

I am trying to connect minicom to a serial device that is connected via a USB-to-serial adapter. This is a PL2303 and from everything I've read no additional drivers are required. The device is recogn...

What does the "at" (@) symbol do in Python?

What does the `@` symbol do in Python?

19 Apr at 01:39

Sample random rows in dataframe

I am struggling to find the appropriate function that would return a specified number of rows picked up randomly without replacement from a data frame in R language? Can anyone help me out?

16 Jun at 04:36

Html.Partial vs Html.RenderPartial & Html.Action vs Html.RenderAction

In ASP.NET MVC, what is the difference between: - `Html.Partial``Html.RenderPartial`- `Html.Action``Html.RenderAction`

Given two directory trees, how can I find out which files differ by content?

If I want find the differences between two directory trees, I usually just execute: ``` diff -r dir1/ dir2/ ``` This outputs exactly what the differences are between corresponding files. I'm inter...

6 Apr at 12:37

Main differences between SOAP and RESTful web services in Java

For now I have a slight idea about the differences between SOAP and [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer#RESTful_web_services) services. My question is when I shoul...

14 Jun at 14:36

How to get the return value from a thread?

The function `foo` below returns a string `'foo'`. How can I get the value `'foo'` which is returned from the thread's target? ``` from threading import Thread def foo(bar): print('hello {}'.form...

Eclipse comment/uncomment shortcut?

I thought this would be easy to achieve, but so far I haven't found solutions for comment/uncomment shortcut on both `Java class editor` and `jsf faceted webapp XHTML file editor` : 1. to quickly co...