Generation of false cases at the time of execution

I'm looking for an utility class to generate fake entity instances at runtime. I'm implementing a ASP.NET MVC3 website using EF4 with a code-first approach, so I'd like to run the site before creating any database. The fake instances should contain v

User input in Node.js

I am writing a program which will create an array of numbers, and double the content of each array, and storing the result as key/value pair. Earlier, I had hardcoded the array, so everything was fine. Now, I have changed the logic a bit, I want to t

What should I use as the primary key for this table?

I'm building a small forum component for a website where sub-forums have different admins and mods responsible for them, and users can be banned from individual sub-forums. The ban table I have looks like this: _Bantable_ user_id group_id start_date

PHP: preg_replace behaves differently on different servers

I'm working with a PHP function that takes a string and converts all of its spaces to underscores, converts all of its accented characters to non-accented characters, and removes non word characters. In other words, it creates slugs. This function wo

WCF Contract for Field Update

I'm developing an application that does some CRUD operations through a WCF service. The read method returns a complete entity, the update is performed through a legacy system, and only the changed values should be updated. What is the best way to des

Mysql query with case statement

i have a query that sorted by date sort currently work but i want to use case for condition like if priority<=10 THEN 10 will be add with current priority my query currently return a default abnormal value of modified priority value my

How to load this ArrayList into a JTable

I have a List (List<MyBean>). Then I used it for fill a 2D array. I used following steps to do it. public class MyBean{ private int id; private String name; private String address; /** * @return the id */ public int getId() { return id;

SQL select id where other columns are the same

If I have a table of properties with columns owner, wallColor and roofColor (let's say one owner can own multiple houses but houses can have only one owner), how can I select all owners who only have houses that have identical wall and roof colors? S

Creating an executable jar using Eclipse

It export it fine as a Jar, but when I double click the project it won't load up. I'm building a Java Slick2d game (my first). I've tried on both windows 7, and Ubuntu 12.10. Any suggestions?If you run the exported jar file from the terminal, you'll

Application of basic butter does not work

I am trying to build simple JSF application using primefaces but somehow primefaces components are not getting rendered properly. I dont understand what is going wrong. I am trying to display following Facelet file : <html xmlns="

How to do line alignment of several MATLAB lines?

I'm trying find all straight lines in an image which is border. for example,stamps have four edges and I have already find those edges by edge function in MATLAB. But there is a problem that they are not real straight line. so I need to use line fitt

.indexOf () does not work with a specific vowel

So I'm making an algorithm that converts input to Pig Latin. Here's what I have so far: function translatePigLatin(str) { var consonantCluster = []; var vowels = ['a', 'e', 'i', 'o', 'u']; var stringArray = str.split(''); if (vowels.indexOf(stringArr

Ruby do a git diff

I'm very new to Ruby and pretty much never written using it. However I'm trying to write a server shakeout script using Ruby. It's pretty much the only option available to me. What I want to do is a git diff of a file on a remote repository and local

How to block all traffic for a given user?

I'd like to run a script on UNIX with restricted privileges. Specifically, I'd like to run code that I received without letting it send data. My current solution is to: Create a dummy user. Use iptables to block all outgoing traffic for the dummy use

Version .NET framework used

I have a third-party program installed, and I want to find out what version of the .NET framework it is using. How do I figure that out?Start up the Visual Studio 2008 Command Prompt, go to the folder your assembly is in, type corflags.exe assemblyNa

Customized control and elimination

The start of story is here. I have a component and I want it to clean up timers (managed resources, right?): public class MyPictureBox : PictureBox, IDisposable { private Timer _timer1 = new Timer(); private Timer _timer2 = new Timer(); public MyPict

The size of the database is enormous

I have the following problem. We have a database that stores binaries in the database. We know the size of the database can be big so we removed all the binaries from the database and used the task "shrink" on it. This way we hoped that the data

Replace Javadoc's comment on java.lang.Enum.values ​​()

I have a very specific problem about the method java.lang.Enum.values(). I would like to override its javadoc. Very precisely, the current javadoc for this is, after I created my own enum: public static MyClass.MyEnum[] values() ... This method may b

Prototype: how to dynamically build a selector?

I am having a little bit of difficulty passing a variable into a selector in prototype. I would like to be able to pass a variable into the select string, so that one function can work for many of the same kind. At the moment, this is what I would ba