Text

Javascript : check all the checkboxes in the page

Hello there,

Its been a While since my last Post, and am not gonna be sorry about that, Because I was busy being in and preparing for Hong Kong baby ! wooohoooo

So, you are someone who wants to spam his friends via mail so the sign up to dropbox ? or want to wipe out all your tweets ??

Here is a bit of my touch !

var cbs = document.getElementsByTagName('input'); for(var i=0; i < cbs.length; i++) { if(cbs[i].type == 'checkbox') { cbs[i].checked = true; } }

and that’s all ! use firebug/chrome’s console to run this command and all the checkboxes will be checked !

You’ll be reading more soon ;)

Tags: Javascript
Text

PDO is just a fail

Hi,

I’ve always wanted to try this “awesome” PDO thing, everyone is talking about it, it was like a miracle came from nothing, They are saying that mysql extension is getting deprecated, Bullshit !

Yes, the Old fashioned MySQL extension is planned to be deprecated but in a long term, so why bother with this new PDO thing ? you should, because it is cross-database, which means the same code works perfectly with all supported databases (well maybe few changes but it is ofcourse way better than rewriting every code in the project).

That made me try it, only that, and I got disappointed and I’m feeling bad for the wasted time :(

The main issue I’ve had is that you can do ONE operation on each query, which means if you want to organize an array from your SELECT query after checking if there are rows or not is not possible, you have to re-query again, which is plain bad.

another thing is lack of SQL error reporting, if the query fails, it returns FALSE, and doesn’t return an error or something, which is again Bad, you have to look for the error yourself.

I’ve had other problems like server crashing twice, “too many connections to the server” “MySQL gone away” and that is enough !

I’ll not go back to PDO again, NEVER, Until they deprecate the OLD fashioned MySQL extension, I’ll move to MySQLi or just use another database without bothering with too many retarded details

Best Regards

Text

Starting out with Appcelerator’s Titanium

Oya folks,

You might have heard about the new framework that compiles phone applications to different phone OSes without a single code modification.

Yea that’s right its Appcelerator’s Titanium :

One of the most important features of Titanium is HTML5 support, it supports it nativly, Even after you package it and run it on the mobile, the application will NOT work under a browser object, it will work under its own interpreter.

Using Titanium is fairely simple, Sign Up, download Titanium Studio, and install the Phone SDKs (Blackberry, Android and iOS if you are on Mac)

Working with it however is even easier, if you have some knowledge with Javascript you’ll be able to catch up with its codes very quickly, otherwise there is an awesome Documentation for everything you need, tutorials in the internet are countless too !

One thing is that many Windows 7 users (especially 64bit) have problems with the software detecting JDK paths, Android Paths, and anything Paths, You’ll need to modify environment variable in order to work with the Studio.

I have managed to fix everything, BUT the android issue, the studio is not yet able to detect that I have android-8 Platform API installed :(

how sad I can’t work much more without testing things,however it seems that the linux version is way better detecting everything on its own (isn’t that obvious ? :D ) and I’ll try it as soon as I finish configuring my new HDD.

Best Regards.

Photo
Text

use direct file editing rather than FTP in wordpress

Hi all,

so I’ve merged to Cloud and VPS hosting for a while now, and I’ve been doing a lot of changes in my web life with it, one of the most important things I’ve changed is FTP usage, no more FTP ! but more on that later ;)

so when you try to update a plugin via the dashboard, wordpress will ask for ftp information to connect to the server and update it, well for security measures I don’t have FTP and I won’t.

The alternative for updating plugins without FTP pain is to give Apache user permissions to edit wordpress files,

simply

chmod 777 ./wp-content

your wordpress directory, followed by changing the group of the directory to Apache’s using the following command

chown -R apache:apache

in debian servers you have to use www-data:www-data instead, and in opensuse it is httpd:httpd

if you have another distro running in your server you may want to try looking for the usergroup apache is using before touching anything using 

lsof -l

and looking for apache2 in the first row, the third row should contain the usergroup name, use it !

Warning : Shared hosting people shouldn’t use this method, as it expose them to risks of getting hacked if the server is compromised 

Best Regards !

Photo
Blurrrrrrrrrrrrrrrrrrrrrr

Blurrrrrrrrrrrrrrrrrrrrrr

Text

Move all files and directories from the current folder to the upper folder

Thanks to the Answer found in SuperUser By Stephan202 : 

The command you are looking for is

mv * .* ..

Explanation: the mv command moves files and directories. The last argument to mv is the target (in this case the directory one step “up” in the tree, ..). The arguments before that are the source files and directories. The asterisk (*) is a wildcard which matches all files which do not start with a dot. Files that start with a dot (dotfiles) are “hidden”. They are matched using the pattern .*.

See the manpage which I linked for more information on mv.

Edit: as Chris Johnsen correctly points out: the pattern .* also matches . and ... Since you don’t want to (and cannot) move those, it’s better to use a pattern which matches any filename starting with a dot except those two. The pattern .[^.]* does just that: it matches any filename (1) starting with a dot (2) followed by a character which is not a dot (3) followed by zero or more arbitrary characters.

Edit 2: As Paggas points out, we’d also have to add the pattern .??* in order to match files starting with two dots. See his answer for an alternative solution using find.

Edit 3: Arjan’s answer mentions shopt in order to avoid all those issues with dotfiles. But then there is still the problem with files starting with a dash. And it requires three commands. Still, I like the idea. I propose to use it like this:

(shopt -s dotglob; mv -- * ..)

This executes shopt in a subshell (thus no second call to shopt required) and uses -- so that files starting with a dash will not be interpreted as arguments to mv.

Text

note to self

Version control is the most retarded thing I have ever seen

Link

This Article made me re-think about the future of AEF, change plans for its 2.0, and try to remember functions I re-written in 1.1 …..

Though, in Rare cases it is a good idea, I recently re-written my plugin code using OOP, turns to be way better now =)

Anyway, I didn’t finish reading, his point has been made in the first page, maybe the second, Y U WRITE 2 MUCH !

Text

Cic-Cac-Coe 1.1 : AI Bundled !

Hi there,

I’ve been silent for a long time now huh ?

Well I have my own life too, so deal with it…(haters gonna hate).

I’ve always thought about making my own game, I even tried to start working on a big one (Agnoizer anyone ?), But obviously, you can’t achieve the success you want without experience (I got this from my experience with Web Applications Development ;)).

Everyone needs a first step to start his track, so I started with Cic-Cac-Coe.

The first version contained nothing but a regular Human VS Human Tic-Tac-Toe game with almost 0 complexity in code, and Bugs !

This 0.1 addition contains Bug eliminating, AI (don’t get excited, hes retarded as chipmunk), better coding (still sucky on some parts to be honest), and Draw Detection !

I am glad I’ve done all this without help from anyone but my experience, derp why lying ?

I want to thank Amin for his help improving the game, and suggesting new license that I should use…

finally you can  find the Source Code in the Cic-Cac-Coe GitHub Repository.

I haven’t Pushed the new update yet because I’ve just installed Mandriva and I don’t have Git installed on it, But I’ll push it later today for sure. Updates are now available in the Repository, You can also find the new license (New BSD license).

What’s Next ?

I think its time to move from console gaming and make a Graphical Front-end for the game with SDL or something similar (openGL maybe ?), and this will be introduced in 2.0 Inchaa Allah !

Best Regards everyone..