I have a short bit of code, where one section executes, the other section does not execute, and I cannot figure out why
alert('potato') var orderList = {"BFLBambooBlueMix":25,"BambooBlackGold":100}; for (var product in orderList) { if (orderList.hasOwnProperty(product)) { putInCart(product,orderList[product]); } } sendList(false); alert("Hello! I am an alert box!!");
The first alert executes. The second alert does not
The solution is not the missing semicolon after "alert('potato')" I just checked.
hi , i have made a post request to the url , its working on localhost but not on live server , any idea what might be the issue and how to bypass restriction if any
I am creating an offline billing page with php and javascript. All main calculations are happening using javascript since its offline. PHP code is used only to fetch and confirm the last bill number. When i use cache manifest to make page offline php codes are not working even if internet is there. Is there any soultion for this ?
{ "name": "MALFORMED_REQUEST", "message": "Method type not supported for this operation", "information_link": "https://developer.paypal.com/webapps/developer/docs/api/#MALFORMED_REQUEST", "debug_id": "85ba3ecb85ff2" }
> Within class methods non-static properties may be accessed by using -> (Object Operator): $this->property (where property is the name of the property).
Waka waka bang splat tick tick hash, Caret quote back-tick dollar dollar dash, Bang splat equal at dollar under-score, Percent splat waka waka tilde number four, Ampersand bracket bracket dot dot slash, Vertical-bar curly-bracket comma comma CRASH!
@BobbyAxe google it you'l find thousands of resources on this, there are even some cron job generators, which ill provide you with the configuration based on your specs etc
@BobbyAxe i) use supervisord to make a script be executed continually ii) record the last run time iii) wait a few seconds between runs. iv) Test if it's time to do the thing again.
i'm not sure that's what it actually does, i just think it does that, as that's how it should work :B would be quite expensive copying an array every time it enters a function
How can i loop 4 ul in 1 loop i dont want to repeat ul just want inner li <ul class="tile__list grid-lisUi Initial_Screening h-100">
@foreach($applicants as $ap) <li data-userId='{{$ap->global_Id}}' data-recurimentStatus='1' data-recuritmentProcess='2'> <a href='#' data-toggle="modal" data-target=".user-request" class='each-grid'> <span class='name'>{{$ap->name}}</span> <span class='designation'>{{$ap->presentDesignation}}</span> {{-- <span class='present-company'>Pakistan Tareek Insaaf long name for show Pakistan Tareek Insaaf long name for show </span> --}}
You have to post what you have (you did) and also how should look expected result. But here in chat is pretty much unreadable, even your array has some pluses from github/bitbcket c/p probably.
@pmmaga when you "copy on write" you copy the array anyway, right? php should allocate an array of nexPowOf2(itemsCount($originalArray)), what it does instead is a straight copy of $originalArray's C buffer, even if it doesn't contain many elements
@Wes yes, because AFAIK doing a memcopy 1:1 will always be faster/more effective than recreating the array from scratch (which you would need to do if you want it to only take the necessary space)
@Wes so, if you want to have a clue, dive into the code and look at it, saying "I don't have the slight clue about how to do that" won't do anything to anyone
So, looking a bit at the code.. It seems like if here it went with nNumUsed instead of nNumOfElements it would probably give you what you want in your example
but I can't test it right now and dunno other implications, but... it sounds reasonable
because basically, it already has special cases for empty arrays and packed arrays, etc..
@PeeHaa I see your point. I keep thinking of this scenario: I start a project, I somehow, magically, have planned out a logical directory path system at the beginning, but I haven't populated the directories yet with files, however, I want git to start tracking these anyway. On the one hand, I'll just have git track the folders when I've begun populating them with files, on the other hand, I'm forgetful as fuck and git is my life preserver.
@PeeHaa For example, if I make a boilerplate template for something, and images must be in /src/assets/img/ for them to be included correctly - but I don't want any images in my boilerplate - I think it would be appropriate to commit that directory without having any files in it
@PeeHaa there's only one other person here that has used git, and he used it back in college, he doesn't use it in his current position... everyone else will not touch it
I've tried getting people on board with using it, but the problem I had when I first started pushing people to use git was that I didn't know enough about git to be able to convince people to use it. If someone had a question I would go "uhhh"
now I'm familiar enough with it to where if my supervisor says "make sure to get a backup before you start..." (her idea of version control) I can say "that's what git is for"
our server admin takes care of backups :P and I occasionally have to ask him to restore a dev server from a backup because I fucked something up horribly, or I need a file from a day ago
he's had to restore the prod website server once because I fucked it up :S (at least we know backups work)
> Since OpenVMS installations tend to only grant access to trusted staff, the main threat here is dodgy or bribed employees seeking to commandeer systems, rather than outside hackers.
apparently "next month" other ways how it can be exploited would be revealed, I'll have to see if there's a followup article
@bwoebi is it possible ot analyze a pattern and see if it has matches in common with another pattern? :P ftr i don't actually want to do this, just curious
for example /^[a-z]$/ matches a subset of /^[a-z_]$/
There's no halting problem involved here. All you need is to compute if the intersection of ^xy1\d and [^\d]\d2$ in non-empty.
I can't give you an algorithm here, but here are two discussions of a method to generate the intersection without resorting the construction of a DFA:
http://sulzmann...
Im looking for function (PHP will be the best), which returns true whether exists string matches both regexpA and regexpB.
Example 1:
$regexpA = '[0-9]+';
$regexpB = '[0-9]{2,3}';
hasRegularsIntersection($regexpA,$regexpB) returns TRUE because '12' matches both regexps
Example 2:
$regexpA =...
simplified example execRegex( string $onstring, string $argRegexCharSet1, string $argRegexCharSet2); where argRegexCharSet* is used e.g. "/^[" . $set . "]{3,10}$/" but before i do that, i want to assert that $regex1->isSubsetOf($regex2)
@NikiC I'm just reading you wrote "We may also want to move from the C# syntax to something where get/set are specified more akin to independent methods." regarding property accessors. I'm a bit failing to imagine how that reasonably should work out?
If I were to implement property accessors, I'd propose one particular difference in semantics to C#: Properties with getters are uninitialized by default. You can assign a value to a property with a getter. The getter is only invoked as long as the property is not uninitialized.
I found it quite annoying in C# to typically end up with two properties of the same type, just one with the getter and one without - and the getter returning the other property.
That way it is also trivial to express a lazily cached value with getters: public $foo { get => $this->foo = $this->bar + 1; } public $bar { set => { $this->foo = $value; unset($this->bar); } }
Why are floats represented by scientific notation? Seems like a lot of the time it results in more memory needed, more processor power to compute with, and wild inaccuracy when used in math functions.
Couldn't you make it more efficient by specifying certain criteria for when you should give up and use scientific notation and when it would be more efficient not to?
Because it seems like that vast majority of cases involve very few significant digits, and if you're converting to scientific notation you clearly have the ability to discern what is significant or not before doing a calculation.