instruction
stringlengths
0
30k
I wonder how widespread the JVM actually is? In the case of Flash, IE5 preinstalled it, giving it a large automatic user base. But unless the JVM was included with the OS install, users wouldn't have it. I suppose as a developer you target the largest install base, meaning choosing Flash over Java. There are Java ap...
Why is ARG_MAX not defined via limits.h?
|linux|limits|
On Fedora Core 7, I'm writing some code that relies on ARG_MAX. However, even if I #include <limits.h>, the constant is still not defined. My investigations show that it's present in <sys/linux/limits.h>, but this is supposed to be portable across Win32/Mac/Linux, so directly including it isn't an option. What's goi...
On Fedora Core 7, I'm writing some code that relies on ARG_MAX. However, even if I #include &lt;limits.h&gt;, the constant is still not defined. My investigations show that it's present in &lt;sys/linux/limits.h&gt;, but this is supposed to be portable across Win32/Mac/Linux, so directly including it isn't an option....
Unfortunately there is currently no designer support (unlike for SQL Server 2005) for building relationships between tables in SQL Server CE. To build relationships you need to use SQL commands such as: ALTER TABLE Orders ADD FK_Customer_Order FOREIGN KEY (CustomerId) REFERENCES Customers(CustomerId) If...
@Jason, yep, `<center>` works. Good times. I'll propose the following, though: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head> <style type="text/css"> body { text-align: center; } ...
@Jason, yep, `<center>` works. Good times. I'll propose the following, though: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head> <style type="text/css"> body { text-align: center; } ...
You need to create a query (in Visual Studio, right-click on the DB connection -> New Query) and execute the following SQL: ALTER TABLE tblAlpha ADD CONSTRAINT MyConstraint FOREIGN KEY (FK_id) REFERENCES tblGamma(GammaID) ON UPDATE CASCADE To verify that your foreign key was created, execute th...
I've noticed that when using "Add Service Reference" as opposed to "Add Web Reference" from VS.net, the actual enum values come across as well as the enum names. This is really annoying as I need to support both 2.0 and 3.5 clients. I end up having to go into the 2.0 generated web service proxy code and manually addi...
The web runtimes like Flex and Silverlight all offer enticing things, but come with two big costs: - They run only within a rectangle on the page, and don't interact with normal web widgets - They are only available to people who have that plugin installed Even the nearly-ubiquitous Flash isn't installed on ...
In order to determine if a user has disconnected (stop button, closed browser, etc.) the server must attempt to send a packet. If the TCP/IP connection has been closed, an IOException will be thrown. In theory, a Java application could send a space character at various points during processing. An IOException woul...
I am not familiar with Apache CXF, but the following should be applicable to any Java Servlet based framework. In order to determine if a user has disconnected (stop button, closed browser, etc.) the server must attempt to send a packet. If the TCP/IP connection has been closed, an IOException will be thrown. In...
If you have the content of the links as a span, you could do this, otherwise I think you would need to give one scenario a class to differentiate it. a > span { background: url(../../pics/remote.gif) right top no-repeat; padding-right: 10px; white-space: nowrap; } a > img { ...
@[anthony-williams], are you sure you're not confusing `extern` template declarations with `extern template` instantiations? From what I see, `extern template` may *only* be used for explicit instantiation, not for specialization (which implies implicit instantiation). [temp.expl.spec] doesn't mention the `extern` k...
There is no cross database solution, as most of them have their own date handling (and mainly interval representation) syntax and semantics, sorry. In PostgreSQL it would be SELECT * FROM messages WHERE messagetime >= messagetime - interval '1 day'
The print statement will take orders of magnitude longer than even the slowest implementation of the modulus operator. So basically the comment "slow on some systems" should be "slow on all systems". Also, the two code snippets provided don't do the same thing. In the second one, the line <pre><code>if(fizzcount >=...
I think it all depends on who your clients are and what they expect. I think knowing about different technologies is good, but really when you're hired by someone, they expect you to know what you are doing. Personally, I would much rather be known that I do a really good job with a certain type of technology and whe...
I think it all depends on who your clients are and what they expect. I think knowing about different technologies is good, but really when you're hired by someone, they expect you to know what you are doing. Personally, I would much rather be known that I do a really good job with a certain type of technology and whe...
For many years I've kept a Word doc named Knowledgebase.doc that contains all my notes with a decent table of contents. I like to keep everything in one searchable doc. I use a sync tool to make sure the file is copied to all the machines I want it on.
Ah, You have to use the UserProfileManager class. More information here: [http://msdn.microsoft.com/en-us/library/microsoft.office.server.userprofiles.userprofilemanager.aspx][1] [1]: http://msdn.microsoft.com/en-us/library/microsoft.office.server.userprofiles.userprofilemanager.aspx
Ah, You have to use the UserProfileManager class. More information here: [http://msdn.microsoft.com/en-us/library/microsoft.office.server.userprofiles.userprofilemanager.aspx][1] [1]: http://msdn.microsoft.com/en-us/library/microsoft.office.server.userprofiles.userprofilemanager.aspx Example use: publ...
The essense of `tail -f` is the following loop: open IN, $file; while(1) { my $line = <IN>; if($line) { #process line... } else { sleep(1); seek(IN,0,1); } } close IN; The [seek][1] call is to clear the EOF flag. [1]: http://search.c...
I was a bit reluctant to learn Python because of tabbing. However, I almost didn't notice it when I used Vim.
If a proxy cache is out of the question, and you're serving complete HTML files, you'll get the best performance by bypassing PHP altogether. Study how [WP Super Cache][1] works. Uncached pages are copied to a cache folder with similar URL structure as your site. On later requests, mod_rewrite notes the existence o...
i believe it's their ugliness that kept them away from the modern web. flash brought the design, javascript brought a convenient way to make some cool things on a client. being a box inside a browser (just like a flash, though, but much uglier) applet technology was put away. actually, the only thing that might be m...
People still use applets. But you are right, there are tons of different solutions out there. For example, take a look at [javafx][1] [1]: http://java.sun.com/javafx/
I think compatibility issues were a big problem. Most notably with IE and Microsoft's Java VM which wasn't as standards compliant as it might have been. Even with the Sun JVM you could have problems. I've had fun where I've had two 3rd-party Applets requiring different versions of Java which causes all sorts of pr...
I see them a lot in acedemic settings (hosted on department or faculty sites), but you're right in that they are not very popular. However, remember that Java's big promise has been achieved. We have Flash, Java Applets, Silverlight, and ever-improving JavaScript frameworks. Now if I made add a personal opinion -...
I think Java applets were overshadowed by Flash and ActionScript (pun unintended), being much easier to use for what Java Applets were being used at the time (animations + stateful applications). Flash's success in this respect in turn owes to its much smaller file sizes, as well as benefiting from the Sun vs. Micr...
Have a look at [this article](http://blog.wekeroad.com/2008/02/27/creating-in-queries-with-linq-to-sql). Basically, if you want to get the equivalent of IN, you need to construct an inner query first, and then use the Contains() method. Here's my attempt at translating: <pre><code>var innerQuery = from fb in FoorBar...
Are you sure your pointing to the right path in the script tags? I put it up on the web, check it out. The left is Dojo parsed input, the right is an regular old input. [Link][1] I'm on OS X, using firefox 3.0.1 I get no errors under firebug. [1]: http://tncrocks.com/test/stackoverflow/
A static class with a load of static variables is a bit of a hack. /** * Grotty static semaphore **/ public static class Ugly { private static int count; public synchronized static void increment(){ count++; } public synchronized static v...
What is your audience: public web site or an intranet business app? Adoption rates are not relevant if you have a controlled audience who will install what is needed to run your app. However, if you need the largest possible audience to make your web startup a success then it may be critical. What is your goal? Bui...
Summary from Jordi Bunster, John Topley, and Jaryl: I. Quick and dirty way: raise @foo.inspect in your controller. Or <% raise @foo.inspect %> in your view. II. Proper logging to you `development.log`: logger.debug "@foo == #{@foo.inspect}" III. [Full-fledged debugging](http://ba...
> Right now our customers are mostly businesses. People seem to be missing that line. If it's for a business, requiring them to login via OpenID really isn't very practical. They'd either have to use an external OpenID provider, or their poor tech people would have to setup and configure a company OpenID. If this...
Yes!, absolutely!; I can even throw in a story for you to explain why it is important that a human can easily read the auto generated code... I once got the opportunity to work on a new project. Now, one of the first things you need to do when you start writing code is to create some sort of connection and data repr...
Oh I almost forgot. Here are a few more Ruby screencast resources: [SD Ruby][1] - the have a bunch of videos online - I found their Rest talks SD9 and SD10 to be among the best of the intros. Other rest talks assume you know everything. These ones are very introductory and to the point. [Obie Fernandez][2] on ...
To be honest, I think you tend to see this kind of thing happen over time, no matter how disciplined the organization is. It's natural for new methodologies to come bundled in the form of new libraries, frameworks, or even languages. Keep in mind that a .NET shop may well have been a ASP/VB shop at one time. They'll pr...
Miguel de Icaza mentions <a href="http://www.linuxtoday.com/news_story.php3?ltsn=2002-02-06-011-20-OP-GN-MS&tbovrmode=3">here</a>: Seasoned industry programmers will notice that the above is very much like Java and the Java VM. They are right, the above is just like Java. The CIL has one feature ...
Miguel de Icaza mentions <a href="http://www.linuxtoday.com/news_story.php3?ltsn=2002-02-06-011-20-OP-GN-MS&tbovrmode=3">here</a>: > Seasoned industry programmers will notice that the above is > very much like Java and the Java VM. They are right, the above > is just like Java. > The CIL has one feature not ...
For Sybase SQL Anywhere: Select * From Messages Where MessageTime > dateadd( day, -1, now() )
You can also use the WindowsCrypto API with Delphi: - [General Crypto & Hash demo and resources][1] There is a unit in there that wraps all the CryptoAPI. You can also use Lockbox, which is now open source. In the end you can support pretty much any Hash algorithms with Delphi. The Indy example is probab...
How do I hash a string with Delphi?
|delphi|hash|md5|
What hash algorithms does Delphi support?
By the time Java's GUI API stopped totally sucking, everyone was using Flash. And even today, Java is no where near as good as Flash at doing fancy graphics.
The JVM is very widespread, especially in the coorporate world, at least where I've worked, there was always a JVM installed. I'm currently working on a Java Applet, but in general, I would never an applet unless I had to. But then again, I wouldn't use Flash or Silverlight, either. Applets have a slow load time, an...
If you're going to go and change an important system setting, make sure to first read the current setting and restore it when you are done. I consider this *very bad* practice in the first place, but if you must do it then be kind. Registry.LocalMachine Also, try changing `LocalUser` - that way if your app...
If you're going to go and change an important system setting, make sure to first read the current setting and restore it when you are done. I consider this *very bad* practice in the first place, but if you must do it then be kind. Registry.LocalMachine Also, try changing `LocalUser` instead of `LocalMachi...
I assume it's because java is a "real", ie. general purpose language. To make an applet, you have to write code, and there aren't any shortcuts. Now that flash etc have come along, you can pretty much just drap and drop your way through making a cool animation for your website. This is a much lower barrier for entry...
I think applets are collateral damage in the battle between Microsoft and Sun. At first, the JVM was very slow to load and demanded too much memory. Then, when increase in computing power made the JVM possible, Sun played hard as it attempted to control all things Java: > As part of another private antitrust law...
Can you load a .Net form as a control?
|.net|winforms|
I want to load a desktop application, via reflection, as a Control inside another application. The application I'm reflecting is a legacy one - I can't make changes to it. I can dynamically access the Form, but can't load it as a Control. In .Net Form expands on Control, and I can assign the reflected Form as ...
Add a Default.png to your project. This should be the image you want shown instead of the black launch screen.
1) can you run mysqldump from exec or passthru 2) take a look at this: http://www.php-mysql-tutorial.com/perform-mysql-backup-php.php
1) can you run mysqldump from exec or passthru<br /> 2) take a look at this: http://www.php-mysql-tutorial.com/perform-mysql-backup-php.php
Always use a single column, surrogate key if at all possible. This makes joins as well as inserts/updates/deletes much cleaner because you're only responsible for tracking a single piece of information to maintain the record. Then, as needed, stack your business keys as unique contraints or indexes. This will keep...
Split out ints from string
|.net|.net-2.0|string|
Let's say I have a web page that currently accepts a single ID value via a url parameter: http://example.com/maypage.aspx?ID=1234 I want to change it to accept a _list_ of ids, like this: http://example.com/mypage.aspx?IDs=1234,4321,6789 So it's available to my code as a string via _context.Request...
Here is one approach generating a lot of separate query statements. You can also use implode to more efficiently combine the strings, but this is easier to read for starters and derived from this you can come up with a million other approaches. $results = mysql_query("SELECT * FROM `table_name`"); while($row = m...
One that noone has mentioned yet is Int16. If you need to store an Integer in memory in your app and you are concerned about the amount of memory used, then you could go with Int16 since it uses less memeory and has a smaller min/max range than Int32 (which is what int is.)
This is the code I use: static HWND hwndToolTip = NULL; void CreateToolTip( HWND hWndControl, TCHAR *tipText ) { BOOL success; if( hwndToolTip == NULL ) { hwndToolTip = CreateWindow( TOOLTIPS_CLASS, NULL, ...
ADA to Java can be done with a find-and-replace!
At least in Visual Studio, there is more information given in the Output Build window rather than the Error List. I've had a template error in the Error List state, "Cannot convert Foo<int> to Foo<int>". There were some lines following the actual error in the Output window that helped me to decipher what the actual pro...
At least in Visual Studio, there is more information given in the Output Build window rather than the Error List. I've had a template error in the Error List state, "Cannot convert Foo&lt;int&gt; to Foo&lt;int&gt;". There were some lines following the actual error in the Output window that helped me to decipher what th...
If you are not working with .NET to .NET SOAP, you can still define an enumerator provided both endpoints are using WSDL. <s:simpleType name="MyEnum"> <s:restriction base="s:string"> <s:enumeration value="Wow"/> <s:enumeration value="This"/> <s:enumerati...
Here's a quick rundown of each area (with lots of helpful links): cross-platform compatibility ---------------------------- [AJAX][1] works in [any modern browser][2] that can run Javascript. Flex requires flash or anything else that can handle SWFs but, once that's installed, it's a [total freeride][3] as far as ...
Check out this post in the ExtJS forum that details how you can enable multi-select in a Javascript tree. http://extjs.com/forum/showthread.php?t=28115
It depends on the usage. I rarely would ever use a Public nested class but use Private nested classes all of the time. A private nested class can be used for a sub-object that is intended to be used only inside the parent. An example of this would be if a HashTable class contains a private Entry object to store data in...
If I understand Katheleen's article right, she proposes to use nested class to be able to write SomeEntity.Collection instead of EntityCollection<SomeEntity>. In my opinion it's controversial way to save you some typing. I'm pretty sure that in real world application collections will have some difference in implementat...
If I understand Katheleen's article right, she proposes to use nested class to be able to write SomeEntity.Collection instead of EntityCollection< SomeEntity>. In my opinion it's controversial way to save you some typing. I'm pretty sure that in real world application collections will have some difference in implement...
|delphi|hash|cryptography|md5|
Why does all methods in the Google Analytics tracking code start with an underscore?
|google-analytics|
Prefixing variable and method names with an underscore is a common convention for marking things as private. Why does all the methods on the page tracker class in the Google Analytics tracking code (`ga.js`) start with an underscore, even the ones that are clearly public, like `_getTracker` and `_trackPageView`?
Why do all methods in the Google Analytics tracking code start with an underscore?
If you are working with SQL Server 2005 or later there is also a CLR library available at http://www.sqlsharp.com/ that provides .NET implementations of string and RegEx functions which, depending on your volume and type of data may be easier to use and in some cases the .NET string manipulation functions can be more e...
Here's some example code in [a webjump.el file on a site run by Apple:][1] ;; (require 'webjump) ;; (global-set-key "\C-cj" 'webjump) ;; (setq webjump-sites ;; (append '( ;; ("My Home Page" . "www.someisp.net/users/joebobjr/") ;; ("Pop's ...
My best guess is that the UpdatePanel is not able to write out the custom "async" property to the postback request properly. This is likely due to blocking from one of the controls wrapping it (my gut feeling is that it's the popupControlExtender - it tends to have odd behavior with updatepanels, as it is intended to m...
See [boost pointer container][1] for a container that does the automatic deletion of contained pointers for you, while maintaining a syntax very close to ordinary STL containers. [1]: http://www.boost.org/doc/libs/1_36_0/libs/ptr_container/doc/ptr_container.html
Emacs will provide a productivity gain if you're willing to learn and customize it to fit your needs. Most people are not. To increase your productivity you must use the tool for more than simple editing - most people never progress past simple editing. Here's a quick test: have you customized your window manager ...
While Databinding a MemoryStream to a Image is not possible, it could be possible to use a Label/GenericControl, some Code and the [data URI scheme][1] to embed Images in Pages, but there are severe issues with that approach: > Disadvantages > > * Embedded content must be extracted and decoded before changes may ...
While Databinding a MemoryStream to a Image is not possible, it could be possible to use a Label/GenericControl, some Code and the [data URI scheme][1] to embed Images in Pages, but there are severe issues with that approach: > Disadvantages > > * Embedded content must be extracted and decoded before changes may ...
querying 2 tables with the same spec for the differences.
|sql|delta|
I recently had to solve this problem and find I've needed this info many times in the past so I thought I would post it. Assuming the following table def, how would you write a query to find all differences between the two? table def: CREATE TABLE feed_tbl ( code varchar(15), name varchar(40),...
There seems to be some confusion around PAE. PAE is "Page Address Extension", and is by no means a Windows feature. It is a hack Intel put in their Pentium II (and newer) chips to allow machines to access 64GB of memory. On Windows, applications need to support PAE explicitely, but in the open source world, packages ca...
1) AWT made for horrid UIs. Swing improved on that but it was too late, because... 2) Microsoft dropped support for Java in the browser (its propietary MSJVM), and before it did, it would only support the last version it released, which was roughly JDK 1.1 compatible. 3) So today you cannot be sure that an applet...
Passing on named variable arguments in python
|python|variadic-functions|
Say I have the following 2 methods: def methodA(arg, **kwargs): pass def methodB(arg, *args, **kwargs): pass In methodA I wish to call methodB, passing on the kwargs. However, it seems if I simply do: def methodA(arg, **kwargs): methodB("argvalue", kwargs) The secon...
Copy the following in your **ThisWorkbook** object to watch for specific changes. In this case when you increase a numeric value to another numeric value. NB: you will have to replace **Workbook-SheetChange** and **Workbook-SheetSelectionChange** with an underscore. eg: **Workbook_SheetChange** and **Workbook_Sheet...
Databinding expects an IEnumerable object, because it enumerators over it just like a foreach loop does. So, to do this, just wrap your single object in an IEnumerable. Even this would work: DataBindObject.DataSource = new List<YourObject>().Add(YourObjectInstance);
Databinding expects an IEnumerable object, because it enumorates over it just like a foreach loop does. So to do this, just wrap your single object in an IEnumerable. Even this would work: DataBindObject.DataSource = new List<YourObject>().Add(YourObjectInstance);
The choice should in my opinion be mostly based on the nature of the application you'll be building (for example, if you need to manipulate vector graphics, Ajax is pretty much out), but here are some general guidelines: **Ubiquity** 1. Ajax -- Supported by all modern browsers across platforms 2. Flex -- Run...
The choice should in my opinion be mostly based on the nature of the application you'll be building (for example, if you need to manipulate vector graphics, Ajax is pretty much out), but here are some general guidelines: **Ubiquity** 1. Ajax -- Supported by all modern browsers across platforms 2. Flex -- Run...
You can use string.Split() to split the values once you have extracted them from the URL. string[] splitIds = ids.split(',');