text
stringlengths
8
267k
meta
dict
Q: How do I pass a string to a has_many :finder_sql parameter? In my application, a user has_many tickets. Unfortunately, the tickets table does not have a user_id: it has a user_login (it is a legacy database). I am going to change that someday, but for now this change would have too many implications. So how can I ...
{ "language": "en", "url": "https://stackoverflow.com/questions/328692", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Hibernate - Programmatic configuration I'm trying to configure Hibernate classes not through XML/Annotation, but using their programmatic API: Mappings mappings = configuration.createMappings(); mappings.addClass(...); An example of column addition: public void addColumn(String colName, String accessorName, Nul...
{ "language": "en", "url": "https://stackoverflow.com/questions/328696", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How can I turn off anti-aliasing for one specific JLabel? How can I turn off anti-aliasing for one specific JLabel? It uses a very small font which might look better without anti-aliasing. If important, I'm using Java 1.5 on Mac OS X. A: Have you tried overriding paint(Graphics g) or paintComponent(Graphics g), set...
{ "language": "en", "url": "https://stackoverflow.com/questions/328698", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How to make a database service in Netbeans 6.5 to connect to SQLite databases? I use Netbeans IDE (6.5) and I have a SQLite 2.x database. I installed a JDBC SQLite driver from zentus.com and added a new driver in Nebeans services panel. Then tried to connect to my database file from Services > Databases using this U...
{ "language": "en", "url": "https://stackoverflow.com/questions/328704", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How best to generate a random salt for a Web Site? i'm wanting to generate a random salt value and put it into the Application state. Now, i'm using a web farm, so the Application state will be different per machine. I don't want to purchase distributed state farm apps, either. So .. what are some solutions for this...
{ "language": "en", "url": "https://stackoverflow.com/questions/328711", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: V8 JavaScript Engine on Windows (MinGW) The build instructions of V8 JavaScript Engine mention only Visual Studio 2005 and 2008. Has anybody been successful with MinGW on Windows XP/Vista? A: There is a patch for MinGW support: http://codereview.chromium.org/18309 See also: http://code.google.com/p/v8/issues/detai...
{ "language": "en", "url": "https://stackoverflow.com/questions/328718", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How to change the BlackBerry volume, or mute it? My current code is this: int volume = Alert.getVolume(); // reads 100 Alert.setVolume(0); It DOESN'T change the volume setting, like it would be supposed to do Even calling Alert.mute(true); doesn't produce any good effect. Audio.setVolume(0); also doesn't work! I a...
{ "language": "en", "url": "https://stackoverflow.com/questions/328722", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Techniques to follow when you are stuck programming When I am stuck with a problem: * *I search Google for code snippets. *I look at isolating the problem, so that I can better explain it to others in order to get answers. What search techniques do you use to find the solution to your problem? I started askin...
{ "language": "en", "url": "https://stackoverflow.com/questions/328727", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: Resolving SVN merge postponed conflicts recursively I have a dev branch that hasn't been touched for a while. I merged the trunk into it to integrate many fixes/changes in the main line since it was branched out, but now I have many small conflicts (merge-left/merge-right). I want the latest trunk revision to be use...
{ "language": "en", "url": "https://stackoverflow.com/questions/328730", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Is disposing this object, enough? or do i need to do more? I have this code :- using (System.Security.Cryptography.SHA256 sha2 = new System.Security.Cryptography.SHA256Managed()) { .. } Do I need to put this line of code, just BEFORE I leave that dispose scope .. or does the dispose 'call' that already. sha2.C...
{ "language": "en", "url": "https://stackoverflow.com/questions/328743", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Problem with return statement I have problem with return statment >.< I want to store all magazine names into ArrayList<String> ListNameMagazine = new ArrayList<String>(); I have a DB; in the DB there is a table name_magazine and the data in name_magazine is Magazine1 Magazine2 Magazine3 Magazine4 This my main: ...
{ "language": "en", "url": "https://stackoverflow.com/questions/328747", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Long shot: Can Adobe AIR get the current url of your firefox tab? I know this is a longshot but I was wondering if anyone knows if this is possible. A: Most browsers set the HTTP_REFERRER header to the current URL when requesting a linked document. However, it can be spoofed so don't use it for security. A: I kno...
{ "language": "en", "url": "https://stackoverflow.com/questions/328753", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How to take control of style sheets in ASP.NET Themes with the StylePlaceHolder and Style control Update: This turned into a blog post, with updated links and code, over at my blog: https://egilhansen.com/2008/12/01/how-to-take-control-of-style-sheets-in-asp-net-themes-with-the-styleplaceholder-and-style-control/ T...
{ "language": "en", "url": "https://stackoverflow.com/questions/328763", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: ICollection to string[] I have a object of type ICollection<string>. What is the best way to convert to string[]. How can this be done in .NET 2? How can this be done cleaner in later version of C#, perhaps using LINQ in C# 3? A: If you're using C# 3.0 and .Net framework 3.5, you should be able to do: ICollectio...
{ "language": "en", "url": "https://stackoverflow.com/questions/328765", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "18" }
Q: Generics and System.Collections After moving to .NET 2.0+ is there ever a reason to still use the systems.Collections namespace (besides maintaining legacy code)? Should the generics namespace always be used instead? A: For the most part, the generic collections will perform faster than the non-generic counterpart...
{ "language": "en", "url": "https://stackoverflow.com/questions/328768", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: Class inherits generic dictionary and Interface I have a class that inherits a generic dictionary and an inteface public class MyDictionary: Dictionary<string, IFoo>, IMyDictionary { } the issue is that consumers of this class are looking for the '.Keys' and ".Values" properties of the interface so i added: ///...
{ "language": "en", "url": "https://stackoverflow.com/questions/328772", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How do I backup database from ServerGrid.com? I have a hosting account with servergrid.com. I want to backup my database, they say I have to use Sql Server Integration Service to backup the database and I would need a commercial version of Sql Server management studio. I have Sql Server 2005 Developer Edition. I ha...
{ "language": "en", "url": "https://stackoverflow.com/questions/328774", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: What javascript library do you recommend to display/popup screenshots on a webpage? I've seen some nice screenshot popups around the web, do you know of any library to do that? I could write my own, but... if there's something free I can save time. Thanks! A: Here is a collection of some Javascript libraries from S...
{ "language": "en", "url": "https://stackoverflow.com/questions/328786", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: python curses.ascii depending on locale? The curses.ascii module has some nice functions defined, that allow for example to recognize which characters are printable (curses.ascii.isprint(ch)). But, diffrent character codes can be printable depending on which locale setting is being used. For example, there are certa...
{ "language": "en", "url": "https://stackoverflow.com/questions/328793", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Real world implementations of "classical algorithms" I wonder how many of you have implemented one of computer science's "classical algorithms" like Dijkstra's algorithm or data structures (e.g. binary search trees) in a real world, not academic project? Is there a benefit to our dayjobs in knowing these algorithms ...
{ "language": "en", "url": "https://stackoverflow.com/questions/328799", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: Naming variables that contain filenames? If I've got a variable that contains the fully-qualified name of a file (for example, a project file), should it be called projectFile, projectFileName or projectPath? Or something else? A: I usually go with these: * *FileName for the file name only (without path) *FileP...
{ "language": "en", "url": "https://stackoverflow.com/questions/328806", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Why does Visual Studio launch multiple WebDevs when I debug? I have a Visual Studio 2008 solution with several projects in it - some of which are web applications / sites. Whenever I go "Debug > Start new instance" for a specific web application and VS launches the ASP.net Development Server (WebDev.WebServer.EXE) ...
{ "language": "en", "url": "https://stackoverflow.com/questions/328820", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: How to ignore a type with XStream? with XStream, how can I ignore the serialization of a defined Type (for instance, when serializing a GUI, i want to ignore all swing types)? Or if i want to ignore all javax.* types? Thanks in advance, Burkhard A: you need to write a custom converter for the types you want to igno...
{ "language": "en", "url": "https://stackoverflow.com/questions/328823", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Accessing Windows Mobile device Storage Card from Java? I'd like to be able to access the contents of my Storage Card which is in my Windows Mobile device. Normally, I'd just remove the card and shove it in a card reader, but its encrypted (and thus, locked to my WM device). Is there an API or some sort of framework...
{ "language": "en", "url": "https://stackoverflow.com/questions/328824", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: IDictionary versus Dictionary what is the value of using IDictionary here? A: The value of using an interface is always the same: you don't have to change client code when switching to another backend implementation. Consider that profiling your code later shows that a hash table implementation (used in the Diction...
{ "language": "en", "url": "https://stackoverflow.com/questions/328830", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: Issue with serializing Hibernate objects using XStream I've been facing this issue where, the hibernate objects on serialization produces unexpect xmls containing all the instrumented code from Hibernate. We did some cleaning of the object before serializing the object. But, is there a standard option available to s...
{ "language": "en", "url": "https://stackoverflow.com/questions/328832", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: C++: delete vs. free and performance * *Consider: char *p=NULL; free(p) // or delete p; What will happen if I use free and delete on p? *If a program takes a long time to execute, say 10 minutes, is there any way to reduce its running time to 5 minutes? A: Some performance notes about new/delete and malloc/free...
{ "language": "en", "url": "https://stackoverflow.com/questions/328834", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "37" }
Q: Synchronizing databases I am developing an Adobe AIR application which stores data locally using a SQLite database. At any time, I want the end user to synchronize his/her local data to a central MySQL database. Any tips, advice for getting this right? Performance and stability is the key (besides security ;)) A: I...
{ "language": "en", "url": "https://stackoverflow.com/questions/328850", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Printing all instances of a class With a class in Python, how do I define a function to print every single instance of the class in a format defined in the function? A: Very nice and useful code, but it has a big problem: list is always bigger and it is never cleaned-up, to test it just add print(len(cls.__refs__[c...
{ "language": "en", "url": "https://stackoverflow.com/questions/328851", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "85" }
Q: nant logs with data and time stamp How to run NAnt scripts in command line and get the timings of each task on the log file? using nant <record> task or NAnt -buildfile:testscript.build testnanttarget This produces console output but I can't see any timing information. All I want each log message prefixed with dat...
{ "language": "en", "url": "https://stackoverflow.com/questions/328857", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: LinqToSql and the DataContext 101 I'm looking for a good article or two, or just an explanation, on how the DataContext, or dbml file, for LinqToSql, exactly works in LinqToSql. * *Is this a disconnected environment? *Are the database connections still pooled by Sql Server? *If I create an instance of my DataCo...
{ "language": "en", "url": "https://stackoverflow.com/questions/328877", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Disable JavaScript keypress events in iframes How do I disable the support for JavaScript keypress events in iframes? I need keypress events disabled only in specific iframes, so doing a catch-all-events-and-make-em-do-nothing solution is not an option. A: Does this example does what you want ? According to this th...
{ "language": "en", "url": "https://stackoverflow.com/questions/328887", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Implementing Audit Trail for Objects in C#? I'm looking for ideas on how to implement audit trails for my objects in C#, for the current project,basically I need to: * *Store the old values and new values of a given object. *Record creation of new objects. *Deletion of old object. Is there any generic way of do...
{ "language": "en", "url": "https://stackoverflow.com/questions/328898", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: Silverlight 2.0 - databinding a domain object to a UserControl I am starting out with Silverlight. I want to display a list of messages on the UI, but the databinding isn't working for me. I have a Message class: public class Message { public string Text { get; set; } ... } I have the message display Si...
{ "language": "en", "url": "https://stackoverflow.com/questions/328906", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How to check if my ISP blocks port 25? How should I check if my ISP blocks port 25? A: http://www.canyouseeme.org/ A: telnet host 25 Just select a host that you know is listening on port 25. A: You could call them and ask. A: Probing a server that listens on your desired port is of course the best option, as aba...
{ "language": "en", "url": "https://stackoverflow.com/questions/328914", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "16" }
Q: Why does my INSERT sometimes fail with "no such field"? I've been using the following snippet in developements for years. Now all of a sudden I get a DB Error: no such field warning $process = "process"; $create = $connection->query ( "INSERT INTO summery (process) VALUES($process)" ); if (DB::isError($create)) ...
{ "language": "en", "url": "https://stackoverflow.com/questions/328915", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Transfer Mysql database to another computer I have a mysql database filled up and running on a Windows computer, is there any tool to transfer the database to another computer (running Ubuntu)? Else I'll just write a script to take all the data base into SQL and insert it on the other computer. Just trying to save s...
{ "language": "en", "url": "https://stackoverflow.com/questions/328922", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "30" }
Q: when I use nio, serverSocket.accept() throws IllegalBlockingModeException When I code like this: ServerSocketChannel ssc = ServerSocketChannel.open(); InetSocketAddress sa = new InetSocketAddress("localhost",8888); ssc.socket().bind(sa); ssc.configureBlocking(false); ssc.socket().accept(); the ServerSocket.ac...
{ "language": "en", "url": "https://stackoverflow.com/questions/328925", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Getting a unique id from a unix-like system I want to get from any Unix-like system (if this is possible) a unique id that will be persistent every time my application runs in the same machine. If it is possible, I want to get the same id from Linux or FreeBSD or Solaris, etc... I don't want to generate a new id for...
{ "language": "en", "url": "https://stackoverflow.com/questions/328936", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "27" }
Q: What have your experiences been with Entity Framework? EF has been out for awhile now and I'm considering evaluating it - what have your experiences been? I am interested in both web and desktop applications, and maybe some comparisons between EF and other ORM tools that you've used. Learning curve is a factor sinc...
{ "language": "en", "url": "https://stackoverflow.com/questions/328938", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Where is the best place in an app to do validation? Rules of thumb? I am making a C# app for a class project. I want to ensure a string has one of three values. Normally, in a web app, I would do validation with javascript on the client side. However, this is currently a console app. I know that I should do the ...
{ "language": "en", "url": "https://stackoverflow.com/questions/328939", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How do i check if a file is a regular file? How do i check in C++ if a file is a regular file (and is not a directory, a pipe, etc.)? I need a function isFile(). DIR *dp; struct dirent *dirp; while ((dirp = readdir(dp)) != NULL) { if ( isFile(dirp)) { cout << "IS A FILE!" << endl; i++; } I've tried comparing...
{ "language": "en", "url": "https://stackoverflow.com/questions/328944", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: What are the semantics of 'stat' on a dirhandle in Perl? On researching another question I noted that the stat function in Perl can take a dirhandle as its argument (instead of a filehandle or filename). However I can't find any examples of correct use of this - there are none in the Perl manual. Can anyone show an ...
{ "language": "en", "url": "https://stackoverflow.com/questions/328946", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: C: the definitive truth about rand, random and arc4random There's a lot of conflicting information about this topic. So let's try to agree on a definitive answer: Which one of these random number generator in C create better randomness: rand, random or arc4random? note: Just to make the question clear, this is not a...
{ "language": "en", "url": "https://stackoverflow.com/questions/328950", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: How to use std::sort with a vector of structures and compare function? Thanks for a solution in C, now I would like to achieve this in C++ using std::sort and vector: typedef struct { double x; double y; double alfa; } pkt; vector< pkt > wektor; filled up using push_back(); compare function: int porownaj(cons...
{ "language": "en", "url": "https://stackoverflow.com/questions/328955", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: Looking for some good resources to get started with Django All, I'd like to check Django out and maybe hack together some web pages to see how it feels - but after having a look at a few tutorials like this one I am starting to wonder if there is any way of getting it up and runinng without typying cmd line stuff fo...
{ "language": "en", "url": "https://stackoverflow.com/questions/328960", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Argument exception - parameter is not valid ( LinkLabel on WinForm ) I wrote a Win Forms app to test how a LinkLabel class works. It appears to be fine until I click on the changed LinkLabel. The Form1.cs code is below: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data;...
{ "language": "en", "url": "https://stackoverflow.com/questions/328962", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: long <-> str binary conversion Is there any lib that convert very long numbers to string just copying the data? These one-liners are too slow: def xlong(s): return sum([ord(c) << e*8 for e,c in enumerate(s)]) def xstr(x): return chr(x&255) + xstr(x >> 8) if x else '' print xlong('abcd'*1024) % 666 print xs...
{ "language": "en", "url": "https://stackoverflow.com/questions/328964", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Automount EBS volume in Amazon EC2 Windows Instance Does anyone know how to auto-mount an Elastic Block Storage (EBS) volume when starting a Windows 2003 instance in Amazon's Elastic Compute Cloud (EC2)? A: Setup: * *Make sure the EBS volume is formatted and labeled (in the example I used the label PDRIVE). *S...
{ "language": "en", "url": "https://stackoverflow.com/questions/328965", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Thorough use of 'if' statements or 'try/catch' blocks? Give me some of your thoughts on which is a better coding practice/makes more efficient code/looks prettier/whatever: Increasing and improving your ability to use if statements to anticipate and catch potential problems? Or simply making good use of try/catch ...
{ "language": "en", "url": "https://stackoverflow.com/questions/328976", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: Best Practice: When to dispatch back to the UI Thread I have a question on best pactices. When is the best time to dispatch a call back to the UI when using a helper loading method like the two below? Button1 uses the Dispatcher when returned and Button2 allows the helper loading class to encapsulate the call on t...
{ "language": "en", "url": "https://stackoverflow.com/questions/328980", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How to reduce linkage time for large project written in native Visual C++? I am working with a large bunch of sources written in Visual C++. The target is dll library. Linkage time consumes several minutes. How this time can be reduced? Library depends on other dlls and libs, which are in the same solution. The fir...
{ "language": "en", "url": "https://stackoverflow.com/questions/329007", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Accessing stored structures for which I have an xml description I have set up a sort of introspection-enabling C++ library that allows, using minimum macros and a fair amount of template trickery, to declare structures and classes that get enriched with some meta-information. This meta-information captures all impor...
{ "language": "en", "url": "https://stackoverflow.com/questions/329020", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Whats the best (most useful) interface you have written? The title basically spells it out. What interfaces have you written that makes you proud and you use a lot. I guess the guys that wrote IEnumerable<T> and not least IQueryable<T> had a good feeling after creating those. A: Strictly an interface? Or just an AP...
{ "language": "en", "url": "https://stackoverflow.com/questions/329029", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: FileNotFound exception when using XmlSerializer When trying to serialize a type (a generic List<T> which T is a class marked with XmlRootAttribute) into XML using XmlSerializer, a FileNotFoundException is thrown (sometimes) and serialization fails. It seems that XmlSerializer tries to create a temporary file with a ...
{ "language": "en", "url": "https://stackoverflow.com/questions/329030", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: What is the difference between CurrentCulture and CurrentUICulture properties of CultureInfo in .NET? In .NET there is the CultureInfo class in the System.Globalization namespace. It has two similar properties both returning values of the CultureInfo type: CurrentCulture and CurrentUICulture. What is the difference ...
{ "language": "en", "url": "https://stackoverflow.com/questions/329033", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "393" }
Q: Subscription Protecting Content? What are the best ways of developing a subscription type website that provides lesson content (like Lynda.com)? How do you protect the content from download (audio and video)? What's the best way to handle passwords? Can the user have a login name and password, and then also have an ...
{ "language": "en", "url": "https://stackoverflow.com/questions/329034", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Get machine properties I would like to write a program that will identify a machine( for licensing purposes), I tought about getting the following information and to compile an xml file with this data: * *MAC address. *CPU data (serial, manufacture, etc) *MotherBoard Identification. (serial, manufacture, etc) ...
{ "language": "en", "url": "https://stackoverflow.com/questions/329039", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How can I conditionally compile my C# for Mono vs. Microsoft .NET? I need a conditional compilation switch that knows if I am compiling for the mono or MS .NET runtime. How can I do this? A: The Mono compiler defines __MonoCS__ BUT, BUT, BUT, the whole point of Mono is that you can take an assembly that you built ...
{ "language": "en", "url": "https://stackoverflow.com/questions/329043", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "35" }
Q: returning a method name I'm using the following as a way of seeing listing the various methods in my developement print basename(__FILE__) . "::serve_table()" is there any function that's able to return the name of a class method so I don't have to trpe it each time? A: Use __FUNCTION__ and __LINE__ and __CLASS__ ...
{ "language": "en", "url": "https://stackoverflow.com/questions/329044", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Execute DB2 iSeries Stored Procedure from a SQL 2005 Linked Server I am trying to execute a stored procedured from a linked database in MS SQL 2005. The linked database is a db2 database on a iseries server. I am using the iSeries IBMDASQL service provider. I am able to query the stored procedure without problems...
{ "language": "en", "url": "https://stackoverflow.com/questions/329051", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: What's the rationale behind IEnumerable? Why do you think Microsoft wants us to go through IEnumerable to get to IEnumerator? Isn't the presence or absence of a valid cast to IEnumerator for a given type enough to determine if the type is enumerable or not? For example whats wrong with the following? class MyClass :...
{ "language": "en", "url": "https://stackoverflow.com/questions/329058", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: What is __gxx_personality_v0 for? This is a second-hand question from an OS development site, but it made me curious since I couldn't find a decent explanation anywhere. When compiling and linking a free-standing C++ program using gcc, sometimes a linker error like this occurs: out/kernel.o:(.eh_frame+0x11): undefin...
{ "language": "en", "url": "https://stackoverflow.com/questions/329059", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "112" }
Q: Writing Multithreaded Exception-Safe Code What are the tensions between multithreading and exception-safety in C++? Are there good guidelines to follow? Does a thread terminate because of an uncaught exception? A: C++0x will have Language Support for Transporting Exceptions between Threads so that when a worker thr...
{ "language": "en", "url": "https://stackoverflow.com/questions/329061", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "12" }
Q: How do I convert a variable to a string? For example so that it works like this toString (Var x)= "x" A: Use the show function: putStrLn (show x) will print out the "x" variable. (Naturally, you don't need to use it with putStrLn, either -- show returns a string that can be used anywhere like a string.) A: If I u...
{ "language": "en", "url": "https://stackoverflow.com/questions/329063", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Using LinqtoSql, how can I return values from a temp table in a SPROC? I have a stored procedure that returns values from a temp table. In my DBML, it displays (None) for the return type. What is the trick to get it to recognize the columns from my temp table? CREATE PROCEDURE [dbo].[GetCategoryPriceRanges] @Cate...
{ "language": "en", "url": "https://stackoverflow.com/questions/329065", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: checkpointing library for C# Am looking for checkpointing library for C#. Any ideas ? see http://en.wikipedia.org/wiki/Application_checkpointing A: This should be possible to implement using transactions (commit/rollback) or undo. If you design your classes and operations correctly it will work, it will require so...
{ "language": "en", "url": "https://stackoverflow.com/questions/329067", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: ASP.NET Authenticate Using [Authorize] I defined a Controller to force authentication by using the [Authorize] attribute. When a session times out, the request is still passed down and executed instead of forcing a redirect. I do use FormsAuthentication to login and logoff users. Any ideas on how to control that? Ex...
{ "language": "en", "url": "https://stackoverflow.com/questions/329102", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: VisualWorks Smalltalk-like IDE for C++ (Linux) Sup bros, Is there anything out there for C++ which displays the class hierarchies as a tree on the left panel? I've been using VisualWorks Smalltalk for a while, and the way that classes are displayed, and methods broken out, makes it very easy to build a mental pictu...
{ "language": "en", "url": "https://stackoverflow.com/questions/329109", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How do I activate JButton ActionListener inside code (unit testing purposes)? I need to activate a JButton ActionListener within a JDialog so I can do some unit testing using JUnit. Basically I have this: public class MyDialog extends JDialog { public static int APPLY_OPTION= 1; protected int buttonpres...
{ "language": "en", "url": "https://stackoverflow.com/questions/329118", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Forms in MasterPage and Views I have a master page which all my views inherit from. The issue I am having is with the form tag which is created in the master page and then the form tag which is created in view. Because of the form being inside the master page form, all my postbacks are sent to the controllers Index ...
{ "language": "en", "url": "https://stackoverflow.com/questions/329123", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Best way to use Linq2Sql? I'm struggling to think of a good way to use linq2sql, simply I want to use it, but I can't figure out whether it's best to wrap up the linq2sql generated classes inside my model classes providing some form of generic abstract base class / or interface for the common methods on my model cla...
{ "language": "en", "url": "https://stackoverflow.com/questions/329125", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Set the execution directory in Eclipse? Is it possible, to execute a class in a specified directory? I mean, a.class is in directory abc and i want it to be executed as if it were in directory xyz. A: Absolutely. Go into the Debug/Run dialog (drop down button next to the bug/"go" buttons), and in the Arguments tab,...
{ "language": "en", "url": "https://stackoverflow.com/questions/329129", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "20" }
Q: Handling national signs like ą ę in url? - your option how do you handle them? A: In domain names, you can do use IDN domains, if they are supported by the registrars you want to register them with. Elsewhere in the URL, they are generally sent by the browser as utf8 urlencoded. Only recently I was looking at: http...
{ "language": "en", "url": "https://stackoverflow.com/questions/329139", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Metadata file ... could not be found error when building projects Every time I start Visual Studio 2008, the first time I try to run the project I get the error CS0006 The metadata file ... could not be found. If I do a rebuild of the complete solution it works. Some information about the solution: * *I'm buildin...
{ "language": "en", "url": "https://stackoverflow.com/questions/329142", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "99" }
Q: How do you specify stylesheets for spcific media using ASP.NET Themes? This is a question brought up in a local user group mailing list at dot.net.nz ... I when I create an XHTML page old-fashioned way, I used to use the following syntax for my CSS declarations: <link rel=”stylesheet” type=”text/css” media=”...
{ "language": "en", "url": "https://stackoverflow.com/questions/329144", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Rewrite rules - going outside the docroot Assuming the following directory structure, htdocs/ images/ css/ .htaccess system/ index.php ... I would like to route all incoming requests through that php script. I have been trying some rewrite rules within the htaccess, but I can't seem to be able to route to...
{ "language": "en", "url": "https://stackoverflow.com/questions/329145", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Always use jquery selectors or cache them in variables? jQuery selectors are wonderful, but I sometimes I find myself typing them over and over, and it gets a little annoying. $('#mybutton').click(function() { $('#message-box').doSomething(); $('#message-box').doSomethingElse(); $('#message-box').attr('...
{ "language": "en", "url": "https://stackoverflow.com/questions/329151", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Should I design the application or model (database) first? I am getting ready to start building a new web project in my spare time to bring to fruition an idea that has been bouncing around my head for a while. I have never gotten down whether I am better off first building the model and then the consuming applicati...
{ "language": "en", "url": "https://stackoverflow.com/questions/329160", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "17" }
Q: Detecting (unknown) hardware in .NET I need some pointers on how to detect unknown hardware using .NET and C++/C#. I'm looking for the technique to use under NET to do this. What I basically want is to identify the PCIID/USBID and so on for all the hardware in the machine. Of course I also need this for the hardware...
{ "language": "en", "url": "https://stackoverflow.com/questions/329164", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: What is FLOP/s and is it a good measure of performance? I've been asked to measure the performance of a fortran program that solves differential equations on a multi-CPU system. My employer insists that I measure FLOP/s (Floating operations per second) and compare the results with benchmarks (LINPACK) but I am not c...
{ "language": "en", "url": "https://stackoverflow.com/questions/329174", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "50" }
Q: Report Writing in a PHP Web Application I've been developing business apps, basically CRUD, in ASP.Net for years now, and am interested in learning another language and platform. After a few trips to Borders and poking around a bit on the web, I have not found much dealing with generating reports in PHP. I can imag...
{ "language": "en", "url": "https://stackoverflow.com/questions/329181", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Report Generation in a Ruby Web Application I've been developing business apps, basically CRUD, in ASP.Net for years now, and am interested in learning another language and platform. After a few trips to Borders and poking around a bit on the web, I have not found much dealing with generating reports in Ruby / Ruby ...
{ "language": "en", "url": "https://stackoverflow.com/questions/329188", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Cross-table UPDATE in SQLITE3 In SQL Server, I can do something like this: UPDATE tbl1 SET col2 = tbl2.col2 FROM table1 tbl1 INNER JOIN table2 tbl2 ON tbl1.col1 = tbl2.col1 I haven't bothered to look whether this is part of any SQL standard or not, and I'm sure there are other ways to do it, but it is...
{ "language": "en", "url": "https://stackoverflow.com/questions/329197", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: Event log automation/tools for big web farm A good friend of mine works for a large asp.net shop, with a web farm with many web servers (dozens). The application logs exceptions and messages to the event log on each box (not to a centralized location). Does anyone know of a convenient way to perform unified reporti...
{ "language": "en", "url": "https://stackoverflow.com/questions/329203", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: UIView bounds with top bar When creating a UIView with a navigation bar in interface builder, the top bar takes some space, but the view still has the same size. This mean that the bottom of the view is not visible. Is there a way to get the "visible size" of a UIView? I would like to show a subview at the bottom ...
{ "language": "en", "url": "https://stackoverflow.com/questions/329210", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Issues with jQuery and TinyMCE rich text editor? I'm experimenting with the Tiny MCE editor. We also use jQuery, and I noticed that the standard Tiny MCE install includes a file called tiny_mce_jquery.js. Can anyone enlighten me as to what that's for? Oddly, I can't find anything about it online. Should I reference ...
{ "language": "en", "url": "https://stackoverflow.com/questions/329213", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Changing the stylesheet of a nested page at runtime First off, I apologize if this doesn't make sense. I'm new to XHTML, CSS and JavaScript. I gather that in XHTML, the correct way to have a nested page is as follows (instead of an iframe): <object name="nestedPage" data="http://abc.com/page.html" type="text/html" ...
{ "language": "en", "url": "https://stackoverflow.com/questions/329216", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Medium-size Clojure sample application? Is there a medium-sized Clojure sample application that could be used as a "best-practices" example, and a good way to see what such an application would look like in terms of code and code organization? A web application would be particularly interesting to me, but most impor...
{ "language": "en", "url": "https://stackoverflow.com/questions/329221", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "98" }
Q: Fonts missing in WinForms.FontDialog When I display an instance of WinForms.FontDialog (C#, .NET 2.0), I am missing some fonts that I expect to be there (e.g. Courier, Fixedsys, MS Sans Serif). Also, a customer is complaining that Adobe fonts he has installed are also not showing up in the list. How can I get these ...
{ "language": "en", "url": "https://stackoverflow.com/questions/329225", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How do you package and self host your Firefox extensions? I'm developing a site-specific Firefox extension. The official hosting/updating mechanism at addons.mozilla.org forces my users to login to download my plugin (until it get approved for public status), which isn't good for me, especially as my plugin is unlik...
{ "language": "en", "url": "https://stackoverflow.com/questions/329242", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: How to shrink to printable area in C#? Greetings, I have problems (when trying to print from c# to certain printers that do not have large print areas. Is there a way to shrink to printable area (like Adobe Acrobat do)? Thanks! A: You can determine the size of your image, then the size of the printing area (from th...
{ "language": "en", "url": "https://stackoverflow.com/questions/329252", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: What is the best way to consume REST web services? What's the best way to consume REST web services from .NET? A: Instead using WebClient like Kenney, you can use HttpWebRequest and HttpWebResponse and process the result with a StreamReader and XmlDocument . A: A straight forward and easy approach would be to use ...
{ "language": "en", "url": "https://stackoverflow.com/questions/329256", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "47" }
Q: How do I debug an MPI program? I have an MPI program which compiles and runs, but I would like to step through it to make sure nothing bizarre is happening. Ideally, I would like a simple way to attach GDB to any particular process, but I'm not really sure whether that's possible or how to do it. An alternative woul...
{ "language": "en", "url": "https://stackoverflow.com/questions/329259", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "152" }
Q: Handle Swing events in JUnit test I have Swing java application with network communications to several "Players" that are represented as player objects, each with their own communication thread. The app has a "Team" object managing all player objects. Several UI components listen to events passed from the players th...
{ "language": "en", "url": "https://stackoverflow.com/questions/329264", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How can I skip the login prompt for Visual Sourcesafe? I'd like to automatically login to VSS when I open it, and skip the login prompt altogether. Is this possible? A: Answering my own question: 1 - Right-click My Computer, click Properties 2 - Click "Advanced" -> "Environment Variables" 3 - Under User variables ...
{ "language": "en", "url": "https://stackoverflow.com/questions/329274", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Single event raising pattern for multiple controls I have several controls on a page. It happens to be a Silverlight page but I don't think that it matters for this question. When a control's value changes, a change event is raised. In this event I do a calculation and change the value of one of the other controls. ...
{ "language": "en", "url": "https://stackoverflow.com/questions/329279", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How to get website title from c# I'm revisiting som old code of mine and have stumbled upon a method for getting the title of a website based on its url. It's not really what you would call a stable method as it often fails to produce a result and sometimes even produces incorrect results. Also, sometimes it fails t...
{ "language": "en", "url": "https://stackoverflow.com/questions/329307", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "18" }
Q: Get console buffer contents in C Just wondering if there is any way (in C) to get the contents of the console buffer, preferably as some kind of char array. It is going to be written to a file, so if I am missing out on something stupid that will do exactly that, then point it out. It can be Windows-specific. I am u...
{ "language": "en", "url": "https://stackoverflow.com/questions/329309", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Pure Python rational numbers module for 2.5 Has anybody seen such a thing? Small self-sufficient modules are preferred. A: SymPy is a symbolic maths library written entirely in Python and has full support for rational numbers. From the tutorial: >>> from sympy import * >>> a = Rational(1,2) >>> a 1/2 >>> a*2 1 ...
{ "language": "en", "url": "https://stackoverflow.com/questions/329333", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }