Questions

Bash foreach loop

I have an input (let's say a file). On each line there is a file name. How can I read this file and display the content for each one.

12 Nov at 08:43

What does "sys.argv[1]" mean? (What is sys.argv, and where does it come from?)

I'm currently teaching myself Python and was just wondering (In reference to my example below) in simplified terms what the `sys.argv[1]` represents. Is it simply asking for an input? ``` #!/usr/bin/p...

5 Feb at 09:44

What’s the best RESTful method to return total number of items in an object?

I'm developing a REST API service for a large social networking website I'm involved in. So far, it's working great. I can issue `GET`, `POST`, `PUT` and `DELETE` requests to object URLs and affect my...

16 Mar at 22:41

Trim last character from a string

I have a string say ``` "Hello! world!" ``` I want to do a trim or a remove to take out the ! off world but not off Hello.

26 Aug at 08:36

Why does Lua have no "continue" statement?

I have been dealing a lot with Lua in the past few months, and I really like most of the features but I'm still missing something among those: - `continue`-

25 May at 16:36

What is the difference between a regular string and a verbatim string?

I have a trial version of ReSharper and it always suggests that I switch regular strings to verbatim strings. What is the difference?

29 Mar at 02:48

How do I remove newlines from a text file?

I have the following data, and I need to put it all into one line. I have this: ``` 22791 ; 14336 ; 22821 ; 34653 ; 21491 ; 25522 ; 33238 ; ``` I need this: ``` 22791;14336;22821;34653;2...

23 Jul at 15:46

How do I make background-size work in IE?

Is there any known way to make the CSS style `background-size` work in IE?

23 Aug at 17:27

Strtotime() doesn't work with dd/mm/YYYY format

I really like the `strtotime()` function, but the user manual doesn't give a complete description of the supported date formats. `strtotime('dd/mm/YYYY')` doesn't work, it works only with `mm/dd/YYYY`...

13 Dec at 13:21

MySQL load NULL values from CSV data

I have a file that can contain from 3 to 4 columns of numerical values which are separated by comma. Empty fields are defined with the exception when they are at the end of the row: ``` 1,2,3,4,5 1,2...

28 Aug at 11:47

Good Hash Function for Strings

I'm trying to think up a good hash function for strings. And I was thinking it might be a good idea to sum up the unicode values for the first five characters in the string (assuming it has five, oth...

23 Mar at 11:11

Why do people say that Ruby is slow?

I like Ruby on Rails and I use it for all my web development projects. A few years ago there was a lot of talk about Rails being a memory hog and about how it didn't scale very well but these suggest...

18 Sep at 02:25

Why is there no multiple inheritance in Java, but implementing multiple interfaces is allowed?

Java doesn't allow multiple inheritance, but it allows implementing multiple interfaces. Why?

How can I get the SQL of a PreparedStatement?

I have a general Java method with the following method signature: ``` private static ResultSet runSQLResultSet(String sql, Object... queryParams) ``` It opens a connection, builds a `PreparedStatem...

4 Mar at 20:53

How to add List<> to a List<> in asp.net

Is there a short way to add List<> to List<> instead of looping in result and add new result one by one? ``` var list = GetViolations(VehicleID); var list2 = GetViolations(VehicleID2); list.Add(list...

19 Feb at 15:32

Django ManyToMany filter()

I have a model: ``` class Zone(models.Model): name = models.CharField(max_length=128) users = models.ManyToManyField(User, related_name='zones', null=True, blank=True) ``` And I need to con...

11 Sep at 00:22

How to create multiple directories from a single full path in C#?

If you have a full path like: `"C:\dir0\dir1\dir2\dir3\dir4\"` how would you best implement it so that all directories are present? Is there a method for this in the BCL? If not, what's the most eleg...

25 Jan at 17:59

Best Practices: working with long, multiline strings in PHP?

Note: I'm sorry if this is an extremely simple question but I'm somewhat obsessive compulsive over the formatting of my code. I have a class that has a function that returns a string that will make u...

24 May at 05:43

Convert NSArray to NSString in Objective-C

I am wondering how to convert an `[@"Apple", @"Pear ", 323, @"Orange"]` to a string in .

22 Aug at 19:49

What are the most common naming conventions in C?

What are the naming conventions commonly use in C? I know there are at least two: 1. GNU / linux / K&R with lower_case_functions 2. ? name ? with UpperCaseFoo functions I am talking about C only ...

17 Mar at 15:47

Event listener for when element becomes visible?

I am building a toolbar that is going to be included into a page. the div it is going to be included in will default to . Is there a way i can put an event listener on my toolbar to listen for when it...

12 Jul at 08:38

Execute unit tests serially (rather than in parallel)

I am attempting to unit test a WCF host management engine that I have written. The engine basically creates ServiceHost instances on the fly based on configuration. This allows us to dynamically recon...

15 Oct at 23:0

How can I print the contents of a hash in Perl?

I keep printing my hash as # of buckets / # allocated. How do I print the contents of my hash? Without using a `while` loop would be most preferable (for example, a [one-liner](https://en.wikipedia....

24 Apr at 10:16

In a .csproj file, what is <None Include="..."> for?

How is ``` <None Include="C:\foo.bar" /> ``` different from ``` <Content Include="C:\foo.bar" /> ``` ?

29 Oct at 20:26

Catch browser's "zoom" event in JavaScript

Is it possible to detect, using JavaScript, when the user changes the zoom in a page? I simply want to catch a "zoom" event and respond to it (similar to window.onresize event). Thanks.

15 Jun at 12:46