Would you write something like:
enum XYZ_TYPE {X=1, Y=2, Z=3};
I saw it and the suffix _TYPE confuses me in the enum context. There is a strong prospect that it is because I am not bright.
I am trying to do something along the lines of the following where I have a Controller with an method similar to:
public ActionResult Insert(Author author) {
//do something...
}
Where the Author type looks like:
public class Author {
public string FirstName { get; set; }
public string LastName { get; set; }
public Book[] Books { get;…
I have a vector of vectors:
vector< vector<int> > BigVec;
It contains an arbitrary number of vectors, each of an arbitrary size. I want to delete not duplicate elements of each vector, but any vectors that are the exact same as another. I don't need to preserve the order of the vectors so I can sort etc..
It should be a really…
So if your converting from Void* to Type* or from Type* to Void* should you use:
void func(void *p)
{
Params *params = static_cast<Params*>(p);
}
or
void func(void *p)
{
Params *params = reinterpret_cast<Params*>(p);
}
To me static_cast seems the more correct but I've seen both used for the same purpose. Also, does…
I'm implementing a simplistic JIT compiler in a VM I'm writing for fun (mostly to learn more about language design) and I'm getting some weird behavior, maybe someone can tell me why.
First I define a JIT "prototype" both for C and C++:
#ifdef __cplusplus
typedef void* (*_JIT_METHOD) (...);
#else
typedef (*_JIT_METHOD) ();
#endif
…
I have been tasked with integrating image acquisition into a .NET application and I have been looking for an API to use for performing this function. I have come across several "standard" APIs, some have been in existence for a long time, some not so long. I have looked at references to ISIS, TWAIN, WIA, and SANE (said to be mostly *nix). …
I have several TextField columns on my UserProfile object which contain JSON objects. I've also defined a setter/getter property for each column which encapsulates the logic for serializing and deserializing the JSON into python datastructures.
The nature of this data ensures that it will be accessed many times by view and template logic…
I have the folliwng JSON request code on an ASP.NET MVC web application:
var userID = 'id=' + $('#namesList').val();
$.getJSON('/Person/GetPerson/', userID, function(data) {
$('#collar').text(data.collarNumber);
$('#name').text(data.Name);
$('#email').text(data.EmailAddress);
});
This…
So I signed on with a startup web development company as a subcontractor. They are putting together a large, complex user/product management system for a company that needs to support multiple levels of hierarchial localization. I signed a 3 month contract, and upon looking at their code, wish I hadn't.
They opted to write their own MVC…
I'm trying to create a new environment in my LaTeX document where indentation in the next paragraph following the environment is suppressed.
I have been told (TeXbook and LaTeX source) that by setting \everypar to {\setbox0\lastbox}, the TeX typesetter will execute this at the beginning of the next paragraph and thus remove the…
I need to make my little guy (in a UIIamgeView) jump forward and it has to look natural. I want to know is there a way to do it with CoreAnimation (beginAnimation/commitAnimation)?
I could do it by setting a point in between in the air but the movement looks not natural :P
I'm looking for some advice on how to go about reading the online documentation of various packages classes and methods for java.
i mean all this stuff: http://java.sun.com/javase/6/docs/api/
Hi Guys,
I have a problem with the jquery-ui dialog box. The problem is that when I close the dialog box and then I click on the link that triggers it, it does not pop-up again unless I refresh the page. How can I call the dialog box back without refreshing the actual page. Have a look:
$(document).ready(function() {
…
This is a little bit like http://stackoverflow.com/questions/288757/how-to-identify-email-belongs-to-existing-thread-or-conversation but I am more interested in how Entourage 2008 really does threading as opposed to how it ought to.
I have the parent message that has something like
Message-ID: <foo-123@blah.com/>
…
Another noob regex problem/question. I'm probably doing something silly so I thought I'd exploit the general ingenuity of the SO regulars ;)
Trying to match newlines but only if they occur within either double quotes or single quotes. I also want to catch strings that are between quotes but contain no newlines.
Okay so…
I'm putting together a dating site and I'm having a mysql query issue.
This works:
SELECT *
FROM `user`
, `desired_partner`
, `user_personality`
WHERE dob BETWEEN '1957-05-18' AND '1988-05-18'
AND country_id = '190'
AND user.gender_id = '1'
AND user.user_id = desired_partner.user_id
AND…
This interesting question http://stackoverflow.com/questions/2837267/ concerned how to do a negative look-ahead in MySQL. The poster wanted to get the effect of
Kansas(?! State)
because MySQL doesn't implement look-ahead assertions, a number of answers came up the equivalent
Kansas($|[^ ]|…
I have a table with shifts history along with emp ids.
I'm using this query to retrieve a list of employees and their total shifts by specifying the range to count from:
SELECT ope_id, count(ope_id)
FROM operator_shift
WHERE ope_shift_date >=to_date( '01-MAR-10','dd-mon-yy') and…
What is the most concise programing language?
in case a criteria is needed for conciseness: on balance requires the least amount of characters to create any given program.
How would you do this:
http://matthewjamestaylor.com/blog/keeping-footers-at-the-bottom-of-the-page
Except with a fluid center (vertically stretched, height 100%)?
So, my iPad program has a pseudo-split view controller (one that I implemented, not base SDK one), and was working correctly a while ago. It has the basic layout (UINavController for master, content view controller for detail on right), but I have it so the master view doesn't…
In my en.yml translation file, I have:
activerecord:
errors:
template:
header:
one: "1 error prohibited this {{model}} from being saved"
other: "{{count}} errors prohibited this {{model}} from being saved"
When an activerecord/validation…
I'm trying to build a javascript bookmarklet for a special URL shortening service we've built at http://esv.to for shortening scripture references (i.e. "Matthew 5" becomes "http://esv.to/Mt5". The bookmarklet is supposed to do a GET request to http://api.esv.to/Matthew+5,…