instruction
stringlengths
0
30k
How do you use gen_udp in Erlang to do multicasting? I know its in the code, there is just no documentation behind it. Sending out data is obvious and simple. I was wondering on how to add memberships. Not only adding memberships at start-up, but adding memberships while running would be useful too.
Have a look at <a href="http://www.javascript-examples.com/autocomplete-demo/">Javascript Examples</a> it lists 13 different autocompleting field code. I've used something similar on one of my sites, I essentially have a div layer set up under the text box, as a user types this fires of an Ajax based HTTP request to...
PythonWin's python interactive shell calling constructors twice?
|python|activestate|
While answering [http://stackoverflow.com/questions/68645/python-static-variable#81002][1] I noticed that PythonWin PyWin32 build 209.2 interpreter seems to evaluate twice? PythonWin 2.5 (r25:51908, Mar 9 2007, 17:40:28) [MSC v.1310 32 bit (Intel)] on win32. Portions Copyright 1994-2006 Mark Hammond - ...
Can you make the new class inherit from the old one? If so, maybe you can simply deserialize into the new one through casting. If not, another possible solution is to implement a batch operation where you include a reference to the old class and new class in different namespaces, hydrate the old object, perform a de...
Remote debugging with Eclipse CDT
|c++|eclipse|aix|remote-debugging|eclipse-cdt|
We're using the Eclipse CDT 5 C++ IDE on Windows to develop a C++ application on a remote AIX host. Eclipse CDT has the ability to perform remote debugging using gdbserver. Unfortunately, gdbserver is not supported on AIX. Is anyone familiar with a way to debug remotely using Eclipse CDT without gdbserver? Perh...
> t's good to separate content from layout But this is a fallacious argument; Cliche Thinking It's a fallacious argument because HTML tables are layout! The content is the _data_ in the table, the presentation is the table itself. This is why separating CSS from HTML can be very difficult at times. You're not ...
One of the problems of MDD is that, since it works on an higher abstraction level, it requires developers that can go up on the abstraction level too. That greatly reduces the universe of developers who can understand and use such methodologies.
maybe 2-3 %? Mostly using this DSM plugin: http://tcdev.free.fr/
Some image recognition software solutions are actually not purely algorithm-based, but make use of the **neural network** concept instead. Check out http://en.wikipedia.org/wiki/Artificial_neural_network and namely NeuronDotNet which also includes interesting samples: http://neurondotnet.freehostia.com/index.html
Well, there is AMPC. It is a C compiler for Windows, MacOS X and Linux, that can compile C code into Java Byte Code (the kind of code, that runs on a Java virtual machine). [AMPC][1] However, it is commercial and costs $199 per license. I doubt that pays off for you ;) I don't know of any free compiler like that....
Database Authentication for Intranet Applications
|asp.net|sql|nhibernate|
I am looking for a best practice for End to End Authentication for internal Web Applications to the Database layer. The most common scenario I have seen is to use a single sql account with the permissions set to what is required by the application. This account is used by all application calls. Then when people re...
Depends what language you're working in. For example, in perl you'd use the regex modifier s: m{<div id="super_special">.*?</span>}s
After spending quite a lot of time developing 3D I came to realize that in most cases the best way is to learn by examples and advance with them as you go. Start by setting to yourself a goal to achieve (for example - implementing a particles system. this includes usage of blending modes, textures, vertex colors, b...
What language are you using? In .NET you must set an option to ensure that it isn't single line.
Are you sure the declaration you made: const char** b = a; Really reflects your intention? To explain, if you declare: char ** const b = a; Then **b (the char) can't be changed. And: char * const * const b = a; Then both **b and *b (the char *) can't be changed. And finally: char co...
To be considered compatible, the source pointer should be const in the immediately anterior indirection level. So, this will give you the warning in GCC: char **a; const char* const* b = a; But this won't: const char **a; const char* const* b = a; Alternatively, you can cast it: cha...
For the most part I agree that TDD does provide a sort of design tool. The most important part of that to me is the way that it builds in the ability to make more changes (you know, when you have that flash of insight moment where you can add functionality by deleting code) with greatly reduced risk. That said, som...
> Did you debug it? ;) Are you sure the > cell_val is not empty? Also you don't > need the 'Step 1' in the For loop > since it's default. Also what do you > expect to acomplish with your code? It > logs if any ascii values are above > 127? But that's it - there is no > branching depending on the result? I did...
With VBA, VB6 you can just declare a byte array and assign a string value to it and it will be converted for you. Then you can just iterate through it like a regular array. e.g. Dim b() as byte Dim iter As Long b = CStr(Nz(fld.value, "")) For iter = 0 To UBound(b) if b(iter) > 127 th...
/usr/lib/openoffice/share/template/ That's on a Debian Lenny/testing. You can find them by typing locate .ots in a console (ots being the extension of OOo templates)
What we do is we check out (from source control) the app.config and *.cs files that are autogenerated by the svcutil.exe utility, then we run a batch file that runs svcutil.exe to retrieve the service metadata. When it's done, we recompile the code, make sure it works, then check the updated app.config and *.cs files b...
List from http://freeradius.org/related/opensource.html (not copying the descriptions because the page says it's copyright *rolleyes*): Cistron - http://www.radius.cistron.nl/ GNU Radius - http://http//www.gnu.org/software/radius/ FreeRADIUS - http://freeradius.org/ JRadius - http://jradius.sourceforge.net/...
explode() is for pansies. This is a job for [regular expressions](http://regular-expressions.info)! <?php preg_match('/^(\d\d):(\d\d):(\d\d)$/', $video_duration, $parts); if ($parts[1] !== '00') { echo("{$parts[1]} hours, {$parts[2]} minutes, {$parts[3]} seconds"); } else { echo("...
Literal Answer: Dictionary<int, SomeObject> myDictionary = new Dictionary<int, SomeObject>(); foreach (var pair in myDictionary.OrderByDescending(i => i.Key)) { //Observe pair.Key //Do stuff to pair.Value }
From [gamedev][1] string.erase(std::remove_if(string.begin(), string.end(), std::isspace), string.end()); [1]: http://www.gamedev.net/community/forums/topic.asp?topic_id=359650
Not sure if this will help but here are instructions for [setting up Eclipse][1] for blackberry development. Maybe you can use that information to figure out what changes to need to make in IDEA. [1]: http://www.blackberryforums.com/developer-forum/138210-setup-up-eclipse-blackberry-development.html
One time when an FK might cause you a problem is when you have historical data that references the key (in a lookup table) even though you no longer want the key available. Obviously the solution is to design things better up front, but I am thinking of real world situations here where you don't always have control ...
Consider calling osql.exe (the command line tool for SQL Server) passing as parameter a text file written for each line with the call to the stored procedure. SQL Server provides some assemblies that could be of use with the name SMO that have seamless integration with PowerShell. Here is an article on that. http...
Consider calling osql.exe (the command line tool for SQL Server) passing as parameter a text file written for each line with the call to the stored procedure. SQL Server provides some assemblies that could be of use with the name SMO that have seamless integration with PowerShell. Here is an article on that. http...
I think VolkerK already has the answer - stripos() does not return a boolean, it returns the position within the string, or false if it's not found - so you want to be checking that the return is not false using <tt>!==</tt> (not <tt>!=</tt> as you want to check the type as well). Also, be very careful with that eva...
I mostly stick to SimpleXML, at least whenever PHP5 is available for me. http://www.php.net/simplexml
Even if you are targetting a 2.0 deployment, some of your assemblies might require 3.5. For instance, LINQ requires 3.0. This should, however, be reflected when you build. Check each assembly to ensure that it's 2.0 compatible. You don't want any 3.5 things sneaking in. If this is the case, my guess would be a 3rd...
Fluent NHibernate Architecuture Question
|fluent|nhibernate|architecture|
I have a question that I may be over thinking at this point but here goes... I have 2 classes Users and Groups. Users and groups have a many to many relationship and I was thinking that the join table group_users I wanted to have an IsAuthorized property (because some groups are private -- users will need authorizat...
Fluent NHibernate Architecture Question
|architecture|nhibernate|fluent|
I presume that you must mean targeting the .NET 3.5 framework for your compilation? If so then as others have said I don't believe you will see much difference. However, if you're talking about using the updated compilers then there are various changes and break changes described for both C# and VB at the following...
I've always liked this one. Add this to your /etc/inputrc or ~/.inputrc "\e[A":history-search-backward "\e[B":history-search-forward When you type "ls <up-arrow>" it will be replaced with the last command starting with "ls " or whatever else you put in.
I have to mention [PSPad](http://www.pspad.com/). <br/> It is very good, feature rich free editor. I have used [UtraEdit](http://www.ultraedit.com/) and finally found free alternative in [PSPad](http://www.pspad.com/)
Thanks all, as the data are little in size, but the underlying tables will change, I think that I'll go the HttpCache way: I need actually a way to reduce db access, even if the data are changing (so that's the reason to not using a direct Sql dependency as suggested by @Bloodhound). I'll make some stress test befor...
To be honest, I probably wouldn't do this. Unit tests are isolated and you won't actually know if you have "unwanted, obscure side-effects" because everything is walled off from the other things that cause the side effects. As a result, you need integration or system testing and <em>that</em> is not something you can...
Segfault on stack overflow
|linux|segmentation-fault|
Why does the linux kernel generate a segfault on stack overflow? This can make debugging very awkward when alloca in c or fortran creation of temporary arrays overflows. Surely it mjust be possible for the runtime to produce a more helpful error.
Barry Brumitt, one of the engineers of Google maps route finding feature, wrote a post on the topic that may be of interest: [The road to better path-finding](http://googleblog.blogspot.com/2007/11/road-to-better-path-finding.html) 11/06/2007 03:47:00 PM
MySQL has a built-in function to find the Levenshtein edit distance, it's quite slow though. I'd use the auto-complete function offered above, or simply edit entries after-the-fact every week or so.
Can I call an external script or program when building a SWF file in Flash CS3?
|flash|svn|build-process|
Is there a way to call an external script or program from Flash CS3 every time it builds a SWF file? I'd like to add subversion information using subwcrev - the SVN keywords don't work because they only update when the version class file is updated.
it will improve the performance a little. Other than that it won't do much more (you won't be able to see when the file was last accessed of course). I have it turned of by default when I install windows XP using [nLite][1] to cut of the bloat I don't need. [1]: http://www.nliteos.com/
You've got a couple options. One is to write a supressions file for valgrind that turns off reporting of stuff that you're not working on. Python has such a file, for example: http://svn.python.org/projects/python/trunk/Misc/valgrind-python.supp If valgrind doesn't like your setup, another possibility is using `li...
. (dot) Matches any single character except line break characters \r and \n. Most regex flavors have an option to make the dot match line break characters too. . matches x or (almost) any other character
maybe: <div id="super_special">.*[\r\n]*.*[\r\n]*</div>
We used the Richfaces library Datatable: <http://livedemo.exadel.com/richfaces-demo/richfaces/dataTable.jsf?tab=usage> It's quite simple, and if you're not using richfaces already, it's **really** easy to integrate with MyFaces.
have written a message handler function in Outlook's Visual Basic (we're using Outlook 2003 and Exchange Server) to help me sort out incoming email. It is working for me, except sometimes the rule fails and Outlook deactivates it. Then I turn the rule back on and manually run it on my Inbox to catch up. The rule spont...
What Java versions does Griffon support?
|swing|groovy|griffon|
I want to write a Swing application in Griffon but I am not sure what versions of Java I can support.
explode() is for pansies. This is a job for [regular expressions](http://regular-expressions.info)! <?php preg_match('/^(\d\d):(\d\d):(\d\d)$/', $video_duration, $parts); if ($parts[1] !== '00') { echo("{$parts[1]} hours, {$parts[2]} minutes, {$parts[3]} seconds"); } else { echo("...
[CreateFile function reference on MSDN][1] [1]: http://msdn.microsoft.com/en-us/library/aa363858.aspx Scroll down to "Physical Disks and Volumes" - note the security restrictions on Vista do not apply for voulmes without a filesystem, so you'll be fine even on Vista under the conditions you have given.
One way I've found to enumerate the window is on DocumentEvents.DocumentOpened event, but it fires it always and not only during the loading of a solution. It does not seem that the SolutionEvents.Opened gets fired at all in my experience otherwise a static variable could be changed in it. [This][1] might help expla...
I believe the answer is that realtime systems are subjective, in that "real time" is just timeliness contraints imposed by the requirements. Though clearly something that takes 2 hours to respond to a request is not real time, a 30 second delay might be fast enough to qualify as real time. I work on what I consid...
I believe the answer is that realtime systems are subjective, in that "real time" is just timeliness contraints imposed by the requirements. Though clearly something that takes 2 hours to respond to a request is not real time, a 30 second delay might be fast enough to qualify as real time. I work on what I consid...
P/Invoking becomes so much easier when you use Reflector on WindowsBase.dll. Check out the MS.Internal.Interop namespace for COM interop, and MS.Win32.NativeMethods and MS.Win32.UnsafeNativeMethods for Win32 interop.
Google Authentication API: How to get the user's gmail address
|api|authsub|
I've been studying the Google authentication API (AuthSub)...My question is, how do I get the user's account information (at least his Gmail address) after the authentication has passed? Because currently, all I get back from the authentication process is a token granting me access to which ever Google service I h...
std::string::iterator end_pos = std::remove(str.begin(), str.end(), ' '); str.erase(end_pos, str.end());
I'm not aware of any; the approach i'd take is a project which has sample files you can checkout by various criteria, and then verify everything you expected arrived, and it is the right file (hash matches). You're aware that they ship a command line client (stcmd) too, right? For a lot of things, you don't need to ...
What about [Trac][1]? It's pretty simple, but does it's Job for a lot of Open Source projects. [1]: http://trac.edgewall.org/
It is the "Replace With" menu option. It is not under "Team", but on the same level.
If I remember correctly, that error message is given when XDB (Oracle's XML DataBase package) is not properly installed. Have the DBA check this out.
Migrating to Team System from SVN & Cruise Control.NET and back
|svn|visual-studio-team-system|cruisecontrol.net|migration|war-stories|
I was wondering if anyone tried migrating between TS and SVN/CC. What I mean by migrating is importing and exporting the repository between source control systems without losing the history. How good are the tools to migrate to and from VSTS? I am also interested in knowing any opinion regarding using Team Sys...
How good are the tools to migrate to and from VSTS?
I was wondering if anyone tried migrating between TS and SVN/CC. What I mean by migrating is importing and exporting the repository between source control systems without losing the history. How good are the tools to migrate to and from VSTS? I am also interested in knowing any opinion regarding using Team Sys...
How good are the tools to migrate to and from Team System?
|svn|cruisecontrol.net|migration|visual-studio-team-system|war-stories|
You could make an image with the watermark and then set the image as the background via css. For example: <style type="text/css"> .watermark{background:url(urltoimage.png);} </style> <div class="watermark"> <p>this is some text with the watermark as the background.</p> </div> That ...
Good ways to test a unit that communicates via HTTP
|language-agnostic|unit-testing|http|
Often, I find myself wanting to write a unit test for a portion of code that accesses HTTP resources as part of its normal function. Have you found any good ways to write these kinds of tests?
Aptitude and enthusiasm will get you a long way. If you can answer interview questions, work through programming problems, and you have personal projects that you are working on, lack of experience shouldn't hold you back too much. Make sure you nail the questions, though. If you don't have experience, you've got ...
First, one thing I always follow that has never led me wrong is honesty. If you don't know something just say "I don't know". This is so important when it comes to programming interviews and very easy to follow. Next, take the time to start and/or get involved with some open source projects. Saying that you worked o...
Andy Matuschak has a great [blog post][1] that leads you through several good Cocoa tutorials, explaining why you are reading each one. [Cocoa Dev Central][2] has loads of tutorials. For books, see Dave's answer. [1]: http://andymatuschak.org/articles/2007/09/09/getting-started-with-cocoa-a-friendlier-approa...
Andy Matuschak has a great [blog post][1] that leads you through several good Cocoa tutorials, explaining why you are reading each one. [Cocoa Dev Central][2] has loads of tutorials. For books, I echo Dave and Phillip Bowden with [Cocoa Programming for Mac OS X by Aaron Hillegass][3]. [1]: http://andymatusch...
Quoting from [Understanding Weak References](http://weblogs.java.net/blog/enicholas/archive/2006/05/understanding_w.html): > What good are PhantomReferences? I'm > only aware of two serious cases for > them: first, they allow you to > determine exactly when an object was > removed from memory. They are in fact ...
Edit, since I've misunderstand the question first: Quoted from here [http://www.memorymanagement.org/glossary/p.html](http://www.memorymanagement.org/glossary/p.html): > The Java specification says that the > phantom reference is not cleared when > the reference object is enqueued, but > actually, there's no w...
Lighttpd and WebDAV for serving a Subversion repo
|svn|webdav|lighttpd|
I've configured (at least I've tried to configure) Lighty to enable the WebDAV plugin when I go to a certain URL. I don't get any errors, so it seems to be working. How, then, do I configure it to serve my subversion repositories (of which I have many)?
@nickf That's a rather fatuous test though, you're comparing the execution *and compilation* time there which is obviously going to cost method 1 (compiles N times, JS engine depending) with method 2 (compiles once). I can't imagine a JS developer who would pass their probation writing code in such a manner. A fa...