« first day (2481 days earlier)      last day (2691 days later) » 

00:08
@tereško ikr. one of my fav channels
mornings
@Dereleased per worker, not just per app instance.
00:19
@Sara how goes your cunning plan to break PHP for 'no discernible benefit'?
 
3 hours later…
03:37
    <?php
//Database.php file
class Database{
	public $conn;

	public function __construct(){

		try {
			$this->conn = new PDO("mysql:host=localhost;dbname=clapdust_db",'root',"");
			// set the PDO error mode to exception
			$this->conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
			//  echo "Connected successfully";
			}
		catch(PDOException $e)
		{
			echo " " . $e->getMessage();
		}
	}

		function dataInsert($table,$data)
		{
			$fields = array_keys($data);

			$field_values= implode(',',$fields);
Error: Catchable fatal error: Object of class PDO could not be converted to string in C:\wamp64\www\clapdust\Database.php on line 24
03:57
@FélixGagnon-Grenier hu
sup
in JavaScript, 3 mins ago, by Félix Gagnon-Grenier
@EarvinNillCastillo if you wish to discuss that further, let's jump to php chat room, but at a glance, the $count = 0; increment to numerate the rows really is the same as using the much clearer $id[] = $row['column']; form. you should also declare $id = []; before the loop, in case there are no results.
@FélixGagnon-Grenier oh so you're felix also on js room lol
$result = $mysqli->query('Select * from masterdata where fdDate_Resigned IS NULL');
$count=0;
while($row=$result->fetch_array()){
	// $id[$count]=$row['fcEmpFName'];
	$id[$count]=$row['fcEmpFName'];
	$count++;
}

echo json_encode($id);
I have but one account.
Using procedural it works but I dont know why it dont work using PDO
as i said before, when im returning empid
it works, but when i get fcempfname, it returns null and if i return echo jseonecnode($id[1]) or any indeces, it works.
how come when the variable type i return isn't working?
04:01
please read the comment I cross posted here. after that, verify what is receiving the call. $id[0] is the row you want, directly, $id is all the rows.
you have to modify the code accordingly to loop over all the rows, not only expect one row
04:14
mornin
@FélixGagnon-Grenier let me get back to you. ill just have my lunch. :D
Good morning Everyone
04:30
morning room
Wes you look so cute <3
mornin Joe o/
??
disgusting is the word
04:39
Nope i am serious
hey joe
@WesStark you didn't see me :P
it's just our faces :B
:B
@Trowski i'm not entirely sure what you mean. why would i even disable...?
04:53
today started too early
05:43
hello everyone
o/
all well?
@FélixGagnon-Grenier hi
user8046090
Hello all, i have a small issue..
user8046090
i like to change wp-admin url of wordpress to something else
user8046090
without plugin
user8046090
is anyone have idea about this ?
05:56
@ChiragDaxini i don't think anyone will help you here
@ChiragDaxini everyone here are just egoistic, have knowledge but not for sharing and those are active in this room are just doing their personal team stuff in this group
4
user8046090
If anyone is having any idea then do lemme know
we don't use wordpress
it looks like a plugin is the simplest option
why can't you use a plugin, and what's the reason you want to change that url ?
06:02
loyal person is here
The Joe
i wanna build regex can anyone help me?
in this url domain can be anything, type is fixed i have aroung 7 type
id can be number
@SagarNaliyapara after insulting everyone here - no
and name can be anything
@SagarNaliyapara why should anyone help you, you just insulted everyone in the room ...
@SagarNaliyapara Use PHP Routers
06:05
@AbrarAhmed i wanna build regex for google analytics filter
@JoeWatkins because i love you all
:D
learn how to talk to people....
o/
\o
06:13
hello
@SagarNaliyapara check your attitude at the door ... egotistical is insulting everyone, then asking that same group for help, like you deserve it ...
you don't ...
~([^\/]+)\/([^\/]+)\/([0-9]+)~
might I suggest that you get familiar with regex, since that's a really simple pattern ...
it would serve you well to learn how it actually works, rather than asking the interweb for the pattern you need whenever you need something new ... which is likely what you are doing now ...
@JoeWatkins Yup i'm learning that now, Thanks and sorry for all :)
star of shame incoming
06:30
why i can't return array of string?
$id= array();

$result = $mysqli->query('Select * from Employee');
$count=0;
while($row=$result->fetch_array()){
	// $id[$count]=$row['fcEmpFName'];
	$id[]=$row['empname'];

}

echo json_encode($id);
when i get empnum, seems to be working, but when string, it is not working unless i echo id with specific index.
--- ignore me ---
@WesStark tried printing $id[0] when row is empname and it's working. but when it is in terms of variable of row empname, it returns null
i have no idea what the error could be
@WesStark also no error in network tab.
06:33
do var_dump() all the things
returns all data i needed when i do var dumop
what is happening
after
index 127, more elements...
null
i have 1800 data
are you saying you're getting null from json_encode? if so, check json_last_error_msg
yes, in terms of string
how to placed json_last_error_msg?
or how to insert it in my code
Malformed UTF-8 characters, possibly incorrectly encoded
this is the error
figured. yeah, only utf-8 strings are supported by json_encode. what encoding are you currently using?
im not so sure @PaulCrovella.
sorry idk.
06:47
okay. do you understand what I mean by "encoding"?
that! is what i do not understand.
I only searched in forum how to output array from php to ajax.
and the result says use json in datatype ajax.
then use json encode in php file to send it to ajax
okay. So I recommend you read this article joelonsoftware.com/2003/10/08/… - it'll help you understand the problem better. And for the practical "do this" sorta thing see stackoverflow.com/questions/279170/utf-8-all-the-way-through
Thank you @PaulCrovella. Will read this now.
you're welcome
mysqli::set_charset(): Error executing query after inserting it.
07:07
@Trowski fwiw I don't mind breaking apis in this phase of the project
I agree that from a user PoV a pool is the same as a connection
yohaaaa aaa
mo to the mummy lovin' in
bitches
o/
07:18
\o
morning
bob
bob
Morning all, I'm getting a 502 Bad Gateway when trying to send all users an email it's only like 300 rows. why might this be happening? p.s not getting any errors.
502 is sent by nginx, there are errors in php log from fpm
sending 300 emails in response to a web request doesn't sound like a good idea whatever ...
think about using a queue for that sort of thing ...
bob
bob
@JoeWatkins how would one do that?
07:35
Which part.
Also google.
36 degrees today -_-
posted on August 01, 2017

New Cyanide and Happiness Comic

Hi chat, How to make user to point directory where i want to write data to file. In other words I want user to give me first parameter to fopen() function.
I want user to give me first parameter to fopen() function by OS interface.
you don't want to do that
why?
"Save file to"
whats wrong with that?
allow a relative path
you must verify that the path is safe somehow before you open it ...
wait
you want them to write to a specific file on your system ?
why do they get to choose the file name, and what if two users choose the same file name ?
that's a detail that should be hidden from users I think ...
07:49
!!dad
Dad, can you put the cat out? I didn't know it was on fire
:P
@JoeWatkins "Save file to user filesystem location"
Anonymous
07:58
mornin
morrrrrrning
'nin
has everyone seen game of thrones e3?!
Anonymous
nooooooooo spoilers please
ah!! i would never!
that's worse than adultery.
Anonymous
08:01
@PeeHaa noo, moment
Anonymous
@PeeHaa linky?
Nice day of sailing yesterday?
Cyber crimes div. was here :P
Someone gave ~€4k monies on the phone... when the sms said their insurance fees were due or something like that
mornin
o/
08:14
I'm trying to implement short-closure syntax and have a question related with PHP VM do it need to emit new OP type using zend_ep_emit or it should be achieved other way?
\o
@MadaraUchiha google translates that original as "a rainbow" - is that right?
גשג?
גשג isn't a word
Huh
קשת is a rainbow (and also a regular bow)
languages are hard
08:28
@PaulCrovella you mean hieroglyphics?
@Ekin Cyber crimes aye. Did you give up the data willingly?
Yeah
It's not like you have a choice :P
Did they have a warrant?
do they need a warrant there?
Active investigation. The guy did this to multiple people. They didn't need a warrant, they needed to confirm the national ID of the sender on our systems vs theirs.
08:39
that sucks, hope those people can get their money back
I have read of some crypto currency hacks recently. guy lost millions but had his tokens stored on a local wallet -_-
Another guy lost about half a million
USD that is
Well, technically he only lost what he bought it at, but current value is over 1 million
Anonymous
!!wotd
anoesis: a state of mind consisting of pure sensation or emotion without cognitive content.
Have you guys heard about PHP on Chip? phpoc.com/index.php They are saying this is embeded PHP interpreter, but actually why does it even use PHP name if this what they sell isn't even running PHP but their own language with similar syntax but differs much?
probably for the same reason "javascript" is named that - piggy-backing on the success of another language for marketing purposes
Anonymous
> Also, I don't like excessively breaking code out into methods. I like to keep my class namespace tidy, so I don't want to clutter it with methods that only exist to aid another method. I like my methods to be used more than once by more than one caller, or be public methods.
Anonymous
shut up, shut up, shut up
He seems to think that good code is just about readability.
That "brain power" is mostly eliminated by IDEs that can read good code.
omg again this visual debt thing
09:01
:P
it's from laravel community ... what the hell would you expect
Jul 18 '11 at 16:37, by Gordon
Comments are the deodorant on code smells - Robert C. Martin
yup
I couldn't remember who said that
actually, Kent Beck said it iirc
but it's quoted in clean code
May 24 at 9:19, by Gordon
> Comments often are used as a deodorant [on code smells]. — Refactoring [page 87], Martin Fowler and Kent Beck
or something like that. would have to look up the page to see who said it
for some reason I thought it was from Kevlin Henney (but this explains why googling it gave me no results)
09:10
@JayIsTooCommon I think that's a fair approach. They break apart the method if they need to reuse it from another client or when it's API. Else they don't bother. Nothing wrong with that. It's basically deferring method extraction to a later point in time.
I like doing it right away. Might be yagni
is writing inline comments code smells?
@Gordon or simply that small methods are easier to read
Anonymous
No he's not.. ignore that.
Anonymous
@Gordon it sounds like he's all for long methods that don't need logic separated because 'it's only used once'. I'll re-read when I get a chance but that's the gist I got.
09:16
How do I escape a \ for a string? I have: $path = "$this->pageFolder/$slug.md"; Which creates the following path: C:\xampp\htdocs\sandbox\src\..\pages/Homepage.md but I need to use \
@FlorianMargaine they are on their own, but not necessarily when composed. Good names help, but the whole still can be harder to grok when you need to jump around in code to get what's going on. Having just one linear function can be easier to follow.
@Gordon I never bought that argument
@JayIsTooCommon yeah, sounds like it. I don't think its necessarily wrong.
ah sweet. One other problem, I'm using Auryn and defined the following variable for a class: ':pageFolder' => __DIR__ . '\..\pages', (snippet), I'm expecting the \..\ to escape to the parent folder, though i've echoed my path and it's just appending to the path
Anonymous
09:19
@Gordon usually smelly and unreadable though, imo
@Daruchini why would you expect that? it's just a string
Because it's being used as a directory. Anyway, echoing it just printed the string but executing it worked.
a string should know how you're intending to use it?
sorry, im not following?
i'm using file_get_contents on the string
The problem was I was echoing the path expecting \..\ to go back to the parent folder, but you're right. Why would it do that, it's just a string
moronings
09:37
Good morning
@FlorianMargaine @JayIsTooCommon I think it largely depends on the size of the chunk of code. A hundred lines of code might be easier to understand than the same block chunked into ten methods with ten lines each, simply because you can read it from top to bottom and get the picture. A thousand likely not so much.
Anonymous
@Gordon yeah agreed, it's contextual
Wow some receptionist in Poland sended an email without BCC to 204 hotel guests, some of them reported the case to the prosecutor's office. Then the prosecutor's office sended an summons including all 205 persons full name and surnames including receptionists family - that all was in the name of defense of personal data. :)
guess what I'm doing today
formatting HTML?
Anonymous
09:39
emails.
winner
taking screenshots
@DaveRandom indent hadouken?
Anonymous
@DaveRandom condolences
what is way to restrict erasing data in csv file and when you insert data for do upload is restricted like 6 lines and all completed with the first id is autoincrement
?
any idea helpful is welcome
09:40
youtu.be/sEQf5lcnj_o best piano cover ever... :D
@DaveRandom is it something to do with the interweb ?
@ChristopheCosta I'm sorry but I do not understand the question, you need to explain more about the problem
@brzuchal It's a mystery to me why email clients after all these years don't give a warning when you try to put more than three recipients in anything but BCC. This happens every day in every company.
@DaveRandom, first
@JoeWatkins In about the most 1990s way possible, yes
09:42
also moin new peepz
@DaveRandom that was my favourite decade
@DaveRandom hadouken
the best way to restrict to not erase any data in file csv
?
@tereško that's what I said!
I was both a child, and a little adult ... it's really been downhill since the 90s ...
09:43
woops
@JoeWatkins for drugs and music, sure. For communication technologies, not so much.
@Gordon damn
@DaveRandom I couldn't have communicated if you had wanted me too, I was too busy having fun ...
I wasn't even born in the 90s
@SheikYerbouti that's pathetic
09:44
:|
@Gordon Good question
@ChristopheCosta what do you mean? Is this CSV file on your server or on a user's computer? You can't stop people from modifying files on their own computers. You shouldn't be using CSV files on your server for anything other than input and output
let's play a game, let's answer every question in chat today as if it's 1999 ...
@Gordon but the funniest was the prosecutor's office which sended summone with full names and surnames, so all of them retrieved emails and more...
CSV files are awsum, shut up Chris ...
Anonymous
09:46
yes, I was only 3 so I'll just scream at people.
@DaveRandom, You do export for your computer and you have only option to add lines in that file
when you do import you will only add lines to database
@JayIsTooCommon modus operandi for you then
so... what should I do?
Anonymous
@JoeWatkins just using complex words like, 'then'.
09:47
definitely use CSV files, or invent your own database format in flat files ... that's what the pros do ...
Anonymous
yo ekins
mainframes?
@JoeWatkins this was a valid form of communication in the 90s, right?
@JoeWatkins You mean, sqlite? :D
09:48
@DaveRandom that red-eye tho :P
@DaveRandom so long as one of you had hair like that, I believe so ...
ormin ekin
@SheikYerbouti A cocktail of cheapo film photography and marijuana
@DejanMarjanovic not invented yet, it's 1999
@JoeWatkins ftr the guy with the ginger afro still has a more-or less identical ginger afro
09:50
@DaveRandom high five him for me
has no one told him that he has a ginger afro?
@PeeHaa Guess which member of the team is not happy about having to conform to codesniffer rules for code formatting.
@JoeWatkins en.wikipedia.org/wiki/NATO_bombing_of_Yugoslavia sorry, can't play, in a shelter :D
@ChristopheCosta You need to work out how to determine which lines already exist in your database, by using some form of unique key. e.g. you might use an email address field. It depends entirely on what the data actually is and what makes sense in your data model.
@DejanMarjanovic shit
09:52
@JoeWatkins will do
@DaveRandom who even uses table these days?
@JoeWatkins CSV's uploaded by FTP.
Because fi to modernity.
Anonymous
@SheikYerbouti you clearly have never had to create html emails.
I'll accept... I never have
@Danack yes, definitely FTP, to production ...
10:05
Good morning everyone :D
Are prepared statements in a for loop better than bulk import?
Anonymous
those things aren't really related. What are you trying to do?
hahaha well i just want to confirm your yesterdays answer thats it :D I couldn't find any good article on the web on that topic.
Anonymous
what answer did I give yesterday?
@JayIsTooCommon god you are so egoistic today
Sorry wrong perosn.....my bad Your Common Sense answered yesterday this :codereview.stackexchange.com/questions/171660/…
Anonymous
10:10
@WesStark sorry, I just have sooo much knowledge that I'm not willing to share
i thought this was an help desk
Bascially I'm wondering if it makes sense to run the query in a for loop or to do it somehow via bulk insert.
Anyone had any luck in running PHPStorm scratches in docker?
@Danack :D
@JayIsTooCommon just go to one of our mailinglists e.g. news.php.net/group.php?group=php.doc.cvs
so beautiful <3
Anonymous
10:19
@PeeHaa we can do better..
10:34
@JayIsTooCommon any help?
@Arslan.H he's mostly correct.
as for bulk-insert .. well ... you might take a second look, why you think you need that
and how much of "bulk" there actually is - there is no point, if all you need to do is 4 calls in a loop
@tereško sorry didn't want to disturb you since you were on that 'don't disturb mode'.I'l need around 40-50 things in that loop max.
is that a common operation?
or some "admin task"?
Admin task
then it does not matter
making a loop is just easier
just make sure you run those in a transaction
10:42
I have integrated the transaction though the whole project almost now where i need it.Cool thanks sensei :D
mirror site for download can not reach direct – #75014
don't overdo it
when people get a new tool, the have a tendency to use it for everything .. in hindsight that turns out not to be the most productive thing to do
Thats for sure thanks for the help one more time
@Gordon Trying Bertrand right now for the first time
@Jimbo it seems to work. I saw you updated your profile pic on FB and grew a beard beard-ish thing bumfuzzle now.
10:54
Nah, that's just the shadow of the camera :D
so how is Bertrand?
bertrand as in bertrand.bio ?
Crash in spl_recursive_it_dtor() – #75015
Is it possible to make multiple virtual hosts for apache on port 80? I've created one for my site which sets the document root to a sub folder but now I want to make an additional vh which starts at the document root for phpmyadmin?
@SheikYerbouti yes
10:58
looks interesting
wtf
Even worse maybe is the getAll call
I mean you already have gotten them all
ah got it. Forgot to edit Windows host file
11:03
@PeeHaa you translated that from snake_case - was that intentional or automatic?
oh. The latter
I wonder how much of it is being fed directly into those 49,000 date calls
11:18
i got flagged in the game of thrones room, which never had more than 3 people connected at the same time
which means one among paul, fabor and felix did that. probably @felix. damn i hate that guy :B
Flags are so broken
when? i see no flag
anyone want to write the next php+mysql cookbook for packt? one of their guys just asked me and I declined, but he wants to know if I know anyone interested
Chapter I - installation
yum install postgres
@PeeHaa I forwarded your contact data
11:21
haha
:P
That backfired
what do cookbooks like that even cover? i've never read one
Are there any role based access control libraries people use here? I've browsed Composer but the libraries have a small number of downloads. Unsure if this is something that is normally implemented from scratch
yes, I have one, but ATM it is closed-sourced and I haven't got around to publishing it
Anonymous
11:35
@tereško is that a branch off of palladium?
I'll try give it a shot then. I've just finished going through a tutorial setting up a SOLID application, so looking to extend
@JayIsTooCommon nope. It's a separate project (but they are compatible)
authorization and authentication are different problem-domains :D
@Daruchini all of the details need to be written by hand really - as all of the rules are business/domain rules rather than standard rules. the Zend/ACL is kind of okay as a base library, but yeah, it leaves you to implement 95% of the code.
Yeh that's fair enough. I'm just playing around with it at the moment, nothing for production. Still learning how to structure solid code, struggling haha
Anonymous
11:55
@Daruchini well as long as you Google well first, keep asking away in here. Some of the best programming advice you'll ever receive... Unless it's from @WesStark, ignore him :)
Yeh I had my suspicions about him...
3
What about me? I'm a suspicious character
I'll nick anything, me
Anonymous
typical Manc
@Daruchini really? am i that bad?
No you are not
You are worse
11:58
@JayIsTooCommon silence, you probably don't even get that reference
Anonymous
@WesStark guide.room11.org rule 2
@JayIsTooCommon i've just been flagged for this, but you are such a cunt
Anonymous
:D <3
hahaha
bloody kids with their own contemporary subcultures
Anonymous
11:58
@WesStark Please come to NW..
Anonymous
@DaveRandom nope.. just thought you were being honest..
bloody immigrants, stuffing their low-riders with free healthcare and... snow
@JayIsTooCommon do you really want to get punched in the face that bad? we can arrange @PeeHaa to do that for me

« first day (2481 days earlier)      last day (2691 days later) »