Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×

Comment Re:I dunno... (Score 1) 776

lol, that's very easy. Not even basic mathematics and iteration. When you use modulus this indeed doesn't even require math skills to figure out.
And these guys call themselves coders?

I must start passing guys this test myself! ;D

Any other good 5mins or less coding tests you've used?

Comment Re:Tell him to write goddamn login page himself? (Score 1) 507

And code is written faster with clean code. Way faster.
Code architecture, cleanliness is the key to make features faster and eliminate defects.

Dirty code will lend itself to a set of various problems, messy code even further.

Well architectured code base, with a clean writing style will make things happen faster, easier to maintain and every body understands a particular piece easier. On large systems tho, a great mind is required not to only comprehend but also understand the whole system with proper structure.

The rules are very simple:
* Every function should have at least short comment of what it does, preferrably a docblock style
* every function and variable name should be unshortened, camelCased (my preference) or hyphened without abbreviations or shortening the words, for example instead of uSesAuthGenId type it open userSessionAuthenticationGenerateId you also see this is incorrectly structured it should be more like users->authentication->generateId
* Insert a comment approximately every 10 lines on average
* Do not type a huge list on intended recursive function calls on single line, ie. $example = array_walk( array_map( $$exampleMethod1, $data1, $conf1 ), $$exampleMethod2, $mode ); is a bad example of code, doubly so if the callbacks use references and change the original data :P That should be written more open and commented
* a single method should preferrably not exceed 100 lines, if it does it's doing too much
* You should never ever need intendation further that 4 levels, intendation comes from if clauses, for/while/foreach loops etc. for example: foreach($data AS $thisKey => $thisValue) { if ($thisValue['type'] == 'type') { switch($thisValue['mode']) { case 'thing': if ($something != $something2) { foreach($thisValue['someArray']) { .... Is bad
* Abstract, but do not abstract too much. Abstract things which require more than say 10 lines, but if you are abstracting single line things via 8 different methods/functions you are doing something HORRIBLY WRONG (even Zend FW falls for this)
* When you abstract, do not duplicate code, try to reuse code intelligently, do not copy & paste ... *EVER*
* Separate, isolate certain types of code, for example: View, Business Logic, Flow control. MVC is not just a "fancy word" forcing you to "a nasty framework i need to work around". Infact MVC is a very old concept. Learn it, digest it, understand it. For example anyone saying Smarty is not MVC, or Smarty is MC+V or stupid things like that do *NOT* understand what MVC is and how to write structured code.
* Above all: Reuse, Reuse, Reuse, Reuse. Don't do practically the same thing in 50 different ways, do the same thing 1 time but do it excellently and reuse it elsewhere. Goes for architecture & structure, for layer separation, and line level code. For example, each model method shouldn't have it's own handling of MySQL result set, they should ask another model for the results.

And the most important lessons today are: Creating code is 7 times more reading than writing, it's 10 times better to spend 50 minutes planning/designing a particular feature then writing it in 5minutes rather than use 45 min writing it and 0 minutes planning it (First change arises you will know why).

One can create a particular system using just ~25k lines of code instead of 200k lines of code if it's well structured and thought out.
One can also spend creating that either half a year in man hours, or 5.
It's all in *executed* high worth lines of code, not about quantity of written low worth lines of code.

My basic benchmark for qualitive productive? If code style is properly adhered, how *few* lines of code and what's the ratio of comments vs. code.

Comment Re:U$A (Score 1) 183

Earnings and value of money is also relative, 2$ in India buys hell of a lot more than in the US, nevermind in Finland you can't even get a decent cup of coffee with 2$

So living on less than 2$ per day doesn't tell anything if not put into context of the local economy. For example how much does carton of milk cost? What's the cost of rice per kilo in those areas?

I'm quite sure that 2$ buys at least a kilo of rice in that area and some soybeans to go with it. But how about in US?
I know here in Finland you can barely get a kilo of rice with that.

Comment Re:Damn Microsoft (Score 2) 176

Nokia N900 was AMAZING - Sure it had it's issues to be used as a phone, it simply wasn't polished properly - but that was a real proper geek style smartphone, complete with QWERTY.

I loved it's debian based. The only phone i've REALLY wanted in the last decade or so until the N950 which turned out to be justa developer phone.
Then they dropped the production despite demand being high :(
Auction prices for used N900s were same as new phones when they were last available for sometime.

N950 if sold to public i'm sure would have sold A LOT.
These few models are the only ones i've seen from Nokia in a really long time which combines their HW excellency with some software excellence.

I would buy either N900 or N950 still new to date if they were available - not interested in used phones of this kind, can't be arsed to go through finding out how to reset the system to completely original from factory to avoid 'extras'.
I was waiting and hoping for N950 to hit the shelves like the rising moon! I was hugely disappointed when it came clear it's developers only. I would even accepted drawbacks like short battery life, no camera what-so-ever, no bluetooth and even major ones like way too slow CPU, too little RAM, no MicroSD slot!

I even considered getting N9 despite lack of qwerty phone but the demand for Qwerty outweighed, i might need to SSH into servers on the road, and doing even basic maintenance on touchscreen keyboard ... no thanks, so i got E7. Since E7 nokia hasn't released any phone worth even considering for my use.

I don't want an Android or IOS phone due to obvious privacy concerns, usability concerns etc. I want Nokia Hardware + Meego! and i'd pay extra for that.

To me, other manufacturers are not even proper choice, Nokia is a phone manufacturer first, everything else then, unlike the other companies. This means Nokia pays attention to things which don't come up anywhere in the development cycle with the likes of Samsung, Apple, HTC etc.

Sure, Nokia hardware ain't perfect neither, but they are *phones* from start to finish, and this shows up in things like durability (mechanical) and battery life which are most obvious, and many many little details.
For example, my E7 i've dropped to concrete floor, on asphalt on multiple occasions, but absolutely no damage, the most wear on that phone is on the plastic end parts from being in my pocket. Screen is still like from factory, and the screen is actually so sensitive that you can use thin gloves with it, which i hear other phones are not. Once on a trip i was away for 6½ days without charging my phone before getting back to home and putting it back to charger.
Friend with whom i was on the trip had to charge his android phone every night.

So please nokia! Bring back Meego, make a brilliant phone with Aluminium or Titanium case, nice screen, qwerty, protected durable USB connector, plenty of storage + ram, decent extra low power cpu and meego -> You will sell a lot.
I can't be alone willing to put out extra 100-200€ for a Nokia phone like that! Even if it's "low end" hardware spec i would still happily put the extra 100-200€ !

Comment Re:It'll make Linux better (Score 1) 1051

like the other commenter said, you have a serious disconnection from reality.
There *needs* to be a "top dog" who dictates the qualities of the project, otherwise it ends up being endless debate and project systematic individual style hacks introduced, in the end no one knows how it was supposed to work and how it does work now.

Certainly, it will create some grief on the short term when someone is adamant about bad quality and breaking things, in the long run however -> things work better as a result of that.

Those doing bad job needs to be punished, and those doing a good job needs a reward.

Comment Re:Still.... (Score 1) 1051

Still Linus was right in doing this.
Any bad coder out there like that - who doesn't test properly and breaks things horribly deserves some wrath.
I've seen too many bad, so called coders out there, even hired some. Excellent CV has not been a guarantee that even basic processes of the person doing the job is anywhere near the required level for the job.

Especially lack of testing, even if manual 5min testing, is something which is completely unacceptable.
In this case, the person probably did not need to do more than compile the kernel, boot a KDE environment and try to play a song. I've not looked into this patch which caused the trouble, but usually you can immediately tell from glancing at the code what to test.

And your example is wrong - in this case Linus is stopping crap to be introduced to mainline and making sure quality is maintained - anyone with basic reading comprehension skills can see that, and infact, for sensible persons that's positive marketing -> knowing that "heads will drop" if quality is not maintained.

Comment Re:Simples! (Score 1) 314

By far not sufficient when you get to that level of required security.
If there is no alarms, monitoring etc. and reinforced walls, a thief can potentially get inside without anyone noticing through another wall, ceiling or floor.

Practical security:
  * Use linux with GRSEC
  * All network daemons turned off
  * Firewall all ingress, don't even allow ping etc.
  * Firewall all egress, only make sure what's ultimately needed is accessible, potentially building a whitelist if possible
  * No excess software what-so-ever, just what is ultimately needed
  * ROOT account: No logins, create another account which can only be locally logon to, which can sudo. Password 16 chars, potentially automatically rotating. Possibly also having 2 factor authentication. You can trivially create this step by even creating a PHP Script as the shell :)
  * USER account: Limited to only what is required, potentially chrooted to the exact data which is required to be accessible etc. Depends on the usability required
  * Watch logins: More than 2-5 failed logins, shut the system down immediately using "magic" SYSRQ, wrong username? Instantly
  * Full disk encryption, on top of which potentially using a bit obscure filesystem to make it that much harder to break. The required data should have 2nd level encryption unless doing that creates a potential attack vector on the first level encryption

Hardware:
  * Potentially use hardware where you can review the firmware/bios if possible
  * HW firewall "integrated" to the motherboard, motherboard network connectors are removed and hardwired to this HW firewall, so that even a skilled person would require atleast 20mins to bypass the HW Firewall
  * HW Firewall configured in the same sense as the SW firewall, potentially with additional protections.
  * Super Epoxy glue all connectors, modules etc. including the HW firewall buttons and it's mainboard into the motherboard etc. -> Stops quick tampering.
  * Disk drives and CPU needs cooling, so CPU heatsink could use heat transfer glue to the CPU and super epoxy from the sides on to the motherboard. Disk drives can have little spacing with the super epoxy.
  * The whole case is epoxied together/welded. No connector should be accessible, but peripherals mounted permanently with super epoxy to avoid inserting capturing devices directly.
  * Braided stainless steel sleeves for all cabling to make splicing in harder.
  * Epoxy on the other side of the peripherals as well ;)

FW Config: Potentially disabling all unencrypted connections, verifying against known certificates, no other connections allowed, if possible. Potentially also limiting data transfer rates so that if anyone tries to transmit data outside -> it will take long enough for security to take notice.
GRSEC configuration is very involved, but can be teached.
Process list should be verified and checked against.

This will create a secured SW + HW environment.
If you cannot use a motherboard/devices which firmware you can verify, the extreme FW measures taken (both SW + HW) should ensure no data gets transmitted without permission. It is highly doubtful that same organization can be behind a security hole in the motherboard AND the HW FW, but you can also create your own HW FW using things like Arduino where you would be the person creating the firmware as well.

Epoxy: Modern cars are glued together, so just use similar industrial strength epoxy.

In the end it's all about making accessibility slower if it's a highly skilled attacker with knowledge about the system upfront, which can potentially stop the attempted attack all together if it's deemed too secure.
BUT Security via obscurity is still not security, i see people changing their SSH ports, blocking Ping etc. but that doesn't really add to security, as the information can still be gathered very quickly.

Comment Re:Simples! (Score 1) 314

Not sufficient. No computer is secure if it's in any way accessible, operable, even a computer buried underground, with no direct access is secure.

In practice however?

Just operate within a reinforced concrete and steel building, ie. a warehouse, signals get so weak that barely modern cell phones work, and you can forget data for the most part, even if there is just 1 layer of blockade. If you have physical security around no one can get close enough to get reliable signal through, especially if you place couple of scramblers.

Yet inside off the building you can even utilize wireless communication within the network - tho i wouldn't allow that, scramblers all around.

In the end, if the computer has human accessing it -> that's your weakest link most likely.

Comment Re:...and where they got your number (Score 3, Insightful) 451

it's FREE, so people tend to demand better than commercial product support etc.
Anything FREE and you will attract the worst "customers" the planet earth has to offer, they demand extraordinarily much, and will shy from even 1$ payment.

That's just the nature of the business, they need to find a way to deal with it, sure. But will it end? Probably never.
Biggest thing they can change is their attitude towards these kind of people, and make sure support terms (cost) is WELL Communicated, so anyone reading the bullshit review will easily know the author of the BS review is at the very least questionable authority.

Many people using free stuff will not even bother to glance at the terms of the free offering, and the company is by default at fault if the moon is not given in 5seconds flat.

Comment Re:Cast in a negative light, obviously (Score 1) 301

For joe average a lot of the "bank red tape" is because of stupid things like chargeback etc. not because of opportunity to steal from the bank.
Opportunity is with those who are working in the banking industry.

Chargeback btw is a major nuisance for many merchants, it gets mostly abused. For actual fraud i think the individual who lost their CC should be liable or a additional insurance for that case included in all CCs. It should not be the merchants responsibility to cover for that.
Probably 95%+ of Chargeback cases is just individuals looking to get free stuff in any case.

Comment Re:Seconds? (Score 3, Informative) 151

AC is correct.

In motorsports few seconds is a very long time. The lap times are not mentioned.
The raceway in question is probably this: http://thunderhill.com/staticpages/index.php?page=TrackMap
But which variation? Long version 2.866miles record times tend to be just over the 2minute mark for somewhat normal cars.
Short version is 1.769miles for which SCCA website is missing the record times, the medium version is 1.814miles and record times tend to be close to 1:30 mark with somewhat regular cars.
Also they don't say how good race car driver was the AI against, there is a huge variety of race car driver skill levels.

Few seconds? They are being vague, i bet it was more than just 2 seconds because they are being vague.
Some racing series have 3% rule to qualify, ie. within 3% of the best time, for 1:30 lap time that is 2.7seconds, in other words this AI wouldn't even qualify. :)

All that being said, great work! Got to start from somewhere.
In theory AI could become better than humans, but then again AI will most likely always lack intuition, so could well be that a human will always surpass AI.
Nevermind that a very highly skilled human with very high motivation can do some insane reaction and completely remove the guesswork some of the time when surpassing the limits, ie. see Ayrton Senna. For AI we'd need sensor capable of few ms polling rates with data returned, then compute all the data within few milliseconds and then some insane fast and accurate servos to achieve that level.

Few millisecond polling rate doesn't sound like much until you realize that for example USB has 90ms, PS/2 is in theory capable of 5ms, and serial port even faster, but that doesn't account for data transfer rates.
There's a reason why we cannot even build a simple ECU/EMS with standard off-the-shelf hardware: Polling rates are too slow.

Comment Re:On the one hand... (Score 1) 316

US:
Domains are being taken completely off the hands of the owners without due process, not just censored.
Censoring happens via DMCA in avery widespread manner, "under penalty of perjury" doesn't do much to stop abuse.
US tries to impose it's laws and regulations to other nations.

At the opposite is countries which are trying to cut off themselves form the global internet.

But there is also countries which have total freedom on internet usage, we don't just see it on news because they don't censor etc. causing debacles like that.

I would prefer all countries in the world have a say, in relation to their populace connected, with streamlined same rules for everyone.
Currently as a business owner i find it sometimes overwhelming trying to conform to a bunch of different laws different organizations are attempting to enforce on us at times. Sometimes our upstream providers laws have direct conflict with our laws, and the situation gets very delicate not to break either our law nor our upstream provider's.

A intergovermental, global organization could make rules the same for everyone, and this would help greatly businesses to provide services. Probably also would make it easier for companies like Netflix to provide their services globally.
BUT only if it's a sensible, sane organization, not under the influence of US corporate lobbyists. It also needs to transparent, so thinks like SOPA, ACTA, PIPA, CETA cannot be sneaked in.

Comment Re:Good riddance to geo-blocking (Score 1) 206

and in many countries that is illegal because you are circumventing copy protection.
Illegal even if making backups or converting to another media for playing it on different devices is legitimate.

Here in Finland you are permitted to make anyway you wish a backup of any copyrighted material for your own usage.
Just the bypass of copyprotection is illegal, but there is no punishment for that.
Also downloading anything/gaining a copy of protected is legitimate for the individual, but distribution is illegal, which in some rare cases does result into fines or even jail time.

To add insult to the injury, every single CD, DVD, BluRay, any media to what you can save data, includes a copyright fee so you are free to copy for your own personal usage.

Businesses can purchase non-copyright fee media for backup purposes and other proven legitimate uses. Also many order media directly from Estonia to avoid the copyright fees.

Comment Re:It's not just games (Score 2) 206

Someone mod parent up and quick!

Exactly what is going on globally everywhere.
Just couple days back here in Finland i read news that a online TV broadcasting firm is being sued for copyright violations. What they did was rebroadcast the channels over internet, allow recording etc. basicly a TiVO/DVR via the net. For each customer there was even a receiver attached to stay on legal side.

They were sued by all major finnish tv channels, even our BBC counterpart which is funded by actual taxes starting 1st of Jan, 2013.
They did not rebroadcast paid channels, only free channels.
All the channels stood only to gain if they just worked with the internet broadcasting company, which has been under discrimination and persecution ever since it's inception.

They also provided access to Finns living elsewhere in the world, because things are so shitty here (A lot of it has to do with taxes and how those taxes are spent). A LOT, and i mean A LOT of finns move abroad, some of them eventually come back like my dad, some frequently visit finland, but many of them never comes around anymore.
It was the only means for "out finns" to watch finnish broadcasts. In that case however it's questionable legitimacy as "out finns" don't pay the public broadcast tax, but ad sponsored channels again stood to gain a lot. Ethically and morally i think "out finns" should be eligible to watch any Finnish TV or Radio channel for free, after all those are the very same guys taking the finnish culture out there - so why should we deny them from appreciating finnish culture in the form of TV or Radio?

Slashdot Top Deals

It is better to live rich than to die rich. -- Samuel Johnson

Working...