instruction
stringlengths
0
30k
|c++|memory-management|
|c++|memory|
I want to create an allocator which provides memory with the following attributes: - cannot be paged to disk. - is incredibly hard to access through an attached debugger The idea is that this will contain sensitive information (like licence information) which should be inaccessible to the user. I have done...
IMHO you can disable every hint or error marker in IDEA. Please tell us the version of IDEA that you use.
I haven't directly done any game programming but some scene-demo coding and have found that [JOGL][1] is really a quite nice framework to work with. It's Java OpenGL so it has a rich 3D functionality and i do believe there are some open source graphic engines done for it aswell. [1]: https://jogl.dev.java.net/
Using Ajax PageMethods and Validators
|asp.net|ajax|
I have a basic CRUD form that uses PageMethods to update the user details, however the Validators don't fire off, I think I need to manually inspect the validator status in my javascript save method. Any ideas on how to do this?
I have a basic CRUD form that uses PageMethods to update the user details, however the Validators don't fire off, I think I need to manually initialize the validators and check whether the validation has passed in my javascript save method. Any ideas on how to do this?
Using ASP.NET AJAX PageMethods and Validators
|asp.net-ajax|validation|
The short answer, as others have said: **no.** The longer answer: IIS is there, classic ASP is there, and other server-side languages such as PHP will work, too. [What's missing is .NET Framework, and adding it to Server Core is in the works.][1] > Currenly the .NET Framework is not on Server Core, which means AS...
Intel CPUs after Core Duo support two Model-Specific registers called IA32_MPERF and IA32_APERF. MPERF counts at the maximum frequency the CPU supports, while APERF counts at the actual frequency. The actual frequency is given by: freq = max_frequency * APERF / MPERF (if you have edit permissions, feel free...
Yourdon still [believes][1]. But he might also still believe the world is going to end with Y2K. This is not something I would personally put a lot of faith in or want to be yoked with in the future. But often ours is not to reason why... [1]: http://www.yourdonreport.com/index.php/2008/05/21/moving-beyond-...
The higher end? No. CMM-5 shops do not impress me. The lower end? Yes. CMM-1 organizations scare me. CMM can help a new/novice team measure themselves and do the self improvement thing.
I think Jason Cohen is incorrect. The caret position is preserved when focus is lost. [**Edit**: Added code for FireFox that I didn't have originally.] [**Edit**: Added code to determine the most recent active text box.] First, you can use each text box's onBlur event to set a variable to "this" so you always...
Do not poll. Use events and other OS primitives to wait for notifiable occurrences. Polling ensures that the CPU will stay active and use more battery life.
I've used CVS as a substitute for ghost so I don't see why not. I'ts nice as you can tag a baseline: you can change manage machines. This works better on unixes than windows, obviously.
The thing that would put me off that idea, is that for general use any binary data would get copied over anytime it changed, whereas the text content SCM systems are based around can easily be updated in the form of diffs. So you could do it, just be aware you may not want to use it to manage things like photo repos...
It sounds like your web app is speaking SMTP directly to your user's mail server. [Your web app is a MUA (Mail User Agent) talking to the user's MTA (Mail Transfer Agent).] Nothing says that the user's MTA must be reachable or working at the moment. You need to run your own MTA so you ensure that somebody is providi...
FTP Timout on LIST when directory is empty
|webmethods|java|
Our business uses the WebMethods integration server to handle most of our outbound communications, and its FTP functionality leaves something to be desired. We are having a problem that may be specific to WebMethods, but if anyone can point me in a direction of what kinds of things might cause this I'd appreciate it. ...
Why not just make your WMI query only pull back where name='Y'? So: Dim oQuery As System.Management.ObjectQuery = New System.Management.ObjectQuery("select FreeSpace,Size,Name from Win32_LogicalDisk where DriveType=3 AND name='Y'")
IE6 handles width as min-width: td { min-width: 100px; _width: 100px;/* IE6 hack */ } If you want IE6 to handle width like normal browsers, give it an overflow:visible; (not the case here)
I posted a js cookie util a week or so ago on [my blog][1]. This has worked for me on all "A Grade" browsers. var CookieUtil = { createCookie:function(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); va...
Email -> mailserver ->[something] -> file-on-disk. File on disk is pretty easy to parse, use [JavaMail][1]. The [something] could be: - listener for smtp connections (overkill)! - [Pop3][2]/[imap][3] client - [Maildir][4]/Mailbox [1]: http://java.sun.com/products/javamail/javadocs/javax...
For Platform Invoke www.pinvoke.net is your new best friend! http://www.pinvoke.net/default.aspx/advapi32/AllocateAndInitializeSid.html
ok so this doesn't answer your question directly but it might offer an insight as to why you should create multiple session objects for each datastore. [This article][1] explains how you can implement a thread safe lazy singleton for each type of Session you need so that you only have one session per datastore but i...
Copying a directory that is version controlled
|vcs|dvcs|svn|bazaar|
I am curious whether it is OK to copy a directory that is under version control and start working on both copies. I know it can be different from one VCS to another, but I intentionally don't specify any VCS since I am curious about different cases. I was talking to a coworker recently about doing it in SVN. I th...
One thing to bear in mind when using SVN as a backup for binary files is that SVN will double the size of your files, because it keeps a local copy of each file (in the .svn/text-base) file. Apart from that I use SVN for a backup as well. Simply add all files then commit via script.
'bad address' error from copy_to_user
|c|linux|kernel|
I am attempting to copy a custom struct from kernel space to user space. inside user space errno returns 'bad address'. What is the usual cause of a bad address error? if(copy_to_user(info, &kernel_info, sizeof(struct prinfo)))
Ask your accountants! They will frown upon you for using float. Like some one posted before, use float ONLY if you don't care for accuracy. Although I would always be against it when it comes to money. In accounting software is NOT acceptable a float. Use decimal with 4 decimal points.
What's a good way to find relative paths in Google App Engine?
|python|
So I've done the trivial "warmup" apps with GAE. Now I'd like to build something with a more complex directory structure. Something along the lines of: siteroot/ models/ controllers/ controller1/ controller2/ ... templates/ template1/ template2/ ... ..etc. The controllers wil...
|python|google-app-engine|
iframe wikipedia article without the wrapper
|javascript|iframe|wikipedia|
I want to embed a wikipedia article into a page but I don't want all the wrapper (navigation, etc.) that sits around the articles. I saw it done here: http://www.dayah.com/periodic/. Click on an element and the iframe is displayed and links to the article only (no wrapper). So how'd they do that? Seems like JavaScr...
|java|ftp|webmethods|
FTP Timout on NLST when directory is empty
EDIT: Learned that Webmethods actually uses NLST, not LIST, if that matters Our business uses the WebMethods integration server to handle most of our outbound communications, and its FTP functionality leaves something to be desired. We are having a problem that may be specific to WebMethods, but if anyone can point...
Visual Studio *remembers* 2 sets of window layouts, normal mode and debugging mode. My solution is to arrange my normal windows exactly like I want them, then start debugging an application and once again arrange all of the windows the way I want, usually making it as similar to my *normal* layout as possible, then st...
You can use this code (Python) # Rename international files # -*- coding: cp1252 -*- import os, shutil base_dir = "g:\\awk\\" # Base Directory (includes subdirectories) char_table_1 = "áéíóúñ" char_table_2 = "aeioun" adirs = os.walk (base_dir) for adir in adirs: ...
Environment.GetFolderPath(Environment.SpecialFolders.LocalApplicationData);? i can't remember if there is a "Local Settings" folder on xp anymore, seems vaguely familiar
I want to create an allocator which provides memory with the following attributes: - cannot be paged to disk. - is incredibly hard to access through an attached debugger The idea is that this will contain sensitive information (like licence information) which should be inaccessible to the user. I have done...
How can a C++ windows dll be merged into a C# application exe?
|c#|dll|merge|
I have a Windows C# program that uses a C++ dll for data i/o. My goal is to deploy the application as a single EXE. What are the steps to create such an executable?
You could use a [hash_set][1] of any hashable type - for example, turn each tuple into a string "(x, y, z)". hash_set does fast lookups but handles collisions well. [1]: http://www.sgi.com/tech/stl/hash_set.html
It is particularly important for performance to not use select * when you have a join becaseu by definition at least two fields contain the same data. You do not want to waste network resources sending data you don't need fromthe database server to the application or web server. It may seem easier to use select * but i...
I am assuming you are talking about *continuous* integration. You can run [CruiseControl][1] on a virtual machine or an old machine, but if it needs to be up in the Internet, you can try virtual dedicated server hosting services. You can save money by picking Linux here, but I'd go for a Windows server if your targe...
If you have a XSD for your Xml then you can import that into your database and you can then build indexes for your Xml data.
I'm using jQuery and the javascript file only version of the Microsof ajax tool kit side by side in project right now. I think I'm going to go with jQuery and end up removing the Microsoft one. I'm very new to jQuery, but the more I learn about it, the more enamoured I get.
Are we sure there's no code that sets the Cookie to HttpOnly (we're not missing anything above)? The HttpOnly property will stop (modern) browsers from modifying the cookie. I'd be interested to see if you can kill it server side like Rob suggests.
We have also just installed Delphi 2009 and it does seem to have improved the support for Typelibraries. However I have worked with COM and type libraries for quite some time and here are my general gotchas that I have found over the years. I would agree its pretty buggy and is all the way up to Delphi 2006 (our vers...
**I would seriously consider reading the following code project article:** [Globalization and localization demystified in ASP.NET 2.0][1] It covers everything from Cultures and Locales, setting the threads current culture, resource files, encodings, you name it! And of course it's loaded with pretty pictures a...
How to Clear OutputCache for Website without Restarting App
|asp.net|outputcache|
Is there a way clear or reset the outputcache for an entire website without a restart? I'm just starting to use outputcache on a site and when I make a mistake in setting it up I need a page I can browse to that will reset it.
|asp.net|duplicate|output-cache|
|asp.net|output-cache|
How about this, for example: String appData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); I don't see an enum for just the Local Settings folder. <http://www.dotnetjunkies.com/WebLog/nenoloje/archive/2007/07/07/259223.aspx> has a list with examples.
unchangeable.AccessWidgets(): At this point, you are creating a new object of type WidgetHolder. This object is not protected by const. You are also creating new widgets in the WidgetHolder and not references to the Wdiget.
If you really need parallelism in Ruby for a Production level system (where you cannot employ a beta) processes are probably a better alternative. <br> But, it is most definitely worth trying threads under JRuby first. Also if you are interested in future of threading under Ruby, you might find this [article](http:...
How do I sync between VSS and SVN
|svn|visual-sourcesafe|synchronization|
I am forced to use VSS at work, but use SVN for a personal repository. What is the best way to sync between VSS and sync?
You could take a look at Argotic. It is a really cool framework. [http://www.codeplex.com/Argotic][1] [1]: http://www.codeplex.com/Argotic
What is causing a JVMTI_ERROR_NULL_POINTER?
|java|jvm|
I'm getting an error when my application starts. It appears to be after it's initialized its connection to the database. It also may be when it starts to spawn threads, but I haven't been able to cause it to happen on purpose. The entire error message is: FATAL ERROR in native method: JDWP NewGlobalRef, jvmtiEr...
I'm getting an error when my application starts. It appears to be after it's initialized its connection to the database. It also may be when it starts to spawn threads, but I haven't been able to cause it to happen on purpose. The entire error message is: FATAL ERROR in native method: JDWP NewGlobalRef, jvmtiEr...
To add to palehorse, another tip is [Full Screen][1] mode. [1]: http://blogs.msdn.com/saraford/archive/2007/08/09/did-you-know-visual-studio-has-a-full-screen-mode.aspx
This regex seems to be working: "^(\s*\b\S+\b\s*){0,10}$"
This regex seems to be working great: "^(\b\S+\b\s*){0,10}$"
Use [Thread.BeginCriticalRegion()][1] > Notifies a host that execution is about to enter a region of code in which the effects of a thread abort or unhandled exception might jeopardize other tasks in the application domain. Thread.BeginCriticalRegion() //do important stuff here Thread.EndCriti...
I did make some headway on this sort of thing a few years back using [Apache POI][1] to extract the contents of an email from .msg files. I'm pretty sure they have a simple swing explorer / viewer that you can use to examine the structure within the compound document format, but I can't find it right now. I was a...
While researching another issue, I came across this article which reminded me of your question: [Plumbing the Depths of the ThreadAbortException using Rotor][1] It shows the gyrations that .NET goes through to implement Thread.Abort() -- presumably any other cross-thread exception would have to be similar. (Yeec...
PDO may be worth it some day, but it's not just there yet. It's a DBAL and it's strengh is (supposedly) to make switching between vendors more easier. It's not really build to catch SQL injections. Anyhow, you want to escape and sanatize your inputs, using prepared statements could be a good measure (I second that)....
Writing a [screen scraper][1] is probably your best bet. Some of the major ERP systems have done this for years during a transition from server based apps to 3-tier applications. One i have worked with had loads of interesting features such as drop down lists for regularly used fields, date pop ups and even client base...
I'm surprised no one has mentioned [Perforce][1]. It's free for 2 people, blazingly fast, and integrates with VS. Also [source server][2] has bindings for it by default. In addition to source control, it really is worthwhile to complete the loop and setup a [symbol server][3] and a [source server][2], so that you...
As with everyone said, do call the `Close` and `Dispose` method on any IO objects you have open when reading/writing the PDF files. But I suppose you'd incorporated a **3rd party component?** to do the PDF writing for you? If that's the case you might want to check with the vendor and/or its documentation to make su...
Whatever your storage method, I would suggest you decide on an epsilon (minimum floating point distance that differentiates two coordinates), then divide all coordinates by the epsilon, round and store them as integers.
How do you grab a text from webpage (Java)?
|java|html|
I'm planning to write a simple J2SE application to aggregate information from multiple web sources. The most difficult part, I think, is extraction of meaningful information from web pages. For example, I might want to extract a list of questions from stackoverflow, but I absolutely don't need that huge tag cloud o...
I'm planning to write a simple J2SE application to aggregate information from multiple web sources. The most difficult part, I think, is extraction of meaningful information from web pages. For example, I might want to extract a list of questions from stackoverflow, but I absolutely don't need that huge tag cloud o...
I'm planning to write a simple J2SE application to aggregate information from multiple web sources. The most difficult part, I think, is extraction of meaningful information from web pages, if it isn't available as RSS or Atom feeds. For example, I might want to extract a list of questions from stackoverflow, but I ...
"No newline at end of file" compiler warning
|c++|compiler-construction|warnings|
What's the reason for the "No newline at end of file" warning in some C++ compilers? What's good about having an empty line at the end of a source\header file?
Power Efficient Software Coding
|efficient|power|
In a typical handheld/portable embedded system device Battery life is a major concern in design of H/W, S/W and the features the device can support. From the Software programming perspective, one is aware of MIPS, Memory(Data and Program) optimized code. I am aware of the H/W Deep sleep mode, Standby mode that are use...