Questions

Table Naming Dilemma: Singular vs. Plural Names

Academia has it that table names should be the singular of the entity that they store attributes of. I dislike any T-SQL that requires square brackets around names, but I have renamed a `Users` tab...

5 Nov at 04:11

What is "stdafx.h" used for in Visual Studio?

A file named `stdafx.h` is automatically generated when I start a project in Visual Studio 2010. I need to make a cross-platform C++ library, so I don't/can't use this header file. What is `stdafx.h`...

Delete from two tables in one query

I have two tables in MySQL ``` #messages table : messageid messagetitle . . #usersmessages table usersmessageid messageid userid . . ``` Now if I want to delete from messages table it's ok. ...

31 Oct at 10:51

How to convert char to integer in C?

> [How to convert a single char into an int](https://stackoverflow.com/questions/439573/how-to-convert-a-single-char-into-an-int) [Character to integer in C](https://stackoverflow.com/questions/6...

23 May at 11:54

How to get overall CPU usage (e.g. 57%) on Linux

I am wondering how you can get the system CPU usage and present it in percent using bash, for example. Sample output: ``` 57% ``` In case there is more than one core, it would be nice if an averag...

15 Feb at 11:49

Pretty printing XML in Python

What is the best way (or are the various ways) to pretty print XML in Python?

21 Jun at 13:45

When to use static classes in C#

Here's what [MSDN has to say under When to Use Static Classes](https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/static-classes-and-static-class-members): > ``` st...

30 May at 00:25

How can I create an object and add attributes to it?

I want to create a dynamic object (inside another object) in Python and then add attributes to it. I tried: ``` obj = someobject obj.a = object() setattr(obj.a, 'somefield', 'somevalue') ``` but this...

13 Aug at 09:38

Get just the filename from a path in a Bash script

How would I get just the filename without the extension and no path? The following gives me no extension, but I still have the path attached: ``` source_file_filename_no_ext=${source_file%.*} ```

22 Oct at 19:0

Connect to Amazon EC2 file directory using Filezilla and SFTP

I have created an AWS EC2 Instance and I want to be able to upload files to the server directory using FileZilla in the simplest and most straightforward fashion possible.

Java 8 Distinct by property

In Java 8 how can I filter a collection using the `Stream` API by checking the distinctness of a property of each object? For example I have a list of `Person` object and I want to remove people with...

Maximum filename length in NTFS (Windows XP and Windows Vista)?

I'm designing a database table which will hold filenames of uploaded files. What is the maximum length of a filename in NTFS as used by Windows XP or Vista?

Best way to repeat a character in C#

What is the best way to generate a string of `\t`'s in C# I am learning C# and experimenting with different ways of saying the same thing. `Tabs(uint t)` is a function that returns a `string` with `t`...

20 Jan at 15:10

How to use Global Variables in C#?

How do I declare a variable so that every class (*.cs) can access its content, without an instance reference?

12 Jun at 19:33

Download file of any type in Asp.Net MVC using FileResult?

I've had it suggested to me that I should use FileResult to allow users to download files from my Asp.Net MVC application. But the only examples of this I can find always has to do with image files (s...

23 May at 11:47

How to open, read, and write from serial port in C?

I am a little bit confused about reading and writing to a serial port. I have a USB device in Linux that uses the FTDI USB serial device converter driver. When I plug it in, it creates: /dev/ttyUSB1. ...

18 Dec at 10:56

Returning an array using C

I am relatively new to C and I need some help with methods dealing with arrays. Coming from Java programming, I am used to being able to say `int [] method()` in order to return an array. However, I h...

3 Nov at 19:35

How to connect from windows command prompt to mysql command line

I'm trying to connect to mysql server command line from my windows prompt I write the next line in cmd but i get an error. ``` cd C:\MYSQL\bin\ ``` And then i execute ``` mysql.exe -u=root -p=ad...

10 Dec at 20:27

How to remove CocoaPods from a project?

What's the right way of removing CocoaPods from a project? I want to remove the whole CocoaPod. Due to some limitations imposed by my client I can't use it. I need to have just one xcodeproj instead o...

7 May at 19:58

How do I get a list of all the duplicate items using pandas in python?

I have a list of items that likely has some export issues. I would like to get a list of the duplicate items so I can manually compare them. When I try to use pandas [duplicated method](http://panda...

31 May at 02:37

Left padding a String with Zeros

I've seen similar questions [here](https://stackoverflow.com/questions/388461/padding-strings-in-java) and [here](https://stackoverflow.com/questions/473282/left-padding-integers-with-zeros-in-java). ...

23 May at 12:2

Reverse engineering from an APK file to a project

I accidently erased my project from [Eclipse](http://en.wikipedia.org/wiki/Eclipse_%28software%29), and all I have left is the [APK](http://en.wikipedia.org/wiki/APK_%28file_format%29) file which I tr...

24 Aug at 10:20

git add only modified changes and ignore untracked files

I ran "git status" and listed below are some files that were modified/or under the heading "changes not staged for commit". It also listed some untracked files that I want to ignore (I have a ".gitign...

19 Aug at 16:40

AngularJS access parent scope from child controller

I've set up my controllers using `data-ng-controller="xyzController as vm"` I have a scenario with parent / child nested controllers. I have no problem accessing parent properties in the nested html ...

28 Dec at 06:47

How to increase request timeout in IIS?

How to increase request timeout in IIS 7.0? The same is done under application tab in ASP configuration settngs in IIS 6.0. I am not able to find the asp.net configuration section in IIS 7.0

18 Jun at 00:13