@Danack I need to come up with a "no" as well, tbh. I'd rather have protected classes or something like that, than public things that talk to each other
@mush it's a lot slower than a lot of compiled languages, it's the same speed or faster as other 'scripting' languages.....but for most peoples use cases (building web sites) it doesn't matter.
@Ocramius Feel free to steal this - something like 'the previous discussion was interesting, and although the friendship crap is a potential solution, there seems to be more consensus behind the "package private" idea.......'
@mush Because it's completely compiled it's easier to "prove" that a java application is 'correct' (whatever correct means). Whereas PHP can fall over in the middle of an application because of an error condition which a compiler might have caught.
@mush you can fuck up very badly with Java too… Java is just better suited for implementing custom crypto (because of fixed width integers) (which you shouldn't even do…), but in general, no
so most of the learning is from your own projects? So did it happen for example for you that you just dig in to stuff and don't really know how to get things done and then find answers and progress yourself without outside help and master things gradually...?
@mush they help you in case you don't want to remain the little programmer. You only need to be a bit smart to write great code, but CS courses will learn you the theory how to solve certain problems.
@mush to really understand things, you often need to implement them.
is it the methodology that you feel people benefit from most? Like a certain approach in for example problem solving that is taught that leads to the advantage ?
@mush No. I meant certain problems. Specific applications like programming language optimizations (there you have to know some theory or you'll probably be lost), which algorithms exist (giving you clues what the optimal solution will be), helping you with understanding side-effects affecting performance … but after all, you still need to read up a lot on your own. It gives you a lot of starting points though.
There are good computer science courses, but most CS lectures come from a different era. I'd never let someone fresh from a CS degree work on my websites without strict supervision by a self-taught senior.
The problem is that the CS student may be great at spotting optimization flaws, doing big-O-notation analysis, planning how to implement a particular function. They are not taught issues such as XSS (for web dev), business value analysis, clean architecture design (OO/fp), project organization, etc
I've seen a problem for many years. Basically some of the CS grads I've worked with had a problem where all they were taught was "When you see this problem, this is the solution" when confronted with a problem where there was no clean solution possible, they pretty much didn't know what to do. I've literally had someone (employed by the company) refuse to work on making a tool, because the correct way to make it wasn't obvious...
Whereas myself, who studied chemistry at university, I have the opinion that, if at the end of the day, nothing is on fire or dissolved into a pool of sludge on the floor then the solution to solve the problem was acceptable.
yea, but no one could say a solution is not right if they can't solve the problem
i guess, the initial problem is solved, but there may be another problem that occurs, so there is a shift from solving problem A to problem B
at least, that's what I believe, i think problems are highly relative and can only be seen in the light of the goal... So if you come closer to a goal but there are still other things to be done to reach the goal, that's progress to me :)
speaking about problems, I have an issue that I can't seem to get my head around... XML seems valid to me but get a 1002 xml invalid error. Remember i am a total beginner :) $XML="<BOOKING_DETAILS> <VERSION_HISTORY APPLICATION_NAME=\"AppName\" XML_FILE_NAME =\"XMLFileName\" LICENCE_KEY=\"XXX\" TS_API_VERSION = \"TSAPIVersion\"> <XML_VERSION_NO>3.0</XML_VERSION_NO> </VERSION_HISTORY> <BOOKING> <BOOKING_DATE>08 Jan 2016</BOOKING_DATE> <BOOKING_START_DATE>25 Jan 2016</BOOKING_START_DATE> <BOOKING_END_DATE>26 Jan 2016</BOOKING_END_DATE>
@mush If the document is really utf-16 to start with, you'll need to do more clever stuff to change it from utf-16 to utf-8. It is likely errors when there is a non-utf-8 char in the response.
Maybe cross your fingers and set an accept header for utf-8 and hope the remote server can serve it?
For an extremely small value of "work". The only utf-16 sequences that are likely to be parsable as utf-8 are ascii codepoints, and even then you have a null byte at every other octet.
My *hope* is that the thing he's replacing is actually just an embedded URL query param, like: <?xml ....blah... ><node><othernode url="http://example.com/blah?eo=utf-16"/></node>
i just want a very simple blogging platform with a markdown editor something like this igor.io/2014/12/18/stack-machines-compilers.html do i have to write one myself or is there such a simple solution ?
'cause that could work fine. It's hard to tell since his patten is SO vague. And the [^?]+? sequence is questionable as fuck too. He probably meant to escape that second ?, 'cause all he's saying there is [^?]*
@someone It exists. I don't know what it's called, but it certainly exists. Google to the rescue.
I have table from which I have to get invoiceNo, Sum of all the weights, count the number of barcodes and the last value in sum_total from table called selected_items for a particular date.
SELECT invoiceNo, SUM(weight), COUNT(barcode), sum_total
FROM selected_items
WHERE date LIKE '07-Jan-2...
This is the query I am using SELECT invoiceNo, SUM( weight ) , COUNT( barcode ) , sum_total FROM selected_items WHERE DATE LIKE '07-Jan-2016' GROUP BY invoiceNo ORDER BY id DESC;
This is the output
My goal is to get the last entry in the sum_total column but ORDER BY id DESC isn't working for me
If that is how you calculated all the time, maybe you should make a function with attendance as a parameter. And then you can get list of user as attendance and looping it
public function calculatedTime(attendance){
//Your coding here
}
and You can looping it to get the time
foreach($logina...
i have a controller that sends a array of logins and logouts to view. There i calculate the total worked hours of the employee for now i using dropdown so whoseover's name was selected that person's total hours were calculated.
Now i want to calculate for all the users in database
So i guess i need to loop thought the code for every user but don't know how exactly i do it
i am doing some schedule based on NY time, in my program i set some time ( ex . 2.00 pm ) that starts schedule. i handle this by converting the time into UTC as 19:00, but for EDT zone when converting 19:00 UTC into NY time means it will return 3:00 pm EDT. So it shows one hour delays on schedule.
@GugankumarP You shouldn't use EDT or EST. Instead, use an actual time zone like America/New_York. Then your conversions to and from UTC will be more accurate.
@jbafford am tried that one but my confusion is " If i sets time as 2.00 pm ( for example today )it converts into 19:00 UTC ( because now it is EST on America/New_York ), but for may month when converting 19:00 UTC into America/New_York it returns 3:00 pm ( because may month is EDT )"
i used cron scheduler for doing this one, it executes every one minute
it executes the query if January 8 19:00 UTC equal to current UTC time
January 8 19:00 UTC it is stored on DB when creating schedule.
In another issue is if the user created a schedule on EDT zone like May month, it should be execute based on presets time only not by zone, that is the problem actually
@GugankumarP It's a bit unclear what exactly it is you're trying to do. If it the user says "May 4 3:00 PM America/New_York", then that (or the UTC equivalent) is what needs to be stored. But you need to use America/New_York for calculating the time, and not EDT/EST, because "May 4 14:00 EST" and "May 4 14:00 EDT" are not the same time.
@jbafford Actually, now i am creating a schedule with time of 2:00 pm EST ( it should execute on 2:00 pm everyday ), i stored into db like 19:00 UTC. Now it is working well. But for May month, when converting the same value into current time it returns as 3:00 pm EDT. But i scheduled it for 2:00 pm only.
Ok. That is insufficient. Because 19:00 UTC is not always 2 pm in America/New_York. What you need to store is 2:00 pm and the user's time zone (America/New_York, and NOT EDT or EST).
Or you need to store the full date and time (in UTC).
LTS distros provide their own sec fixes, we don't have to care about those ... the only reason it should stick around outside of LTS distros is that we are still providing sec fixes ...
long goodbyes are hard, let's just get it over and done with I think ...
that's what I wanted to vote for, but there is no point, because second option will win ...
a no vote is a yes vote for second option ... strange kinda voting, but whatever ...
also, a thought to precedent should be given, if when 8 comes around, everyone can say "we had two years last time, we need at least that this time" ... because 8 will be legitimately much more complex than 7 ...
that will be bad, and by the time 10 comes around, there will be 4 or whatever years of sec fixes and not much reason for the industry to upgrade from 8 ...
@PeeHaa That is true, a nice cuppa is sometimes what the body needs. Much prefer hot chocolate though. Sometimes my 10 year old self likes to shine through.
So you get addicted on the channel, the channel gets you addicted to the music the music makes you addicted to alcohol you go to rehab you come back to the channel.
hey, im trying to make an internal booking system for a meeting room.. now im trying to figure out if the room is taken from a time to another time and if not, then let the user book the room
my current if statement:
if($Old['ToTime'] <= $_POST['FromTime'] && $Old['FromTime'] >= $_POST['ToTime']){ echo "Event can not be created.. Event already exist: FROM: ".$Old['FromTime'].' TO: '.$Old['ToTime'].' ON: '.$Old['Date']; }
but it adds records anyways, what would be the correct statement ??
@zaq178miami Basically i'm trying to develop very simple real-time multiplayer game. I tried fireBase and PubNub. But it's always come to the same result - problem handling multiple requests.
Let me explain - each "game" constructed with just two players(not more). If 4 players logs as the same time. And each player look for a "match". player one might match with player two.while player two might match with player three, and so on. How can i avoid this? (real-time?)
@zaq178miami the problem is that each users looks for a pair. so nothing gurantee that player 1 will match with player 2. while at the same time player 2 already match player 3
but if have only N clients, N > 2 and want to match exactly 2 clients, not respecting which one, then just let run some round-robin request and when you get response, run some kind of handshake
so smth like hi Jane, hi Mia, hi Sindy, then when some of them reply, just ask, "let's go out tonight", and then if she's ok with that and doesn't already accepted someones proposal, go and date
In computer science, brute-force search or exhaustive search, also known as generate and test, is a very general problem-solving technique that consists of systematically enumerating all possible candidates for the solution and checking whether each candidate satisfies the problem's statement.
A brute-force algorithm to find the divisors of a natural number n would enumerate all integers from 1 to n, and check whether each of them divides n without remainder. A brute-force approach for the eight queens puzzle would examine all possible arrangements of 8 pieces on the 64-square chessboard, and,...
ah, that stinks. well then, brute force sounds about right. you could attempt like a double hand shake. user arrives and asks all users to pair up. the first positive response is accepted with another handshake. during the handshake, requester and positive responders are all 'inaccessible' until receiving the second 'all-clear' response ?
if you get all negative responses then ask again. could be intensive if quite a few users at once all shouting to each other 'PICK ME!' but I don't know