instruction
stringlengths
0
30k
|linux|debugging|gdb|
Please consider both commercial and free debuggers. Would like to see also the pros and cons for each.
It depends on the application type. A desktop application is much different than a web application. An application server is much different than a standalone application. It also depends on the JVM that you are using. JDK5 and later 6 include enhancements that help understand how to tune your application. H...
Personally I use web application projects exclusively now. I actually converted a rather web site to a web application because of compilation times for the web site. I also use pre-build events to move configuration specific configuration files around and pre-build and post-build events are not available in web site...
Perhaps one or two users who find records are using a different schema-name and thus a different tables. IE most users are using dbo.PODORDH, but one or two users are using otheruser.PODORDH.
Take a procedural-style written piece of code and try to transform it into OOP based solution. During the process, consult a book on refactoring and design patterns. A friend of mine was able to make a huge step forward in understanding object oriented concepts exactly this way. As with anything, this might not work fo...
A KeyedCollection is a type of dictionary that can be directly serialized to xml without any nonsense. The only issue is that you have to access values by: coll["key"].Value;
I've used Pipes to translate blogs into English. I would have liked to use it to fetch the full text for blogs which only provide a summary of the content in the feed, but unfortunately they don't provide any input which fetches the content from a parameterizable source :-(.
The C89/90 and C++03 standards are available in book form from Wiley. [C++ Standard on Amazon][1] [C Standard on Amazon][2] Plus, as already mentioned, the working draft for future standards is often available from the committee websites: [C++ committee website][3] [C committee website][4] The C-201x draft is ava...
[Rubik's Infinity][1]'s quite fun, it's a little bit like Connect Four but subtly different. Evauluating a position is pretty easy. I knocked together a Perl script to play it a while back, and actually had to reduce the number of moves ahead it looked, or it beat me every time, usually with quite surprising tactics...
I recently had to write a component that accessed a wiki and did some basic text scraping. The majority of tests I wrote validated the correct HTTP response code. As far as validating the actual resource goes, I would save an offline version of a known resource and check that the algorithm is gathering/processing the c...
PyTables Pro claims that "for situations that don't require fast updates or deletions, OPSI is probably one of the best indexing engines available". However I've not personally used it, but the F/OSS version of PyTables gives already gives you good performance: http://www.pytables.org/moin/PyTablesPro
This syntax is from Visual Basic, where you can code something like this: Dim number As Integer = 8 Select Case number Case 1 To 5 Debug.WriteLine("Between 1 and 5, inclusive") ' The following is the only Case clause that evaluates to True. Case 6, 7, 8 ...
Can we see more code? My first hunch is the table cell needs the text-align: center.
subversion tags and branches
|branch|subversion|tags|
Has anybody come up with a better technique for managing tags and branches in subversion than what is generally recommended (the parallel directories called 'tags' and 'branches')?
|svn|branch|tags|
**PowerShell** > & ($f={param($f);& $f $f}) $f "The script failed due to call depth overflow. The call depth reached 1001 and the maximum is 1000."
**PowerShell** > & ($f={& $f $f}) $f "The script failed due to call depth overflow. The call depth reached 1001 and the maximum is 1000."
**PowerShell** > $f={&$f};&$f "The script failed due to call depth overflow. The call depth reached 1001 and the maximum is 1000."
By the fact that you A) posted a question to this site and B) have a blog it appears, it shows you have passion. That is one thing a lot of people don't have so you that to your advantage. Use that passion to further your knowledge. If you are truly passionate about programming as you say, then just start program...
I haven't had SharpDevelop installed for a while but when I did the only problem I ran in to was that I couldn't easily share the solution file. If you don't mind having two different solutions there should be no problems.
I'm not sure that can be found in /proc. You could try using the getuid() function or the $USER environment variable.
Why not just use "`id -u`"?
Help on Porting a SIP library to PSP
|c++|porting|psp|pspsdk|sip|
I'm currently trying to port a SIP stack library (pjSIP) to the PSP Console (using the PSPSDK toolchain), but I'm having too much trouble with the makefiles (making the proper changes and solving linking issues). Does anyone know a good text, book or something to get some insight on porting libraries? The only d...
It is somewhat of a shame that [Contains is not supported in Linq to Entities][1]. IN and JOIN are not the same operator (Filtering by IN never changes the cardinality of the query). [1]: http://msdn.microsoft.com/en-us/library/bb738638.aspx
DAO doesn't support Hierarchical recordsets. You may be able to use ADO in access, but I'm not certain.
Cleanest way to implement collapsable entries in a table generated via asp:Repeater?
|c#|.net|repeater|
Before anyone suggests scrapping the table tags altogether, I'm just modifying this part of a very large system, so it really wouldn't be wise for me to revise the table structure (the app is filled with similar tables). This is a webapp in C# .NET - data comes in from a webservice and is displayed onscreen in a tab...
|c#|repeater|
Most likley, you either want to check the $USER environment variable. Other options include getuid and id -u, but searching /proc is certainly not the best method of action.
How to do relative imports in Python?
|python|
Imagine this directory structure: app/ __init__.py sub1/ __init__.py mod1.py sub2/ __init__.py mod2.py I'm coding mod1, and I need to import something from mod2.. How should I do it? I tried from ..sub2 import mod2 but I'm getting ...
Imagine this directory structure: app/ __init__.py sub1/ __init__.py mod1.py sub2/ __init__.py mod2.py I'm coding mod1, and I need to import something from mod2.. How should I do it? I tried from ..sub2 import mod2 but I'm getting ...
Imagine this directory structure: app/ __init__.py sub1/ __init__.py mod1.py sub2/ __init__.py mod2.py I'm coding mod1, and I need to import something from mod2.. How should I do it? I tried from ..sub2 import mod2 but I'm getting ...
As a tablet user I can answer a few of your questions. First: > You cannot very easily keep a "keyboard focus" on a window when the stylus has to trail out of the focused window to push a key on the virtual keyboard. Most of the virtual keyboards I've used (The windows tablet input panel and one under ubuntu) ...
Flex: How to add a tab close button for TabNavigator component
|apache-flex|actionscript-3|
I'd like to have a TabNavigator component that has a close button for some of the tabs. How do I do that? It seems that the TabNavigator component does not allow (or I could not find) extensibility of this form. Help. Thanks
What Is the simplest way to build an Array of N numbers following a simple pattern?
|c#|
Let's say the first N integers divisible by 3 starting with 8. I'm sure there is some one line solution using lamdas, I just don't know it that area of the language well enough yet.
What is the simplest way to build an Array of N numbers following a simple pattern?
Let's say the first N integers divisible by 3 starting with 8. I'm sure there is some one line solution using lambdas, I just don't know it that area of the language well enough yet.
What is the simplest way to initialize an Array of N numbers following a simple pattern?
Let's say the first N integers divisible by 3 starting with 9. I'm sure there is some one line solution using lambdas, I just don't know it that area of the language well enough yet.
Good references / tips for designing rule systems?
|rules|filtering|user-interface|dsl|
I often need to implement some sort of rule system that is user-editable -- the requirements are generally different enough that the same system isn't directly applicable, so I frequently run into the same problem--how do I design a rule system that 1. is maintainable 2. properly balances expressiveness with ...
|user-interface|dsl|filtering|rules|
I often need to implement some sort of rule system that is user-editable -- the requirements are generally different enough that the same system isn't directly applicable, so I frequently run into the same problem--how do I design a rule system that 1. is maintainable 2. properly balances expressiveness with ...
Extract the part that accesses the HTTP resources out of your main code. Create an interface for that new component, In your test, mock the interface and return data that you can control reliably. You can test the HTTP access as an integration test.
`phone.dial()`, because it's the phone that does the dialing. Actor.Verb( inputs ) -> outputs.
actually, this works by itself, no need to define it. <a href="#top">top</a> This is a "magic" hashname value that does not need to be defined in browsers. Just like this will "reload" the page. <a href="/">reload</a>
def import_file(full_path_to_module): try: import os module_dir, module_file = os.path.split(full_path_to_module) module_name, module_ext = os.path.splitext(module_file) save_cwd = os.getcwd() os.chdir(module_dir) module_obj = __...
If your writing OO then you start with the basic object, which is not the number, the number is going INTO the phone, so phone.dial() that way you can also phone.answer() phone.disconnect() phone.powerOFF, ect.<br /><br />Another way to look at it is does the phone dial the number or does the number dial the phone?
Are tuples more efficient than lists in Python?
|python|performance|
Is there any performance difference between tuples and lists when it comes to instantiation and retrieval of elements?
I have been working on learning Cocoa myself recently and have found Apple's own [Cocoa resources][1] to be incredibly helpful. For example projects I have spent quite a bit of time in the [Adium source][2]. Adium is a relatively large projects so I am very often able to find examples of whichever concept I am in...
I have been working on learning Cocoa myself recently and have found Apple's own [Cocoa resources][1] to be incredibly helpful. For example projects I have spent quite a bit of time in the [Adium source][2]. Adium is a relatively large project so I am very often able to find examples of whichever concept I am int...
Yes, www.jobtree.com.au is. I also have another new site coming online in the next few days www.afterkickoff.com/football that is using it.
Sounds like you're looking for, a phonetic-based algorithms, such as [soundex][1] or [double metaphone][2]. The former actually *is* what several government departments use, is not very complex, with many implementations [available][3] (although it seems simpler to implement your own). [Levenshtein distance][4] is a...
Maybe this will help [http://jquery.bassistance.de/autocomplete/demo/][1] It uses JQuery (client side) and php (serverside). The example feeds from an array but can be easily modified so it will use a MySQL database. [1]: http://jquery.bassistance.de/autocomplete/demo/
Fatal Error C1083 - Cannot open include file: "windows.h": No such file or directory
|ikvm|.net|path|c#|
I'm trying to get IKVM to build (see [this question][1]) but now have encountered a problem not having to do with IKVM so I'm opening up a new question: When running nant on the IKVM directory with the Visual Studio 2008 Command Prompt (from the Start Menu), I get the following error: > ikvm-native-wi...
I'm trying to get IKVM to build (see [this question][1]) but now have encountered a problem not having to do with IKVM so I'm opening up a new question: When running nant on the IKVM directory with the Visual Studio 2008 Command Prompt (from the Start Menu), I get the following error: > ikvm-native-wi...
|c#|.net|path|ikvm|solved|
I'm trying to get IKVM to build (see [this question][1]) but now have encountered a problem not having to do with IKVM so I'm opening up a new question: When running nant on the IKVM directory with the Visual Studio 2008 Command Prompt (from the Start Menu), I get the following error: > ikvm-native-wi...
You could run it through perl. export CLEANSTRING=$(perl -e 'print join( q//, map { s/\\s+/_/g; lc } split /[^\\s\\w]+/, \$ENV{STRING} )') I'm using ksh-style subshell here, I'm not totally sure that it works in bash. That's the nice thing about shell, is that you can use perl, awk, sed, grep....
I definitely prefer annotations, having used them both. They are much more maintainable and since you aren't dealing with that many classes to re-map, I would say it's worth it. The annotations make refactoring much easier.
Using the **Brief** keyboard mapping this is done using the **Al+L** to mark the line and the **Minus** key on the numeric keypad (or **Alt+D**) to cut the line to clipboard. The cut will remove the line entirely, including the newline character. Hitting the **Ins** key on the numeric keypad would put the line back ...
You might want to move the validation outside of the getters and setters. You could have a function or property called IsValid that would run all the validation rules. t would populate a dictionary or hashtable with all of the "Broken Rules". This dictionary would be exposed to the outside world, and you can use it ...
[MSDN](http://msdn.microsoft.com/en-us/library/ms187858.aspx) I'd say use those procedures inside a SQL Agent job (use master.xp_cmdshell to perform the copy).
As far as I know, `/proc` is specific to Linux, it's not in UNIX in general. If you really just want the current UID, use the `getuid()` or `geteuid()` function. If you know you'll be on Linux only, you can explore the hierarchy under `/proc/self/*`, it contains various information about the current process. Remembe...
Thanks for all your answers, After a bit of experimentation I saw that Oracle was indeed using the values 0 and 1 to store boolean values in varchar2 columns without any mapping in the JDBC code. That said, if I can give a bit of context, we're going to fix that situation where things would just work "by accident...
The [jQuery FxQueues plug-in][4] does just what you need: $('#element').fadeOut({ speed: 'fast', preDelay: 5000 }); [4]: http://plugins.jquery.com/project/fxqueues
ADO 2.0 support MSDataShape - an OLEDB provider. Check out data shaping at [http://microsoft.apress.com/asptodayarchive/72268/data-shaping-with-ado-part-1][1] [1]: http://microsoft.apress.com/asptodayarchive/72268/data-shaping-with-ado-part-1
If all you want is XSD, LiquidXML has a free version that does XSDs, and its got a GUI to it so you can tweak the XSD if you like. Anyways nowadays I write my own XSDs by hand, but its all thanks to this app. http://www.liquid-technologies.com/
Generating Javascript code
|javascript|
Are there any good tools to generate javascript.I remember in dotnet, there was Script#, dont know its status today.Anyone has experience with any tools?
What tools generate JavaScript?
Are there any good tools to generate JavaScript? I remember in .NET, there was Script# - don't know its status today. Anyone have experience with any tools?
I've used a relational database which tags ID's (int) to uuids that are the name of the files. This way it doesn't matter how they are on disk. It helps me obfuscate the files. Also, I can then use JOINs to "rename" the file arbitrarily. Also, I can use different file "names." It all depends on your app and where it is...
Since the "i" in get<i>(tup) needs to be a compile-time constant, template instantiation is used to "iterate" (actually recurse) through the values. Boost tuples have the "length" and "element" meta-functions that can be helpful here -- I assume C++0x has these too.
The phrase "real-time" covers a fairly large patch of ground. The vague definition is "software that acts within a bounded response time". Where the boundary is hard e.g. in a car's injection control system, the software is said to be "hard real-time". Where the boundary is soft e.g. in a music-playback system...
I was a VisualStudio + VA-X user before I switched to ubuntu, and needed good auto completion and function navigation features in any IDE. I have tried Netbeans,Eclipse CDT,CodeBlocks,Geany,Anjuta, KDevelop and finally settled for KDevelop since that was the closest I could get to VS+VA-X. Eclipse & NetBeans ar...
$datefrom = strtotime($datefrom, 0); $dateto = strtotime($dateto, 0); $difference = $dateto - $datefrom; $days_difference = floor($difference / 86400); $weeks_difference = floor($days_difference / 7); // Complete weeks ...
Multiple tabs in windows vista and gvim
|vim|tabs|
I am trying to get the "Edit with Vim" my Right click context menu to work, so that each new file I open opens in a new tab in a single instance of vim. Currently, using Regedit I have set <code> \HKEY-LOCAL-MACHINE\SOFTWARE\Vim\Gvim\path = "C:\Programs\Vim \vim72\gvim.exe" -p --remote-tab-silent "%*" </c...
Asp.net and WF get along just fine, and WF doesn't add much maintenance overhead. Whether or not this is the right design for you depends a lot on your needs. If you have a lot of event driven actions then WF might be worthwhile, otherwise the overhead of rolling your own tracking would probably add less complexity ...
One of the benefits of unit testing is predictability. Before unit testing I could have predicted to a great degree of accuracy how long it would take to code something, but not how how much time I would need to debug it. These days, since I can plan what tests I am going to write, I know how long coding is goi...