« first day (554 days earlier)      last day (4619 days later) » 
00:00 - 22:0022:00 - 23:00

00:03
anyone know how to make an online quiz here? :[ completely stuck
just from using php, no sql or java, how do I set the correct answer for a question?
I think just about every on on this site might know how to make an online quiz
Using arrays
Umm I think you will need java to make everything work properly depending an what all you add and how you want it to function
00:09
i've started it and actually set the right answers but the thing is, all the right answers are 'letter a' which makes the quiz completely pointless
$answers = array(
'firstAnswer = array(
'correctValue' => true,
'incorrectValue' => false
)
);
would you guys happen to know a way to shuffle the multiple choice answers without affecting the index values of the arrays?
Is it like one of those quizzes that u make what ever choices and it tells you what character to are most alike
nope its the "where is the CN tower located" kind of quiz. Your answer is either right or wrong
Then use arrays
00:12
i did but I set the right answers to the first choice as I don't know how else to set it (without java or sql)
I agree with Tomirammstein use arrays that way you can put the answers in a random order
without using the shuffle() function how else to i randomize the order?
I'm not sure if theirs another way to shuffle them other than the shuffle() but that just off the top of my head tho
i've tried the other sort functions but they don't work so I guess my quiz is gonna stay that way :( my next problem is the results table as I have no idea how to code it
00:18
Do yo need check the value that was selected by the user
With check buttons
That's what I would do
yes, I need a table that shows the question#, the user's selected answer, the right answer, and if they got the right answer, I give them 1 point
Ok
Then assign to any array tha corrects and incorrect array
Oh
But I prefer just doing it all throw MySQL for the questions and answers and just have the pho code to call on it and import all the data to the site
Before this initialize a variable $points = 0;
And foreach good answer sum 1
And quit 1 point foreach bad answer
if ( $_POST ['checkedValue'] == $myArray ['correctValue'] ) { $userPoints+=1; }
else { $userPoints-= 1; }
00:25
I would use sql, but my instructor refuses to teach us and let us use it
I'll try that out
Thank you!
Its easy
Thanks for all the suggestions too =]
If your instructor won't teach you then you need to teach your self how to do it
PHP without any database is null
00:29
Agreed but you can still have pho with out a database but u are limited on what you can do
Php*
But without databases php isn't dinamic
01:13
what the heck are you people talking about?
 
3 hours later…
05:10
If anyone here has experience with a web platform that keeps resources in memory and can serialize them periodically, ping me. I'm interested.
Tek
Tek
05:27
@LeviMorrison What are you trying to accomplish?
@Tek Developing an application for a LAN party that helps organize matches. Most match setups are thrown away, so using a database isn't really ideal. Also, since the state of the application is changed by many users, having a shared-resource environment would be nice for this part of the app.
Tek
Tek
@LeviMorrison Is it a large amount of data?
I understand that the app can be written using a database (in fact, I already have done it). However, making changes to the database schema and updating the code that accesses it is not fun.
@Tek No.
Tek
Tek
@LeviMorrison Why would you need to change the schema more than once?
@Tek I understand that in theory, you never change the schema.
Tek
Tek
05:31
The schema is a non-issue
As for accessing the data... it's the same story
However, the criteria for app seems to be in constant flux.
If this was a business adventure, believe me, I'd get a few more things nailed down before writing any more code.
Tek
Tek
You're being vague, what does "constant flux" even mean?
@Tek Always changing.
Tek
Tek
Still vague, WHAT is always changing?
Oh, I see what you mean.
The data we hold, the structure of the data, relationships between the data sets.

Basically, everything is changing.
If you'd like me to, I can explain the flow of the program.
Tek
Tek
05:36
@LeviMorrison Sounds like you just need different cases for different data. Once you've set them in stone there's no need to keep changing everything all the time
@Tek If we had a good model for the resources, then we could just set it in stone and move along.
However, all the modeling we've done seems nice, but some of use-cases seemed quite cumbersome to serve. For one use-case, we had to run two queries to get the data because of poor modeling.
It's an instance where modeling the real life relationships exactly into a schema is a bad idea.
Tek
Tek
@LeviMorrison Sounds more like a simple database layout problem. Why don't you ask a question about what data needs to be stored and what would be the best way to store it? Someone will always know more than I or you : )
Dar
Dar
06:34
There is way to send HTTP Post request from yii framework?
did you try and look for relevant methods? aside from asking here? @Dar
Dar
Dar
@sg3s Yea, I didn't find anything about this
only a way to handle with REST request into my app.
 
5 hours later…
11:37
How can i reverse the order of an assoc array?
11:47
Is there a difference between a regular array and an "assoc" one?
12:00
@HarryBeasant Do you mean changing the associations? e.g array('a' => 1, 'b' => 2, 'c' => 3) to array('a' => 3, 'b' => 2, 'c' => 1)
12:15
@Chris btw, the answer is no I believe. SPL Fixed array is different though.
@Paul All right.
@Chris No, PHP has only one array data structure
12:48
morning
13:05
So, the blogging platform thing I'm working on to gain skills - drbl.in/dMLQ
14:09
hi how are u dear friends?
want to acces localhost through wifi. Want to access my index.php
from my mobile phone
any idea?
is your phone using wifi ?
yes
it is
It is smart phone: Nokia E75
if you can, please explain me detailedly how to connect my phone and laptop. thnx
@serdar your mobile runs a php enabled webserver?
@Gordon, I dont know it. I want to view that page through browser in my mobile.
any advice?
@serdar , then look up the IP of your localhost's
it should be 192.168.x.x something
14:15
In computer networking, localhost (meaning this computer) is the standard hostname given to the address of the loopback network interface. The name is also a reserved top-level domain name (cf. .localhost), set aside to avoid confusion with the narrower definition as a hostname. On modern computer systems, localhost as a hostname translates to an IPv4 address in the 127.0.0.0/8 (loopback) net block, usually 127.0.0.1, or ::1 in IPv6. Localhost is specified where one would otherwise use the hostname of a computer. For example, directing a web browser installed on a system running an HTTP ...
found it ?
no, not found. I have a WAMP server working. I want to execute my index.php through wamp server
I know that WAMP server's localhost IP is 127.0.0.1
what is your computers ip ?
How to know my computer's ip? There are many ips
Also, you gotta open your ports.
14:18
First of all, I created a Wifi point at my computer. Next step, what to do?
ipconfig to see the configured network devices
Should I know execute WAMP server?
next sept is : call a professional
ok,now I ll check
u re professional ))
I will never be a teacher. Because the day I'll become a teacher is the day I'll go to jail after attacking an idiot who could not understand anything.
14:20
@serdar you should first make sure your wamp server is working on localhost (e.g.the machine you installed it on) before attempting to connect to it from mobile (where localhost points to the mobile of course and not the machine your wamp is running on)
@Chris , there is a difference between teaching children and students
@Chris, what do you mean by saying idiot?
@tereško Well, yes. Maybe in university I could manage my anger issues.
@Gordon, WAMP server is working fine on localhost
An idiot, dolt, or dullard is a mentally deficient person, or someone who acts in a self-defeating or significantly counterproductive way. Archaically the word mome has also been used. The similar terms moron, imbecile, and cretin have all gained specialized meanings in modern times. An idiot is said to be idiotic, and to suffer from idiocy. A dunce is an idiot who is specifically incapable of learning. An idiot differs from a fool (who is unwise) and an ignoramus (who is uneducated/an ignorant), neither of which refers to someone with low intelligence. Etymology Idiot as a word deriv...
14:22
just let Gordon deal with it .. i kinda enjoy to watch him in pain
Chris, I think you are an idiot :)
@serdar ok, now go to whatismyip.com to learn your ip address. type that into the browser on your mobile
@Gordon, I run ipconfig, and then, which ip should I look at?
@Gordon, ok. Now I ll do it
lol
Your IP Address Is: 217.174.232.12
No Proxy Detected
So, I found my ip. Next step?
14:27
So you want to access a website on your PC from your Phone which is connected to the same network through the means of WiFi?
now i am connecting to my computer..
@serdar now you type that ip into the browser on your mobile to find out that there will be no response because there is likely your router or firewall is blocking access to the webserver
sg3s, exactly!
We don't need your public IP for that
:-|
@sg3s, what to do then?
14:28
so you need to open up port 80 and 443 to allow access to the webserver
@Gordon, where should I open it?
@serdar umm, no offense, but you have no clue whatsoever about your computer, do you?
use win+r, type in cmd, you'll get a black screen, type ipconfig, look for the "IPv4 Address" and input that into your phones browser. If a webserver is running on your PC on port 80 it will connect to it
@Gordon, you are right. That is why I need a help.
@sg3, ok, I am trying now, Just a minute.
@serdar try what @sg3s suggested. if that works its more secure anyway
14:31
Wellll... that is unless your router has made Wifi its own network and your PC has a hardwired connection; that would be problematic
IPv4 of which? Mobile brand... or Wireless Lan adapter?
theres really too many variables to account for
uuh
yes
192.168.137.1 is my IPv4
@serdar the one that has a default gateway more or less matching the "IPv4 Address".... Thats a guess though
looks ok
so put that into the browser of your mobile phone
while it is connected to the network through Wifi
i ve put it. It writes: forbidden, you dont have permission on access/on this serve
14:33
So at least that is something
@sg3s, yeah. Thanks. At least sth :)
that means the webserver you are running is not allowing you to access the particular directory, what server are you running?
WAMP/Apache
ohh it is working
I am happy lol
Sounds like this question:
http://stackoverflow.com/questions/5657279/make-wamp-www-available-on-local-network
ok another suggestion
I turned my WAMP online
It was offline, i didnt see it. And now I turned it online
14:38
@tereško i've settled for the popcorn alternative ;)
I am very happy. And I want to express my thanks to @Gordon, @sg3s!
You're welcome
Thank you for your kindness and for support of newbies :)
yeah, you're welcome
Are you usually here? If I have another questions, I ll come here
or do you have yahoo messenger?
14:39
no, this is really just a coincidence
we're never here really
ok. Then do u have messenger?
no
in order to be in touch
yeah.... I don't do messengers and stuff, really
@serdar where are you from? which country?
14:40
ok. Then, see you all! :)
From middle Asia.
And you Gordon?
thats a country? :)
India? :-/
from germany. but currently in switzerland
No, Turkmenistan
cool
14:41
This year I applied for DAAD, I was rejected (((
sg3s, and where r u from?
The Netherlands
Cool!
@Gordon, @sg3s, see you!
I have to go. And thanks again for your help.
bye
@serdar bye
Why is gravatar such a piece of trash?
I can't even sign up
yeh
16:11
anyone know what -2 / 1 hour ago / removed / User was removed in my rep tab could mean?
@Gordon You lost rep because a user (including all the posts) was deleted
how do you lose 2 rep with that? :s
@sg3s yeah, that's what im wondering, too /cc @RepWhoringPeeHaa
23
Q: What does "user was removed" mean and why did I lose 5 reputation for it?

aefIt seems I have lost 5 reputation points on Stack Overflow yesterday. The reason given in my history is "removed". On mouse over I get the message "user was removed". I don't understand what that means. What caused this?

doesn't explain how you get into a situation where it results in -2 rep.....
he only thing i can think of is s/he uv'ed something when i was at 198 for that day.
so i only got 2 rep of it because of repcap
16:20
aaaah makes sense
16:32
Hello
When you have different pages for a "thing" in your web application such as "Bicycle". What do you do? Name a folder "Bicycle" and add "new.php", "edit.php", "show.php" as well as index.php that has the list of bicycles.....or do you just name the files add-bicycle.php and so on?
Maybe you should try something like stackoverflow.com/questions/1717429/… @Viper
And that does mean?
Why do you add pages in folders when you can use mod_rewrite?
Or did I misunderstood your question?
but how would you name the files in the first place+
@Viper using folders and calling the scripts after what they do sounds good to me.
16:45
@Gordon Hi, like add-bicycle.php or bicycle-add.php, or no hyphens, with underscores? What would you do
@Viper bicycle/add.php
and then use the index.php for listing all bicycles right?
@Viper sounds okay
Is this how you would have done it?
that is such a funny question
16:49
yeah, I am laughing now
@Viper Depends on the complexity of the project.
I would say it will be pretty complex
@Viper not to be insulting but we're at different skill levels, I would have an OOP framework and database to work with, generic classes and pages would probably be somehow managed in the database as well, there wouldn't be any file or folder on the server called bicycles, not in a system where we have basic CRUD actions.
user50049
Heh, I just wrote a no-framework framework
16:55
Wow, I am asking a question here because the Java room is dead, now I would not make a web application about bicycles either but in order to have my question answered I wanted to make it simple...
@sg3s you can have all that which you mention and still use a folder layout like example.com/bicycles/add.php.
its only a matter of using a frontcontroller or not using one.
@TimPost Hi
user50049
'Allo @Gordon :)
@TimPost why would I lose 2 rep when some user got deleted? Did s/he upvote me when I was at repcap-2? Its puzzling.
@Gordon I don't question that, I just prefer a maintainable set of tools to work with that offer the least duplication of code possible so I'm not re-doing stuff each time I want to add a new folder for instance.
user50049
@Gordon I just lost 10 due to the same. If a user is removed, so are their votes. It just means an account was deleted and the votes they cast were invalidated.
16:58
To get a resume like lerdorf.com/resume just jumped to #1 on my "100 things to do before I die" list.
user50049
@Gordon Not that I agree with it.
@TimPost ok, so it must be i was at repcap-2 then, otherwise i cannot lose 2 rep
user50049
@Gordon Yeah, that would explain it.
Why the hell doesn't Chrome 19 add cursor:pointer; by default on input[type="submit"] 's ?
@Chris No browser in existence does.
17:01
@sg3s you could put the bootstrap into php's prepend directive. then you wouldnt need a front controller and wouldnt duplicate code. not that i would suggest that to anyone. but it would work. you'd still have the folders of course, but you would have those with an MVC setup, too.
@BoltClocksaUnicorn Really? Then why did I think they do ... I should drink less.
Also, why nobody congratulated me on my 100+ reputation ?
I mean, it's a bloody big deal considering I don't answer questions .. like ever.
anyway.. have to get some food
@Chris damn, can't un-do that even if I downvote everything you did do :<
Haha
@Chris I'm sure the site congratulated you when you received the privilege to edit community wikis :) But in all seriousness, congrats. Now aim for 200. Then 500, then 1000, and onward
17:05
anyway.. off to get some food
laters
Community wiki is not a place for idiots and therefore, it's not useful to me and therefore, well, it sucks. @BoltClocksaUnicorn
Well, I got 100 with 2 months. I'll probably get another 100 in the next 2 months. A simple calculation would suggest that it would take almost half a year to get 1000.
Scratch that, I suck at math.
yeaaah.... that must be embarrassing half a year will get you up to 300 I don't know how you can get that wrong :s
I kind of haven't visited the math class since, uhm, 5th grade.
user50049
wat? Why are you using CW?
17:10
I ain't. That's the point.
However, all the things I can't do with math I make up with design. So, yeah.
user50049
Get really drunk and tear into the Android tag, that's what everyone else does with a great deal of success.
I'd rather shoot myself. In the head.
user50049
In that case, check out facebook.stackoverflow.com , same effect.
I think it's safe to say that this chat room is as far as I'll ever go on the Stack Exchange network.
Then again I might get bit by a radioactive spider, but since my luck sucks I won't get any superpowers, but maybe .. just maybe, I'll get smarter.
user50049
It's good to have goals.
user50049
17:18
But, well, congrats on hitting 100. SO is just there man, use it how you like as long as you don't irritate thousands of people.
Having a goal is a dumb guys explanation of religion. I lack it. But I do not lack visual taste and hence I truly belong with Photoshop and illustrations. That being said, I can't deny the mysterious power of something I don't quite understand - which is either beautiful women or PHP.
user50049
I'd shoot for PHP.
Yes, and hence I'm here.
user50049
Well, what did you make today?
Finished authentication class for my blogging tool. Am now working on publishing bits (articles, pages).
Just to learn, I am not interested in putting out yet another cms.
Basically, it's gonna look like this: dl.dropbox.com/u/61036343/blogthing.jpg - Of course, powered with Markdown.
user50049
17:29
Are you using pagedown?
A what?
user50049
Stack Overflow's editor and parser
Nope.
user50049
You're really into learning then :)
17:30
I was actually thinking of using oscargodson.github.com/EpicEditor
Haven't decided yet tho'
user50049
17:41
@Chris I'm indecisive as well. I work for a hosting company, many of our clients are programmers and prefer markdown when using our support system. But, not all. so I'm trying to come up with an auto detect that shows the typical WYSIWYG until you say no thanks by just using markdown.
@TimPost That is awesome (if you do it right)
user50049
@BoltClocksaUnicorn That was harder than I thought. Initially it worked just fine until we all started playing with it :)
user50049
And, well, when dealing with a bunch of programmers, you can't #fail
Markdown has such a striking resemblance to regular chatspeak. I'm not surprised if it's difficult to pull off :)
morning folks
whats the best way in your mindset to manage crontab via web?
I have an admin panel, that id like to add a crontab management feature to..
framework is CodeIgniter
17:45
@Mike is the code public?
user50049
@BoltClocksaUnicorn Difficult, but not impossible, I built in 'hints' we can take from client profiles. Still not implemented, my boss would kill me if I did that prior to making the ordering system work correctly.
it will be behind an admin panel, so it will be accessible via the web, blowfish encrypted passwords and SSL on the admin panel is required.
the cron jobs are already predefined
so it wouldnt be a "add whatever cron task you want", more like, these are the cron tasks enable whichever of them, and also going to be tracking stats for the cron tasks, last run date/time etc. manual run now.
ill be using db table for tracking the task statistics but im not sure the best route to go to modify crontab.
could create a user specific for this, and exec() as that user i suppose?
user50049
@Mike Insert your cron jobs into a DB, set them active or not, and something that root owns needs to run them.
17:48
yeah @TimPost, just not sure how to "run them" as a root user via php.
@Mike cronjobs should run by themeselfs?
not using php
from everything i can tell, editing crontab is the best way.. and just locking down the available tasks so the admin cant add whatever they want.
so i should create a primary cronjob that polls DB for other crons?
user50049
@Mike Set up a cron job as root that queries to get jobs. One for every minute, one for every 5 minutes, etc
user50049
@Mike Stick that in root's crontab
thanks @Tim, that seems like the best route.
that way php doesnt have acces to crontab, it only adds to db.
user50049
17:51
@Mike If you accept crons via some kind of form input, make sure they go into some kind of queue to be approved before actually being inserted.
again they wont be adding crons
just enable/disable
and of course :)
user50049
@Mike That should do it then.
which i could give up rep in chat lol
user50049
17:53
@Mike I'm pretty sure I answered that on SO before, I just can't find it. Happy hacking.
lmao @RepWhoringPeeHaa
Anybody into 64k demo's?
user50049
@RepWhoringPeeHaa As in commie demos?
anyone familiar with WP codex? I'm looking for a function or variable that will output the name of the page
I am. But am not proud of that fact.
the_title();
History

A revolution happened when fr-08 was released in 2000.
@BoltClocksaUnicorn History: github.com/PeeHaa/fr_public
@BoltClocksaUnicorn yeah, laughed at that :D
@Chris thanks
@Knownasilya For what?
@Chris your input to my question :)
Oh, right. No problem.
18:47
is there any way to use push on php? or long polling?
19:11
kinda
but it would be easier to implement from the JS end of things
So much of PHP. I gotta make a Tumblr theme for some shitty agency unaware of the fact that they are most likely going under pretty soon.
oh and, hi @tereško
 
1 hour later…
20:32
I feel for those who follow me on Twitter. I really do.
20:46
@rdlowrey Have you used MySQL triggers before? I'm basically looking for a database-driven way to know the timestamp of the last modification to any record in the table. Would triggers be a good way to do it?
@LeviMorrison MySQL provides native ways to update a timestamp field on update
there is some attribute to do so, don't know the name by heart ;)
@NikiC No, I don't need to associate it with the last time a row was updated, just the table was updated.
I mean, I could use that to query a max timestamp, but it seems like an extra look-up.
ah, now I get what you mean :)
well, then a trigger seems appropriate
whats wrong with this sql statement wtf
@NikiC Now that I've thought about it for a while, I actually should just implement a caching mechanism. Sometimes we just don't think of the right solution the first time :)
20:54
@Mike , when you ask for help, please have the decency to format the code
user986408
21:05
@tereško i think i've already asked you once but i was quite in a hurry that day.. i'm still looking for terms and sources for my paper i have to write.. it's about saving a state in php.. i've collected the following terms: session, memcache, apc, nosql
user986408
i also found the term "websocket" but i'm not quite sure what it is and if it can be implemented with php.. do you know anything about it ?
Hi to all,

Someone who can help me with this issue?
http://superuser.com/questions/415458/sendmaildovecot-cant-receive-emails
websockets are the "new thing" for browsers , i have way too minor exposure to them to even describe what they actually do , @ThatWebNerd
besides , what is the premise of your paper ?
@Mike

#1075 - Incorrect table definition; there can be only one auto column and it must be defined as a key
user986408
@tereško what do you mean by premise.. i think that's one of those words i lack in english or in general
user986408
err.. the goal of my paper is to find out if it is possible to program "stateful" in php which (i assume) means to save special data by using existing methods
user986408
to be honest i also dont fully understand the question/issue of the paper .. i mean http is stateless.. my lector said it's a very experimental issue
i think the conclusion should be that PHP is not stateful
not in the way like java or ruby
user986408
php underlies http so is loses the state after a response..
user986408
come to think of it.. what is a state anyway ?.. i mean i can save data in sessions right? so i preserve them among many requests/responses
user986408
21:25
isn't this also a kind of "state" in php ? @tereško
@ThatWebNerd additional words to lookup: semaphores and shared memory
in php each request is a separate process
you can store data , but not share the object instances
user986408
so the difference is that i "lose" my object instances after a response ?
user986408
@Gordon thanks!
@ThatWebNerd websockets provide a persistent bidirectional connection between a browser and the server. which means a php request runs as long as the connection between both is alive.
21:31
its the XHR on drugs
user986408
@Gordon does this include persistent object instances ?
user986408
xhr is ajax right ?
in php the object instances exist only while the script is running
php has "share nothing" architecture
and yes , XHR is what marketing department calls "AJAX"
@ThatWebNerd what @tereško said. just that with websockets the request keeps running while the browser is connected. you dont send multiple requests but send data back and forth.
hey @Gordon
21:35
the point is , the "state" that can persist in php is data (with sessions, caching and db storage)
@NikiC yo
user986408
i think i get it too
user986408
@tereško u mentioned that in java and ruby it's different with the objects ? can u explain it please ?
user986408
u mean in java the objects are living as long as the application is running ?
user986408
btw. since when is there a cool green notifier for other chatrooms i attend :D
21:44
like a year ..
user986408
@Gordon can't i persist my business logics somehow? putting object instances into the session array sounds kinda insane but only so that you get my idea ..
no , you cannot
user986408
what about serializing objects > storing them > and then unserializing them ?
user986408
also doesnt work ?
no , it doesnt
user986408
21:56
damned.. i have to write at least 20 pages about this topic.. now that the answer is thaaat obvious i dont know what to write about so much. lol
user986408
@tereško isn't this a working example of searializing an object instance of MyClass ? at2.php.net/manual/de/function.serialize.php#101926
00:00 - 22:0022:00 - 23:00

« first day (554 days earlier)      last day (4619 days later) »