« first day (1166 days earlier)      last day (3782 days later) » 

Can anybody who is less stupid than me tell me why when I try to exec this in PHP it does not work ™, but when running the same thing from cli it does work (on windows)?
 convert C:^\Websites^\FlareGramster^\images^\input^\input.jpg -resize 100x100! C:^\Websites^\FlareGramster^\images^\input^\output.jpg
 
Permissions?
I had the same issue adages ago
 
permission on the executable?
 
Or the user running it
 
@PeeHaa Or maybe 'convert' isn't found on the PATH for the 'user' that is running PHP?
Any error message?
 
5:05 PM
Yeah path was an issue for me too
 
have I missed anything entertaining ?
 
Atheism talk
 
radiometric dating
 
@Danack No error messages. Return status 4 though
Will try full path to executable
Ok that did something. I get a return status 1 now
Still no output though :(
 
@MadaraUchiha oh come-on. no need to waste votes on that one.
 
5:14 PM
Hmmmm nothing I try works :P
 
@MadaraUchiha only questions that religions have answered start with "why hate ..", "why harm .." and "why kill .."
and the answers have been wrong
 
@tereško Not true. That's extremist thinking.
 
yeah .. forgot one "why fear .."
 
At the very least, Judaism always teaches about love, etc. Not about killing or dealing with heratics.
 
Any other paths in there PeeHaa?
 
5:15 PM
@MadaraUchiha you really should read carefully your own religious book
 
@tereško My own religious book should be treated as a history book, at best.
 
Assume convert is full pathed now
 
Every people had its wars.
 
@MadaraUchiha I've seen a fair share of violence in the torah
 
@Jeremy Read the rules it teaches, not the history of the people.
I can find bloody useless wars in any people's past.
 
5:17 PM
 
@Fabien nope. This is the complete command and inject into exec:
C:^\Program Files^\ImageMagick-6.8.7-Q16^\convert C:^\Websites^\FlareGramster^\images^\input^\input.jpg -resize 100x100! C:^\Websites^\FlareGramster^\images^\input^\output.jpg
@Jimit Why are you double posting?
 
Don't get me wrong, I'm an atheist. But I don't give a crap about other people's beliefs, and I dislike people who like to speak without knowing the subjects in which they speak of.
 
What about executing something else to see if that works fine?
 
3 messages moved to Trash can
 
I tried mkdir C:^\Websites^\FlareGramster^\images^\input^\test which works
 
5:18 PM
@PeeHaa exec("sudo {$_GET["hackme"]}");
O, wait, you're on Window, right?
 
Ow @tereško is owner now :) gratz
 
In that case, just exec($_GET["hackme"]) works fine :D
@PeeHaa For quite a while now, I believe.
 
PeeHaa what about adding a file to the output dir?
 
@MadaraUchiha ah i see
@Fabien What do you mean? file_put_contents?
 
5:21 PM
Yeah, just to create a file in the out dir to test
 
I already put a file in there when the thing starts. It gets a file from the web and adds it to the dir
 
Definitely gets it?
 
Yes
 
I always disliked exec() :(
 
5:27 PM
Yeah I can see why. The combo with windows seems terrible
 
Felt to me like there was a missing layer between the web and exec() to help secure these kind of things
 
Aaaaaaaah yes finally
 
What was it.
 
A combination of everything you people said + the fact it wetn bonkers on the space in my path to the executable
 
5:37 PM
Heh. Does it feel safe?
 
I've used ye old Progra^~1 instead
 
morning everyone, oh what a horrible day =o(
 
Morning pony
 
Hi cryptic
 
What's wrong?
 
5:37 PM
it's x-mas =o( not allowed to sleep-in, bah humbug!
 
Sure you are...
 
1st world problems
:-)
I'm going to order me a nice christmas meal...
 
@crypticツ you lazy. I worked whole day while you sleep
 
YES! I can haz food
> Je ordernummer is HXIAZM
 
@AlmaDo gotta pickup mom, do some last minute grocery shopping, cleaning, then cooking all day. I did get myself a bottle of white wine =o) I know my mom will be going all religious on me about doing so, but it's the reason I got it to drown out with her Jesus talk.
 
5:46 PM
lulz
 
O_X
 
6:23 PM
@PeeHaa how did the adventures with using nginx as a proxy go?
 
@PeeHaa not IHAZFUUD ?
how can I get that racing helmet?
 
6:54 PM
@RonniSkansing I think I forgot about it. Not sure :P
 
@PeeHaa ok. Merry xmas ;)
 
:D
 
Does anyone know if there is a nice status-image provider for packagist package infos (like installs, stars) that can be placed into readme.md files?
 
merry XMAS girls and guys :)
 
@PeeHaa thx a lot. you also know one for pear?
 
Hey everyone, where should I go to get better at OOP PHP after all the tutorials I can find are just repeating themselves?
 
:)
 
what those tutorials that you are talking about ?
it's a morbid curiosity .. but still ... I need to know
 
A couple on net.tutsplus. Killerphp. Tutorialspoint.
 
7:11 PM
@hakre Nope
 
lol
 
i have a sort of crazy idea.. lets say, user inputs a jumbled up text, and submits its, my app finds the actual word if possible, and if not possible, shows a few nearest result... like if the input is `ifrest` then the outputs would be, fine, forest, rest etc.
So lets say, i have a big list of dictionary words stored as a text file. Now the problem is i have to load the text file everytime a new request is made... how do i avoid that?
 
I'm sorry to break this for you (no really), but, @Alcapwn, those sites are quite dreadful when it comes to learning anything more complicated then "hello world"
 
That's what I was starting to gather. xP Any recommendations?
 
maybe this list .. but I am not sure how useful will it be for you
 
7:19 PM
@tereško +1
 
...
@Ultimater i am not quite sure if (1,2,3) means an array in C . but guess what , i found this: en.wikipedia.org/wiki/Comma_operator
 
@blackbee my mistake... thought that was an array
 
not a problem ..
so as i was asking, is there any way to cache the Dictionary.txt file instead of loading it in a var and referring to it over nd over .. or is it the only way that works the easiest..
Grr..
ok . crap idea.. forget it
 
7:36 PM
hehe
 
7:58 PM
@RonniSkansing What was it again. Proxy an original non https request to a https request right?
 
8:08 PM
there's this project on github, it's a fancy server api by the name of onion
we'll have some of that !!
I only got bare bones working, initial testing on phpinfo looks good ...
bout 4x what you get from apache basic setup ...
 
onion as in the tor infrastructure ?
 
no
(that's where I've heard it)
I thought it "sounds familiar, good name for networking kit"
 
:)
 
8:29 PM
Server Software:        libonion
Server Hostname:        127.0.0.1
Server Port:            12000

Document Path:          /index.php
Document Length:        57508 bytes

Concurrency Level:      8
Time taken for tests:   0.916 seconds
Complete requests:      1000
Failed requests:        108
   (Connect: 0, Receive: 0, Length: 108, Exceptions: 0)
Write errors:           0
Total transferred:      57646880 bytes
HTML transferred:       57507880 bytes
Requests per second:    1092.13 [#/sec] (mean)
that's phpinfo in a debug build with no opcache
debug+ts
 
Failed requests: 108 :)
 
yeah it's nothing like properly implemented
but that's pretty quick tho right ?
apache gets nothing like that in the same kind of circumstances ...
 
why are you benchmarking a debug build?
also, the problem with apache is not that it's slow (it's not that slow), just that you need a lot of experience to configure it correctly, so it can process more than a handful requests per second
 
I'm not, I'm valgrinding it really is the reason for debug
 
if you don't know much about apache config, you likely won't be able to produce a meaningful benchmark
Much easier to use nginx instead ^^
 
8:34 PM
what does that get ?
same sort of test ?
ab -n 1000 -c 8 http://127.0.0.1:12000/index.php

is what I used ...
I think it's quite clever, I'm hoping the author of the library can expose some stuff to make it less fragile
 
right now we'd have to parse the query string and whatever and that doesn't seem proper, since he's build a dictionary of parameters, it's probably somewhere accessible ...
 
8:47 PM
@glavic I've stolen your demo button stackoverflow.com/questions/20776404/… ;-)
 
8:59 PM
wtf my comment disappeared :|
 
@PeeHaa: hehe ;)
 
:D
 
What about copyright and so on? ;)
I didn't think of this, I also saw it somewhere ;)
 
Quick file a patent!
:)
 
In which country? ;)
 
9:11 PM
uspto
 
That doesn't apply for Europe
 
We don't care about patents that much over here do we ;-)
 
Nope ;)
 
ifaik software patents have been cancelled here - it hasn't changed anything though
 
9:21 PM
@PeeHaa "Het rijmt niet eens", how to say that in english :P ?
 
it doesn't even rhyme ;-)
I think :D
 
google translate says the same. I guess you're right
 
9:37 PM
^ the other cry for help by the same user.
 
Possible duplicate of this user's answer list. — PeeHaa 12 secs ago
;-)
 
9:58 PM
Hmmmm it looks like all comments which start with "Possible duplicate of *" gets removed ones a question in closed as dupe (even the manual comments) :(
 
@PeeHaa hehe :D
 
Can we test it out to be sure so I can start nagging on meta?
 
@PeeHaa: I have also noticed the same thing few days ago...
 
@hakre @Glavić Let me post some dupe question and can you post 1 manual comment with Possible duplicate of some so url to a user and add a real dupe so I can see if I'm correct?
 
10:01 PM
hi @Glavić! :)
 
OFC, why not. We can do auto comment with close vote, and then additional manual comment.
@hakre: heeej ;)
 
Yep it is gone @Jeremy
tnx
To the meta mobile!
 
@PeeHaa It may also be
 
@PeeHaa: kinda cool feature for auto comments
 
@Jeremy Yeah, but that means the design sucks ;)
 
10:07 PM
I really love websites like blooberry.com/indexdot/html/topics/urlencoding.htm - we need more html 2 or 3.2 culture in the web again.
 
:)
 
> NOTE: This converter uses the String.charCodeAt and String.fromCharCode functions, which are only available in Javascript version 1.2 or better, so it doesn't work in Opera 3.x and below, Netscape 3 and below, and IE 3 and below. Browser detection can be tiresome, so this will just fail in those browsers...you have been warned. 8-}
oh yeah :D
 
@hakre How did you land on this site? ;)
 
@Glavić I was enlighted :D
 
;)
 
10:14 PM
Fun aside, right now I'm debugging an issue with URL encoding (or the lack thereof), looking for a robust way to recover from wrong input so that the output is conforming the standards.
 
> All images are copyright 1996-2005 Brian Wilson
err... what images?
 
Just following the good principles of the robustness principle (be lax with input and strict with output):
In computing, the robustness principle is a general design guideline for software: :Be conservative in what you do, be liberal in what you accept from others (often reworded as "Be conservative in what you send, be liberal in what you accept"). The principle is also known as Postel's law, after Internet pioneer Jon Postel, who wrote in an early specification of the Transmission Control Protocol that: RFC 761: Transmission Control Protocol. Jon Postel (ed ), January 1980. :TCP implementations should follow a general principle of robustness: be conservative in what you do, be liberal in wha...
 
0
Q: Manual "Possible duplicate of" comments are wrongly removed when question is closed

PeeHaaWhen closing a question as duplicate the "Possible duplicate of" comment is automagically added to the question. However when adding such a comment manually: "possible duplicate of random text" that comment is also removed. To me it doesn't make sense that questions which to not point to a SO / ...

Probably will get closed as dupe, because I suck at meta
:P
 
Probably ;==))
 
3
A: Automatic "possible duplicate" links are removed even if the question isn't closed as a duplicate

Jeff AtwoodOK, the "possible duplicate of..." comments are only deleted now in the case where the question was closed as a duplicate. They are also not deleted if they have a non-null EditCount.1

 
10:19 PM
goddamnit
 
:(
 
asked Apr 15 '10 at 23:18 ?
 
I say keep the post up there though
It's time for a new stylesheet xD
 
@Jeremy BTW not a dupe
:-)
That's about something else
 
10:20 PM
@PeeHaa But still by design, from Atwood himself. I would acknowledge the answer in your post at the very least.
 
@Jeremy nice find!
 
`I just made it so the comments are not deleted if they have a non-null EditCount (that is, the little pencil icon) – Jeff Atwood♦ May 8 '10 at 10:32`
So comments won't be deleted if you have edited them...
 
Great now I need a userscript :P
 
And now it's gone
3
A: Do not delete *edited* vote-to-close auto-comments

Jeff AtwoodIf you don't want the comment deleted, make sure it doesn't begin with "possible duplicate of"

@PeeHaa As an answer to your most recent comment, looks like Atwood took a final word ^
 
That violates the Principle of Least Astonishment. How about not deleting the comment if it has been edited at all? That should be easy to check for -- just use the same check that displays the pencil icon. — Ether Apr 23 '10 at 1:03
hence my feature request ;)
It shouldn't matter whether it was edited or not. Just do some sanity check
 
10:40 PM
The principle of least astonishment (POLA/PLA) applies to user interface design, software design, and ergonomics. It is alternatively referred to as the rule or law of least astonishment, or the rule or principle of least surprise (POLS). A textbook formulation is "People are part of the system. The design should match the user's experience, expectations, and mental models." What is least surprising may however depend on the expected audience, e.g. end users, programmers or system administrators. In more practical terms, the principle aims to exploit users' pre-existing knowledge as a way...
In computer science and automata theory, the state of a digital logic circuit or computer program is a technical term for all the stored information, at a given instant in time, to which the circuit or program has access. The output of a digital circuit or computer program at any time is completely determined by its current inputs and its state. Digital logic circuit state Digital logic circuits can be divided into two types: combinational logic, whose output signals are dependent only on its present input signals, and sequential logic, whose outputs are a function of both the current i...
 
If I have a class, which is not initialized and no methods are called from this class, does that affect the code's performance?
 
smh
 
@CvetomirLazarov Do you care?
 
no
 
@CvetomirLazarov why not use simply a namespace with functions ?
 
10:54 PM
@CvetomirLazarov do you mean that the class is not used at all? then you would not need to define it ...
... which leads me to say that writing code that is never used is dead code and it results in sub-optimal performance when maintaining the codebase. So yes, it affects (your) performance.
but not the codes performance. As the code is dead, performance technically is not affected at all.
does that answer your question?
 
-2
Q: I created Stack Exchange and Jeff Atwood took the credit

John"As we all remember Jeff Atwood and Joel Spolsky founded Stack Overflow together back in 2008. Joel or Spooky as we called him never did much on the project, neither did Jeff Atwood in fact. I was the one who created Stack Overflow. Have you ever tried looking up the first users on Stack Overflo...

lulz
 
sad, it's gone already. that could have evolved in such a great story.
 
user1607528
11:14 PM
they deleted it right away haha
 
user1607528
 
@Muhammet I don't see how that is any different from ads
 
user1607528
yeah
 
lol, they got a penalty. so what? happens to each spammer sooner or later. especially if media raises attention which was exactly what happened ca. 3 days ago through hacker news.
bonjour m. baquer :D
 
@hakre If anything it is only free publicity
 
11:23 PM
@PeeHaa they have a good agency obviously.
 
:-)
 
Evening folks, and a very merry Christmas to one and all, or a merry Halloween to mathematicians among you
 
@hakre lol if that would be a ms I would not fork it ;)
 
@PeeHaa you catched me in a typo.... :~
 
Evening @MarkBaker. Merry Christmas to you too :)
 
11:25 PM
@MarkBaker I don't fully get the joke about Halloween ... but don't ruin it :D
and happy X-Mas.
 
25/12 == 31/10
25 base 12, 31 base 10
 
base 12. that explodes my head.
 
hehehehe
 
I once tried to knock onto base 63 and failed.
but lets not get depressive
@MarkBaker: Have you seen the presents for Christmas this year?
 
Presents for Christmas?
I've been trawling through Derick Rethans advent blogs
 
user1607528
@MarkBaker i dont understand the meaning of what you wrote, what does it mean
 
Derick's posted a lot of internal stuff on xdebug and datetime, and some interesting stuff on geodata
 
on his blog?
 
@MarkBaker Did he also mention he screwed everybody over with hit non default timezone setting warnings? :P
Or with his ImmutableDateTimeBrainFart ;-)
 
@PeeHaa - at least the non-default timezone setting is easily resolved
 
11:33 PM
Yep most of the time
 
@Muhammet - which bit didn't you understand?
 
Wow two edits
 
user1607528
@MarkBaker what is that equation and numbers
 
@PeeHaa we share the code, we share the bugs
 
Open a bottle of champagne or just whiskey?
 
11:34 PM
hmm, good question :D
 
:P
 
is it already that late that whiskey is appropriate? I think no.
 
I don't mind drinking whiskey in the morning ;)
Does that make me a bad person? :P
 
sort of, yes :D
 
The data of Halloween is 31st October or 31/10 in dd/mm format; Christmas Day is 25th December or 25/12... 25 in base 12 is the same as 31 in base 10
 
11:37 PM
@hakre :D
 
Make mine a Raspberry and Lemon soda, off to get a fresh glass now
 
BTW in totally unrelated news. I just whipped up some prototype without an autoloader and it looks just freaking horrible:
    require_once __DIR__ . '/lib/Image/Process/Executable.php';
    require_once __DIR__ . '/lib/Image/Process/ImageMagick.php';
    $imageProcesser = new \FlareGramster\Image\Process\ImageMagick($settings['executable']);

    $input  = uniqid('TMP', true) . '.jpg';

    file_put_contents(__DIR__ . '/images/input/' . $input, file_get_contents('http://i.imgur.com/XTBwBhB.jpg'));

    require_once __DIR__ . '/lib/Image/Graphic.php';
    require_once __DIR__ . '/lib/Image/Image.php';
    $image = new \FlareGramster\Image\Image(__DIR__ . '/images/input/input.jpg');
 
user1607528
@MarkBaker thank you very much
 
Whatever did we do in the days before autoloaders?
 
I know right
 
11:41 PM
@tereško I have a base Model class which holds the connection to the database and some functions, which are used by all children classes, like a method for recording logs. I have methods, which extend the Model and do some other stuff, which are relevant just to those particular children classes. They are included in the executed php file, only if there is need to use them. My problem is that I have some other methods that I use often, but not in all children classes.
 
@MarkBaker that sounds tasty.
 
s/children/child
 
@MarkBaker well, we included the files?
 
@PeeHaa yea we were talking about something like client (https) -> proxy (https) -> remote (http)
 
@PeeHaa You mean a namespace?
 
11:43 PM
Nope ;) I mean that child classes sound much better :-)
 
@RonniSkansing requestable.pieterhordijk.com/nPd7o As I already figured it's easy to do :)
 
@PeeHaa i will check it out, might save me abit of time, thanks
 
Let me post my server config
 
By the way, what do you think about my problem? @PeeHaa
 
11:45 PM
@RonniSkansing pastie.org/8576020
@CvetomirLazarov I don't see what the question is
 
@PeeHaa If I have a class, which is not initialized and no methods are called from this class, does that affect the code's performance?
 
Are those helper methods specific to any particular child classes, or simply generic helpers
 
@CvetomirLazarov you have not shared what you think that makes this a problem.
 
@MarkBaker Not to all of the child classes, but most of them.
Shall I make a child class between them, which will hold those methods?
 
@PeeHaa yep can not get much easier then that
 
11:47 PM
@CvetomirLazarov no, you don't need that. keep the number of classes low.
 
That's why I love nginx :D
 
If they're dependent on instance data, and related to the children, then include them in the parent class.... the actual code won't be a big memory hog even when it's included in children that don't need them
Or use two levels of inheritance for children that use the helpers
 
hello, i can store the characters: ç,ö,ü,ğ in the database, but when I try to store "ş" it gets stores as a S... Can anyone help me?
 
@y451n welcome to the world of character encodings.
 
@MarkBaker But @hakre said that I should keep the number of classes low.
 
11:48 PM
@y451n I have some dupes for you somewhere
 
@y451n - what charset is your database table?
 
hi, thnx all
 
@CvetomirLazarov that is a general advice. perhaps not that specific to what you ask right now about.
 
@mark
@MarkBaker utf8_turkish
 
188
Q: UTF-8 all the way through

mercutioI'm setting up a new server, and want to support UTF-8 fully in my web application. I have tried in the past on existing servers and always seem to end up having to fall back to ISO-8859-1. Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL and...

 
11:49 PM
@Cvetomir - don't create unnecessary classes, but create as many as you actually need
 
@CvetomirLazarov you will create more and more classes over time anyway :)
 
So 2 levels of inheritance is okay?
(Because I cannot extend multiple classes in PHP)
 
I don't see why not
 
Which is not really a bad thing
 
An alternative would be using traits
But I don't like traits personally, or the abuses that I see being done with them
 
11:51 PM
anyone got any clue, what can I do :(
 
There is only a very very narrow usecase for traits
@y451n I just linked you the answer
 
oh sorry
 
Or, if the methods aren't directly related to your child classes, then you could simply create a helper class
 
@y451n are you looking at the result inside a mysql session? or in the browser?
 
it's in aspx, don't know if that works the same as in php ;p
 
11:52 PM
I will make two levels of inheritance and I will include the file with the middle child class, holding the helpers, and then include the child class. But that makes 2 include functions. Doesn't that cost memory, too?
 
Lol at this
Note that MySQL does not speak the same language as everyone else. When MySQL says "utf8" it really means "some weirdly retarded variant of UTF-8 that is limited to three bytes for god knows what ridiculous reason". If you really want UTF-8 you should tell MySQL that you want this weird thing MySQL likes to call utf8mb4. Don't bother saving on the "WTF!"s. — R. Martinho Fernandes Apr 9 at 9:21
@CvetomirLazarov You are worrying about totally wrong things
Readability, maintainability and testability comes first
 
@PeeHaa depends on the mysql version. they fixed that some time ago.
 
@y451n you have to check the output directly from the mysql server, what if you the encoding goes wrong in php or in the browser?
 
If you really hit a bottleneck. FInd out what it is and fix it
 
@PeeHaa Maybe you are right :)
 
11:54 PM
@CvetomirLazarov helpers should never be inherited. make them a class of their own. (as written, you will end up writing more and more classes anyway :) )
 
@CvetomirLazarov reconsider the responsibility of the class called model...
 
@RonniSkansing but its weird that öçğü is working, but only ş goes wrong
 
and reconsider a new name =]
 
@hakre ah good to know. Still mysql sucks for things like this
 
@y451n in the mysql result? or in the browser?
 
11:54 PM
:-)
 
@RonniSkansing in the mysql database,
 
@CvetomirLazarov You might find this interesting
 
@ro
 
@PeeHaa I'm checking it out :) Thanks
 
@RonniSkansing its saved as ''S'' while I write ''Ş''
 
11:55 PM
@y451n which version are you using, i want to try it local
 
@y451n how does the data inside the database look like? is the transformation on the insert operation or later on when you select data from the database?
@y451n saved or retrieved?
 
@RonniSkansing phpmyadmin 4.0.4.1
 
@y451nI am asking for which mysql version you are using
 
@RonniSkansing sorry: 5.6.11
@hakre ehm
 
np
@y451n you are using utf8_turkish_ci ?
 
11:58 PM
@RonniSkansing yes
utf8_turkish_ci
 

« first day (1166 days earlier)      last day (3782 days later) »