instruction
stringlengths
0
30k
Go to the BIRT website and follow their [Directions](http://www.eclipse.org/birt/phoenix/build/buildInstructions.php#checkout).
Well - Since I haven't seen a reference to the good old Linear Feedback Shift Register I post some SSE intrinsic based C-Code. Just for completenes. I wrote that thing a couple of month ago to sharpen my SSE-skills again. #include <emmintrin.h> static __m128i LFSR; void InitRandom (int ...
Common readability problems include [function pointers][1] and the fact that [arrays are really pointers][2], and that [multidimensional arrays are really single dimension arrays (which are really pointers).][3] Hope that helps some. In any case, whenever you do understand the declarations, maybe you can figure out ...
Using {0} to initialize a struct is a trick to 0 the entire struct, because when using {} initialization any fields not specified are initialized to 0.
Using {0} to initialize a struct is a trick to 0 the entire struct, because when using {} initialization any fields not specified are initialized to 0. Here is the relevant section of the spec: [http://www.kuzbass.ru:8086/docs/isocpp/decl.html#dcl.init.aggr][1] > -7- If there are fewer initializers in the list...
What's happening here is called **aggregate** initialization. Here is the (abbreviated) definition of an aggregate from section 8.5.1 of the ISO spec: > An aggregate is an array or a class with no user-declared constructors, no private or protected non-static data members, no base classes, and no virtual functions....
In [Micro-ISV: From Vision to Reality][1], Bob suggests [MegaDox.com][2] and [Soft14.com][3] [1]: http://www.amazon.com/Micro-ISV-Vision-Reality-Bob-Walsh/dp/1590596013 [2]: http://www.megadox.com/index.php/search/?for=Software+Licence++ [3]: http://www.soft14.com/upload/software_000039.htm
High Availability Storage
|storage|high-availability|
I would like to make 2 TB or so available via NFS and CIFS. I am looking for a 2 (or more) server solution for high availability and the ability to load balance across the servers if possible. Any suggestions for clustering or high availability solutions?
I'm not sure what your setDDL method does in your script but it should fire if one of the link buttons is clicked. I think you might be better off just inserting a generic html anchor though instead of a .net linkbutton as you will have no reference to the control on the server side. Then you can handle the data exca...
Yes. Convert your images to use indexed pallets (png256). You can support transparency, but not an alpha channel. You can do this using [Irfanview][1] and the pngout plugin, [pngquant][2] or [pngnq][3]. [1]: http://www.irfanview.com/ [2]: http://www.libpng.org/pub/png/apps/pngquant.html [3]: http://pn...
Yes. Convert your images to use indexed pallets (png256). You can support transparency (just like gif), but not an alpha channel. You can do this using [Irfanview][1] and the pngout plugin, [pngquant][2] or [pngnq][3]. The YUI performance team also did a [great presentation][4] that covers this an many other im...
Once you created the object in: public static package1.Foo foo; it isn't being accessed in a Static way. You will have to use the class name and, of course, the full package name to address the class since they have the same name on different packages
I think a more appropriate question might be: In what situations is the use of a SIngleton Pattern inappropriate? Or what have you seen that uses a Singleton that shouldn't.
I think this is the **most robust version** for C#: using System; using System.Collections; using System.Threading; namespace DoFactory.GangOfFour.Singleton.RealWorld { // MainApp test application class MainApp { static void Main() { ...
This is a system I made for a configurable Fixed Width file writing module. It's configured with an XML file, the relevant part looking like this: <WriteFixedWidth Table="orders" StartAt="1" Output="Return"> <Position Start="1" Length="17" Name="Unique Identifier"/> <Position Start="18" Length="3" ...
I haven't used SWIG or SIP, but I find writing Python wrappers with [boost.python](http://www.boost.org/doc/libs/1_35_0/libs/python/doc/index.html) to be very powerful and relatively easy to use. I'm not clear on what your requirements are for passing types between C/C++ and python, but you can do that easily by eit...
Globalization architecture
|c#|architecture|localization|globalization|
I need to store products for an e-commerce solution in a database. Each product should have descriptive information, such as name, description etc. I need any product to be localized to x number of languages. What I've done so far, is to make any column that should be localized and nvarchar(MAX) and then i store ...
How can I merge my files when the folder structure has changed using Borland StarTeam?
|version-control|refactoring|merge|starteam|
I'm in the process of refactoring some code which includes moving folders around, and I would like to regularly merge to keep things current. What is the best way to merge after I've moved folders around in my working copy?
You can move the files around in StarTeam also. Then merge after that. Whatever you do, make sure you don't delete the files and re-add in StarTeam. You'll lose the file history if you do that.
java.io.Console support in Eclipse IDE
|java|eclipse|java.io.console|
I use the Eclipse IDE to develop, compile, and run my Java projects. Today, I'm trying to use the java.io.Console class to manage output and, more importantly, user input. My problem is that System.Console() returns null when an application is run "through" Eclipse. I assume this means Eclipse runs without opening a...
|java|eclipse|java-io|
I use the Eclipse IDE to develop, compile, and run my Java projects. Today, I'm trying to use the java.io.Console class to manage output and, more importantly, user input. The problem is that System.Console() returns null when an application is run "through" Eclipse. Eclipse run the program on a background process, ...
Sometimes you can create new tables that have better structures and then create views with the names of your old tables but are based on the data in the new tables. That way, you code doesnt break while you start to move to a better structure. Be careful with thsi though as sometimes you move from a non-relational tabl...
Try [Unfuddle][1] for a free hosted SVN source control. [1]: http://unfuddle.com/
Tips on refactoring an outdated database schema
|database|schema|refactoring|hints-and-tips|
Being stuck with a legacy database schema that no longer reflects your data model is every developer's nightmare. Yet with all the talk of refactoring code for maintainability I have not heard much of refactoring outdated database schemas. What are some tips on how to transition to a better schema without breakin...
If you're trying to intercept calls within the framework (i.e., not in your own code), it won't work. PostSharp can only replace code within your own assembly. If you're trying to intercept calls you're making, then it looks like it should work. Do you see PostSharp running in the build output?
[Microsoft Windows Server Update Services][1] > Microsoft Windows Server Update > Services (WSUS) enables information > technology administrators to deploy > the latest Microsoft product updates > to computers running the Windows > operating system. By using WSUS, > administrators can fully manage the > distr...
loosely coupled, highly cohesive. Composition over inheritance.
[Here][1] is an open source C# port of the Java QR Code [library][2]. [1]: http://www.codeproject.com/KB/cs/qrcode.aspx [2]: http://qrcode.sourceforge.jp/
You can reference System.Data.Linq.dll and System.Core.dll, and set your build target for C# 3.0 or the latest VB compiler, but verything else would have to be mapped manually (no designer support in VS2005 in LINQ to SQL RTM).
You can reference System.Data.Linq.dll and System.Core.dll, and set your build target for C# 3.0 or the latest VB compiler, but everything else would have to be mapped manually (no designer support in VS2005 in LINQ to SQL RTM).
Interfaces
|c#|
In c#, we have interfaces. Where did these come from? They didn't exist in c++.
|c#|java|
Where did the concept of Interfaces come from?
Not quite sure what you're asking here. Do you want a macro on multiple lines? #define NEWLINE_MACRO(x) line1 \ line2 \ line3 Additionally, if you would like to include a literal in your macro: #define NEWLINE_MACRO(x) ##x what you you put in x will be put in place of ##x, so: NEWLI...
The c compiler is aware of white space, but doesn't distinguish between spaces, tabs or new lines. If you mean how do I have a new line inside a string in a macro, then: <pre> #define SOME_STRING "Some string\n with a new line." </pre> will work.
It's true that a Foo instance has access to Foo's static fields, but think about the word "static". It means "statically bound", at least in this case. Since A.foo is of type Foo, "A.foo.bar" is not going to ask the object for "bar", it's going to go straight to the class. That means that even if a subclass has a st...
TimeStamp in Control File
|oracle-database|sql-loader|controlfile|
I have a script that takes a table name and generates a control file by querying all the columns/rows the table. This works fine for numeric and character data but fails on timestamp data so I need to adjust the script to output the timestamp data into the control in such a way that it can be read in properly. So e...
This looks to me like a bug with Linq to NHybernate. One possible workaround is to convert to an array before sorting. A potentially big downside is that you can't limit the results using Skip() and Take() before enumerating, so this may not be sufficient for you. var results = items .ToArray() ...
You should note that many large Relational DBs (Oracle and SQLServer) have XML datatypes to store data within a database and use XPath within the SQL statement to gain access to that data. Also, there are native XML databases which work very much like SQLite in the sense they are one binary file holding a collection...
The problem with singletons is not their implementation. It is that they conflate two different concepts, neither of which is obviously desirable. 1) Singletons provide a global access mechanism to an object. Although they might be marginally more threadsafe or marginally more reliable in languages without a well-...
I think its VS2008 I am having all sorts of wierd things happen with it but im running xp. Not to the degree that you say where it is messing with volume controls. My wierd things are in VS2008. For example I place a gridview on page 1 go to page 2 then back to page 1 and my gridview will have moved.. Its just buggy.. ...
Use `Scalar::Util::looks_like_number()` which uses the internal Perl C API's looks_like_number() function, which is probably the most efficient way to do this. ##Example: #!/usr/local/bin/perl use warnings; use strict; use Scalar::Util qw(looks_like_number); my @exprs = qw(1 5.25 0.0...
Why is it bad practice to make multiple database connections in one request?
|database|resources|database-connection|
A discussion about Singletons in PHP has me thinking about this issue more and more. Most people instruct that you shouldn't make a bunch of DB connections in one request, and I'm just curious as to what your reasoning is. My first thought is the expense to your script of making that many requests to the DB, but then I...
Moving the files in StarTeam and then updating your project/solution is the cleaner way to go. I would also suggest creating a view label prior to doing anything so you have a definite "roll back" point if things go wrong :)
I seem to remeber having a similar problem a long time ago, the problem was related to accessing the smtp server to despatch the reports and was resolved by applying a patch to the server.
You could use the [Outbound dependencies][1] feature of [DependencyFinder][2]. You can do that entirely in the GUI, or in command line exporting XML. [1]: http://depfind.sourceforge.net/Manual.html#ShowingOnlyOutboundDependencies [2]: http://depfind.sourceforge.net/
Folders in StarTeam can be renamed to match the filesystem moves by right clicking the folder and going to Properties. If you created new nesting levels, you will have to create those folders normally. If you moved files between existing folders, you can move those in StarTeam by dragging them from the file window on...
It is the cost of setting up the connection, transferring the data and then tearing it down. It will eat up your performance. Evidence is harder to come by but consider the following... Let's say it takes x microseconds to make a connection. Now you want to make several requests and get data back and forth. ...
I would like to make 2 TB or so available via NFS and CIFS. I am looking for a 2 (or more) server solution for high availability and the ability to load balance across the servers if possible. Any suggestions for clustering or high availability solutions? This is business use, planning on growing to 5-10 TB over nex...
I would like to make 2 TB or so available via NFS and CIFS. I am looking for a 2 (or more) server solution for high availability and the ability to load balance across the servers if possible. Any suggestions for clustering or high availability solutions? This is business use, planning on growing to 5-10 TB over nex...
I would like to make 2 TB or so available via NFS and CIFS. I am looking for a 2 (or more) server solution for high availability and the ability to load balance across the servers if possible. Any suggestions for clustering or high availability solutions? This is business use, planning on growing to 5-10 TB over nex...
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...
Manrico Corazzi - I specialize in Oracle, not MS SQL, so you'll have to tell me if this is possible as a performance boost:- 1. Leave the same as your first step - insert distinct values into TABLE2 from TABLE1. 2. Drop TABLE1. (Drop should be faster than delete I assume, much as truncate is faster than delete). 3...
You either need to roll your own, or get a service that is a screen scraper. After you have created your feed, you can use something like [Feedburner][1] to disseminate it. [1]: http://www.feedburner.com/fb/a/home
This is pretty trivial. The CGPDFDocument functions will allow you to do anything you'd want to do with a PDF file.
I would use a Comparator that takes a range of years and license plate pattern as input parameters. Then just iterate through your collection and copy the objects that match. You'd likely end up making a whole package of custom Comparators with this approach.
I've found [sched module][1] to be helpful in cron-like activities. It simplifies things a lot. Unfortunately I found it too late. [1]: http://docs.python.org/lib/module-sched.html
You will need to utilise an AJAX framework ([JQuery][1] is one i often recommend) which will provide the functionality to display the drop down box. You will then need to create a separate page (or web service) to return all the possible values to display in the auto-complete drop down. To save on performance i reco...
A few more thoughts on this topic: Actually, Oracle Standard does have an OLAP facility based on a descendent of Express embedded in the database engine and storing its internal data structures in BLOBs in the main tablespaces. Using this is technically possible but not necessarily advisable for the following reaso...
Fix argument handling in SQL Server 2005 Mgmt Studio custom Keyboard Accelerator shortcuts?
|sql-server|customization|
I've long been a fan of Stored Procedure Keyboard Accelerators, as described in [this article][1]. When we moved from SQL 2000 to 2005, though, and from Query Analyzer to Management Studio, the handling of the arguments changed. In QA, comma-separated arguments were automatically read as two separate arguments. In S...
I've long been a fan of Stored Procedure Keyboard Accelerators, as described in [this article][1]. When we moved from SQL 2000 to 2005, though, and from Query Analyzer to Management Studio, the handling of the arguments changed. In QA, comma-separated arguments were automatically read as two separate arguments. In S...
Most of the singleton patterns that I see written aren't written in a thread safe manner. If written correctly, they can be useful.
Passing user input to eval() is a security risk, but also each invocation of eval() creates a new instance of the JavaScript interpreter. This can be a resource hog.
Singletons are handy when you've got a lot code being run when you initialize and object. For example, when you using iBatis when you setup a persistence object it has to read all the configs, parse the maps, make sure its all correct, etc.. before getting to your code. If you did this every time, performance would...
Well, I couldn't find the code. Tried on my old RAC account, nothing. Nothing in my old backups. Go figure. But I tried to work out how I did it, and I think this is the correct sequence (I based a lot of it on this [article][1]): 1. Get all drive letters and cache them. 2. Wait for the WM_DEVICECHANGE ...
They are very similar. With Objective-C 2.0 most enumerations now default to NSFastEnumeration which creates a buffer of the addresses to each object in the collection that it can then deliver. The one step that you save over the classic for loop is not having to call objectAtIndex:i each time inside the loop. The inte...
They are very similar. With Objective-C 2.0 most enumerations now default to NSFastEnumeration which creates a buffer of the addresses to each object in the collection that it can then deliver. The one step that you save over the classic for loop is not having to call objectAtIndex:i each time inside the loop. The inte...
They are very similar. With Objective-C 2.0 most enumerations now default to `NSFastEnumeration` which creates a buffer of the addresses to each object in the collection that it can then deliver. The one step that you save over the classic for loop is not having to call `objectAtIndex:i` each time inside the loop. The ...
|database|refactoring|schema|hints-and-tips|
Being stuck with a legacy database schema that no longer reflects your data model is every developer's nightmare. Yet with all the talk of refactoring code for maintainability I have not heard much of refactoring outdated database schemas. What are some tips on how to transition to a better schema without breakin...
just be cool about the license. explain up front that this is your passion and a child of your labor. give people a chance to do the right thing. if someone wants to pirate it, it will happen eventually. i still remember my despair seeing my books on bittorrent, but its something you have to just deal with. Don't cave ...
And in [python 2.6](http://docs.python.org/dev/whatsnew/2.6.html): import itertools itertools.permutations([1,2,3]) (returned as a generator. Use list(permutations(l)) to return as a list.)
Write a C test harness and use valgrind/alleyoop to check for leakage in your C code, and similarly use the java jvisualvm tool.
Found something about this at http://www.stupidjavatricks.com/?p=43 . And sadly, since console is final, you can't extend it to create a a wrapper around system.in and system.out that does it either. Even inside the eclipse console you still have access to those. Thats probably why eclipse hasn't plugged this into...
just to point out--madExcept has a "hang" detection option that should help.
Assign them to projects that don't require "top quality stable code" if that's your concern and let the jr. developer fail. Have them be the one to 'come in on the weekend' to fix their bugs. Have lunch a lot and talk about software development practices (not lectures, but discussions). In time they will acquire and...
I also use it to initialize strings eg. char mytext[100] = {0};
Queuing actions (not effects) to execute after an amount of time.
|jquery|javascript|
What I'd like to know is if there is a nice way to queue jQuery functions to execute after a set amount of time. Perhaps an example of what I'd envisage it would look like would illustrate: $('#alert') .show() .wait(5000) // <-- this bit .hide() ; I know that it's possible b...
|javascript|jquery|