« first day (334 days earlier)      last day (4838 days later) » 

00:13
And you are trying to truncate cities?
Oh. That's right. You can't truncate. Only delete
Because truncate is an atomic drop and recreate. And since you can't drop while a foreign key exists, you can't truncate...
Delete from blah; should work though...
it does
but i still think it is an unexpected behavior
I had this crazy idea during some...ugh..."toilet brainstorming" :D. Basically, it's a way to "remove" the client-server architecture from web requests, in a way similar to comet, but the server state is retained.
// server-side (php)

function set_state($value){
	$GLOBALS['some_state'] = $value;
}

function get_state(){
	return $GLOBALS['some_state'];
}

$r = new MySpecialResponder();
$r->registerCallback('set_state', array('value'=>'mixed'));
$r->registerCallback('get_state');

// client-side (js)

var r = new Caller();
r.call_sync('set_state', 45);
alert(r.call_sync('get_state'));
// alternatively, there's also call_async
// which accepts a callback, like regular ajax
// the important part is that alert would say '45'
Of course, the $GLOBALS is just to give an idea. It could have been accessing a database wrapper object etc.
The important part is that the request doesn't really end. So if you used, say, 20 different variables, they'll remain there as they are.
Currently we do this by persisting variables across requests, eg, via sessions.
Now with a clear idea in mind of what this does, the question is, is it worth it?
00:30
do you have to exert effort to come up with so fucked up code , or does it come naturally ?
@tereško It's 2:30am and I wrote the code so I don't get people crying "no code, no play".
Yet we get the usual guy which instead complains the code looks awful.
I suppose it comes naturally at this time. I think you should respect the fact I didn't expect you to imagine it all up while insulting your lack of imagination :)
Talk later...
 
5 hours later…
05:15
damn wake up people.... im bored
me too
yay someone is there
heres a non programming question for ya.. when you think of 'the code star'.. what do you invision the logo looking like? lol
05:42
Hello
05:59
hi @TimothyPerez
Hey @OmeidHerat
How are you
Good and feeling pushed for time. I have a client meeting in 15hours and I have to have a running demo of a complex script done.
AH!
deadlines
sucks!
Now thanks to Teresko, I'm reading through a 518 page book on advanced PHP and re-doing a bunch of stuff.
06:01
what is the script about ?
Document Management, Form Generation, Account Login Access, PDF Exporter
@TimothyPerez Oh what book ?
Those are just some of the functionalities I have to incorporate
PHP Objects, Patterns, and Practices
that pretty much sums up my last project.
When I do the demo I will probably have a streamlined example that I'll show via a screencast.
That way the client can't mess anything up.
And it's all directed.
@OmeidHerat what level PHP dev do you consider yourself?
06:05
slightly experienced self though programmer open to improvement.
@TimothyPerez Do you mind say the book ?
Yeah, the book is called - PHP Objects, Patterns, and Practices
Haven't read that.
I have the PDF, want it?
yeah that will be nice
its about 31 Bucks.
Done!
k, will send
06:11
now you may delete your email cause you might get spammed.
Cheers!
I mean delete your email from chat.
Hover over that line and click on the arrow next to it
then click delete.
Wont let me.... ohh no
06:12
Damn!
Sorry I should have said that before.
np
Send moderator request for removal
sent*
and also you can edit your typos.
hover click on the arrow and then edit.
or you can push the arrow up and simply edit the last message.
@Justin a star made of code LOL
Sent
I think too much time went by
@Phelios lol I actually think i got it... I have the text 'the code star' thats glowing.. with swirling lines wrapping around it and some speckle-stars along with that...
06:16
yeah there is a time limit for pretty much everything in SO
wow... that is so happening!!
eh.. it looks good.. we'll see if the design that i end up doing to go along with it looks as good lol
07:11
Hi
user680786
good morning
07:33
good morning
@Cesco sorry I didn't see your message from earlier
np
hey anybody tell me what is FIELD() in mysql ?
yeah, lol
Returns the position of the first argument in the subsequent arguments
FIELD(str,str1,str2,str3,...)
So it will return a number
Ex: “select *,Field(status,3,2,4,1) from tbl Order By Field(status,3,2,4,1)”
Another Ex: ORDER BY FIELD(day, ‘Monday’, ‘Tuesday’, ‘Wednesday’, ‘Thursday’, ‘Friday’)
It's really useful if you want to specify an exact sort order.
@rajesh Understand now?
And there it is... no response after giving a nice long explaination.
@OZ know of any good PHP OCR classes?
user680786
07:59
@TimothyPerez no
I need something that can import a PDF and extract the text data from it.
08:10
I never tried it, I've just found it while searching on Google: sourceforge.net/projects/phpocr
AWESOME, thanks
@TimothyPerez I can't download the link :(
I just removed it.
I didn't know you didn't download it, thought you did
I can put it back up
one sec
08:17
I was behind a proxy server with lots of limitation.
lol
What the heck are you doing on a proxy?
Ok, retry and download it now
@Omeid Please let me know once you have it.
sure
is it under the same link ?
cause I get 404.
Yup
Just tried the link, do a refresh.
It works for me.
domain.tld/uploads/php_book.rar gives me a 404
lol, what?!
one sec
08:21
Oh got it !
cheeers
its downloading
Good morning
not done yet !
Morning @Robik
user680786
@Robik hello
08:21
Just let me know it's like 7mb
[5pm here though]
Sup all I haven't spoken to yet.
Ever fight with a Kangaroo?
Hi @OmeidHerat, @OZ_
Hello @Robik
Hi @TimothyPerez :)
How are you?
08:24
High on my legally prescribed Adderall and Caffeine
That sounds bad... I'm not a druggy... swear
I just have ADD.
ADD?
Attention Deficit Disorder.
Had since I was a kid.
user680786
@TimothyPerez my son has it too
Yeah, it sucks cause I hate taking this crap. Basically, here's a good explanation in a single image: newideas.net/images/adhd_eeg.png
Your brain thinks so fast that other parts can't keep up sometimes.
Also shows why kids with ADD have the motor skills of a person having a seizure trying to ride a bike
@OZ_ Thought all of them do?
user680786
08:29
@ChristianSciberras looks so :)
@TimothyPerez Wait, you're saying a normal 9-year-old's head should be blank?
I didn't say that..
@TimothyPerez That seems to be what the image implies XD
Here's a metaphor, let's imagine different parts of your brain have attribute points... like (Motor Skills, Speech, Logic, Creative, etc)
Let's say the norm should be 5 on a scale of 1-10
for each
ADD for a little kid is like having 9 in Logic & Creative and 2 in Motor Skills.
Make sense?
Hmm, reminds me of when I wanted to write a program to do my math homework, taking 4x the time needed.
user680786
08:33
@TimothyPerez well, I can't agree about 2 in Motor Skills. It looks more like 11.
It was fun back then...while it lasted :D
@OZ_ Out of 1..10? O.K.
First thing doctors look for in a child to determine the possibility of having ADD is scraped elbows and knees. No joke.
user680786
@ChristianSciberras exactly :)
If they had motor skills of 11, they could do acrobatic back-flips while dodging bullets.
@TimothyPerez O.o
08:35
They might run around a lot, but usually don't think before doing.
@TimothyPerez This is starting to sound like my criminal record profile. Except I'm no criminal. So far. :D
I'm not sure what you mean by that
hy!, Friends
:)
user680786
hi
@JonathanEdgardo ello
08:42
:D i recently gained my first 20Reps and Stackoverflow say now i can use the chat and is really cool!
Tim, I got the book
thanks heaps man
Awesome, you're welcome
@JonathanEdgardo where you located?
@JonathanEdgardo now that you have joined the StackOverflow chat, you will join us in taking over the world with PHP!
Thanks Mate,
but here on the site for the moment I can see very novice, Thanks for the welcome
@TimothyPerez Honduras :)
Really, Really I love PHP
Ah, tu puede habla espanol?
Claro que si.
Es mi lengua nativa, Hermano :)
08:45
Mi puede escribir espaniol un pucito y muy lento
Muy buen
Mi idioma primera es ingles
primero*
Pero te pudo entender perfectamente, No hay problema todos empesamos asi :D
Perfectly!
Estoy de acuerdo
I'm glad to interact with people who have the same passions :)
Yeah, hard to find.
I didn't know this existed till recently
Do you want a good PHP book?
08:47
PDF link?
Oh yeah,
Anything to learn more
Send me an email.
Okay :), wait
Quickly copy and paste that
Did you get it?
user680786
Bond. James Bond
08:49
@OZ ?
user680786
@TimothyPerez about email :)
Feel free to email me if I'm not around
And you need anything
email sent :)
@Everyone who here is hardcore PHP5 OOP proficient and is interested in taking on some work soon?
user680786
2329
Q: List of freely available programming books

KaranI'm trying to amass a list of programming books that are freely available on the Internet. The books can be about a particular programming language or about computers in general. What are some freely available programming books on the Internet?

08:52
I'm on the cusp of taking on a crap load of work and I need backup.
@Go
@Gordon what are you talking about?
@Gordon, it's a PHP book I wrote
@TimothyPerez ok, then i didnt say anything
@Gordon Take a look, I'm in the process of writing it.
Look at the Author... lol
@TimothyPerez yeah, sorry. I was too quick to judge.
NP
@Gordon would you possibly be interested in taking on some decent freelance work on the side?
In the near future anyways.
08:58
@TimothyPerez well, since Im a freelancer it would be odd to say no. However, Im fully booked until mid 2012 atm.
@Gordon NP, I completely understand. Do you know of any good OOP devs that you can refer?
user680786
@Gordon then you bookedlancer :)
booklancer?
@Gordon what does that mean?
@OZ_ haha, yeah.
@TimothyPerez when you were talking about your book, your wording ended up like, you are looking for someone to work with you.
09:01
@TimothyPerez it means, i cannot take new freelance work before mid 2012 :)
@TimothyPerez Do you mind some critics about your book ?
This book I started a while back, so it needs to be updated
This is only a brief exert.
i see
will first thing you need to is slap a preface and introduction.
Oh, yeah... lol. This is definitely not anywhere near what the finished copy will be. It will definitely have all the basics of a real book. Preface, introduction, index, glossary, etc...
I don't claim to be an expert, just someone who would like to explain the core meat and potatoes needed for web programming in today's world.
I will probably touch on simple things like how designing in tables is like shouting vulgar language in a church.
@Gordon Let's say you have a site which gets some data from another site. This data needs to be updated(synced) at some point in time.
The best way to do the syncing would be via cron
or a similar functionality.
09:09
tim, makes sense, and I really like that you want to share it and let others have a look.
My question is, what if you don't have cron?
NodeJS / CRON Job + CURL!
@TimothyPerez Let's assume this is for a shared server.
You can probably create a class to fake cron.
@ChristianSciberras data as in databases?
09:10
@TimothyPerez To be honest, what I'm doing is an open-source plugin, hence I have to assume the server will have some common limitations.
@Gordon No, HTML content. But it will be stored in DB as blobs
@ChristianSciberras so you really want to sync the databases?
The simplest scenario I can think of is a website that downloads RSS feeds
I created a good RSS feed parser if you need it
@Gordon No, my plugin use a database. The data is either plain HTML or read from some API.
And external content reader
09:12
It doesn't relate to RSS. I mentioned RSS to give an idea of what it does.
@ChristianSciberras i dont understand the question. cant help.
@ChristianSciberras Try the below

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://www.yahoo.com');
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($ch);
curl_close($ch);
echo $output;
Except replace yahoo with whatever you need to pull in.
@Gordon what's your thought about Static methods in a class?
@Gordon Pseudo-code looks like:

// cron job or something
if( $data_row->last_modifed < time() - strtotime($cache_time_to_live){
    $data_row->data = file_get_contents('http://target.com/xyz');
    $data_row->save_to_db();
}

// the output page
<div class="content">
    <?php echo $data_row->data; ?>
</div>
Note: I'm being verbose on naming for the sake of clarity.
09:15
4 mins ago, by Gordon
@ChristianSciberras so you really want to sync the databases?
@Gordon By that I took it that you meant syncing a DB with another DB (which isn't the case).
The DB is just the storage medium.
@ChristianSciberras ah, now i get it. you want to download html pages and update your own db. that aint syncing
Well, I'm "syncing" local content with remote one :D and yes, that's correct.
if you cannot use cron on that server, use an external cron service that can trigger the update script
@ChristianSciberras You could do the code I gave you above, and instead of outputting it you could do
// CURL CODE
$data_row = $output;
$data_row->save_to_db();

@Gordon BRILLIANT IDEA!
09:19
@Gordon I would, but this isn't for a client of mine. I'm not sure I can find a free service to do this.
DUH! The framework that makes the plugin tick has it's own cron functions. My bad.
Well, thanks for all the help @Gordon, @TimothyPerez.
@ChristianSciberras first result for "cronjob online": onlinecronjobs.com
@Gordon are we allowed to swear in this chat?
@TimothyPerez as long as it is pg
09:21
@TimothyPerez Define "swear".
@Gordon :D
@Gordon why is swearing not permitted?
@Gordon it's a piece of expression that sometimes can help accentuate a concept or point.
@TimothyPerez im not sure if there is a written rule for that, but in general its because swearing isnt too constructive
@Gordon but what if it's something humorous?
I see
In a way, that's good. Keep mean people away.
09:24
damn , i hate it when i dunno where it all went wrong
i perform a query , all the chars sow up ok on phpmyadmin
i fetch them via PDO , and what comes out is ansii instead of utf8
Echo your query
and i have utf8 set everywhere where it is required
$db = new PDO('dblib:host=your_hostname;dbname=your_db;charset=UTF-8', $user, $pass);
09:25
yes , that is set
it is not like a am doing this first time
UTF9 is an april's joke isn't it
its a typo
i think it is phpmyadmins fault
when i input data via my site , ever works fine
when i import table content , it shows me ? instead of baltic chars
Question, what do you guys recommend as a good free app for creating UML?
@TimothyPerez i guess the occasional swearing isnt an issue but restraining yourself isnt bad either. You'll see when you went too far when your posts get flagged.
@tereško If you're using PHPMyAdmin why not do a manual import?
09:28
hmm
oh well .. i could do that too i guess
user680786
phpMyAdmin sucks
user680786
big security hole
i fail to see how that has anything to do with my issue
+ who the hell lets people from unauthorized IP range to use subdomain on which myadmin lives
administration tool access should always be based on whitelists .. if you are not in the list , goto current site featuring lemonparty picture
@tereško I know shared hosting companies like GoDaddy and Network Solutions use PHPMyAdmin.
But then again, whoever is using a shared host either doesn't really care about their site or doesn't know what they are doing.
if you use goDaddy you deserve what you get
09:34
lmao
lolz
anything bitter then hostgator out there ?!
Personally use and huge advocate of Rackspace
Cloud Servers are good and innexpensive.
Plus they are elastic.
They give you root access to a clean install of almost any flavor of linux you need.
user680786
@TimothyPerez what about support?
yesssss
Awesome support!
09:35
manual import is the good shit
@tereško glad it worked
user680786
@TimothyPerez and fast?
Makes Amazon EC2 look like crap
user680786
@TimothyPerez thank you. About control panel: can I move my VPS from one datacenter to another in panel (without calling support or writing ticket)?
@OZ blazing and so is their CDN (Akamai speed) but cheaper
09:38
well .. as for VPS , i have connection which lets me host my own stuff
it's not really an issue
What are you currently on @OZ
@OZ are you good with linux bash/shell?
user680786
@TimothyPerez currently I'm trying to choose good hoster for big project.
Rackspace hosts nearly half of the sites for the 100 largest companies in the US.
user680786
@TimothyPerez well.. I can deploy the server, but in our team we have special man for it :)
All I have to say, is you should definitely learn how to use linux from the shell prompt.
user680786
09:40
@TimothyPerez well.. it's just marketing words :) when you write "awesome support, and fast" - it means much more, than "100 largest..." ;)
It's hard to pick up at first, then you pretty much figure everything out pretty quick after the initial hump
@OZ I have my own business, I seriously have no affiliation with them.
I've just been a client of theirs for under a year and I'm impressed
user680786
@TimothyPerez thanks. So now I'm choosing between Rackspace and Linode
I was at Network Solutions and had a VPS... meh support was bad
Linode's not too bad. Google for benchmarks and comparisons.
I think my RS server is on a Xenon processer
so that may be outdated
That review has an affiliate referral link on the bottom
user680786
09:45
It's an endorsement!
user680786
ok, it's PHP chat, not serverfault.com :)
lol
But we are discussing how PHP code can run well on these "servers"
Loads of APIs are easy to use nowadays. For example, to get general details about an SO questions, it's as easy as:
$q = json_decode( file_get_contents("http://api.stackoverflow.com/1.0/questions/$questionId") );
echo $q->questions[0]->title;
My question is, how would you give that sort of thing auto-documentation?
09:58
The only thing that comes to my mind is fake(/empty) classes:

class Question {
    /**
     * @return array List of questions.
     */
    public function questions(){}
}

/**
 * @return Question The question.
 */
function SoQuestion($obj){ return $obj; }
@Gordon THanks!
U need PEAR for both?
@TimothyPerez no. its just the most convenient way to get it onto the machine

« first day (334 days earlier)      last day (4838 days later) »