
markjoe
Members-
Posts
226 -
Joined
-
Last visited
Never
Everything posted by markjoe
-
First of all, before people get all worked up: I realize this is the basic functionality of a keylogger, and no, that is NOT what I am trying to build. If I wanted a keylogger I would download one of the many available. In fact in searching for what I need, all I can find is keylogger programs... again, NOT what I want. On to my issue... I am writing a testing simulator/bot type app in Java and I need a way to pause it when it is not the active window. It doesn't seem to be possible from within the JVM and while this app will be cross platform supporting Mac, Windows and Linux I am ok with native calls for each OS if that's what it needs to be. All my testers (both, lol) are on Windows right now, so that is all I am currently concerned with. So does anybody know if there is a DLL that offers such functionality or can point me in the right direction (.NET class,Namespace, etc) to write my own DLL?
-
I can't say I fully understand this (I've pampered myself with a GUI for too long now), but the ; didn't look right, so I started there. Here's what I ended up with. CREATE TABLE `poker` ( `id` int(11) NOT NULL auto_increment, `player1` varchar(40) NOT NULL default '', `player2` varchar(40) default NULL, `player3` varchar(40) default NULL, `player4` varchar(40) default NULL, `cards1` varchar(250) default NULL, `cards2` varchar(250) default NULL, `cards3` varchar(250) default NULL, `cards4` varchar(250) default NULL, `money1` int(11) default '0', `money2` int(11) default '0', `money3` int(11) default '0', `money4` int(11) default '0', `deck` varchar(250) NOT NULL default '', `ante` int(16) NOT NULL default '0', `pot` int(16) NOT NULL default '0', `password` varchar(32) default NULL, `current` varchar(40) default NULL, `stage` int(1) default '0', `swapstart` int(1) NOT NULL default '0', `raiseamount` int(11) NOT NULL default '0', `currentraise` int(1) NOT NULL default '0', `maxraise` int(16) default NULL, `allin` binary(1) NOT NULL default '0', `lastmove` int(11) default NULL, `winners` varchar(250) NOT NULL default '', `created` int(11) NOT NULL default '0', `p1` varchar(100) NOT NULL default '', `p2` varchar(100) NOT NULL default '', `p3` varchar(100) character set latin1 collate latin1_spanish_ci NOT NULL default '', `p4` varchar(100) character set latin1 collate latin1_spanish_ci NOT NULL default '', `entry` varchar(100) NOT NULL default '', PRIMARY KEY (`id`), UNIQUE KEY (`player1`,`player2`,`player3`,`player4`))
-
The DOM isn't populated with default style properties. If you didn't set a style property, it will be null. I guess technically they are attributes, not properties, but whatever.
-
I've always checked for display:none, and assumed anything else is visible. <script type="text/javascript"> function toggle() { var tables = document.getElementsByTagName('table'); for(var i = 0; i < tables.length; i++) { var x = tables[i]; x.style.display = (x.style.display == "none") ? x.style.display = "block" : x.style.display = "none"; } } </script>
-
Any single condition in the if must be a valid comparison by itself. looking at: if($var1 = 2 || 3 || 4) if(3) doesn't work if(($var1==2 || $var1==3 || $var1==4) && ($var2==2 || $var2==3 || $var2==4) && ($var3==2 || $var3==3 || $var3==4)) Remember that && and || are binary operators, hence they must operate on 2 (bi) values.
-
I thought I remembered some differences with setInterval/setTimeout in IE6, but I just tested a setInterval in IE7 and found no trouble. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <script type='text/javascript'> function one(){ document.getElementById('one').innerHTML = parseInt(document.getElementById('one').innerHTML)+1; } </script> </head> <body> <script type='text/javascript'> setInterval('one()', 1000); </script> <div id='one'>0</div> </body> </html> This worked identically in IE7, Firefox 3 and Chrome.
-
I recreated this the best I could with given info. Firefox Error Console complains that mBoxCreate() is not defined, (which it isn't because I don't have mbox.js) which tells me it is being called. I also put an alert() at the same spot and it executed. I'd say the problem is in mbox.js.
-
At first glance, isn't location.href = tUrl; going to unload the page (parent of the iframe) and destroy the iframe anyway?
-
It appears to me that none of those suggested frameworks provide "Excel" like functionality. They do grids and tables, not editable spreadsheets. I have had to create such an animal in the past, but the functionality was so specific, it wouldn't do you any good. Perhaps I'll look at starting such a project if I can't find one, you've got me curious.
-
[SOLVED] PHP XML Generator including .DS_Store File
markjoe replied to erikjauli's topic in PHP Coding Help
Some small details: Are all these files under your control? can a file get in there with .jpeg? or other formats? Also, the ==true is redundant if(stripos($file,'.jpg')==true) is functionally identical to if(stripos($file,'.jpg')) that usage of strpos() will work fine, but strpos and stripos can be tricky, watch out for them in the future. (php.net is your friend) ...just a few general pointers -
http://www.crockford.com/javascript/jsmin.html
-
Other than obviously making sure your code is efficient, the only other thing you can do to the js files is "minimize" them. Basically remove all (or nearly all) white space. I would bet you could find tools to do this, otherwise a decent text editor with regex find/replace could do it as well. You will want to keep 2 copies of the files, a readable/editable copy and the 'mini' version, only deploying the mini version to the live site. (you can do the same to your CSS if it's a big one) I previously never subscribed to this technique until I found a typical 30% reduction in download sizes. If that isn't enough, you would want to look into gzip compression, however that may be a bit too complex subject for a beginner.
-
Put text inputs in a table and follow any typical tutorial on form processing. In reality, such a feature would be best with AJAX, but I have no idea what you're really trying to do with such a vague question.
-
actually it is comparing correctly. "http://empreintes-digitales.fr/board/register.php" simply does not contain the string: "http://www.empreintes-digitales.fr" perhaps you want to shorten your target_url a bit? I don't know what the purpose of this is, but you could strip the target url down to 1st and 2nd level domains and get far better matches. since "http://empreintes-digitales.fr/board/register.php" does contain "empreintes-digitales.fr"
-
[SOLVED] PHP XML Generator including .DS_Store File
markjoe replied to erikjauli's topic in PHP Coding Help
Yes, you can delete it, BUT, another one will be created when a Mac opens the folder again. Anytime you scan a directory for files, you should be excluding hidden files. Unless you are specifically looking for them anyway. $D = scandir($P); foreach($D as $F){ if($F{0} != '.'){ // do stuff here } } -
every one of those is false. based on the examples of $url and $target_url you just posted, strpos() will return boolean false for each of them, boolean false does not translate to a string, so nothing is printed.
-
Unfortunately, a full rewrite isn't going to happen. for many reasons... I'm looking at rewriting functions that get called thousands of times and optimizing all database joins. Besides, even if I were to rewrite it, I would still want to know the most efficient way of doing things. This topic isn't only about how I can shave a couple seconds off the load times for this project, it's about overall efficiency. I don't just want code that works, I want code that works as well as it possibly can.
-
The most common reason for this, I believe, is bad headers. shortj75 nailed it already, that post contains everything you need to send HTML email. (however, this: $to=$_POST['to']; is a wide open door to become a spam relay, please don't do that on the internet) check your headers at the client by viewing the raw source of the email.
-
I have never used exceptions in PHP, but the finally block should execute whether or not the was an exception thrown or caught. try{ // code that might throw exception }catch{ // code will that will run ONLY if exception is thrown }finally{ // code that will always run // unless you exit() or die() in the catch, i think }
-
if the case returns FALSE, then yes, it returns 'empty'. <?php echo "{".strpos('abc', 'a')."}<br>"; echo "{".strpos('abc', 'b')."}<br>"; echo "{".strpos('abc', 'c')."}<br>"; echo "{".strpos('abc', 'd')."}<br>"; ?> that code outputs {0} {1} {2} {} I think this explains it pretty well: http://us2.php.net/manual/en/function.strpos.php
-
I am maintaining a large PHP app, and am trying to squeeze every last bit of performance out of it. (as it is painfully slow as is) I am looking for some efficiency tips, surprisingly google has turned up nothing for me, and I know there are good PHP'ers here. Here's my contribution, I've done some simple benchmarks on a few common issues I know. $x1=abcdefghijklmnopqrstuvwxyz substr($x1,n,1): 0.7362 seconds (225.3%), value=t $x1{n}: 0.326759 seconds (44.38%), value=t $x2=123456abcdef intval($x2): 0.572915 seconds (195.06%), value=123456 (int)$x2: 0.293719 seconds (51.27%), value=123456 $x3=array(a,b,c,d) split(',',$x3): 2.54544 seconds (158.36%), value=Array ( [0] => a [1] => b [2] => c [3] => d ) explode(',',$x3): 1.607407 seconds (63.15%), value=Array ( [0] => a [1] => b [2] => c [3] => d ) I can further explain that if it doesn't make sense. Anybody else have any suggestions or ideas?
-
When checking for false from, strpos() use === since strpos() can return (int) 0. 0 == false but 0 !== false === checks value and type, == only checks value