« first day (2013 days earlier)      last day (3159 days later) » 

12:00
FUCK
my brain is drawing a blank
posted on April 20, 2016 by remicollet

* fix #176 segfault when apc.preload_path contains bad data

@tereško what's the problem?
I need to create a data structure for a directed acyclic graph
works fine for all sorts of graphs.. be prepared to do nasty things with big interesting ones though
@tereško Store in reverse direction, methinks. Reasoning about cycles is easier when you go from the edges
But that sounds like something that would already have an implementation somewhere?
12:10
@MadaraUchiha the list of edges (based on the two given vertexes) comes from a databases
there is no way tho actually know the order
though, I can get the root
@tereško Is there necessarily a root?
In that case, you can store in each node the route from the root to it, for validation purposes
hye
why this button did not function??

$pbody.='<tr><td> <input type="button" value="Marking Spec" onclick="window.open('.$row['product_spec'].')" /></td></tr>';
can anybody help me
hi guys have any one worked on cakephp 3.0 framework?
12:16
@MadaraUchiha I think I figures out what I need to actually implement, but it will be nasty
I have a function which returns an array. However, when I try to print the returned array, I get a number returned instead along with the actual array. What seems to be wrong here?
Anonymous
@SantonuBuragohain Just ask the Q, someone will help, if they can! :)
i want to host my cakephp 3.0 in godaddy server
@MuhammadYusufAhmadShahRudd what's the exact problem? Define if it's client or server side. YOu might want to check the browser's control if it's client side
@ManasChaturvedi a sample output would be helpful.
i want user click that button and open new window.... $row['product_spec']. is data from database
@HamZa i create a system for localhost only
12:20
@MuhammadYusufAhmadShahRudd why don't you use a simple link ("<a ...>"). Opening new windows is so 1990 and is annoying
Oh no, nvm. I just need moar coffee.
@Oldskool the weather is nice lately :- )
@HamZa It is, had my lunch outside again today, getting me some suntan... 8)
@tereško DAGs can have multiple roots, if it's not the case for you then what you have is a tree or a set of disconnected trees
^ Not sure if this is epic trolling or actually revolutionary.
12:36
Date is suspiciously close...
hahaha
> We generate electricity from plant's photosynthesis
cook stery bro
DAG reminds me of this question: stackoverflow.com/questions/6163683/…
They appear to be serious
@MadaraUchiha Well, that's why I'm a little in doubt. It sounds far fetched, but on the other hand if somebody told you the sun would give us electricity 50 years ago, they would've said you're crazy too. I do believe natural processes can be used to generate power, I'm just not sure what to make of this one.
12:41
Um, someone mentioned me saying "How not to be a prick when helping someone" and I can't find it.
@Oldskool Well, our bodies get also transform sugar into energy
@littlepootis where? on main or in chat?
We just don't know how to use that in our advantage without wasting a bunch of energy on heat and friction (say, use our legs to spin a dynamo)
Might have been flagged and removed though....
@HamZa chat, while I was away
12:42
@littlepootis He deleted it shortly after
yeah, maybe
(shortly after I kicked him, that is)
oh I see
@MadaraUchiha True, as I said I do believe natural processes can be used/are meant to generate energy, so converting that energy to electricity would seem possible. I just never figured a little plant could achieve that. But now I'm starting to get curious :)
It would be awesome if it'd work though. That would be a very good development for getting the earth a little greener again.
Because you know there is just no way we're about to consume less electricity anytime soon, these are the kind of solutions we'd need.
set plant on fire, use fire to boil water, generate steam, use to drive steam engine
12:48
@PaulCrovella LOL, I guess that would work. But who still has a steam engine? :D
@Oldskool s/engine/turbine - every nuclear power plant
13:15
Hi
Can someone answer my question.
@Mubeen1992 can you ask your question?
@Oldskool It's too inefficient to be of any practical use. And.. it's plant cruelty.
@DaveRandom hey could you take a look at this? stackoverflow.com/questions/36744787/…
There's biofuel, but it's not green.
@HamZa Yes sure :)
2
Q: Laravel 5.2 Validator Throuing exception instead of redirecting back when debug mode is off

Mubeen1992I upgraded my site to Laravel 5.2 and now if I user don't enter any value in fields instead of redirecting it back to previous and flash error message it show exceptions. Below is my sample code. public function save(Request $request) { $this->validate($request, [ 'title' => 'require...

13:22
@Loko well for starters, your parseUrl() does not return anything. Are you getting any output at all?
@littlepootis It might be, but if this proves to work, it could be opening a door to broader research.
Change the print_r() to var_dump() and I'd expect to see NULL, then change $url = to return and see if that solves it
@DaveRandom the var_dump returns null and the return does nothing.
@Loko In __construct(), add var_dump($_GET, $_SERVER); and pastebin the output please
13:28
@Loko What does your parseUrl() function now look like? You can see from the output of $_GET that the page key is in there and has a sensible value, the problem is just how you are processing it
@marcio please tell me when you update your ?? in static scalar exprs patch, I'll give it another look then.
@DaveRandom My parseUrl() function is:
if(isset($_GET['url'])){
echo $_GET['url'];
return explode('/',filter_var(rtrim($_GET['url'],'/'),FILTER_SANITIZE_URL));
}
@HamZa I have posted my question.
@Loko You are looking for $_GET['url'], but the data is in $_GET['page']...
@DaveRandom Okay this may look very stupid but honest to god I had it right before. I jsut mixed them up. It does echo the page now though. I have no clue waht fixed it
@DaveRandom I mixed the word 'url' and 'page' up when trying to fix this and apparently now it works for some weird reason
13:31
@Loko when using print_r() you can use a html <pre></pre> tag to make it a little easier to read.
or make a function called "pre_r($data);" that does it.
@Loko also, a generally better (read: more powerful and frequently more readable) way to deal with this sort of thing is just have RewriteRule ^(.+)$ index.php [QSA,L] and do the routing based on $_SERVER['REQUEST_URI'] instead... it avoids having a million unreadable rewrite rules and because you are writing PHP instead of a DSL it's a lot more flexible
@DaveRandom I dont quite get that you mean deleting the ?page=$1?
Also if you are running Apache >=2.4.0 you should use the [END] flag instead of [L] on the rewrite rule... 99.9999% of the time that's what you really want, it just didn't exist before then
Actually I think it existed somewhere in 2.3.x but that was a dev branch
@DaveRandom what's the difference?
> Using the [END] flag terminates not only the current round of rewrite processing (like [L]) but also prevents any subsequent rewrite processing from occurring in per-directory (htaccess) context.

This does not apply to new requests resulting from external redirects.
from the docs
13:36
@FlorianMargaine You know how mod_rewrite loops until there are no changes to the URI (or you hit the max iterations)? END is like break;, L is like continue;
@Loko So, rather than passing data to PHP using $_GET and writing all sort of fancy rules to get Apache to pre-process the route, just blindly route every request through to index.php and inspect $_SERVER['REQUEST_URI'] instead
Change your rewrite rule as above and in your index.php just put var_dump($_SERVER['REQUEST_URI']); and you'll see what I mean
@DaveRandom that var_dump gives me my whole url after localhost though.
mod_rewrite basically works like this @FlorianMargaine:
for ($i = 0; $i < $MAX_REWRITE_ROUNDS; $i++) {
    $oldURI = $uri;
    $uri = run_applicable_rewrite_rules($uri);

    if ($uri == $oldURI) {
        break;
    }
}
[L] causes run_applicable_rewrite_rules() to return early, [END] causes the outer loop to stop
And if you hit $MAX_REWRITE_ROUNDS you get a 500 I think
I forget, I haven't used Apache for ages because it sucks hairy testicles
@Loko Yes, which you can then process with string functions in PHP to work out what to do.
how to run combination of javascript and php code with one eval function?
@DaveRandom And why would this be better?
13:45
@phpdeveloper this sounds wrong on many levels
@Loko Essentially it moves the responsibility of routing the request (within your application) to your application. This is more semantically correct (the web server shouldn't know about what's going on inside your application), more portable (every web server supports enough rewriting to route everything to a single script), more powerful (PHP code can do a lot more than regular expressions) and more maintainable (PHP code is usually a lot more readable than a bunch of regex rules)
Even if you put a bunch of regex rules in your PHP router, it's still usually a lot more readable
@DaveRandom So if I want to get for example: /mvc/public/home/test/lol/ only the /home/test/lol/ but my friend uses these files as well and has a different directory structure, I would just take everything after public basically? Since public folder is a folder that should always be there.
@DaveRandom ah, nice
thanks
@Loko Yes, you'd have a config variable in you application of URI_BASE or something, which in this case is defined as /mvc/public, and you just strip that from URI before you route with it. This config variable would also be used when building URLs that reference other parts of your application
And if you were running the application on the root of a domain you just set it to the empty string
13:49
@DaveRandom Damn I wish you were my teacher back then.
:-P
If only...
Nevermind, just going to let it go.
Wait what did you remove?
I wouldn't worry about it, it's very meta
user image
5
I'm adopting that
cc @tereško
14:08
@MadaraUchiha I hope it was not aimed at my "tree question"
@tereško No
You generally like these things
s/question/complaining
yes, yes I do
@NikiC fair enough. I think it still serves the example tho
@tereško I didn't see implementations of closure-table repositories for common ORMs. I saw decent implementations for nested set though, and they work quite well
The problem with closure tables is that you'd probably use recursive SQL to make them work as you wish, and recursive SQL works in a tiny fraction of engines
ah, no, wait, it's a flat inheritance. It can be implemented in ORMs that allow for customization. Plugging in an ORM directly without customization would just cause O(levels) traversal at every operation tho
What's a closure-table repository?
Disclosure: it doesn't have anything to do with closure functions
14:23
@nikita2206 Surely you mean dis-closure
Can Zeev not even preserve proper formatting when responding to emails? Sheesh it's annoying.
@NikiC :P
14:43
@NikiC just the implementation of the closure-table from a DDD perspective. You have an OO-style API for fetching records at a particular level, all the ancestors of a certain element, or all the children of that element. Then the implementation can either be ORM specific or just SQL and a result builder that hydrates back to objects.
Doesn't need to be OO-style btw. I currently write repositories as invokable classess
@bwoebi yeah
I think it will be met with more resistance, you could also allow implementing interfaces where there is only one abstract method that is a non-prototype, but it just feels really odd leaving abstract classes in the class table ...
we know the engine is not prepared to execute them, since we only fixed a possible bug in their execution in the last week ...
unknown territory is unknown ...
@Ocramius that sound like something you will hate yourself for in about a year
Not really, works quite well, and I can customize single use-cases on a case-by-case basis instead of having a giant repo class
user6116249
15:01
good afternoon all
mocking and testing are also simpler: class SimpleRegisterUser implements RegisterUser { public function __construct(FindUserByIdentifier $findById, FindUserByEmail $findByEmail) { ... } ... }
user6116249
whats the best way to count a row where a specific id equals the same value? this has proven to be a pain with no answer.
sum of id + value = id * 2?
@William In SQL?
Ekn
Ekn
ugh really... still?
user6116249
15:11
yes still I have been through 73 posts all same result Ekn
Ekn
Ekn
that was the last question before I went to sleep and now first when I wake up -_-
user6116249
lol
user6116249
sorry
@William Try what I mentioned.
Ekn
Ekn
but I remember you deleted your question?
15:12
oh wait
id = same as value? :-/
user6116249
0
Q: While Loop echos only 1 value twice

WilliamI have a 2 tables called forums in the table forum_categories cat_id forum_id cat_id I am trying to count the total for each category for some reason it displays total record for all records. I have 2 categories so far in the database first category has value of 1 second cate...

@bwoebi zend_symtable_find worked. I can't commit now, but I'll give a new try later today. Just noticed code like const A = null ?? B['undefined']['index']++ ?? false; is still emitting a notice.
user6116249
no Ekn i just up dated it
user6116249
Ekn that was a different post
15:14
@William You lost me at "I have a 2 tables called forums in the table" ... so you have 2 tables with the same name within a table? Tableception! (And impossible).
Ekn
Ekn
okay...
Probably also the reason why no answers are given yet.
@William Try writing it up in sqlfiddle.com
You might need to rephrase the question.
Ekn
Ekn
I made you a sqlfiddle
but hell impossible to find before my first coffee
user6116249
15:17
well whats blowing my mind is it display all results fine just not count
user6116249
if category one has 2 post and category 2 has 1 post the count should not be 3 for both
Ekn
Ekn
sigh...
@marcio you're doing a ++ operation … that also should emit a notice in normal executor (I mean outside of consts)
@bwoebi do you know whether an exclamation point should be escaped in uris?
jabbascruts encodeURIComponent doesn't encode it, but rawurlencode does
      reserved    = gen-delims / sub-delims

      gen-delims  = ":" / "/" / "?" / "#" / "[" / "]" / "@"

      sub-delims  = "!" / "$" / "&" / "'" / "(" / ")"
                  / "*" / "+" / "," / ";" / "="
@PeeHaa ^ yes (RFC 3986)
15:26
ty <3
in JavaScript, 1 min ago, by Todo Pertin
JS and PHP are the same. Just the syntax is different.
@PeeHaa At least in URIs in general it should be percent-encoded… specific URI types (like URLs) may unreserve a few tokens.
Anonymous
in JavaScript, 3 mins ago, by rlemon
@TodoPertin just like my foot and your ass are the same in the sense that they will soon be connected?
@JoeWatkins nah, that's odd. just for where the sole method is abstract (I consider interface methods implicitly abstract)
@bwoebi I'm fairly certain I need to use RFC 3986 for oauth
15:31
I think it can be added later, if it gets in at all ...
@PeeHaa If in doubt, just encode all of the above
I think people don't get it ...
@littlepootis LOL
is there a PHP Unit method for checking if two objects are different
fuck ... lost my train of thought for a second there
@tereško assertNotSame()
15:33
@tereško assertNotEquals/Same? Or what d'you mean with that?
probably
it's an object-tree type of situation :(
@tereško You mean the opposite of deeply equals?
yes , "deeply wrong"
@tereško You always can $this->assertTrue($a !== $b) ...
@bwoebi Does === do deep equality?
Or referential equality?
15:36
referential
@tereško If I read the manual correctly, assertNotEquals() should work for you
@Ocramius So it won't do what he wants
you should use self::assertNotSame($a, $b)
He wants "deeply not equals"
then self::assertNotEquals($a, $b)
assertNotSame() is to check if two objects are identical like $objA !== $objB. assertNotEquals() is to check it like $objA != $objB.
15:38
@MadaraUchiha oh, now I realize what's meant with deep…
@bwoebi That's what sh- OK.
is @NorthbornDesign around?
or indeed anyone else who works with C# on a day-to-day basis
@DaveRandom There are a few of them in the JS room
@NikiC thinking of making the required changes to mt_rand for 7.1. Did you have a better RAND_RANGE implementation? (I thought you linked one before, but I might have dreamed it)
(I think there's also a C# room, dunno how active though)
15:42
@Leigh Same one as random_int
I.e. use sampling
good morning
@Leigh Will you also switch to a 64bit generator?
Ekn
Ekn
mornin
15:44
@NikiC Not for mt_rand(). I am concatting two outputs together
@MadaraUchiha oh good point, I forgot #11 is not the only room on here :-P
@DaveRandom It's the only one that matters though.
\o @AnmolRaghuvanshiVersion2.0
Fuck IEEE754
@NikiC I have that basically copied over already, minus the sampling part, wasn't sure if rejecting outputs was a good idea
15:44
@NikiC ಠ_ಠ
lol
Ekn
Ekn
o.O
Nan semantics are pretty much the stupidest thing in CS I know, and I use PHP.
5
@NikiC lol
in JS, when you query the type of NaN, you get "number"
That's right, Not A Number is, in fact, a number.
Also
Check out the downloads/month, then check out the source code
I don't believe the numbers
2
please tell me they're falsely inflated
15:51
@FélixGagnon-Grenier They aren't
But it's a bit misleading
@MadaraUchiha Which is odd, but also perfectly reasonable :D
yeah of course, to actually not be something you have to know what it is
They should have called it INDET instead of NAN
It's not that all those packages have it as a direct dependency, but rather that it's as a dependency of a dependency of a dependency of packages very near the root of the tree.
Or IND for consistency with INF. We wouldn't want to have different name lengths.
15:54
@NikiC But then, wouldn't lookup be slow?
@MadaraUchiha bah :P
@MadaraUchiha This seems perfectly fitting for JavaScript.
Love it.
@Leigh will you be also aliasing rand to mt_rand?
@NikiC Perhaps I missed something but what about those two things makes them different? You imply IEEE 754 but those are both comparing arrays with a single bucket that has NaN.
@PeeHaa I need you help, should be trivial... But, I'm having trouble (because linux). I want to install Jeeves as a Service
15:58
@LeviMorrison IEEE754 is genius specification that made equality non-reflexive
And we short-circuit the case where === has the same array on both sides
I.e. assume a reflexive comparison
@NikiC I wasn't going to, I know rand() but wasn't trying to break things, even if they are already broken
I've done sudo ln -f jeeves.service /etc/systemd/system/jeeves.service reloaded daemon but still getting Failed to start jeeveswiki.service: Unit jeeveswiki.service failed to load: No such file or directory.
what am I missing?

« first day (2013 days earlier)      last day (3159 days later) »