« first day (1310 days earlier)      last day (3863 days later) » 

00:01
@LeviMorrison I do, but I'm ignoring the coversation. Nothing has changed. No point in paying attention...
Hey guys. I'm doing this class assignment to ask a web developer/programmer questions about how they got where they are, typical day at work, etc. Any of you mind helping out a student? (I'm an aspiring web developer/programmer)
as far as typical day at work, I never have a "typical day" :-)
@ircmaxell Thanks!! I'll read through them :) Ah.... I see....
@ircmaxell Thanks for sharing! It's also nice to know the story of people who have more experience in the field.
If anyone wants to answer some questions, I put some questions on pastebin: pastebin.com/jznSz5fg Thanks :D If you want to email me, you can send stuff over to [email protected]. I'll be on here for a while, though!
00:11
why not make a google form?
Oh! Right!
Good idea! I'll do that. Thanks :D
00:27
Okay, I made a form for the interview: https://docs.google.com/forms/d/14-3pBSwg8ouKvsm25A_ScQGN0FsiCvrIqWtWqx0jkLM/viewform?usp=send_form

If anyone can fill it out, that'll be so awesome! It would be fun to see all the different stories and present it in my class. Thanks :)
Hi. Is there anything wrong with this line if not (isset($array[]) && $array[] == $id) { ? I'm trying to search in an array.
@ManolisC.
Don't you need to iterate through and check for $id?
You mean like if not (isset($array['key']) && $array['key'] == $id) ?
user924016
PHP Notice: Use of undefined constant NOT - assumed 'NOT' in php
Or you mean to create a loop?
00:38
Well, I mean, is it giving you any errors?
I personally have no tried what you are doing, but I would think you need to loop through and check for $id in $array[]
if not, there must be a function in PHP that can check if an array containts the value.
(but that PHP function most likely has a form of iteration)
Oh I think i get it now
I'll try to iterate through the list
Until now it gives me a blank page
user924016
Add error output, set level to strict.
user924016
Did you notice that the "not" is not defined constant or anything in php?
Oh, wow, didn't notice.
Yeah dude, don't use the keyword not
just use ! or something.
unless he/she is not using PHP/ standard PHP.
00:42
wow i used not
bit of python there
user924016
@KevinTomiyoshiYang what do you mean?
@Ronni He said he kind of put Python in there. I was saying how it could be possible if he/she was using some kind of scripting language that could become PHP later on (not the best thing to do though. not sure if it even exists.)
user924016
I think he was reffering that he accidently stuffed some python in there =]
user924016
Anyways I am off to bed, nn
@RonniSkansing Oh hahaha. Okie dokie! good night ronni!
@ManolisC. Does it work?
00:54
Yes. I'm not getting a blank page now. But the big issue is still there
@ManolisC. What is the "big issue" ?
Let me update the code on the question so you can see whats my issue
Here it is
1
Q: PHP cookies, add more values to atribute

Manolis C.I'm trying to implement the following feature. When someone reads an article, I want to add a cookie that stores the article id so I can use this in another page. My issue is that if the user sees another article, then the cookie is rewritten so the old id is deleted. I want to keep in the cookie...

I think the problem is at if (!$array[$i] == $id) {
Where i'm trying to see if the id exist in the array already
It nevers passes through
Oh
try if (!($array[$i] == $id)) {
not sure if parenthesis helps, but it surely does in other languages.
Hmm i think it passes now
did that fix it?
01:02
But still not working 100%. Because it overwrites the previous value
hmmmm
what previous value? can u tell me the variable name?
Sure give me 1'.
I got an idea
k. Btw, you shouldn't do $array[] = $id
I mean, I that'll override the whole array maybe. You should append $id to the array.
you mean array push?
yeah
It you want to add $id that doesn't exist, you should maybe array_push it to the array
That way you don't need to feed it a counter variable (so no need to do like $array[i]. Just use array_push()
01:08
hmm let me try it
Hmm ok i'm completely lost now
lol
lol did you update your code?
Doing it now
Btw did you understand what i'm trying to do?
I think you are trying to add an id to the array if it doesn't exist? So you have a cookie, and you make that an array, and you check if the id of the doc exists?
if not, you add it to the array
if there isn't a cookie, you make a new array, and add the id.
Yes
Exactly
OKay. I see a bunch of possible problems in your code.
well not problems...just...suggestions
For your case when you do not have a cookie, when you make a new array, maybe:

$array = new Array();
Not sure if important.
01:15
I updated the question with my current code
Also, assigning $array[] = $id; could work. I'm not too clear. if it doesn't, you can do $array[0] = $id;
kk
Hmm, when you create a new array, you don't need to use array_push() because there will only be 1 id
and the following logic will end up following your "Cookie exists" logic
just do $array[0] = $id;
ok
updated link
cool.
Btw, you can check your array by outputting it's stuff to see if the cookies were successfully. You can pass the PHP stuff to Javascript and console.log() it or something.
*cookie arrays
I think the issue is still in the detail page
and in the iteration
even though the id exists, it still adds it to the array
01:24
So it kinda reads only the first item of the list
because if you reload the first item of the cookie it does not adding it again
Oh I see. It's quite simple I think
You are not iterating correctly
First, you are iterating through $array, and you check each time if it's != $id
That's your problem right there. There WILL be cases where $array[i] would != $id
even if the $id already exists in $array. If you want your current logic to work, your $array would need to have the same $id for every single one. That's not what you want :)
to be honest i didn't get that
You mean what I said?
Okay
I can explain
01:29
Btw the code
say, we have $array = [1,2,3];
You want to check if 3 exist in $array.
You iterate through $array
First iteration will be $array[0], which is 1.
1 does not equal to 3.
Your logic says if 1 does not equal to 3, you add $id
yes. but my current code adds it even if it exists
Yes. That's what I mean.
I'm pointing out where your error is exactly:
your logic says: if !($array[i] == $id) then you add the $id to the array
the thing is, in many cases, your $array[0] or $array[1] will not be equal to $id
so you add $id even though $id already exists.
hmm i think i get it now
what I think would work (but could not be the best solution)
01:32
but not getting how to fix it
is to do this:
$exists = 0;
if($array[i] == $id){ $exists = 1;//you can do something if it exists}else{...}
or you dont even need an extra variable. I'm just giving an example.
so that it will exit the iteration?
actually
what you can do is this:
$exists = 0;
for($i = 0; $i < count($array); $i++){
if($array[$i] == $id){$exists = 1;}
}

if(!$exists){
//do your stuff here
}
I updated. I prematurely pressed enter.
01:40
let me try it
kk
There might be better solutions, but this one is off the top of my head.
well unfortunately nothing
still keeps adding the values
i think the problem is in the iteration
because it works for 1 value
but not for more than one
yeap. i see that the iteration stacks when a second element is added
well, I mean for sure, the previous you did wouldn't work
you just need to check if $id exists. If not, you add $id
your previous logic said if ANY element in $array isn't $id, add $id to the array, which isn't right.
you need to check if $id exists, do something. else, you do something else.
01:57
i'm still trying to figure it out
okay. Update your pastebin and share it here when u want.
well i'm still working with the iteration
02:13
I updated the question
I think the iteration is correct now
But i'm getting a blank page
@ManolisC. check out in_array() or array_search()
I tried in_array() but i was getting a blank page too
did you turn on error_reporting and check your error logs?
i've just set it to E_ALL
When you say "blank page" do you mean a white screen? Or just no results?
02:17
white screen
ok fixed the white screen
well that's a PHP problem. There's an error in your code somewhere. You cannot check for error reports?
Oh okay. What was the problem?
forgot one $
@ircmaxell in array did what i exactly wanted
yup :-)
i was working on both pages (list and details) in the same time.. so that's why I couldn't make it work.
Had to fix each one seperately
Ok! Well glad it worked out.
02:29
Took me a bit long but finally
hahaha. I'm new to these chats. This is quite fun!
02:47
Fun is prohibited here.
4
03:03
do you know a good company to do email blasting?
user652649
sup!
Guys, what name you like best for a hosting company?

- criatweb.com
- piggyhost.com
criat = ?
reminds create / creativity
in portuguese those words starts with "cri"... criar / criatividade (I'm brazilian)
I like piggy better
piggy 2014
he will save us from doom.
*or she
03:17
so what type of hosting?
this is my current website
I'll rebuild it to look more like uk2.net
@LucasB prepare your servers. You'll have a surge of traffic suddenly
https://github.com/pigeonhole/java_image_filter/blob/master/filter/ConvolvFilter.java I wrote it a few months back and now I cannot determine why I wrote it.
Why am I like this!! :(
03:39
@ircmaxell I cannot understand the public key private key concept. How does a message encrypted with one kind of key opens with another key to produce the same message!!
03:55
@shortCircuit Well from what I know, Public key VERIFIES stuff, and private keys CREATE stuff
@shortCircuit So, you private create a signature, but the public key can verify it without compromising your private key to other things.
@shortCircuit The flip side: If Public Keys CREATE stuff, and Private Keys VERIFY stuff, then you can kind of see where this could go wrong.
@shortCircuit So, think of Public Key as your house main door. Thin of Private Key as your door keys. Who would have your door keys? Maybe family, close friends, etc. Same idea
@shortCircuit I use my Private Key with your Public Key to go into your house.
 
3 hours later…
07:01
hey morning guys
@NullPoiиteя Good morning lol
@KevinTomiyoshiYang lol ? :/
@NullPoiиteя Indeed.
07:28
Morning'
today, I'm 2 years a member of SO...
07:46
@HamZa congrats
@KevinTomiyoshiYang thanks
@bwoebi Just write a patch for it ...
I don't understand how that's supposed to work (as in, how it's supposed to be implemented and what that will gain us) from the sample ^^
@NikiC I don't see bwoebi's post...???
@KevinTomiyoshiYang click the arrow
nvm.Wow.... long while ago
yeah hahaha
07:56
Morning
08:13
hello does someone know which is better
to download a file with curl or normal php
@user2327579 depends on your needs and what you mean by "normal php"
while(!feof($file)) {
fwrite($newf, fread($file, 1024 * 8 ), 1024 * 8 );
}
where $file is the file to be downloaded
and $newf is the file to be saved
do you want to know the curl implementation
also i want to download large files on my server
well
@user2327579 I would actually say cURL is faster than php
"cURL is faster than php" --- it's the most weird phrase of the day
depends if you are hitting or not an API
08:24
based on the php codes i've posted
out of context it looks like "black is taller than winter"
Morning
php could generate bottlenecks
and curl which one is faster
@DevStarlight why do you think so?
08:25
because while trying to execute the codes i've posted on files say 700 mb i could not download the whole file
I did not try with cURL
"could not" is not the technical explanation for the issue
@user2327579 max execution time problem?
@user2327579 Most likely rather a server config issue
nope not execution time
guys don't try to argue with them )))
php is slower than curl
that's it
08:26
^ that
i've set it to 0
gotta do something useful...
@zerkms even though i'm fan of php, my teacher told me cURL response on server is higher than php
by could not i mean that if for example i'm downloading a video of 700 mb of 1 hr 30 mins i've got only 40 mins of video
08:28
" my teacher told me cURL response on server is higher than php" --- ohhhhhh
Morning @gordon
@DevStarlight if you want to be a good developer - start thinking yourself
not just blindly believe someone
Especially not teachers
@zerkms I guess I've chosen correctly then ^_^
@PeeHaa What do you do for dispatching your routes?
08:29
hehehehe
And yes I'm reflecting my own education on others
@Fabien I have a simple FrontController::run() in a try/catch to catch 403s and 404s
Think you'll add a dispatcher class to PitchBlade at some point?
And a generic Exception catch just in case
Yeah I can do that
08:39
@zerkms can u help me a little bit? I'm trying to find a solution for something I've been thinking to reduce my php sql file.
@HamZa You need to stop giving them out until you have 15k at least.
@zerkms I've posted here the problem stackoverflow.com/questions/23719878/…
@DevStarlight Don't make a master SQL function.
I have a little question about htaccess. How can I redirect all pages to one static address?
08:41
There is a reason there isn't one natively implemented, it's not practical or possible to cover all cases.
@IonicăBizău .*
@IonicăBizău redirect or rewrite?
e.g. foo.com/something ----> newfoo.com
okay thanks
40
Q: .htaccess redirect all pages to new domain

Yuval AdamWhich redirect rule would I use to redirect all pages under olddomain.com to be redirected to newdomain.com? The site has a totally different structure, so I want every page under the old domain to be redirected to the new domain index page. I thought this would do (under olddomain.com base dir...

08:42
@SecondRikudo @HamZa I don't have any experience with htaccess, so I don't know.
E_NOT_ENOUGH_GOOGLE
@SecondRikudo I don't want to modify the address of the new domain: olddomain.com/some/page ----> newdomain.com or olddomain/a/n/y/thing --> newdomain.com
@SecondRikudo heh, that bounty was strategic. I expected more upvotes, I got 9, so one to go to win the loss of my bounty
@HamZa You already have one from me, so I can't really add more
@SecondRikudo huh, which one?
08:43
But a smarter move would be to have me offer the bounty, and give it to you in the end of the week after it gathered all the upvotes.
@HamZa You already have my upvote on the answer.
@SecondRikudo ah ok, nice. thx
57 secs ago, by Second Rikudo
But a smarter move would be to have me offer the bounty, and offer it to you in the end of the week after it gathered all the upbotes.
heh, I would feel bad...
@HamZa Why? your answer is excellent
Also, I'm the one who suggested this:
08:45
@SecondRikudo hey nice answer btw :P
37
Q: Enhance moderation ability by encouraging excellent content

Second RikudoI have a proposal, I've been upholding it for quite a while now, and I'd like to share my efforts with the rest of the high (30k+) reputation users. I found a way to both encourage great content and potentially enhance the number of users contributing to the moderation effort we have. Some of th...

@NullPoiиteя On what
It seems that regex isn't the best place to gather 50 upvotes (unless it isn't a reference)
Also welcome back @NullPoiиteя long time no seen :D
Moening
@Leri monning
08:47
Btw, what a pain to migrate a prestashop site to another host...
@SecondRikudo thanks .... fighting with general knowledge now a days :D
So I used:

RewriteEngine on
RewriteRule ^(.*)$ http://ionicabizau.github.com/ [R=301,L]

Thank you so much!
@HamZa Welcome in the club of developers swearing php e-commerce solutions. :D
hehe
yeye now we can hammer php dumb question
08:51
@SecondRikudo So, you are worth of few upvotes from me. Hehe! :D
@IonicăBizău Please don't.
I already did.
Serial upvoting is not allowed. Only upvote my answers if you actually think that they are useful.
It's not serial upvoting, I vote random users, so the system will not catch me. :p
its still serial up-voting ... :P
08:53
OK, let's suppose that his answers really helped me. :-)
Who sent me LOL NICE message from my profile? :-)
@IonicăBizău Haha, it is a nice idea
You made it?
@SecondRikudo Yes I did. :-)
It's a NodeJS app hosted on heroku
Hello everyone!
What a wonderfull day ahead / morning!
@MikeM. morning!
@MikeM. a good day to workout :P
well, it's restday but I still need to work
no workout for me xD
08:57
@MikeM. morning
My workout will be horse riding in about a few weeks (every day)
is it hard enough to be called a "workout"?
anyways, have fun...
uhm by time ye riding horse is actually good for your leg muscles and for your back...
it's highly underestimated if you'd take a ride for about 1+ hour
True enough. But the rest of your body needs work too :P
@MikeM. i think it really hurts ... and causes back pain
08:59
@IonicăBizău I need to generate a token and let the user interact with my nodejs api. Do you have a module in mind that could do this?
@HamZa If you can call "typing furiously" as workout

« first day (1310 days earlier)      last day (3863 days later) »