« first day (1349 days earlier)      last day (3593 days later) » 

1:07 AM
@Fabian I was at I/O. I worked the whole day and will work all of tomorrow
@Levi every conf I have been rejected from (a bunch), I got a letter saying so. Some not the same day as acceptance (they want to confirm all speakers confirm the acceptance before rejecting anyone), but I would flip if they didn't say no...
@Levi: Duolingo is my partner that I was showcasing today/tomorrow at I/O ;-)
 
1:43 AM
would any body be able to see why my php artisan db:seed isn't seeding my database?
I'm using Laravel and Faker,

https://gist.github.com/anonymous/5b0744da757f3f49ddf0
 
 
1 hour later…
3:04 AM
Oi, room eleven
 
3:15 AM
> If it's not required to be possible then it's required to be impossible.
leftontheweb.com/blog/2013/02/23/… ridiculous, IMO. Get a grip people.
Oh, drinking alone in the corner of a bar...
 
4:12 AM
how to read a csv file row
and from a row i need to get values separated with " , "
like that
a row cntains : aaaaaaa,aaaaaaaaaaaa,aaaaaaaaa
another row contains : bbbbbb,bbbbbbbb,bbbbbb
i will first read row 1 and then get its individual component
 
0
Q: array/other data structure to store data in 2 dimention

cyclicHere First of all I fetched all tags from database. (tags are string like marketting,jobs etc). $POS is array of POS(parts of speech words). For each words in this array, for given tag, I am calculating probability using writtten equation. As it is appearing, two nested loops are there. To mak...

 
 
1 hour later…
5:38 AM
Good morning
 
5:54 AM
<?php

	$days = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];
	$day = isset($_GET['day'])?($_GET['day'] - 1):0;
	($day > 6 || $day < 0 ) && die("Don't be oversmart day must be in 1 - 7");
	echo $days[$day];

?>
my first php code in years.
2 messages moved from JavaScript
Am i not following any good practicse at all ?
 
good morning
 
Is there a regex for certain special alts for letters? I'm looking for a custom list.
á, Á, À, Â, Ä, Å, æ, Æ
 
@AbhishekHingnikar No you are not. Mixing application logic with output generation, a die() for valiation... Are you using OOP at all? Are you aware of separation of concerns?
 
nope.
starting to re-learn a langauge
 
6:10 AM
I guess this is the "best" tutorial out there http://www.phptherightway.com/
Once you are familiar with that stuff, work your way through this list (it will take a while) http://stackoverflow.com/a/16356866/2834339
 
Thanks :-)
 
morning
 
6:22 AM
anyone here ?
$allowed_types=array(

"application/msword",
"application/vnd.ms-excel",
"text/plain",
'text/csv'
);
if(isset($_FILES["product_file"]["type"]))
{
// echo $_FILES["product_file"]["name"];
if(!in_array($_FILES["product_file"]["type"] ,$allowed_types))
{
die("You need to upload word/excel/plain text/ only");
}
i have used this code and uploading csv file but still getting error
You need to upload word/excel/plain text/ only
 
@ErumHannan have you debugged it?
 
@ErumHannan change die(...) to die(.... Current type: ".$_FILES["product_file"]["type"]);
 
6:40 AM
600,000

questions tagged
 
yes @SergeyTelshevsky i have debugged code and have print what u told me in above line have used this code and got result
Current type:application/octet-stream
but my file is .csv extension
the above line is an output of this line of code :
die("Current type:".$_FILES["product_file"]["type"]);
 
@sectus 600,005 now
 
7:04 AM
hello php developers
I am a android developer I need a small help from you people
 
1
Q: Compare meta field with two relationship

Shajeer AhmdI am querying user data from wordpress users list, I have to compare two meta data from the table, one is the name and another is graduation-year, for name I have to check whether it is like first name or last name using or relation and for the year I have to check it using and relationship, for ...

 
Morningi room
 
@ShajeerAhmd We saw it the first time, thank you very much.
Also, you won't find many WordPress developers here. We don't like WordPress.
 
Is there a regex for certain special alts for letters? I'm looking for a custom list. I'm not sure what to search. Alt letters? Need á, Á, À, Â, Ä, Å, æ, Æ
 
can someone help me i have csv file that contains row1 , (a space of one row in between two rows ) then row2 now i am able to save only last row data the problem is appearing here because of empty row ?
 
7:07 AM
lol I just got a silver html badge :P
 
@ErumHannan ask a question on SO
 
@Axel what do you mean alts? Å is not a alternative for a
 
@PeeHaa grats
 
is there any possibility to remove space from two rows so that i can easily store data/records in db
@SergeyTelshevsky i dnt have enough reputation to ask qestion
IN SO
 
@SergeyTelshevsky tnx :P Would rather get my silver [oop] badge though :P
 
7:08 AM
@RonniSkansing Oh, didn't know that. How would those come into the regex?
 
@PeeHaa are badge points earned if tags were added later?
 
@SergeyTelshevsky Yes
 
@ErumHannan you have enough reputation
@PeeHaa I think you may search your answers for questions that are missing this tag
 
@Axel they do not
 
Meh I will just keep looking for decent oop questions (which are rare)
 
7:11 AM
Yeah, almost all of them get closed
 
yeap
 
@RonniSkansing so how would I check to see if a string contains any of those specials?
 
@Axel same as any other chars?
 
Where is @Magikaas ? Dint she come today ?
wanted to learn some Japanese words ^_^
 
good morning room
 
7:20 AM
Morning! :)
@user3756876 Heya, you cant chat here until you earn at least 20 reputation. Mean while you can see chat of others and learn if you find it useful. Also contribute on SO by asking and answering questions ^^
 
@TheLittleNaruto so read manga (:
 
@AlmaDo Busy days. dont have much time. Also I prefer episodes. :) What about you ?
 
I'm reading now "The legend about an angel" . Gods.. never before I was laughing so long (:
 
18
Q: Are login "certificates" more secure than standard username + password authentication?

tobikI just opened a new bank account which comes with internet banking. Unlike the others I have used so far, this one requires a personal certificate (a .p12 file stored on my computer) + password for authentication instead of standard username + password. This method is rather inconvenient... I hav...

 
and as for busy.. hm
 
7:24 AM
^ first time reading that a bank is using that kind of authentication
 
<-- this guy is doing nothing all days, remember that
 
@AlmaDo no wonder you're a trusted SO user
 
@HamZa am I trusted user? Gods.. person, who trust me, is a pity .. I would not trust myself (:
 
@HamZa lol
My bank still limits my password to 14 characters, it's a joke.
 
7:28 AM
@HamZa huh.. for all that time I spent here :p You should know that I've trolled :p
 
@SecondRikudo ehehehe I think my bank also limits the password to alphanumeric... What a pain...
 
@HamZa Not only a pain, but it indicates severe security vulnerabilities.
 
@AlmaDo I know, just making sure. You now completed the transaction :P
 
If you hash your password properly, you don't give a damn about what's in it. You always get a uniform string with known length.
You don't GAF if the user has swear words, or uses some funky UTF8 or has a password that's 1000 characters long.
 
@RonniSkansing is this okay? "/^[áÁÀÂÄÅæÆçÇœŒéÉÈÊ˃íÍÌÎÏñÑóÓÒÔÖúÚÙÛýÝa-z]([a-záÁÀÂÄÅæÆçÇœŒéÉÈÊ˃íÍÌÎÏñÑóÓÒÔÖ‌​úÚÙÛýÝ])*$/i"
 
7:31 AM
Hello everyone
 
morning
 
@Axel noooooooooo
 
mornings
 
morning too
 
@HamZa how would I go about making sure a string can only contain those? A-Z, and alll those specials
 
7:32 AM
I need a little php help
 
@Axel Are you using php? Then use /^[^\W\d_]+$/u although this will also match arabic letters for example
 
@SecondRikudo I didn't get you
 
8
Q: Regex plus vs star difference?

David19801What is the difference between: (.+?) and (.*?) when I use it in my php preg_match regex?

 
@ShajeerAhmd Don't dump a link to your question here twice. We saw it the first time.
 
\w => matches alphanumeric characters + underscore. When used with the "u" modifier, it can match utf-8 characters.
We use the inverse to exclude the digits and underscore
 
7:36 AM
Ah, so then it's only the characters
Thank you
 
So \W (uppercase) is the inverse of \w. It's the same as [^\w] but when we use [^\W] it will be the same as \w, but now when we add \d to it [^\W\d] we're excluding the digits
 
please help
0
Q: Metabox is not displaying in custom post

devoI am using myMail news letter plugin.On the new campaign create page, I need some more metaboxes. Here my custom metaboxes are not working. Sorry for the long code - http://laravel.io/bin/1ReQn public function add_meta_boxes() { global $post; add_meta_box('mymail_details', __('D...

 
How ironic. Wordpress functions always start with global ...;
 
@Patrick Why?
 
7:39 AM
@devo we hate wp :(
Ok enough of slacking around. Need to learn some C++
 
@HamZa Just you who hates wp (and alot of others, including me :D )
 
7:56 AM
I need a fucking better PC
 
I bought a SSD for my laptop and I'm quite satisfied now
 
today I'm skipping work (because the health seems to be failing and I am really fed up) , but realized that I cannot play anything interesting on this damned netbook
 
Morning
 
you should step away from your computer...
 
@tereško ouch... Are laptops expensive there? Here you can buy a decent one around 600euro
 
8:00 AM
@tereško Perhaps its time to up the priority on a desktop build?
 
Ok 600euro is still a lot of money though :P
 
@Fabien been thinking about it
but I need to buy a sofa first
 
You'll spend more time on the PC.
 
@tereško that should be able to run tf2 :)
 
meh
 
8:06 AM
But but but..
You can't coffeeshop'it with a desktop.
:|
 
@MackieeE I have a Sony Xperia Z2 for that =P
 
Oh my..
x)
 
.. also I am kinda disappointed by the lack of responsivness of the touchscreen in heavy rain
 
Heavy Rain the playstation game?
 
8:12 AM
@tereško my xperia z is completely unusable when wet
 
@SergeyTelshevsky lolled at that guy :P
 
> Decoded is delighted to offer CodeED, a one-day course and online platform that inspires and empowers teachers with the knowledge and confidence to teach their students to code.

Attendees spend the day building an interactive quiz app; the course covers HTML/CSS, Visual Programming and JavaScript. You will learn by doing, and leave with a series of lessons you can run in your own classrooms.
^ IE Learn to code in 1 day. Source
 
@Fabien no, as in "whether condition", "downpour"
 
Oh heh :P
These guys preach 'Digital Enlightenment' yet sell snake oil programming classes.
 
8:16 AM
hehe
 
lol
E_MORNING
 
well, why did you fixed :p I've did mistake for you :p
 
@SergeyTelshevsky btw, do you know why the lock-screen, when you place the phone in a dock, does not change to landscape mode ?
 
@tereško mine phone does not have landscape mode lock screen, when it's in lockscreen it's always vertical
 
I have seen it, but something goes wrong with it when in dock
 
8:19 AM
@tereško another shit about dock is that it uses rapid charger port on the side, and if you use a dock it only works from AC and does not charge from USB
 
true
it's sad that the side-port cannot do data
^ spoiled / 1st world problems
 
@tereško it's not about the data, it's about that it's not even charging :)
 
heh
could be that it's to prevent burning PC's usb ports
 
dock is 1800mAH input/output, while usb gives 900 max :)
anyway, I should say I won't buy non-sony android in the near future :)
 
0
Q: trigger in wrong schema

samithaI have two database and i created a trigger based one 2nd database table.Trigger will handle to insert new recode to the 2nd database if a NEW entry to the 1st database table.I wrote a trigger like bellow -- -- Triggers `courseTrigger` -- DROP TRIGGER IF EXISTS `courseTrigger`; DELIMITER // CRE...

 
8:32 AM
How should we close this. It lacks basic information, but well we don't have that cv reason anymore.
-1
Q: Video on website using html4 without plugin

Naman KhatorI am looking for a method to play videos on my website. The website is for a special device, the device doesn't support html 5 and it cant either use plugins. I have tried param tag, object tag, i-frame but couldn't get through. Please help.

Custom reason?
 
@tereško Do you usually do validation logic in the Domain Object?
 
@PeeHaa No, I cv'd with a reason - not enough code example provided
 
Or do you have an external Validator service?
 
@Jimbo So custom reason and the reason being my last comment?
 
@SecondRikudo yes , I do the business rule validation in the domain objects. But do not confuse it with data-integrity checks.
 
8:35 AM
@PeeHaa No, the one that says and the shortest code necessary to reproduce it
 
@tereško Business rule validation being "Is this username already in the database" and data-integrity is "Is this username between 4-30 characters"?
 
@SecondRikudo no.
the UNIQUE constraint should be enforced by persistence
 
can anybody see my question about triggers ?
 
@tereško So can you give an example for business rule validation vs data-integrity check?
 
8:38 AM
anyone can help me in php ?
 
also, thing is that, if you are using MySQL, then "is this username between 4-30 characters" has to be pushed to domain objects, because of lack of support ... but it really shouldn't
 
@tereško So... data-integrity checks are done by the RDBM, and you just catch the exceptions?
 
they should be
 
What about limiting the characters allowed in a field?
 
8:42 AM
but we live in an imperfect world
 
Okay, which brings up the question, what are business validation rules?
 
@SecondRikudo look at it this way: WHY are you limiting the length of input field ?
 
@ErumHannan the question/?
 
@tereško I didn't mean length. I meant the possible characters
[\w-.]
For instance
 
@SecondRikudo nitpicking: _ is redundant since \w already matches it
 
8:44 AM
@HamZa Better?
 
@SecondRikudo lol (y)
 
@SecondRikudo well ... those should be done in persistence, BUT you probably cannot.
 
@tereško So you disagree with having a Form class which is responsible for validating and only passing fields which pass validation?
 
Most of the times I do validation on the frontend with html/js and then in the backend with php. So I'm assuming that whatever is sent to MySQL is valid
 
@SecondRikudo "is you chosen city matching the country which you picked" , "is this birth date logically sound (4-year olds cannot register)", etc.
 
8:46 AM
@HamZa Well, think about it this way, the RDBM already does those checks for you.
 
@SecondRikudo I think that "Form class" is one of the most common "stupid ideas" that developers have
 
You can have UNIQUE constraints, on most RDBMs which are not MySQL you have other forms of check.
 
@SecondRikudo I know, but TIL: I should also catch exceptions
 
@tereško Would an RDBM raise an error if you try to input more characters than allowed though?
 
non-mysql would
and a strict mode for mysql too, IIRC
 
8:49 AM
@SecondRikudo mysql just defines the display length for (some?) data types
IIRC
Sorry for 100 pings :P
 
@SecondRikudo do you mean CHECK constraint ?
 
yes
 
^ What our C++ teacher thinks in a ppt slide
 
@PeeHaa yes. do not rely on numbers in brackets. int(11) doesn't mean "integer with 11 bytes" or anything like that
 
@HamZa it's kinda the w3schools for c++
 
8:54 AM
@tereško kekeke
 
w3schools is a great resource. All my knowledge I've got there. I recommend to use it for all IT-related things
 
...obviously
 
and.. silence. noone dear to oppose me :D
 
w3schools was the ideal website for me... Until room11 woke me up...
 
please, don't star it: without context a newbie entering this room might get the wrong idea
 
8:59 AM
@tereško inb4: wall of shame
 
@HamZa I guess you have never been a frontend developer
 
@tereško and that will be ideal trolling :D
 
@AlmaDo no, it is not. It is actively harmful.
 
@tereško great. That was my intention :p
 
@tereško I officially am not even a developer. It started as a hobby and still learning
On that note, I should really find a developing job...
Do you guys recommend some online websites to work from home? (I don't care if the pay is a bit lower than the "standard")
 
9:03 AM
@HamZa You mean like rent a coder?
 
@PeeHaa something like that but on a long term? I've got a bad feeling about those websites where you build a profile and bid on how much you will do a certain task for a certain project/client
 
Those sites are infested by cheap and crap indians so my suggestion would have been: don't :)
 
@PeeHaa exactly my thoughts...
 
@HamZa I would start by offering few local businesses to make a free website
you need a basic portfolio
 
I see...
 
9:06 AM
best option: pick a local business, which has an existing site .. but a horribly outdated one
two sites in your portfolio would be the bare minimum that I would expect from a not-fresh-from-university candidate
(for junior dev positions)
 
mornings
 
Yo dawg @DaveRandom.
 
I actually built some Joomla websites. I also built some websites from scratch:
1) I partially built an event management system: designed the database and made a big progress for the backend
2) Built a website: that scraps another complex website. There was also an API, login etc... It was working alongside with a C# application
3) Built a website that scraps a website to get the students points and displays it in a graph
I also played around with phonegap and connected the backend of prestashop with it
 
then you should have no problem in getting a developer job
 
@HamZa Be honest: not much experience in OOP, but more than happy to learn
 
9:13 AM
@HamZa do you have anything on github? I got my job without showing code but had to write something on the second interview.
 
Nobody expects juniors from understanding OOP
 
and most of php developers are not even aware that they suck at OOP
 
DawgRandom
 
And most people who hire them don't have a clue either :(
 
Exactly
 
9:13 AM
@Patrick nope, I do not want to expose crappy code. On the other side, I might not learn from other peoples if I don't
 
I'd say: most PHP developers are not even aware that they suck at OOP. Good PHP developers are aware that they suck at OOP
 
@HamZa you would have to, if you want any substantial advice
otherwise all that we can offer is "pure theory"
 
Yeah, I'm thinking about a summer project...
 
@HamZa That's ok. But why not put something up there that you could show off? Something OOP following the SOLID principles.
 
So, who watched the Google IO stuff yesterday? Worth watching?
 
9:17 AM
Also interested. Watch aught my eye
While I have you here.
 
> Im not planning to steal your time. Give me a minute of your time, please.
More awesome spam for me today
 
Can we talk specs for boxes. Work is looking to buy a dev and production box. What should I get minimally for specs. Boxes will be multi site. Production box will be used for real traffic. Dev is internal only.
 
@DaveRandom Nope. Not a big fan of those marketing / salespitches. I'll just await the filtered articles about the new stuff
@DaveRandom lol
 
@Fabien Dev box you can use any old piece of junk, what you care about with new hw is reliability imo
 
9:20 AM
Production box depends heavily on what you are actually putting on it
@Patrick That might be taking it a bit too far :-P
 
@Fabien but seriously, why not just use another company for that? Or do you already employ sysadmins? If so, they should know what you need
 
@Patrick Trust me, you don't want to do webdevelopment on a RBPI. Last time I wanted to compile nodeJS on a RBPI it took a century. I stopped halfway...
 
For dev all you should really need is a VM on your workstation, means that developers can work on specific features on their own without interfering with each other - are you actually talking about staging @Fabien?
@Patrick His company badly needs to employ a sysadmin. I have effectively done a little bit of sysadmin work for them (by telling @Fab what to do)
 
@DaveRandom then setting up your own boxes just screams disaster. Setting up all the firewall stuff etc... So much to think about
 
9:26 AM
@Fabien VM for development, VPS for production. If you a cheep, you can set it up here: edis.at/en/server/linux-vps-solusvm-openvz/iceland
@Patrick well ... it would be an educational experience.
@HamZa one does not compile stuff on a microserver.
 
@Patrick +1
 
@tereško ahahaha. So true
 
@DaveRandom .. dunno. I am pretty confident in my server-management skills. Then again, I have been using freebsd for ~8 years.
 
@Patrick We are using another company but we need a spec for machines.
@DaveRandom We have a staging box already.
 
@Fabien how man users are we talking about here per second ?
 
9:29 AM
@tereško Indeed, as would I be, but I have a feeling @Fab would not be
@Fabien The how do you envisage using the dev box?
 
For staging? at max 3 :P
It's internal only for viewing. Or should be.
These things host a large amount of drupal sites though.
 
@Fabien 512MB, 5GB, has a CPU
 
Production is most important as that will have actual traffic but I can't really estimate numbers. Anything that requires a lot usually gets its own box.
We don't need a staging box though. Only a dev and production.
Dev is for development to look at only. Reasons for buying are for backup security.
 
@Fabien 100 concurrent users can be easily served on a 2GB/4GHz setup (cost about 15 EUR/mo)
 
@Fabien Then what's wrong with having the developers use VMs? They can all be made accessible to everyone on the internal network, they don't need to exposed to the internet. Imagine two devs are working on unrelated code in the same file. They each try to deploy to the dev box at the same time... chances are you'll end up with two broken features and you won't actually be able to see it. You don't want to be buggering about with a full merge in dev...
 
9:32 AM
@tereško Aye. I was for leaving our dev box on a local network and opening some ports for home access. But alas we're going buy.
@DaveRandom Too much setup for too little sys admin.
 
@Fabien Not really. The other bonus of using a VM is that you can set up one template, stick in some shared data source, and each dev can just create a local copy of it every time they need to spin up a new box
It is the opposite of too much setup, it is a one-shot setup that can be reused forever...
 
Do you have some place I can read about it?
 
@Fabien Best thing would be to just play with it I suggest. I use virtualbox.org
There's also a VMWare freebie thing but I think virtualbox is better personally
 
Budget has been put fourth it seems for essentially 3 boxes. Dev, Staging and Production. A fresh start so to speak. Production hosts the actual live website. This can also be dedicated if the client will pay for one. Otherwise it'll host 10+ Drupal sites.
 
@Fabien I suggest you look into VMs for dev and repurpose the proposed dev box as a second live box
We also have our live sites running in a VM-per-site (mush easier to deal with some co-lo security issues like that) but that would require a proper sysadmin who actually knows what they are doing
Or you could repurpose the money for the dev box and just hire a fucking sysadmin
get your boss in here and show him that sentiment please
 
9:42 AM
lol
There's plans to get one within the next year or so
 
I really highly recommend the priorities here are reversed - get a sysadmin, then you can use them to know what they are doing when they are ordering the new servers, at the moment you are taking the advice of a bunch of people you have never met
Maybe I work for a direct competitor and am just trying to screw with you...
:-P
 
@Fabien you need a development environment on each developer's box (a VM, preferably). Staging box could be a web-facing cluster of VMs or a single box with virtual hosts set up. Production environment would usualy be governed by client's requirements.
dev - to each developer, staging - shared for whole company, prod - external
 
@Fabien ^ sound familiar? ;-)
Then again, maybe he also works for a direct competitor and is just trying to screw with you...
If you had a sysadmin, you could go ask them if this is actually sound advice or we are just talking out our arses...
 
lol
Not familiar with VMs too much.
Attempts to use them at home always had me pulling hair out over abridged connections not working.
 
@Fabien maybe this helps vagrantup.com
also, I tend to just do a port-forwarding to my VM
so that 5432, 22, 80, 443 and 3306 on localhost actually point to the VM
it's extremely easy to do in virtualbox
 
9:59 AM
I think we've left this a little late then as they want an answer in the next 24 as to specs for what is our current goal setup.
 

« first day (1349 days earlier)      last day (3593 days later) »