Bulk insert with SQLAlchemy ORM
Is there any way to get SQLAlchemy to do a bulk insert rather than inserting each individual object. i.e., doing: ``` INSERT INTO `foo` (`bar`) VALUES (1), (2), (3) ``` rather than: ``` INSERT IN...
- Modified
- 7 Sep at 15:37
@try - catch block in Objective-C
Why doesn't @try block work? It crashed the app, but it was supposed to be caught by the @try block. ``` NSString* test = [NSString stringWithString:@"ss"]; @try { [test characterAtIndex:6]; ...
- Modified
- 26 Jun at 12:22
How to exit from the application and show the home screen?
I have an application where on the home page I have buttons for navigation through the application. On that page I have a button "EXIT" which when clicked should take the user to the home screen on t...
- Modified
- 2 Mar at 10:3
How do C++ class members get initialized if I don't do it explicitly?
Suppose I have a class with private memebers `ptr`, `name`, `pname`, `rname`, `crname` and `age`. What happens if I don't initialize them myself? Here is an example: ``` class Example { private: ...
- Modified
- 15 Dec at 18:3
delete vs delete[] operators in C++
What is the difference between `delete` and `delete[]` operators in C++?
- Modified
- 23 Dec at 15:19
Upgrading PHP in XAMPP for Windows?
I would like to know how you upgrade PHP in Xampp for Windows? I tried to download the latest PHP version from the main PHP site but when I check (phpinfo) I still get that the previous version is sti...
Hash and salt passwords in C#
I was just going through one of DavidHayden's articles on [Hashing User Passwords](http://web.archive.org/web/20120413180026/http://davidhayden.com/blog/dave/archive/2004/02/16/157.aspx). Really I ca...
Converting XDocument to XmlDocument and vice versa
It's a very simple problem that I have. I use XDocument to generate an XML file. I then want to return it as a XmlDocument class. And I have an XmlDocument variable which I need to convert back to XDo...
- Modified
- 2 Oct at 09:29
Whether a variable is undefined
How do I find if a variable is undefined? I currently have: ``` var page_name = $("#pageToEdit :selected").text(); var table_name = $("#pageToEdit :selected").val(); var optionResult = $("#pageToEdi...
- Modified
- 23 May at 12:3
Commenting in a Bash script inside a multiline command
How can I comment on each line of the following lines from a script? ``` cat ${MYSQLDUMP} | \ sed '1d' | \ tr ",;" "\n" | \ sed -e 's/[asbi]:[0-9]*[:]*//g' -e '/^[{}]/d' -e 's/""//g' -e '/^"{/d' | \ ...
Using HeapDumpOnOutOfMemoryError parameter for heap dump for JBoss
I was told I can add the `-XX:+HeapDumpOnOutOfMemoryError` parameter to my JVM start up options to my JBoss start up script to get a heap dump when we get an out of memory error in our application. I...
- Modified
- 13 Jun at 21:25
Objective-C : BOOL vs bool
I saw the "new type" `BOOL` (`YES`, `NO`). I read that this type is almost like a char. For testing I did : ``` NSLog(@"Size of BOOL %d", sizeof(BOOL)); NSLog(@"Size of bool %d", sizeof(bool)); ```...
- Modified
- 4 Mar at 14:50
How do I write output in same place on the console?
I am new to python and am writing some scripts to automate downloading files from FTP servers, etc. I want to show the progress of the download, but I want it to stay in the same position, such as: o...
- Modified
- 23 May at 12:10
Accessing private member variables from prototype-defined functions
Is there any way to make “private” variables (those defined in the constructor), available to prototype-defined methods? ``` TestClass = function(){ var privateField = "hello"; this.nonProtoH...
- Modified
- 22 Oct at 17:57
How do I convert a double into a string in C++?
I need to store a double as a string. I know I can use `printf` if I wanted to display it, but I just want to store it in a string variable so that I can store it in a map later (as the , not the )....
Do event handlers stop garbage collection from occurring?
If I have the following code: ``` MyClass pClass = new MyClass(); pClass.MyEvent += MyFunction; pClass = null; ``` Will pClass be garbage collected? Or will it hang around still firing its events w...
- Modified
- 9 Apr at 08:2
How to save picture to iPhone photo library?
What do I need to do to save an image my program has generated (possibly from the camera, possibly not) to the system photo library on the iPhone?
- Modified
- 13 May at 20:3
Youtube - downloading a playlist - youtube-dl
I am trying to download all the videos from the [playlist](https://www.youtube.com/watch?v=7Vy8970q0Xc&list=PLwJ2VKmefmxpUJEGB1ff6yUZ5Zd7Gegn2): I am using youtube-dl for this and the command is: `...
- Modified
- 22 Aug at 14:16
Automatically set appsettings.json for dev and release environments in asp.net core?
I've defined some values in my `appsettings.json` for things like database connection strings, webapi locations and the like which are different for development, staging and live environments. Is the...
- Modified
- 2 Jan at 11:35
Enums in Javascript with ES6
I'm rebuilding an old Java project in Javascript, and realized that there's no good way to do enums in JS. The best I can come up with is: ``` const Colors = { RED: Symbol("red"), BLUE: Sym...
- Modified
- 1 Aug at 20:39
How to Import a Single Lodash Function?
Using webpack, I'm trying to import [isEqual](https://lodash.com/docs/4.17.4#isEqual) since `lodash` seems to be importing everything. I've tried doing the following with no success: ``` import { isE...
- Modified
- 15 Jan at 08:24
How to load image (and other assets) in Angular an project?
I'm pretty new to Angular so I'm not sure the best practice to do this. I used angular-cli and `ng new some-project` to generate a new app. In it created an "images" folder in the "assets" folder,...
- Modified
- 15 Jul at 07:50
Should I use virtual, override, or both keywords?
In the last weeks something is bugging my brain about `virtual` and `override`. I've learned that when you do inheritance with virtual function you have to add `virtual` to let the compiler know to se...
Error: EACCES: permission denied
I run but it throws error. I know it is permission issue but as far as I know, sudo permission is not required for installing node module locally. If I run it with sudo, it gets installed inside ~/n...
What are the pros and cons of parquet format compared to other formats?
Characteristics of Apache Parquet are : - - - In comparison to Avro, Sequence Files, RC File etc. I want an overview of the formats. I have already read : [How Impala Works with Hadoop File Formats...