instruction
stringlengths
0
30k
I do not think any hacking is necessary. You can subclass the LWTUI Component class and then you can pain whatever you want on to the graphic context of the component. You do not get the native lcdui.Graphics object but an object with a same interface that is easy to use. If you really need to pass a lcdui.Graphics ...
If compression is necessary do it before you encrypt.
AES does not expand the data, except for a few bytes of padding at the end of the last block. The resulting data are not compressible, at any rate, because they are basically random - no dictionary-based algorithm is able to effectively compress them. A best practice is to compress the data first, then encrypt them.
If you are not in a position to add an RSS feed to the existing site, see [Page2Rss][1] as an intermediate solution. [1]: http://page2rss.com/
The best you can do is compare the 2 query outputs based on a given set of inputs looking for any differences. To say that they will always return the same results for all inputs really depends on the data. For Oracle one of the better if not best approaches (very efficient) is here (Ctrl+F Comparing the Contents o...
You can't mix both AIR and Flex in the same Flex Builder project, but you can share code. Here's how... 1. Create a Flex based project as you normally would. 2. Create a second AIR based project. 3. In the second application, go to project->properties. 4. Select the "Flex build path" option. 5. U...
I'm using XP SP3 and IE7 with all updates. The registry seems configured with everything enabled.
Might <a href="http://www.dapper.net/">Dapper</a> be of some use? You just need to set up which bits of your news feed to scour and voila, instant rss without having to touch any code...
Maximizing an Emacs frame to just one monitor with elisp
|elisp|emacs|editor|
I use [maxframe.el][1] to maximize my Emacs frames. It works great on all three major platforms, except on my dual-head Mac setup (Macbook Pro 15-inch laptop with 23-inch monitor). When maximizing an Emacs frame, the frame expands to fill the width of *both* monitors and the height of the larger monitor. Obv...
|emacs|editor|elisp|
Creating your own drop down list is more of a pain than it's worth. You can use some javascript to make the IE drop down work. Check out this solution here: http://www.hedgerwow.com/360/dhtml/ui_select_with_fixed_width/demo.php http://www.hedgerwow.com/360/dhtml/ui_select_with_fixed_width/ie-select-width-fix.js...
I think "perldoc perltoc" is too verbose for just finding the list of "perlxxx" subjects. Instead use "perldoc perl". Or [http://perldoc.perl.org/perl.html][1], which is the online version. [1]: http://perldoc.perl.org/perl.html
Best resource for learning .NET generics?
|c#|.net|generics|
I've never used any of the .NET generics in my work, but I understand that they are fairly popular. Does anyone have any good links or book suggestions for learning them? As a bonus; I only vaguely understand what .NET generic collections are and what they do...does anyone have any practical examples of how they migh...
No VM I know of will store an Integer[] array like an int[] array for the following reasons: 1. There can be **null** Integer objects in the array and you have no bits left for indicating this in an int array. The VM could store this 1-bit information per array slot in a hiden bit-array though. 2. You can synchro...
WCF REST Caching - Client Side & Server Side
|wcf|rest|
I have wirtten a RESTful WCF Service. Incorporating E-Tags, expires headers. The caching works great when using it from a browser. However how does the caching work when calling it from a WCF Channel Factory or .NET Web Request Objects? So in the scenario where I have my website calling the WCF restful servic...
Welcome to the world of NLP ^_^ All you need is a little basic knowledge and some tools. There are already tools that will tell you if a word in a sentence is a noun, adjective or verb. They are called [part-of-speech taggers](http://en.wikipedia.org/wiki/Part-of-speech_tagging). Typically, they take plaintext En...
As a simple and free solution, you could use some static methods of the DateField: * DateField.stringToDate(valueString:String, inputFormat:String):Date * DateField.dateToString(value:Date, outputFattern:String):String But unfortunately they don't support hours/minutes/seconds (just the date). In your specifi...
Thanks to [Pydev][1], you can [integrate pylint][2] in the [Eclipse IDE][3] really easily and get a code report each time you save a modified file. [1]: http://pydev.sourceforge.net/ [2]: http://pydev.sourceforge.net/pylint.html [3]: http://www.eclipse.org/
The connection to the MySQL server is probably timing out. You should be able to increase the timeout in MySQL, but for a proper fix, have your code check that the database connection is still alive, and re-connect if it's not.
Menu Control: How to Make Whole Item Clickable, not Just Text
|asp.net|
I have a problem that confuses my users, being that although an item is highlighted (by the hover style) when the user mouses over it, they have to mouse over the actual item text, sometimes quite small compared to the item. Is there a way to make the whole item clickable?
When I Googled for `NI:Max:GetTaskInterface` I couldn't find anything. In general, how a window will handle a given message depends entirely on the window concerned. Does the window (specified by `hWnd`) even support the `NI:Max:GetTaskInterface` message?
Mashups and SharePoint
|sharepoint|mashups|
Can somebody in SO please provide me with a list of resources about Enterprise Mashups and technologies related to SharePoint platform?
|sharepoint|mashups|.net|web-services|
|.net|web-services|sharepoint|mashups|
Can somebody in SO please provide me with a list of resources about Enterprise Mashups and technologies related to SharePoint platform? **Update** (as per suggestion of @Spoon16 in the comments):- The mashup application may typically retrieve a list of contacts from a SharePoint site and display the address of a se...
Our (huge) application (a Win32 game) started throwing "Not enough quota" exceptions recently, and I was charged with finding out where all the memory was going. It is not a trivial job - this question and [this one][1] were my first attempts at finding out. Heap behaviour is unexpected, and accurately tracking how m...
What is the best way to share MasterPages across projects
|asp.net|
Suppose you have two seperate ASP.NET Web Application projects that both need to use a common MasterPage. What's the best way to share the MasterPage across projects without having to duplicate code?
Suppose you have two seperate ASP.NET Web Application projects that both need to use a common MasterPage. What's the best way to share the MasterPage across projects without having to duplicate code? Preferably without having to resort to source control or file system hacks.
|asp.net|.net|
|.net|asp.net|
|.net|asp.net|master-pages|
I have one question for Andrea Tagliasacchi, Why? Only if you are looking at 1000s of points and possible 100s of planes, would there would be any benefit from using the method outlined. As apposed to dot producting the point and plane, as outlined my Corporal Touchy. Also due to the finite nature of pixels you'l...
Is it possible your invalid characters are present only within the values and not the tags themselves i.e. the XML notionally meets the schema but the values have not been properly sanitized? If so, what about overriding InputStream to create a CleansingInputStream that replaces your invalid characters with their XML...
Out of String Space in Visual Basic 6
|string|memory|vb6|
We are getting an error in a VB6 application that sends data back and forth over TCP sockets. We get a runtime error "out of string space". Has anyone seen this or have any thoughts on why this would happen? It seems like we are hitting some VB6 threshhold so any other thoughts would be helpful as well. thks, ak
Two framworks I use often. # Ragel Something worth checking out is [Ragel][1]. It's used to generate code for state machines. You just add some simple markup to your source code, then run a generator on Ragel generates code for C, C++, Objective-C, D, Java and Ruby, and it's easy to mix it with your regular so...
Control Fujitsu Softune debugger
|embedded|debugging|fujitsu|
Is there a way to control the Fujitsu Softune debugger with an other application(e.g. Eclipse)? I think about sending the command mentioned in the documentation of Softune and parse the output, but also other approaches are welcome.
Building on the answers so far: It's best to use a parsing engine. It can cover a lot of cases and in an elegant way. I've tried [BeautifulSoup][1] and I like it very much. Also easy to use, with a great tutorial. If sometimes it feels like shooting flies with a cannon you can use a regular expression for quick p...
Try with http://www.lowagie.com/iText/. It can recognize the version of the loaded PDF and can create PDF as well. It is open source, but I'm not sure do they support exactly the version of the PDF you mention.
I think joelhardi's solution is superior to the following. However, in my own application, I like to keep the blog on a separate VPS than the Rails site (separation of memory issues). To make the user see the same URL, you use the same proxy trick that you normally use for proxying to a mongrel cluster, except you pr...
i'm not aware of one concise document, but: * Debug.Write calls are stripped out in Release * In Release, your CallStack may look a bit "strange" due to optimizations, as outlined by [Scott Hanselman][1] [1]: http://www.hanselman.com/blog/ReleaseISNOTDebug64bitOptimizationsAndCMethodInliningInReleaseBuildCal...
Oh, man. There's a few. In order of descending obscurity... * [FTSearch](http://eigenclass.org/hiki.rb?simple+full+text+search+engine) * [Zettair](http://www.seg.rmit.edu.au/zettair/) * [Sphinx](http://www.sphinxsearch.com/) * [Ferret](http://ferret.davebalmain.com/api/files/README.html) * [Solr](http://lucene.a...
If you're fine with Leopard compatibility, there's a very powerful new CGWindow API that will let you grab screen shots, window shots, or composites of any range of window layers. http://developer.apple.com/samplecode/SonOfGrab/
What are your favourite ZX Spectrum development tools?
|z80|zxspectrum|
What are your favourite assemblers, compilers, environments, interpreters for the good old ZX Spectrum?
An obfuscated C version: int IsPalindrome (char *s) { char*a,*b,c=0; for(a=b=s;a<=b;c=(c?c==1?c=(*a&~32)-65>25u?*++a,1:2:c==2?(*--b&~32)-65<26u?3:2:c==3?(*b-65&~32)-(*a-65&~32)?*(b=s=0,a),4:*++a,1:0:*++b?0:1)); return s!=0; } Skizz
Is there something from the Ant process that is holding the files (or directory) open? This would cause the situation where you could delete them after running ant, but not during.
Because it is easier to write and maintain code that uses Java, C#, JavaScript, etc. to deserialize an XML stream, transform it, and export the desired output, and XSLT offers no substantial performance advantage. XSLT makes somethings easy, but it makes other things very, very hard.
Since the comments in the source already state this shouldn't happen, I think it's a bug in the Template software. Submit a bug report to whoever wrote it.
Visual Studio in command line behaves just like GCC. Just open the Visual Studio command line window and: <code><pre> c:\\temp> cl /nologo /EHsc /W4 foo.cpp c:\\temp> dir /b foo.* foo.cpp <-- your source file foo.obj <-- result of compiling the cpp file foo.pdb <-- debugging symbols (friendly names for debug...
XSL is mainstream and widely adopted. What other languages are you referring to? XSL isn't a programming language, just a transformation language, so it is pretty limited in scope.
XSL is mainstream and widely adopted. What other languages are you referring to? XSL isn't a programming language, **just a transformation language**, so it is pretty limited in scope.
I think it boils down to XML syntax is arguably good for describing data, but it's not a great syntax for what's essentially a programming language (XSLT).
If your boss doesn't understand the need to refactor or clean up code, then you have to wonder if he has enough engineering knowledge to be an engineering manager.
The short-circuiting is not for optimization. It's main purpose is to avoid calling code that will not work, yet result in a readable test. Example: if (i < array.size() && array[i]==foo) ... Note that array[i] may very well get an access violation if i is out of range and crash the program. Thus this program...
No VM I know of will store an Integer[] array like an int[] array for the following reasons: 1. There can be **null** Integer objects in the array and you have no bits left for indicating this in an int array. The VM could store this 1-bit information per array slot in a hiden bit-array though. 2. You can synchro...
No VM I know of will store an Integer[] array like an int[] array for the following reasons: 1. There can be **null** Integer objects in the array and you have no bits left for indicating this in an int array. The VM could store this 1-bit information per array slot in a hiden bit-array though. 2. You can synchro...
UrlEncode through a console application?
|c#|.net|console|
normally I would just use: HttpContext.Current.Server.UrlEncode("url"); But since this is a console application, HttpContext.Current is always going to be null. Is there another method that does the same thing that I could use?
adding a pre tag with jquery
|javascript|css|internet-explorer|jquery|
I'm trying to use jQuery to format code blocks, specifically to add a &lt;pre&gt; tag inside the &lt;code&gt; tag: $(document).ready(function() { $("code").wrapInner("<pre></pre>"); }); Firefox applies the formatting correctly, but IE puts the entire code block on one line. If I add an alert ...
|javascript|html|jquery|internet-explorer|
As a follow up, I'm of the opinion that an app should do one job and do it well. Often if you start combining tools into one product, none of them will shine, and most of them will be "'alright, sort-of". If I was doing something like this, I would get myself something like SVN, ANT, and Subversion Ant Library (h...
Try using the UrlEncode method in the HttpUtility class. 1. http://msdn.microsoft.com/en-us/library/system.web.httputility.urlencode.aspx
[marxidad](http://stackoverflow.com/users/1659/marxidad) Just a quick point to note, Justin has already said that the SQL varies a lot dependant on the type, so I have worked on the basis that it could be something _completely_ different dependant on the type, hence delegating it to the subclasses in question. Whereas ...
[marxidad](http://stackoverflow.com/users/1659/marxidad) Just a quick point to note, Justin has already said that the SQL varies a lot dependant on the type, so I have worked on the basis that it could be something _completely_ different dependant on the type, hence delegating it to the subclasses in question. Whereas ...
I usually develop against the [W3C CSS validator][1], then verify things look the way I want them to in the respective browsers. Validating goes a long way toward consistent behavior. Sometimes I'll strip the page down to only styles that validate and show properly in the major browsers I'm targeting, sometimes I'll...
remembers rightfax and lack of information on the internet. this is no answer to your question but one could switch to the builtin windows 2003 fax server with dedicated isdn fax board, has automatic mailforwarding
I'd use SysUtils.CurrToStr(Value: Currency; var FormatSettings: TFormatSettings): string; I'd setup an array of TFormatSettings, each position configured to reflect each currency your application supports. You'll need to set the following fields of the TFormat Settings for each array position: CurrencyString, Curren...
If its a game then i'd drop most of the forms and work with the bare essentials, work off a bitmap if possible and render that by either overriding the main form's paint method or a control that resides within it (perhaps a panel). That will give you better performance. The main issue is that the compact framework i...
*[Stephen's][1] answer is the best.* But if you MUST, you could add a check constraint the HtmlOrCode column and the other columns which need to change. [1]: http://stackoverflow.com/questions/86181/how-do-i-enforce-data-integrity-rules-in-my-database#86203
Use CHECK constraints on the table. These allow you to use any kind of boolean logic (including on other values in the table) to allow/reject the data. From the [Books Online][1] site: > You can create a CHECK constraint with > any logical (Boolean) expression that > returns TRUE or FALSE based on the > logica...
Debug VS Release
|c#|.net|asp.net|
Continuation to my [previous question](http://stackoverflow.com/questions/90751/double-and-floats-in-c) is any one aware of a comprehensive document what list all available differences between debug and release modes in C# application , and particularly in web application ? What differences you aware of ?
Debug VS Release in .net
>> Will: > Due to all the compiler sugar that exists in the .NET platform Fortunately this particular application was incredibly simple, but I don't expect to decompile into the original code, just into code works like the original, or maybe even provides an insight into how the original works, to allow 'splicing' ...
# Common Lisp: FORMAT (obfuscated) Okay, so I'll give it a try myself. (defun format-fact (stream arg colonp atsignp &rest args) (destructuring-bind (n acc) arg (format stream "~[~A~:;~*~/format-fact/~]" (1- n) acc (list (1- n...
Reliable and performant cheap (ish) hosting for ASP.NET 3.5 and mysql
|hosting|web-hosting|shared-hosting|
I'm looking for someone reasonably cheap but better than the majority of budget hosts out there. I'm currently with brinkster.net and I've become increasingly annoyed at the their immense unreliability and low available resources. Fasthosts business plan is close, but has no mysql, only has ASP.NET 2.0 and is maybe ...
Try [HttpUnit][1], although you are likely to end up writing automated tests that are more 'integration tests' (of a module) than 'unit tests' (of a single class). [1]: http://httpunit.sourceforge.net/