“INSERT IGNORE” vs “INSERT … ON DUPLICATE KEY UPDATE”

“INSERT IGNORE” vs “INSERT … ON DUPLICATE KEY UPDATE”

While executing an INSERT statement with many rows, I want to skip duplicate entries that would otherwise cause failure. After some research, my options appear to be the use of either: ON DUPLICATE KEY UPDATE which implies an unnecessary u

Recommended way to save uploaded files in a servlet application

Recommended way to save uploaded files in a servlet application

I read here that one should not save the file in the server anyway as it is not portable, transactional and requires external parameters. However, given that I need a tmp solution for tomcat (7) and that I have (relative) control over the s

Using SQLite in a Python program

Using SQLite in a Python program

I have created a Python module that creates and populates several SQLite tables. Now, I want to use it in a program but I don't really know how to call it properly. All the tutorials I've found are essentially "inline", i.e. they walk throu

Eclipse hangs on startup [duplicate]

Eclipse hangs on startup [duplicate]

This question already has an answer here: How do I prevent Eclipse from hanging on startup? 33 answers I have problem with running my Eclipse. I tried

onConfigurationChanged() not firing for keyboardHidden

onConfigurationChanged() not firing for keyboardHidden

I've followed the various questions and answers here to setup my Android activity to override the onConfigurationChanged() in order to execute logic when the soft keyboard opens and closes. Here's the relevant excerpts from my code. I've

How to do “late” string interpolation in Ruby

How to do “late” string interpolation in Ruby

>> string = '#{var}'=> "\#{var}">> proc = Proc.new { |var| string }=> #>> proc.call(123)=> "\#{var}"Not really what I want. Double quotes around string result in the obvious undefined local variable. 1:Although this is possible, it's not

Can docker port forward to a unix file socket on the host container?

Can docker port forward to a unix file socket on the host container?

Running the following command fails:sudo docker run -p unix:///tmp/file.sock:44444 -d image_nameIs something wrong with my port forwarding syntax or is a configuration like this not possible? 1:Docker's -p syntax won't take a unix socket

slf4j logging with jdk – how to enable debug?

slf4j logging with jdk – how to enable debug?

By default slf4j, when using with jdk (slf4j-jdk14-1.6.1.jar), does not log debug messages.How do I enable them?I can’t find info neither in the official docs, the web or here on how to enable it.I found some info on (failed though) creatin

Create two Automapper maps between the same two object types

Create two Automapper maps between the same two object types

I am using AutoMapper in a WCF service to return User objects. User has properties such as AccountTeams which itself has child objects. All of the classes have AutoMapper maps.Depending on the WCF OperationContract that is called, I want

Using @ComponentScan or  with only one class

Using @ComponentScan or with only one class

I'm maintaining a project with two set of main packages, the project is using Spring and Spring MVC, one of these packages contains several controllers and is scanned using XML configuration ().The problem is that there is a single class in

Spring choose bean implementation at runtime

Spring choose bean implementation at runtime

I'm using Spring Beans with annotations and I need to choose different implementation at [email protected] class MyService { public void test(){...}}For example for windows's platform I need MyServiceWin extending MyService, for linu

What is the expected behaviour of @PostConstruct in @Configuration classes?

What is the expected behaviour of @PostConstruct in @Configuration classes?

We are reusing a project that defines its beans with spring java-config (using @Configuration), and in one such class it has a @PostConstruct init method.What is the expected behaviour here - when is this method invoked? In regard to beans,

How do you set up neo4j to work with Google Compute Engine?

How do you set up neo4j to work with Google Compute Engine?

I'm wondering how one would get neo4j to work with Google Compute Engine. Has anybody done this? What problems did you encounter? 1:Here you go,Basic SetupInstall and setup gcloudInstall py2neoCreate your GCE Instance (https://console.de

Posting JSON with JQuery

Posting JSON with JQuery

Trying to get JQuery to post JSON to a server:$.ajax({ url: "/path/to/url", type: "POST", dataType: "json", contentType: "json", data: {"foo": "bar"}, success: function(){ alert("success :-)"); }, er

Does anyone have any good SSIS Best-Practices tips and suggestions? [closed]

Does anyone have any good SSIS Best-Practices tips and suggestions? [closed]

I would interested to hear from other developer tip on SSIS best practices, dos and don'ts, pitfalls and tricks, etc.I'm trying to introduce a few here at my company. 1:This blog by Jamie Thompson is really good that has both best practi

Database Fail Over in Jboss Data sources

Database Fail Over in Jboss Data sources

In JBoss data source how can I give multiple connection strings for database fail over in which I want .There will be two Mysql db with same tables say DB1 and DB2. I want to insert data to DB1, if DB1 is down, then I need to insert it into

ImageMagick Install Windows

ImageMagick Install Windows

I am trying to install ImageMagick on Windows. What I did is install Windows RailsInstaller created my version and now I need to use ImageMagick but for some reason it doesn't work.I took the binary source code and install and run it from t

Failed to decrypt using provider 'RsaProtectedConfigurationProvider'?

Failed to decrypt using provider 'RsaProtectedConfigurationProvider'?

In my windows application i am trying to encrypt connection string section of app.config file, connection string part of my app.config file isand in .cs file i am encrypting it likeConfiguration config = ConfigurationManager.OpenExeConfigur

Using CurrentDomain.SetData(“APP_CONFIG_FILE”) doesn't work in PowerShell ISE

Using CurrentDomain.SetData(“APP_CONFIG_FILE”) doesn't work in PowerShell ISE

I'm attempting to use a .NET 4.0 assembly in PowerShell ISE, and trying to change the config file which is used via:[System.AppDomain]::CurrentDomain.SetData("APP_CONFIG_FILE", $PathToConfig); [Configuration.ConfigurationManager]::Connec

Visual Studio Settings file - how does it work?

Visual Studio Settings file - how does it work?

I do not understand the following things:What is the difference between app.config (applicationname.exe.config) and settings file ?I am unable to locate the *.settings file in Windows7 AppData directory under the specific account (I heard t

iOS 8 Suggested Apps - How does it work?

iOS 8 Suggested Apps - How does it work?

Over the past little while I’ve been working with a client who would like to leverage Apple’s new Suggested App feature on iOS 8. The client's goal was to display a suggest app lock screen notification any time a person passes by a specific

Inversion of Control with .net

Inversion of Control with .net

It's rare that I hear someone using Inversion of Control (Ioc) principle with .Net. I have some friends that work with Java that use a lot more Ioc with Spring and PicoContainer.I understand the principle of removing dependencies from your

Using LESS with node.js

Using LESS with node.js

Less is amazing and I want to use to node.js because using less.js is not a good performance. I testing purpos i'm using xamp on windows and I install node.js but where and what i should write.. I install express.js npm install -g express

Why doesn't #include  work?

Why doesn't #include work?

I'm trying to run Python modules in C++ using "#include ", however, after setting the "Additional Include Dependencies" of the project to "\include" I get the following error when debuging,LINK : fatal error LNK1104: cannot open file 'pytho

Spring: Getting FactoryBean object instead of FactoryBean.getObject()

Spring: Getting FactoryBean object instead of FactoryBean.getObject()

Short question: If I have class that impelemnts FactoryBean interface, how can I get from FactoryBean object itself instead of FactoryBean.getObject()?Long question: I have to use 3-rd party Spring based library which is hardly use FactoryB