instruction
stringlengths
0
30k
@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...
Eclipse works best if you leave the project folder structure to its management. We are working with 15 developers on a project of several thousand classes and even more XML and .properties files. I agree there are problems with ANT integration, so for production and nightly builds I recommend an external build syste...
MS CRM4.0 Provisioning Issue using CrmDeploymentService
|crm|
i've been working on Provision of an organization for quite a few days , and had faced few issues which i was successful in resolving them.Let me explain abt the issues i faced, the MSCrmServices is a process that is running under the Network Service. When I call the 'Execute' method on the service from a console app...
**Use RAII.** * **Forget Garbage Collection** (Use RAII instead, or try C# or Java). Note that GB can leak, too (if you forget to "null" some references), and that GB won't help you to dispose of ressources (if you have an object which acquired a handle to a file, the file won't be freed automatically when the objec...
Unless you're modifying the browser DOM, I can't think of a reason that you would want to do this. (But without knowing fully what you're trying to do, I could be wrong in this case =) You should be able to send back data from mulitple objects (even nested complex objects in your form) in just one POST. Chances a...
You could maybe wrap each control in a usercontrol that can take in IQueryable<linqclass> and tack on to the query if it is warranted. So your page code might go something like var qry = from t in _db.TableName select t; then pass qry to a method on each user control IQueryable<t> addToQu...
There is no known correlation between a language "catching on" and whether or not is has powerful, well researched, well designed features. A lot has been said on the subject. It exists all over the place in technology, and also the arts. We know artist A has more training and produces works of greater breadth and...
My suggestion: start small. Just start by memorizing a small set of most useful commands. When I started vi, these were my top 10: - (Esc) to return to command mode (most important!) - a to add text after cursor - A to add text at end of current line - x to delete 1 character - dd t...
I use TOAD with our Oracle reports development, and I think that it's a good development tool. I normally toggle back and forth between a number of different Oracle instances and schemae, and I like the way that TOAD can display multiple windows for each instance/schema, or even more than one per schema. TOAD takes...
Renaming/moving files with suffixes quickly: `cp /home/foo/realllylongname.cpp{,-old}` This expands to: `cp /home/foo/realllylongname.cpp /home/foo/realllylongname.cpp-old`
I agree that it's likely the result of disk caching. FYI, the IBM Java 6 VM does contain an ahead-of-time compiler (AOT). The code isn't quite as optimized as what the JIT would produce, but it is stored across VMs, I believe in some sort of persistent shared memory. Its primary benefit is to improve startup perfo...
Well, one place to get immediate, documented, experience is through open source projects. Join a project, or start a new one. Help with documentation on OSS projects (employers would love to see that). Help with writing unit tests, contribute patches, etc. And the sooner you get started, the better. Open Source exp...
Flash originally serialized data into a format called AMF, and with version 9+ uses an updated version called AMF3. While the AMF specs are open (the AMF3 spec is [here][1]), I don't think Adobe has opened the format of SOL files themselves. (Also, I think that SOL files written partially by v9+ players may contain bot...
This is typically a function I would mock out for the tests... I don't like my tests depending on anything external... even worse if it is an external resource I have no control over (such as a 3rd party website). Databases is one of the few external resources I often won't mock... I use DBUnit instead.
Text Centering Problem Using CSS with IE
|css|internet|explorer|center|text-align|
I'm working on a site, and am having trouble getting text within a table to appear centered in IE. Firefox 2, 3 and Safari all work fine, but for some reason, the text won't appear centered in IE 6 or 7. I'm using: h2{font:300 12px "Helvetica", serif; text-align:center; text-transform:uppercase;}. I've also ...
Your $index variable there kind of misleading. That number isn't the index, your "A", "B", "C", "D" keys are. You can still access the data through the numbered index $index[1], but that's really not the point. If you really want to keep the numbered index, I'd almost restructure the data: <pre> $items[] = array("A...
Where to lokk in which encoding is my ACCESS database
|ms-access|
I have ACCESS database, where can I look in ehich encoding character is database?
Where to look in which encoding is my ACCESS database
I have ACCESS database, where can I look in which encoding character is database?
I will use explicit method names. Everyone that maintains that code and me later will understand what that method is doing without having to write xml comments.
Two open-source wavetable synthesizers are [FluidSynth](http://www.nongnu.org/fluid/) and [TiMidity](http://timidity.sourceforge.net/).
I encountered this problem once. It was because the file i tried to delete was a part of a **classpath** for another task.
The "kernel" (it's actually not the kernel running your code, it's the CPU) doesn't know how your code is referencing the memory it's not supposed to be touching. It only knows that you tried to do it. The code: char *x = alloca(100); char y = x[150]; can't really be evaluated by the CPU as you tryin...
I don't think that's possible right now, since mod_dav_svn is an apache module and AFAIK there is no lighttpd module available.
OK here is the answer I ended up finding: rather than being on the Path, the directory with windows.h (in my case, C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include) needed to be set in the Include environment variable.
Simply you cannot do it with FF3. The other option could be using applet or other controls to select and upload files.
[TracExplorer][1] is cool for integrating Trac with VS. [1]: http://tracexplorer.devjavu.com/
Load into an array and sort($array); [php sort][1]... $fruits = array("lemon", "orange", "banana", "apple"); sort($fruits); foreach ($fruits as $key => $val) { echo "fruits[" . $key . "] = " . $val . "\n"; } Output: fruits[0] = apple fruits[1] = banana fr...
You don't specify your target language, but whatever it is, it should have reliable, built-in sorting methods, so use one of them! For PHP... Load into an array and sort($array); [php sort][1]... $fruits = array("lemon", "orange", "banana", "apple"); sort($fruits); foreach ($fruits as $key ...
**Use RAII.** * **Forget Garbage Collection** (Use RAII instead, or try C# or Java). Note that GB can leak, too (if you forget to "null" some references), and that GB won't help you to dispose of ressources (if you have an object which acquired a handle to a file, the file won't be freed automatically when the objec...
**Use RAII.** * **Forget Garbage Collection** (Use RAII instead, or try C# or Java). Note that GB can leak, too (if you forget to "null" some references), and that GB won't help you to dispose of ressources (if you have an object which acquired a handle to a file, the file won't be freed automatically when the objec...
Are both native libraries packaged into a *signed* jar which is listed as <nativelib ...> In the JNLP file?
Response.Cache.SetExpires(DateTime.Now.AddSeconds(60)); Response.Cache.SetCacheability(HttpCacheability.Server); Response.Cache.SetValidUntilExpires(true);
I'd suggest using [LuaInterface](http://luaforge.net/projects/luainterface/) as it has fully implemented Lua where it appears that Nua is not complete and likely does not implement some very useful functionality (coroutines, etc). If you want to use some of the outside prepacked Lua modules, I'd suggest using someth...
In x86 assembly, place a divide by 0 instruction at the location in memory of the interrupt handler for divide by 0!
There is not much difference between "publish", and copying the files. Publish appears in a webapplication. The only difference really is publishing gives you the option to only include html and dll's, where as copying you would need to parse out source code manually. There is no full precompiling in the publish option...
Just adding to DarenW - For windows there is a really nice Subversion server product that is free and makes life a dream - [VisualSVN Server][1]. This packages the latest Subversion build into a single MSI installer and adds in a very useful management console. [1]: http://www.visualsvn.com/server/
As pointed out in other responses, the answer is technically: > ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods ("."). However, as a practical matter, you will be somewhat more limited ...
Please, pretty please, do yourself a *huge* favor: use an HTML parser for parsing HTML. Seriously. That's what they are there for. HTML is a *very* complex language. No matter *how long* you will be tweaking, fiddling, fixing, honing your Regexp, there will *always* be a case you're missing. Anyway, you have to t...
One way would be to convert the dates to unix timestamps using strtotime(...), subtracting the results and div'ing with 86400 (24*60*60): $dif_in_seconds = abs(strtotime($a) - strtotime($b)); $daysbetween = $dif_in_seconds / 86400; ETA: Oh.. You meant weekdays as in Mon-Fri.. Didn't see that at first..
The server does not know where the user saves the file, so the server-code is not what is causing this. Could it be that your browser is caching the file, and then if you save it again to the same location, it only uses the cached version and does not download from the server? Try to save the file to the same (but a...
The best way is to iterate through all dates in between the given date range, and get the day of week for each date. If it's a week day, increment a certain counter. At the end of the process you get the number of weekdays. The PHP functions mktime() and date() (for working with UNIX timestamps) are your friends her...
Typically if you are doing double hop authentication like this, Kerberos is typically involved unless the first authentication is Basic. I would check the authentication on the IIS 6 servers and make sure that it's the same on IIS 7. If the IIS 6 box is set to Windows Integrated, then you need to verify the kerbe...
Transmitfile, download with weird behaviour
|asp.net|delphi|
I am using httpresponse.Transmitfile to download files. If I, in the file download dialog, choose to save in a different folder than the suggested one, the download rate drops down to 10 - 20 kb. If I cancel, or always choose to download in the same folder, then transfer rate are 200 kb and more. Here are my code : ...
I am using httpresponse.Transmitfile to download files. If I, in the file download dialog, choose to save in a different folder than the suggested one, the download rate drops down to 10 - 20 kb. If I cancel, or always choose to download in the same folder, then transfer rate are 200 kb and more. Here are my code : ...
Mixing EJB 2.x BMP entity beans with Hibernate 3.x
|java|hibernate|ejb2|
I have a large application that uses EJB 2.x entity beans (BMP). This is well-known to be a horrible persistence strategy (I can elaborate if necessary). I'd like to start migrating this application to use a much more expressive, transparent, and non-invasive persistence strategy, and given my company's previous exp...
I'd avoid SimpleXML if you can. Though it looks very tempting by getting to avoid a lot of "ugly" code, it's just what the name suggests: simple. For example, it can't handle this: <p> Here is <strong>a very simple</strong> XML document. </p> Bite the bullet and go to the DOM Functions. The powe...
Design question: does the Phone dial the PhoneNumber, or does the PhoneNumber dial itself on the Phone?
|oop|
This is re-posted from something I posted on the DDD Yahoo! group. All things being equal, do you write phone.dial(phoneNumber) or phoneNumber.dialOn(phone)? Keep in mind possible future requirements (account numbers in addition to phone numbers, calculators in addition to phones). The choice tends to illustrate ...
You can also invoke a shortcut by using the "invoke-item" cmdlet. So for example if you wanted to launch "internet explorer.lnk" you can type the following command: invoke-item 'Internet Explorer.lnk' Or you could also use the alias ii 'internet explorer.lnk' Another cool thing is that you could do ...
You can also invoke a shortcut by using the "invoke-item" cmdlet. So for example if you wanted to launch "internet explorer.lnk" you can type the following command: invoke-item 'Internet Explorer.lnk' Or you could also use the alias ii 'internet explorer.lnk' Another cool thing is that you could do ...
Every day in our office there is an exchange which goes something like this: > "Man, I just love unit tests, I've just been able to make a bunch of changes to the way something works, and then was able to confirm I hadn't broken anything by running the test over it again..." The details change daily, but the sent...
The Perl module [Spreadsheet::WriteExcel](http://search.cpan.org/~jmcnamara/Spreadsheet-WriteExcel/) allows you to create Excel workbooks that include charts. You first have to create the type of chart that you want in Excel and then extract it out using a utility called [chartex](http://search.cpan.org/~jmcnamara/S...
I would definitely reccomend to stick it out. Particularly if you are using visual studio which has built in editing, viewing and debugging tools for XSLT. Yes, it is a pain while you are learning, but most of the pain is to do with familiarity. The pain does diminish as you learn the language. W3schools has two...
You also should consider a possible change of [algorithms][1]. Consider that it may be cheaper to simply add the elements to your list, as you find them. Perhaps preallocating space for your list, will make it cheaper to build/populate. [1]: http://en.wikipedia.org/wiki/Sieve_of_Atkin
Personally, I don't want normal end users in the database. For an intranet application (especially one which resides on a Domain) I would provide a single account for application access to the database which only has those rights which are needed for the application to function. Access to the application would then ...
The problem is that the . metacharacter doesn't match newlines by default. You have to use the single-line modifier to achieve this. In .NET, you can either use RegexOptions.SingleLine as the last parameter to the method you're using, or use the modifier directly in the pattern, e.g: (?s)(<div id="super_special"...
Rules about disabling or hiding menu items
|user-interface|standards|
Have you ever been in a situation where a menu function you really really want to use but can't cause it's disabled or worse gone all together? There is an argument for always leaving menus enabled and then display a message to a user explaining why a menu function can not be actioned when they click on it. I think ...
According to the Griffon website, 1.5 or higher. [http://groovy.codehaus.org/Installing+Griffon][1] [1]: http://groovy.codehaus.org/Installing+Griffon
Why not add a variable for the element's Id and make it a reusable function? function SelectElement(selectElementId, valueToSelect) { var element = document.getElementById(selectElementId); element.value = valueToSelect; }
Retrieve all nodes in a tree that are children of another one
|php|data-structures|computer-science|
(Before you down mod it: nope, this is not homework) I have a web system which has a classical parent-children menu saved in a database, with fields id as the PK, and parent_id to pointing to the owning menu. (Yes, I know this doesn't scale very well, but that's another topic). So for these records (id-parent_id...
I love Project Euler. On the subject of prime generators, I am a big fan of the Sieve of Eratosthenes. For the purposes of the numbers under 2,000,000 you might try a simple isPrime check implementation. I don't know how you'd do it in erlang, but the logic is simple. For Each NUMBER in LIST_OF_PRIMES ...
Hierachy recordset in ms access
|sql|statement|
How can I get **hierachy recordset** in ms access through **select** statement?
|sql|ms-access|
VxWorks 6.x provides a function called classShow() which will list all the objects of a specific class (e.g. semaphores, message queues, tasks, ...). The following call will give you a list of objects for a given class: <pre><code> classShow(objClassIdGet(classId), 1) The classId types are: 1 windSemClass, ...
From the official [Wordpress.com FAQ][1]: > Javascript can be used for malicious purposes and while what you want to do is okay it does not mean all javascript will be okay. It goes on to remind the reader that both MySpace and LiveJournal had been affected by malicious Javascript and, therefore, will not be perm...
I know I'm answering my own question, but after yet more searching I think I may have found something matching my needs: [NMail][1] Features - NMail is a 100% .net application. - A Windows installer and setup wizard. - ASP.net Webmail. - An ASP.net administration site. IMAP Server Features - Support...
I know I'm answering my own question, but after yet more searching I think I may have found something matching my needs: [NMail][1] Features - NMail is a 100% .net application. - A Windows installer and setup wizard. - ASP.net Webmail. - An ASP.net administration site. IMAP Server Features - Support...
One possible way to reduce the number of entries for each stay is, store the time-frame e.g. start-date and end-date. I need to know the operations you run against the data to give a more specific advice. Generally speaking, if you need to check how many customers are staying on a given date you can do so with a sto...
Well, it depends on what you are going to be working on. If you are working on client/server, then I would go with WPF. If you are working in an environment where you can guarantee that .Net is installed on all of the machines, then I would go with WPF as well, because you can use what is called an XBAP, which is a WP...
Thanks for the comments. I ended up following the technique described [here][1]. [1]: http://www.mp3car.com/vbulletin/digitalmods-scripts-api/81425-how-create-c-com-object-streetdeck.html
One thing I've found is that being able to define rules as expression trees makes implementation so much simpler. As you correctly mentioned, the requirements from project to project are so different that you just about have to reimplement every time. Expression trees coupled with something like the visitor pattern...
Given two dates what is the best way of finding the number of weekdays in PHP?
|php|date|
The title is pretty much self explanatory. Given two dates what is the best way of finding the number of weekdays using PHP? For instance, how would I find out that there are 10 week days in between 31/08/2008 and 13/09/2008?
The title is pretty much self explanatory. Given two dates what is the best way of finding the number of week days using PHP? Week days being Monday to Friday. For instance, how would I find out that there are 10 week days in between 31/08/2008 and 13/09/2008?
File storing strategies for a web hosting website
|filesystems|
I am going to hosting for files that user submits. I need to grab some data from the file and then move it to some directory. There two points of interest for the lifetime of this file. The first is when the data is being abstracted and the second is when the file is archived so that it can be shared. When data i...
You have to open the device file with [CreateFile][1] and then use [ReadFile][2]/[readFileEx][3]. Don't forget to close the file with [CloseHandle][4] [1]: http://msdn.microsoft.com/en-us/library/aa363858(VS.85).aspx [2]: http://msdn.microsoft.com/en-us/library/aa365467(VS.85).aspx [3]: http://msdn.microso...
You have to open the device file with [CreateFile][1] and then use [ReadFile][2]/[readFileEx][3]. Don't forget to close the file with [CloseHandle][4] [1]: http://msdn.microsoft.com/en-us/library/aa363858(VS.85).aspx [2]: http://msdn.microsoft.com/en-us/library/aa365467(VS.85).aspx [3]: http://msdn.microso...
Try fabForce Database Designer; it is GPL too. http://fabforce.net/dbdesigner4/
Is there an alternative to gdb for Linux systems?