instruction stringlengths 0 30k ⌀ |
|---|
The Wii Remote and Wii Balance Board use bluetooth. You can [pair them with your PC][1] and write your own PC apps that interact with them (like [this guy][2]). If you want to make something that actually runs on the Wii, you can try finding some [homebrew development][3] help.
If you want to actually sell your so... |
Opcode cache impact on memory ussage |
|php|opcode-cache| |
Can anyone tell me what is the memory usage overhead associated with PHP opcode cache?
I've seen a lot of reviews of opcode cache but all of them only concentrate on the performance increace. I have a small entry level VPS and memory limits are a concern for me. |
How Would You Programmatically Create a Pattern from a Date that is Stored in a String? |
As others have said, the pattern looks like it should be
new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy"
As for parsing an arbitrary format date, I'm not aware of any library which does this in Java. If you were keen to develop such a thing, I would start by looking at the perl [str2time][1] function.
... |
How about:
`EEE MMM dd HH:mm:ss zzz yyyy`
Just pass the string into the constructor of SimpleDateFormat. To use the object, just call the parse method passing in the string you want converted to a Date.
You could take a look at:
[http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html][1]
... |
I guess it depends on what you mean by pretty. For example, I do not find it particularly difficult to produce say, reasonable graphs and tables with alternate line shading in Access. It is also possible to use MS Word and fill in bookmarks, or mail merge. If the present system uses VBA to create the PowerPoint present... |
How to select the nth row in a SQL database table? |
|sql|database| |
I'm interested in learning some (ideally) database agnostic ways of selecting the *n*th row from a database table. It would also be interesting to see how this can be achieved using the native functionality of the following databases:
- SQL Server
- MySQL
- PostgreSQL
- SQLite
- Oracle
I am current... |
I'm interested in learning some (ideally) database agnostic ways of selecting the *n*th row from a database table. It would also be interesting to see how this can be achieved using the native functionality of the following databases:
- SQL Server
- MySQL
- PostgreSQL
- SQLite
- Oracle
I am current... |
|xhtml|powerpoint|embed| |
Is it possible to embed a powerpoint presentation (ppt) into a webpage (xhtml)?
This will be used on a local Intranet where there is a mix of IE6 and 7 only so no need to consider other browsers. |
how do I import a class to use inside Flex application? |
|apache-flex|actionscript-3| |
I have an actionscript file that defines a class that I would like to use inside a Flex application.
I have defined some custom controls in a actionscript file and then import them via the application tag:
<pre>
<code>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:scorecard="com.... |
The first few results on Google all sound like good options:
http://www.pptfaq.com/FAQ00708.htm
http://www.webdeveloper.com/forum/showthread.php?t=86212 |
Wow! Lots of questions!
Until a year ago I relied 100% on transactions. Now its only 98%. In special cases of high traffic websites (like Sara mentioned) and also high partitioned data, enforcing the need of distributed transactions, a transactionless architecture can be adopted. Now you'll have to code referential... |
You may want to create a third package the runs packageA and then packageB. |
You may want to create a third package the runs packageA and then packageB. The third package would only contain two execute package tasks.
http://msdn.microsoft.com/en-us/library/ms137609.aspx |
You may want to create a third package the runs packageA and then packageB. The third package would only contain two execute package tasks.
http://msdn.microsoft.com/en-us/library/ms137609.aspx
@Craig
A status table is an option but you will have to keep monitoring it.
Here is an article about events in SSIS... |
'stash' takes the uncommitted, "*dirty*" stuff on your working copy, and stashes it away, leaving you with a clean working copy.
It doesn't really branch at all. You can then apply the stash on top of any other branch. Or, as of Git 1.6, you can do:
git stash branch <branchname> [<stash>]
to apply the stas... |
You'd need to import the class inside a script tag.
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
import com.apterasoftware.scorecard.controls.*;
// Other imports go here
// Functions and other code go here
</mx:Script>
<!-- ... |
If there's no requirement on preserving file type after scaling I'd recommend the following approach.
Image src = Image.FromFile("main.gif");
Bitmap dst = new Bitmap(100, 129);
using (Graphics g = Graphics.FromImage(dst))
{
g.SmoothingMode = SmoothingMode.AntiAlias;
g.Interpola... |
If there's no requirement on preserving file type after scaling I'd recommend the following approach.
Image src = Image.FromFile("main.gif");
using (Graphics g = Graphics.FromImage(dst))
{
g.SmoothingMode = SmoothingMode.AntiAlias;
g.InterpolationMode = InterpolationMode.HighQuality... |
If there's no requirement on preserving file type after scaling I'd recommend the following approach.
using (Image src = Image.FromFile("main.gif"))
{
using (Bitmap dst = new Bitmap(100, 129))
{
using (Graphics g = Graphics.FromImage(dst))
{
g.Smo... |
[Here][1] we can read that it is possible, but the exe will be loaded as an library and not started in it's own process like an exe. I don't know if that is a problem for you? It also contains some possible solutions if you do want to make it act like a real out of process com server. But maybe using another way of int... |
How can I generate a unique, small, random, and user-friendly key? |
|encoding|cryptography|key| |
A few months back I was tasked with implementing a unique and random code for our web application. The code would have to be user friendly and as small as possible, but still be essentially random (so users couldn't easily predict the next code in the sequence).
It ended up generating values that looked something l... |
How do you use the new ModelBinder classes in ASP.NET MVC Preview 5 |
|asp.net-mvc| |
You'll notice that Preview 5 includes the following in their release notes:
> Added support for custom model binders. Custom binders allow you to define complex types as parameters to an action method. To use this feature, mark the complex type or the parameter declaration with [ModelBinder(…)].
So how do you go ... |
When you get this (and other errors out of the InnoDB engine) issue:
SHOW ENGINE INNODB STATUS;
It will give a more detailed reason why the operation couldn't be completed. Make sure to run that from something that'll allow you to scroll or copy the data, as the response is quite long. |
I've never been a fan of nested try/catch blocks, so I'd do it something like:
var xmlHttp;
if (window.XMLHttpRequest) {
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
} else if (window.ActiveXObject) {
try {
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
... |
Both answers were very helpful! Here's what I ended up with:
if( typeof( rpNameSpace ) == "undefined" ) rpNameSpace = {};
rpNameSpace.foo = function()
{
this.length = 613;
}
rpNameSpace.foo.prototype.getLength = function()
{
return this.length * 2;
}
Then, ... |
For a set that small is generally not worth it to convert from an Array to a HashMap/set. In fact, you're probably best off keeping them in an array and then sorting them by key and iterating over both lists simultaneously to do the comparison. |
Resources for an Oracle beginner |
|oracle-database|ibm-midrange| |
Can anyone recommend some good resources that highlight the differences between Oracle and the AS/400 database?
I am trying to help someone with a lot of AS/400 experience implement an Oracle installation, and they need some guidance.
A book or online resource would be ideal. |
Since this file is XML you could and should use xsl to transform it to another format. The _IAmUnkown_ - blog has an entry about [decoding/transforming the trx file into html][1].
You can also use [.NetSpecExporter from Bekk][2] to create nice reports. Their product also uses XSL, so you could probably _steal_ it f... |
A very simple method that we've used where I work is this:
1. Set up a webservice/web method that executes the task. This webservice can be secured with username/pass if desired.
2. Create a console app that calls this web service. If desired, you can have the console app send parameters and/or get back some so... |
Awesome, I'd never really known about the "Administrative Tools -> Local Security Settings -> Local Policies -> User Rights Assignment" under XP. My "Debug programs" policy is set to "Administrators" only, yet trying to debug now just worked and this is several days after installing the .NET framework 3.5, so maybe tha... |
Jeff discussed this on the Stack Overflow blog -
[http://blog.stackoverflow.com/category/aspnet/][1]
Basically, Jeff proposed using the CacheItemRemovedCallback as a timer for calling certain tasks.
I personally believe that automated tasks should be handled as a service, a Windows scheduled task, or a job in S... |
Go with
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
More on this topic [here][1]
[1]: http://faq.javaranch.com/view?JstlTagLibDefinitions |
Could you maybe time some operations and post them so we get an idea what you mean by "slow"? On my machine, I wouldn't call VS 2005 slow, but if you compare it to notepad or my web browser it seems slow. Here's some things that might help people figure out what's going on:
- Turn off any features that could aff... |
String concatenation:
Oracle: || or concat()
Sql Server: +
These links could be interesting:
<http://www.dba-oracle.com/oracle_news/2005_12_16_sql_syntax_differences.htm>
<http://www.mssqlcity.com/Articles/Compare/sql_server_vs_oracle.htm> (old one: Ora9 vs Sql 2000) |
Managing web services in FlexBuilder - How does the manager work? |
|web-services|apache-flex|flexbuilder| |
In FlexBuilder 3, there are two items under the 'Data' menu to import and manage web services. After importing a webservice, I can update it with the manage option. However, the webservices seems to disappear after they are imported. The manager does however recognize that a certain WSDL URL was imported and refuses to... |
Personally, I'd keep the same setup you have now, but change the redirect for a forward. That avoids sending a header back to the client and having them make another request.
So, in particular, I'd replace the
<%
response.sendRedirect("/myproject/MyAction.action");
%>
in index.jsp with
... |
Apache Webservers |
|apache|tomcat|webserver| |
What is the difference in terms of functionality between the Apache HTTP Server and Apache Tomcat?
I know that Tomcat is written in Java and the HTTP Server is in C, but other than that I do not really know how they are distinguished. Do they have different functionality? |
Difference between the Apache HTTP Server and Apache Tomcat? |
get file version in powershell |
|file|powershell| |
How can you get the version information from a `.dll` or `.exe` file in PowerShell?
Specifically interested in `File Version`, though other version info (i.e. `Company`, `Language`, `Product Name`, etc) would be helpful as well.
|
What you're really asking is a related, but substantially different question: how often do I want to truncate names in order to fit them in the database? The answer depends both on the frequency of different lengths of names as well as the maximum lengths chosen. This concern is balanced by the concerns about resources... |
A PDF is what I'm after, so I'm not sure how outputting another format would help.
As it turns out, the footer space just wasn't enough to fit all of this text; verified by the fact that changing the font size to 4pt would fit it all in without a problem.
I spent some time attempting to rewrite the footer code us... |
I have tried the SAXParser once, but once I found [XStream][1] I never went back to it. With XStream you can create Java Objects and convert them to XML. Send them over and use XStream to recreate the object. Very easy to use, fast, and creates clean XML.
Either way you have to know what data your going to receiver ... |
Ruby - Convert Integer to String |
|ruby|arrays| |
I have some Ruby code I'm writing and when I give it the String "0123", I want to be able to print out the individual elements. But when I try to print out these elements, I'm seeing the ASCII values instead:
>> a = "0123"
=> "0123"
>> a[0]
=> 48
I've looked online but can't find any way to get... |
|ruby|arrays|needs-editing| |
|ruby|arrays| |
In Ruby, trying to print out the individual elements of a String is giving me trouble. Instead of seeing each character, I'm seeing their ASCII values instead:
>> a = "0123"
=> "0123"
>> a[0]
=> 48
I've looked online but can't find any way to get the original "0" back out of it. I'm a little n... |
In terms of how you arrange your views, you can put your views in subfolders if you'd like and create your own view structure. All views can always be referenced by their full path using the ~syntax. So if you put Index.aspx in \Views\Feature1\Home then you could reference that view using ~/Views/Feature1/Home/Index.as... |
Territory Map Generation |
|language-agnostic|maps| |
Is there a trivial, or at least moderately straight-forward way to generate territory maps (e.g. Risk)?
I have looked in the past and the best I could find were vague references to Voronoi diagrams. An example of a Voronoi diagram is [here][1].
These hold promise, but I guess i haven't seen any straight-forward ... |
|language-agnostic|maps|voronoi| |
Is there a library for rendering basic flow diagrams in Javascript? |
|javascript| |
On a web page I want to dynamically render very basic flow diagrams, i.e. a few boxes joined by lines. Ideally the user could then click on one of these boxes (DIVs?) and be taken to a different page. Resorting to Flash seems like an overkill and the quality of Javascript graphing libraries suggests such a feat could b... |
Is there a library for rendering basic flow diagrams in Javascript/CSS? |
|javascript|css| |
Since you've already discovered the pseudo-mutable integer "hack," how about this option:
Does it make sense for you to make a separate Parser class? If you do this, you can store the current state in a member variable. You probably need to think about how you're going to handle any thread safety issues, and it mi... |
This should set the IFRAME height to its content's height:
<script type="text/javascript">
document.getElementById('the_iframe').contentWindow.document.body.scrollHeight;
document.getElementById('the_iframe').height=the_height;
</script>
You may want to add `scrolling="no"` to your IFRAME to tu... |
This should set the IFRAME height to its content's height:
<script type="text/javascript">
the_height = document.getElementById('the_iframe').contentWindow.document.body.scrollHeight;
document.getElementById('the_iframe').height = the_height;
</script>
You may want to add `scrolling="no"` to yo... |
In C#, I have used the '[System.IO.Path.GetRandomFileName() : String][1]' method... but I was generating salt for debug file names. This method returns stuff that looks like your first example, except with a random '.xyz' file extension too.
If you're in .NET and just want a simpler (but not 'nicer' looking) solutio... |
There's the [IsThemeActive](http://msdn.microsoft.com/en-us/library/bb759813%28VS.85%29.aspx) WinAPI function. |
Well I looked into this. ASP.NET provides a common location for registering the implementation of IControlBinders. They also have the basics of this working via the new Controller.UpdateModel method.
So I essentially combined these two concepts by creating an implementation of IModelBinder that does the same thing ... |
>>Use URL fetchers like wget or curl to make HTTP GET requests.
>>Secure your URLs with authentication so that no one can execute the tasks without knowing the user/password.
You can also tell cron to run php scripts directly, for example. And you can set the permissions on the PHP file to prevent other people ac... |
Approach A, but I would also include a explicit deny in addition to you implicit deney. I would make some use cases to be sure your end logic works but here are some examples.
User1 is in group1 and group2.
User2 is in group1
User3 is in group2
Folder1 allows group1 and deny group2.
User1 is denied... |
After a bunch of research and experimentation, I've found the answer.
- For the record, the current release of nUnit 2.5 Alpha *does not* seem to contain templates for test projects in Visual Studio 2008.
- I followed the directions [here][1] which describe how to create your own project templates and then a... |
If you are willing to go with flash, [XML/SWF][1] is a wonderful tool
[1]: http://www.maani.us/xml_charts/ |
If we're talking Windows, then I'd always develop a separate Windows Service to handle such batch tasks.
You can always reference the same assemblies that are being used by your web application to avoid any nasty code duplication. |
How to prefetch Oracle sequence ID-s in a distributed environment |
|java|oracle-database| |
I have a distributed Java application running on 5 application servers. The servers all use the same Oracle 9i database running on a 6th machine.
The application need to prefetch a batch of 100 IDs from a sequence. It's relatively easy to do in a single-threaded, non-distributed environment, you can just issue these... |
I have a distributed Java application running on 5 application servers. The servers all use the same Oracle 9i database running on a 6th machine.
The application need to prefetch a batch of 100 IDs from a sequence. It's relatively easy to do in a single-threaded, non-distributed environment, you can just issue these... |
We use [buildbot][1], with the build broken down into discrete steps. There is a balance to be found between having build steps be broken down with enough granularity and being a complete unit.
For example at my current position, we build the sub-pieces for each of our platforms (Mac, Linux, Windows) on their respec... |
Generally speaking I try and copy whatever appraoch the product group has taken when looking to add functionality of my own. In this case they add their own edit/view/add pages via the list definition itself.
I built a solution that also needed its own custom "New" form, not open source unfortunately, though if you ... |
I haven't seen the browser eat exceptions, unless you mean script errors. Script errors can be enabled via the `browser.ScriptErrorsSuppressed` property.
If you're talking about real exceptions, not just script errors, can you show us some code that reproduces the problem? We've used the browser extensively and have... |
I haven't seen the browser eat exceptions, unless you mean script errors. Script errors can be enabled via the `browser.ScriptErrorsSuppressed` property.
If you're talking about real exceptions, not just script errors, can you show us some code that reproduces the problem? We've used the browser extensively and have... |
To make this less tedious, you will need to encapsulate/refactor the mapping between the DataReader and the Object you hold in the list. There is quite of few steps to encapsulate that logic out. If that is the road you want to take, I can post code for you. I am just not sure how practical it would be to post the c... |
In SVN these are simply called "properties". You can read about them in the SVN book:
<http://svnbook.red-bean.com/en/1.4/svn.advanced.props.html> |
In SVN these are simply called "properties". You can read about them in the SVN book:
<http://svnbook.red-bean.com/en/1.4/svn.advanced.props.html>
---
Err, so, are they called properties or keywords? Oh, I see. In SVN you can associate arbitrary metadata, called "properties", with versioned files; some of the ... |