window.addEventListener('unload', function(e)
{
MyClass.shutdown();
window.removeEventListener('unload', /* how to refer to this function? */);
}, false);
I have a Dell Studio 540, 64 bit OS Windows Home Premium. My CPU is supports Intel's virtualization technology, but I don't know how to enabled it on my machine. I saw that you can do it via the bios, but I didn't see this option when going through my BIOS. Is there another way to enabled this feature? Please let me know. I'm trying to installed…
Hi, I've noticed I am a very sloppy coder and do things out of the ordinary.
Can you take a look at my code and give me some tips on how to code more efficiently? What can I do to improve?
session_start();
/check if the token is correct/
if ($_SESSION['token'] == $_GET['custom1']){
/*connect to db*/
mysql_connect('localhost','x','x') or…
I've got a Flex Web project and a Flex AIR project that use a common code-base. The common code defines several run-time loaded Flex Modules. I want the Flex Modules to behave differently depending on whether the running base application is WEB or AIR. What is the proper method for determining from the module code whether the module is…
I'm in the process of writing a small php-cli script that will loop over over my personal inbox and then send me an SMS via a gateway.
The question I have is:
As will have the script launch via cron every 10 minutes, if there is an email sitting in my inbox that is not read before the next script launch then I will receive 2 sms.
Does…
I have a customer that wants to encrypt some data in his database (not passwords; this needs actual encryption, not hashing). The application which will be doing the encrypting/writing is in Java, but the process which will DECRYPT it is behind a secure firewall, and is written in ruby.
The idea was to use a public/private key scheme;…
In C#, throw ex is almost always wrong, as it resets the stack trace.
I just wonder, is there any real world use for this? The only reason I can think of is to hide internals of your closed library, but that's a really weak reason. Apart from that, I've never encountered in the real world.
Edit: I do mean throw ex, as in throwing the…
This is an interview question: How to serialize a graph ? I saw this answer but I am not sure if this is enough.
It looks like a very confusing "open question" and the candidates are probably expected to ask more questions about the requirements: what the nodes and edges are, how they are serialized themselves, is this graph…
I've run into a problem while implementing sound and music into an HTML game that I'm building. I'm using the Web Audio API, loading all the sound files with XMLHttpRequests and decoding them into an AudioBufferSourceNode with AudioContext.prototype.decodeAudioData(). It looks something like this:
var request = new…
As a scrum master introducing scrum to an organization, how do avoid also being product owner?
problem facts:
List item
I am working on a project as scrum master.
Since the organization is new to scrum, I have assumed the role of setting meetings with stakeholders to form their system vision into user stories.
At…
Hi all,
I am trying to open an image / picture in the Gallery built-in app from inside my application.
I have a URI of the picture (the picture is located on the SD card).
Do you have any suggestions?
Thank you in advance.
var ret = []
,xresult = document.evaluate(exp, rootEl, null,
XPathResult.UNORDERED_NODE_ITERATOR_TYPE, null)
,result = xresult.iterateNext();
while (result) {
ret[ret.length]= result;
result = xresult.iterateNext();
}
can anyone explain me what is…
The answer is probably a resounding 'NO' but before I start a new project from scratch, I thought I'd ask.
I create many throw away projects to test ideas and code before combining all the successful bits from the scratch projects into a final version. So I have one project with the Core Data stuff worked out but…
This is supposed to show the winner in the xWinner form label but I cant figure it out.
xWinnerForm.Show(b1.Text);. I'm new to c# so can you please explain in layman terms thanks.
static public bool CheckWinner(Button[] myControls)
{
bool gameOver = false;
for (int i = 0; i < 8; i++)…
I'm working on a codecademy.com lesson with instructions to write the calculateTotal function below. When I click run, it's returning NaN. Anyone know what's wrong with the calculateTotal function as I wrote it that's making it return NaN. Note, I understand that NaN means not a number...
// runner times
var…
I'm trying to teach myself some machine learning, and have been using the MNIST database (http://yann.lecun.com/exdb/mnist/) do so. The author of that site wrote a paper in '98 on all different kinds of handwriting recognition techniques, available at http://yann.lecun.com/exdb/publis/pdf/lecun-98.pdf.
The…
What I have right now is an animation that starts when I press space:
if(input.isKeyDown(Input.KEY_SPACE)) player = movingRightSwingingSword;
However when I stop clicking space my animation continues. until I move my player, how do I make it so it stops the animation right when you let go of space?
A…
I need to access this from my setInterval handler
prefs: null,
startup : function()
{
// init prefs
...
this.retrieve_rate();
this.intervalID = setInterval(this.retrieve_rate, this.INTERVAL);
},
retrieve_rate : function()
{
var ajax = null;
…
Trying to get something similar for Firefox extension using XUL. The most difficult part is the grid with unequal number of rows.
I tried <grid> but it didn't work well. Also don't want to use HTML inside of XUL. Any ideas how to build such table?
Hello,
I have a UINavigationController with two UITableViewControllers pushed onto its stack. Is there any way to reference a property on the first TableViewController that is under the second? I would like to do this in the second controller's viewWillAppear method.
Thank you for any help you can…
Hi,
I am trying to install libsoup for my ubuntu environment:
checking for LIBSOUP... configure: error: Package requirements (libsoup-2.4 >= 2.28.2) were not met:
No package 'libsoup-2.4' found
I tried
$ sudo apt-get install libsoup2.4-dev
and now it said:
checking for LIBSOUP...…
I have a project which uses OMake for its build system, and I am trying to handle a rather tough corner case.
I have some definition files and a tool which can take these definition files and create GraphViz files. There are two problems, though:
Each definition file can produce multiple…
This question is partially related to an older question (Any CMS is Google App Engine compatible?) , but is slightly more general. It seems that in most CMS systems, the most fragile failure point is the database. Traditional database implementations scale poorly and will never be able to…
On Windows, it's possible to program an LSP service on top of Winsock which provides the ability to do a lot of manipulation/etc. with networked applications. For instance, some anti virus applications register an LSP and analyse network traffic that way. Is there a friendly way to…