instruction
stringlengths
0
30k
This is what I always use: `<link rel="icon" href="favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />` The second one is for IE. The first one is for other browsers.
This is what I always use: <link rel="icon" href="favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> The second one is for IE. The first one is for other browsers.
The short answer: Use one of these two methods: [http://java.sun.com/javase/6/docs/api/java/lang/Class.html#getResource(java.lang.String)][1] [http://java.sun.com/javase/6/docs/api/java/lang/Class.html#getResourceAsStream(java.lang.String)][2] For example, InputStream inputStream = YourClass.class.getR...
**The short answer** Use one of these two methods: [http://java.sun.com/javase/6/docs/api/java/lang/Class.html#getResource(java.lang.String)][1] [http://java.sun.com/javase/6/docs/api/java/lang/Class.html#getResourceAsStream(java.lang.String)][2] For example: InputStream inputStream = YourClass.class.g...
A module such as mod_php or FastCGI is incredibly faster than plain CGI.. just don't do CGI. As others have said, the PHP program itself is the greatest security threat, but ignoring that there is one other consideration, on shared hosts. If your script is on a shared host with other php programs and the host ...
I know this is a C# question, but [generics][1] are used in other languages too, and their use/goals are quite similar. Java collections use [generics][2] since Java 1.5. So, a good place to use them is when you are creating your own collection-like object. An example I see almost everywhere is a Pair class, whic...
Zeus - http://www.zeusedit.com
> What are the characteristics of a multitasking operating system? What makes it multitasking? Multitasking operating systems allow more than one program to run at a time. They can support either preemptive multitasking, where the OS doles out time to applications (virtually all modern OSes) or cooperative multitas...
We upsize (either using the upsize wizard or by hand) users to SQL server. It's usually pretty straight forward. Replace all the access tables with linked tables to the sql server and keep all the forms/reports/macros in access. The investment in access isn't lost and the users can keep going business as usual. You get...
We upsize (either using the upsize wizard or by hand) users to SQL server. It's usually pretty straight forward. Replace all the access tables with linked tables to the sql server and keep all the forms/reports/macros in access. The investment in access isn't lost and the users can keep going business as usual. You get...
According to Chapter 7 titled "Exceptions" in **Framework Design Guidelines: Conventions, Idioms, and Patterns for Reusable .NET Libraries**, numerous rationales are given for why using exceptions over return values is necessary for OO frameworks such as C#. Perhaps this is the most compelling reason (page 179): ...
Like this: @Path("/helloWorld") @Consumes({"application/xml", "application/json"}) @Produces({"application/xml", "application/json"}) @Singleton public class MyService { @GET public String getRequest(@QueryParam("name") String name) { return "Name was " + name; } }
<p>The first question you must answer is whether you should be using threading</p> <p>If your function CalculateSmth() is basically CPU-bound, i.e. heavy in CPU-usage and basically no I/O-usage, then I have a hard time seeing the point of using threads, since the threads will be competing over the same resource, in th...
<p>The first question you must answer is whether you should be using threading</p> <p>If your function CalculateSmth() is basically CPU-bound, i.e. heavy in CPU-usage and basically no I/O-usage, then I have a hard time seeing the point of using threads, since the threads will be competing over the same resource, in th...
It's a nice programming exercise to write your own formatter . I wrote one for C++ , and it was a nice challenge . You could learn a lot by writing it :)
Use a DIV tag and CSS absolute positioning, with the z-index property. http://www.w3.org/TR/CSS2/visuren.html
One little thing, might add clarity to override the default value for seconds >>> b = a + datetime.timedelta(seconds=3000) >>> b datetime.datetime(1, 1, 1, 12, 24, 59)
Success! (sort of...) Finally got it working, but not in the way Adam suggested: <script src= "http://maps.google.com/maps?file=api&amp;v=2&amp;key=xxxx" type="text/javascript"></script> <script type="text/javascript"> getMap=function(lat,lng){ if (GBrowserIsCompatibl...
**DISCLAIMER** I haven't tested this code at all, but the idea should work. Also, this only handles the dragging ***to*** a flash movie. Here's some Actionscript 3.0 code which makes use of the [ExternalInterface](http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/external/ExternalInterface.html) class....
The [Ada95 Language Reference Manual][1] says (section 13.13.2): "For elementary types, the representation in terms of stream elements is implementation defined. For composite types, the Write or Read attribute for each component is called in a canonical order. The canonical order of components is last dimension var...
Try to answer this locally, consider your audience. For example when I was developing my own Blog Engine, my appeal was mostly to .NET developers. I hope it stands to reason what browser I primarily develop for. From that point I consider the market share and try to ensure a "reasonable" support level for all other ...
I am also a fairly new user of Xcode. Most of what I know I learned from an Xcode book by James Bucanek (ISBN 047175479x). It is an older book that was written for/with Xcode 2.2, but I find that pretty much all of it still applies for me today, and I currently use Xcode 3.1 You can probably find a cheap used copy...
There is a plugin called [Resource Tagger][1] which may do what you are looking for. Report back on what you find works please. [1]: http://www.eclipseplugincentral.com/Web_Links-index-req-viewlink-cid-818.html
<1% market share isn't a criteria - esp if the browser is new. For me, < IE6 is dead, and the HTML monkeys I work with WISH it was dead. < FF2 is dead. Opera is a nice to have. < Safari 2 is dead, tho most are designing for Saf 3 now. So it's: IE6,7,8 FF 2,3 Saf 3,4 Chrome (which is basicly Saf4) But depen...
Regular expressions: >>> import re >>> splitter = re.compile(r'([+*/])') >>> splitter.split("2+24*48/32") You can expand the regular expression to include any other characters you want to split on.
Instead of doing it that way use the join method. It's somewhat difficult to understand without using the query operators, but once you get it, you've got it. var foo = model.entitySet.Join( //Start the join values, //Join to the list of strings e => e.Name, // on entity.Name value => value...
You might take a look at Sisulizer <http://www.sisulizer.com>. Expensive though. We're evaluating it for use at my company to manage the headache of ongoing translation. I read on their About page that the company was founded by people who left Multilizer and other similar companies.
That should be a good start. You can also find the same information online: <http://perldoc.perl.org/perl.html>. I'm not sure what you mean by better. There's a ton of good information at <http://www.perl.com/> as well.
It might be easier if you stored the original value if it were illegal as a node name in an attribute. Then you wouldn't worry about having some sort of complex to/from translation.
This guy have had partial success with silverlight in chrome, but it does not seem to be supported: <http://wildermuth.com/2008/09/02/Silverlight_2_and_Google_Chrome> From The Microsoft Silverlight Team in the [silverlight forum][1]: > Hello, currently we don't have plans > to support Chrome. We will support ...
This guy have had partial success with silverlight in chrome, but it does not seem to be supported: <http://wildermuth.com/2008/09/02/Silverlight_2_and_Google_Chrome> From The Microsoft Silverlight Team in the [silverlight forum][1]: > Hello, currently we don't have plans > to support Chrome. We will support ...
One of the best ones I've seen and used is SandDock from [Divelements][1], they have both a WinForms and a WPF version. [1]: http://divelements.com/net/
.net remoting is built into .net to do inner process communication. If you use that, they will continue to support and possibly enhance it in future versions. Named pipes doesn't give you the promise of enhancements in future versions of .net
Dockable Form
|winforms|vb.net|
How do you create a "dockable" form, similar to the windows in Visual Studio?
|winforms|vb.net|tabbed-document-interface|
I had marked a post on how to deploy your websites using Subversion : <http://blog.lavablast.com/post/2008/02/I2c-for-one2c-welcome-our-new-revision-control-overlords!.aspx>
Using Google Maps in Coldfusion
|coldfusion|google-maps|
I am trying to use the Google Maps API in a Coldfusion template that is a border type cflayoutarea container. However the map simply doesn't show up: <cfif isdefined("url.lat")> <cfset lat="#url.lat#"> <cfset lng="#url.lng#"> </cfif> <head> <script src= "http://maps.google.com/maps?file=api&amp;v=...
I am trying to use the Google Maps API in a Coldfusion template that is a border type cflayoutarea container. However the map simply doesn't show up: <cfif isdefined("url.lat")> <cfset lat="#url.lat#"> <cfset lng="#url.lng#"> </cfif> <head> <script src= "http://maps.google....
|javascript|coldfusion|google-maps|
Having DB connections directly to the server from the client side is usually a bad idea. I don't know how easy it is to decompile a Silverlight app, but I would guess it's possible in some way. Then you're basically giving away your DB credentials to your users.
You can use an opensource [Unattended][1]. [1]: http://unattended.sourceforge.net/
Kerberos Delegation for Clients Ouside the Firewall
|sql-server|iis|internet-explorer|kerberos|delegation|
I am trying to run a SQL Server Reporting Services where the data for the report is on a SQL Server database that's on a different server. Integrated Authentication is turned on for both the Report Server and the report. I have confirmed that Kerberos delegation is working fine by using Internet Explorer to run the r...
[Suffix trees][1] are a good way to implement this. The bottom of that article has links to implementations in different languages. [1]: http://en.wikipedia.org/wiki/Suffix_tree
I am not sure if I am correctly visualizing each of the steps you have described, and therefore I might be misinterpreting the current state you are in as a result. However, I **think** I follow you, and if I am following correctly, then there is one more simple thing you should do. Open the App project. Right-clic...
I am not sure if I am correctly visualizing each of the steps you have described, and therefore I might be misinterpreting the current state you are in as a result. However, I **think** I follow you, and if I am following correctly, then there is one more simple thing you should do. Open the App project. Right-clic...
For a fun project to test, have a look at [xgamestation][1] But for a more industrial used one chip solution programming, look at [PIC][2] [1]: http://www.xgamestation.com/ [2]: http://www.samengstrom.com/nxl/1669/pic_programming_page.en.html
**The short answer** Use one of these two methods: [http://java.sun.com/javase/6/docs/api/java/lang/Class.html#getResource(java.lang.String)][1] [http://java.sun.com/javase/6/docs/api/java/lang/Class.html#getResourceAsStream(java.lang.String)][2] For example: InputStream inputStream = YourClass.class.g...
**The short answer** Use one of these two methods: [http://java.sun.com/javase/6/docs/api/java/lang/Class.html#getResource(java.lang.String)][1] [http://java.sun.com/javase/6/docs/api/java/lang/Class.html#getResourceAsStream(java.lang.String)][2] For example: InputStream inputStream = ...
> When will the different indexing methods resolve to different indices? According to http://php.net/types.array, an array index can only be an integer or a string. If you try to use a float as an index, it will truncate it to integer. So if $index is a float with the value 3.14, then $array[$index] will evaluate to...
Before you take the plunge breaking the EXE up, you should read up on memory management and DLLs. Here is one article that talks about CRT object issues, but the same thing applies to your own C++ objects. [Potential Errors Passing CRT Objects Across DLL Boundaries][1] [1]: http://msdn.microsoft.com/en-u...
I've used CodeJock's [DockingPane][1] ActiveX control to create docking panes before. [1]: http://www.codejock.com/products/dockingpane/
I used to use <a href="http://blogs.msdn.com/ie/archive/2007/01/09/ie-developer-toolbar-beta-3-now-available.aspx">IE Developer Toolbar</a> as a sort of Firebug alternative. While I don't think it allows you to enter normal CSS, you can adjust the CSS as a list of name/value pairs (adding, editing, removing, etc).
I've used Weifen Luo's "DockPanel Suite" to good effect. Sourceforge project here: [http://sourceforge.net/projects/dockpanelsuite][1] [1]: http://sourceforge.net/projects/dockpanelsuite
I've used Weifen Luo's "DockPanel Suite" to good effect. It's an open source library that mimics Visual Studio's docking system very well, including nested docking, floating windows, tabbed windows, etc. You can download his source and see his approach there, if you'd prefer your own, simpler solution. Sourceforge p...
Not all browsers cache files with '?' in it. What I did to make sure it was cached as much as possible, I included the version in the filename. So instead of stuff.js?123, I did stuff_123.js I used mod_redirect(I think) in apache to to have stuff_*.js to go stuff.js
Should the PageNode class simply have a property of type Root?
Should the PageNode class simply have a property of type Root? ![alt text][1] Is that counter to the idea that a PageNode [is-a][2] Root. Or, are they not "is-a Root" because only *some* of them are roots? And does that imply that the property might traverse the tree looking for the root ancestor? Or is that...
How about maintainability and constancy across application life cycles? Most data has a longer lifespan than the applications that make use of it. Relationships and data integrity are much too important to leave to the hope that the next dev team gets it right in the app code. If you haven't worked on a db with dirt...
I'll echo what Dmitriy said, but adding on a point. I worked on a batch billing system that needed to insert large sets of rows on 30+ tables. We weren't allowed to do a data pump (Oracle) so we had to do bulk inserts. Those tables had foreign keys on them, but we had already ensured that they were not breaking an...
The MSDN entry for WM_PAINT says: *"The function **may** also send the WM\_NCPAINT message to the window procedure if the window frame must be painted and send the WM\_ERASEBKGND message if the window background must be erased."* I'm trying to figure out why it is always sending even if the border isn't touched....
If you have a fairly complex database, Hibernate may not be for you. At work we have a fairly complex database with lots of data, and Hibernate doesn't really work for us. We've started using iBATIS instead. However, I know a lot of development shops who use Hibernate successfully - and it does do a lot of grunt work f...
Why not just use the code formatter and/or cleanup function? It has settings that take care of that stuff for you. You can even have it run automatically on save.
You can use `<div>` containers to seperate content into multiple layers. Therefore the div containers have to be positioned absolutely and marked with a z-index. for instance: <div style="position: absolute; z-index:100">This is in background</div> <div style="position: absolute; z-index:5000">This is in f...
What is the difference between, IsAssignableFrom and GetInterface?
|c#|.net|reflection|
Using reflection in .Net, what is the differnce between: if (foo.IsAssignableFrom(IBar)) And if (foo.GetInterface(typeof(IBar).FullName)) Which is more appropriate, why?<br> When could one or the other fail?
Using reflection in .Net, what is the differnce between: if (foo.IsAssignableFrom(IBar)) And if (foo.GetInterface(typeof(IBar).FullName) != null) Which is more appropriate, why?<br> When could one or the other fail?
Idea from left field, but what about adding an extra field to the table: CurrentRevision bit not null Then when you make a change, set the flag on the new revision and remove it on all previous ones. Your query would then simply become: select Id, Comment from Comments whe...
Idea from left field, but what about adding an extra field to the table: CurrentRevision bit not null Then when you make a change, set the flag on the new revision and remove it on all previous ones. Your query would then simply become: select Id, Comment from Comments whe...
I've used [Box2D][1] in personal projects. It is a 2D physic simulation API. But, it might be overkill if what you want is more a game/graphic API. [1]: http://www.box2d.org/
Your best bet is most likely [Box2D](http://www.box2d.org/). It does 2D physics, has tons of options, and is very easy to integrate into an existing project. It does CCD by default for fixed bodies, but any rigid body can be selectively included in the CCD calculation.
I can't think of doing any javascript development without using JQuery (also take a deep look to JQuery UI).
How can I get Eclipse to show .* files?
|eclipse|hidden|file|
By default, Eclipse won't show my .htaccess file that I maintain in my project. It just shows an empty folder in the Resources tree. How can I get it to show up? No obvious preferences.
|eclipse|file|hidden|
By default, Eclipse won't show my .htaccess file that I maintain in my project. It just shows an empty folder in the Package Viewer tree. How can I get it to show up? No obvious preferences.
I need a binary comparison tool for Win/Linux
|utilities|
First of all, I don't need a textual comparison so Beyond Compare doesn't do what I need. I'm looking for a util that can report on the differences between two files, at the byte level. Bare minimum is the need to see the percentage change in the file, or a report on affected bytes/sectors. Is there anything a...
Design Principles
|principles|oop|
What principles do you generally follow when doing class design?
I guess they believe that you should probably be using HTTPS (perhaps with a self-signed certificate) in development mode. If that's not the desired behaviour, there's nothing stopping you from special casing SSL behaviour in the development environment yourself: class YourController < ApplicationController ...
scriptaculous is a JS library built on top of prototype. As such, they will be behind prototype in their release schedule. To ensure that scriptaculous works only use it with the prototype file that came in the download. Sure, given enough time and energy, you can find all the changed references from prototype 1.6.0...
[Type punning](http://en.wikipedia.org/wiki/Type_punning) is a major example of breaking strict aliasing.
I know that some providers in Japan have a tracking service for location of cellphones. I also know that the information is not public. I think you need to have a very good reason before the provider gives that information free as it is in my opinion sensitive personal data. Of course they will give the information to...
Remoting is an option, but it's not cross-platform. Some other ways are to use named pipes, IPC, or kernel events.
What is the single best free Eclipse plugin for a Java developer
|java|eclipse-plugin|eclipse|ide|
Some Eclipse plugins are mandated by your environment. The appropriate source code management plugin, for example - and I'm not interested in those. Some provide useful enhancements, but in a specific niche. I'm not interested in those. Some are great, but cost money. I'm not interested in those. Some were rea...
|java|polls|ide|eclipse-plugin|
Some Eclipse plugins are mandated by your environment. The appropriate source code management plugin, for example - and I'm not interested in those. Some provide useful enhancements, but in a specific niche. I'm not interested in those. Some are great, but cost money. I'm not interested in those. Some were rea...
If you mean inter-process communication, I used .NET Remoting without any problem so far. If the two processes are on the same machine, the communication is quite fast. Named Pipes are definitely more efficient, but they require the design of at least a basic application protocol, which might not be feasible. Remoti...