How to set java_home on Windows 7?

How to set java_home on Windows 7?

I went to the Environment Variables in 'System' in the control panel and made two new variables, one for user variables and one for system variables. Both were named JAVA_HOME and both pointing to C:\Sun\SDK\jdk\binBut for some reason, I s

How do I protect Python code?

How do I protect Python code?

I am developing a piece of software in Python that will be distributed to my employer's customers. My employer wants to limit the usage of the software with a time restricted license file.If we distribute the .py files or even .pyc files it

What uses are there for “placement new”?

What uses are there for “placement new”?

Has anyone here ever used C++'s "placement new"? If so, what for? It looks to me like it would only be useful on memory-mapped hardware. 1:Placement new allows you to construct an object on memory that's already allocated.You may want to

JAXBContext.newInstance variations

JAXBContext.newInstance variations

I am experimenting with the various forms of newInstance method in class JAXBContext (I am using the default Sun JAXB implementation that ships with Oracle JDK 1.7).It's not clear to me when it's ok to just pass to the newInstance method th

what is the purpose of the extra asterisks in php comments?

what is the purpose of the extra asterisks in php comments?

I've (finally) been reading up on PEAR (php) coding standards.What is the purpose of commenting like this:/** * Here is my comment* I Wrote this in a haiku* But why put the stars?*/As opposed to this:/* Here is a comment No haiku

Print all variables available in a Smarty template

Print all variables available in a Smarty template

How do you print all variables available in the context of a Smarty template? Something like the Django debug trace that lists everything being passed.Thanks 1:Use {debug} From the manual: {debug} dumps the debug console to the page. T

How can I programmatically set dataSource of UITableView?

How can I programmatically set dataSource of UITableView?

I am having a strange problem. I am trying to assign a dataSource to a table programatically.I have created a UITableView and an IBOutlet for it in my ViewController using the Interface Builder. I have created a class that implements UITabl

How to reload a chrome extension automatically?

How to reload a chrome extension automatically?

I am developing a chrome extension, and I found that there are repeating useless manual reloading works.When you save a file, you have to refresh the chrome:\\extensions page to let browser to reload the extension. And then you have to relo

Make .NET WebBrowser not to share cookies with IE or other Instances

Make .NET WebBrowser not to share cookies with IE or other Instances

Since WebBrowser in C# shares cookies with all other instances of WebBrowsers including IE I would like for a WebBrowser to have it's own cookie container that doesn't share any cookies that was created previously in IE or other instances.

Delphi - Windows Aero resources

Delphi - Windows Aero resources

Anyone have any good resources for Delphi and Windows Aero on 7 or Vista?We're just about to add Windows 7 to our company and want to make sure that our in-house applications use fit in as well as possible.Using Delphi 2010 I can add the Gl

What are the Differences between C++ Templates and Java/C# Generics and what are the limits? [closed

What are the Differences between C++ Templates and Java/C# Generics and what are the limits? [closed

I read an interesting Article/Thread/Discussion from here and i got following questions:What are the limitations of Java/C# generics?What is possible with C++ Templates that is impossible with Java/C# generics?Edit 1 More recommended questi

Can WPF themes be used to include multiple skins for an application that can be changed at runtime?

Can WPF themes be used to include multiple skins for an application that can be changed at runtime?

WPF allows a control library to provide different resource dictionaries for different system themes, essentially allowing an application to match the operating system's selected visual theme (Aero, Luna, etc).I'm wondering if I can include

Install mod_wsgi on Ubuntu with Python 3.6, Apache 2.4, and Django 1.11

Install mod_wsgi on Ubuntu with Python 3.6, Apache 2.4, and Django 1.11

How do I get mod_wsgi for Apache2 that was compiled for Python 3.6.1? (or any future Python version)I am using a Python 3.6.1 virtual environment with Django 1.11 and Everything is working according to the Apache error log except that mod_w

c++ std::ofstream flush() but not close()

c++ std::ofstream flush() but not close()

I'm on MacOSX.In the logger part of my application, I'm dumping data to a file.suppose I have a globally declared std::ofstream outFile("log");and in my logging code I have:outFile Now, suppose my code crashes after the flush() happens; Is

dynamic create method and decorator, got error 'functools.partial' object has no attribute

dynamic create method and decorator, got error 'functools.partial' object has no attribute

I am currently using EndpointsModel to create a RESTful API for all my models on AppEngine. Since it is RESTful, these api have a lot of repeat code which I want to avoidFor Example:class Reducer(EndpointsModel): name = ndb.StringPropert

Can gitconfig options be set conditionally?

Can gitconfig options be set conditionally?

Via Github I use the same set of "dot files" on several different computers and servers. On the Macs and Linux boxes under my direct control I have Sublime Text 2 installed and set up as my git merge and commit editor of choice. However, on

Expression Trees and Invoking a Delegate

Expression Trees and Invoking a Delegate

So I have a delegate which points to some function which I don't actually know about when I first create the delegate object. The object is set to some function later.I also then want to make an expression tree that invokes the delegate wit

Creating a C# Color from HSL values

Creating a C# Color from HSL values

How can I create a C# Color from HSL values? 1:Rich Newman has created a HSLColor class that can be used in place of System.Drawing.Color.http://richnewman.wordpress.com/hslcolor-class/ 2:Add the following line below to the "using" na

Locale during unit test on Android

Locale during unit test on Android

I have some code I want to test. I want to check if a String is properly composed out of various strings that I have in resources. The challenge here is to deal with multiple translations in my resources. I know that locale can be an issue

Sealed keyword affects the compiler's opinion on a cast

Sealed keyword affects the compiler's opinion on a cast

I have a situation where I'd like the behaviour of the compiler explained. Given a little code:interface IFoo{ T Get();}class FooGetter : IFoo{ public int Get() { return 42; }}The following compiles and runs:static class

How to get XY coordinates of a control at runtime in WPF? [duplicate]

How to get XY coordinates of a control at runtime in WPF? [duplicate]

This question already has an answer here: Get Absolute Position of element within the window in wpf 4 answers How to get XY coordinates of a control at

How to assign CoreData many-to-many relationship in Swift?

How to assign CoreData many-to-many relationship in Swift?

I have a NSManagedObject class class Disease: NSManagedObject { @NSManaged var diseaseId: String @NSManaged var diseaseName: String @NSManaged var dogBreed: NSSet}How do I add a new relationship to dogBreed? If i change var type to

MailMessage setting the Senders Name

MailMessage setting the Senders Name

Is it possible to set the sender name on a MailMessage object? I tried setting it from MailAddress, but the DisplayName property seems to be read only.I tried "My Name " as the sender and don't seem to work either. 1:MailMessage mail = n

app.config “Could not find schema information” after converting to Visual Studio 2010 / .Net 4.0

app.config “Could not find schema information” after converting to Visual Studio 2010 / .Net 4.0

After upgrading my project to Visual Studio 2010 and .Net 4.0, my app.config file generates these messages upon building the project:Could not find schema information for the element 'supportedRuntime'.Could not find schema information for

Docker, can't reach “rails server” development from localhost:3000 using docker flag -p 3000:30

Docker, can't reach “rails server” development from localhost:3000 using docker flag -p 3000:30

I'm trying to use docker with rails, building an entire stack inside one container. My endgoal is to have an nginx/memcached/unicorn/rails/postgres stack with runit as the process manager. So far I have my app, ruby, and postgres installed.