Crime and punishment
A Finnish paper noted yesterday that in the U.S, Lauri Love could face 99 years in jail, whereas in Finland he would face 5 years at the worst, but probably less. U.S prison sentences are completely out of proportion.
1057 posts • joined 18 May 2007
A Finnish paper noted yesterday that in the U.S, Lauri Love could face 99 years in jail, whereas in Finland he would face 5 years at the worst, but probably less. U.S prison sentences are completely out of proportion.
The rules ask for the source as a zipped text file, but there are two common text file representations: CRLF terminated lines, like on Windows, and LF terminated lines, like on Linux and other Unix-style systems (I am not sure if any Macs still use CR-terminated lines, I believe the older ones did). Can the judges handle all of these, or must the entry be normalized to one specific format?
The rules say each program must be submitted as a single zipped text file. This is a bit unnatural for Java, which requires a 1-1 relationship between public classes and source files, although probably feasible in this case. The problem does not appear to require a complex program. Just use a single public class.
but the war will never end as long as NATO exits.
Sadly, NATO is the only thing preventing Russia from gradually subjugating Western Europe. I wish it weren't so, but with the current Russian regime, I see no other option.
About the dynamically allocate array in C++: I did it that way to keep the versions in different languages closer, and believe it should not have any effect. Firstly, the allocation and deallocation of the array occurs outside the measurement loop, so that overhead is not included. Secondly, any C or C++ compiler worth its salt will keep the base address of the allocated array in a CPU register during a tight loop like this, so there is no difference between accessing it and a stack-allocated array (which would in fact also be accessed indirectly via a register).
I'd be wary of drawing conclusions from implementing half a page of code in various languages and running it.
I fully agree one should not draw too many conclusions from microbenchmarks like this, but it helps get a feel of how various features behave in different languages or compilers.
I also find it hard to believe that you'll outperform C or C++ in an integer focused task, using a JVM language. I'd be very interested to replicate your results, if you provide some details on your methodology.
After thinking about it, I did not find hard to understand. Java is a statically typed language, and modern JVM:s do JIT, where they can apply all the same optimizations as the C++ compiler (at least for algorithms like this that do not require using run-time type information). So it gets down to which compiler has the better code generator. If you want to check for yourself, see macrorodent.blogspot.fi, where I just copied the benchmarks. If you get interesting results, please post comments there.
The overhead is minimal (add a segment to the LDT) and you can trap any overrun from any language. Sure when you DO trap, there is a huge overhead... but you are debugging then!
Actually there is quite a bit of overhead with this method, because access to such far data requires generating a more complex code sequence than for data in the "default data segment". You need to load a segment register (a compiler can sometimes optimize this away, but usually not, and there are not many of these registers, only ES, FS and GS are free for general use). Loading the segment register is expensive in protected mode in the 386 architecture (it loads the descriptor data and checks protections), and the overhead has even got worse in succeeding generations of the Intel architecture, because it is seen by Intel as a legacy feature that almost nobody uses. It is kept around for compatibility, but they don't care about its performance.
Yes, I too have worked with an embedded system that uses the Intel segmentation feature for fine-grained memory protection (still occasionally do), and I can assure you it is a bad idea!
If you must use strncpy, then at least use 'strncpy(bufer, string, maxlen-1)' to make room for the null.
Reasons for that include having to take into account old C libraries. The strl* functions are newfangled inventions. I recall reading somewhere the reason for the dangerous behaviour of strncpy when the target size is exceeded comes from its usage in the original Unix file system, where file name components were limited to 14 characters. They were stored in fixed-size directory entries with 14 bytes reserved for the name, and only names shorter than 14 were nul-terminated. So strncpy with size 14 writing to the file name field did the right thing...
That only works for STATIC bounds-checking, but a lot of the overruns come from DYNAMIC buffers with bounds only known at runtime
This gets language-dependent. If you have a language where the compiler knows how the size of a dynamic array can be determined (for example Java), it can optimize bounds checking also in those cases. I agree this is hard to make work in C, and we might not even want to, if we just use C as a close-to-the-metal language, and use something else for higher-level applications.
That's the big problem with bounds-checking: it necessarily draws a performance penalty in a world where speed mattered.
Yes, if done naïvely, but a good compiler can actually eliminate most of the overhead (for example, deduce that looping over an array needs to check the bounds only once). Of course, the early compilers for microcomputers were limited in this department.
Although Kepler 1647-b was found in the stars’ ‘habitable zone’, as a gas giant with no solid surface, it is unlikely that it can support life.
What, you mean there are no Dwellers? (see "The Algebraist").
Nice video, but compared to Mars, it would be quite boring sitting in that Zeppelin and looking at the clouds of Venus... Hard to see any point in sending humans there, since any exploration of the surface would have to be done using probes and remote sensing anyway.
It is amusing to see claims that weakening the copyright protection of APIs is bad for free software, because if APIs had been considered copyright protected back in the 1980's, there would not be any free software implementations of operating systems. Free software started by building tools (like Emacs and GCC) running on proprietary Unix versions, and only later replaced also the operating system part with a mostly compatible implementation. In the case of BSD:s, only part of the system needed replacement, but there we had an ugly lawsuit until AT&T was forced to agree very little of the original Unix implementation remained in BSD.
Had the Unix API been considered copyrightable back then, neither Linux nor FreeBSD could exist in the present form. Probably not at all, because they would have had to implement an API that is totally different from any other OS else, and would therefore have started with a nonexistent set of applications.
Many have pointed out that Oracle's flagship product actually implements an API originally by IBM (the SQL language for issuing commands to the database). Strong API protection might have meant Oracle also would not have started. Similarly, Microsoft's first product was re-implementing DEC's flavour of the BASIC language, which arguably includes an API, I'm pretty sure they did not license it. (At the time it was actually still unclear if even code could be copyrighted - Bill Gates famously wrote an open letter pleading microcomputer to not copy his BASIC). Now that Oracle and Microsoft are established companies, they want to block the same routes they used to get started. Understandable in a way, but not something we should encourage.
The field of software already has serious a lock-in problem, which makes it hard for users with an investment in some existing platform to switch vendors and promotes monopolies. Strong protection of interfaces will make it even worse. So I fervently hope Google wins. It should also be remembered the same judgment can be used against Google, if someone wants to make a competing product that re-implements the Android API, and Google sues. If that happens, I for one will certainly root for Google's opponent!
cosponsor of the SPEAK FREE Act Farenthold – who actually supports Trump in his run for the White House – told Politico's Nancy Scola: "Obama will sign this. I don't think Trump will,"
Help, my mind just boggled!
but if you want a Linux machine I'd say go with anyone OTHER than Dell.
All big PC vendors are like that. Dealing with a small-scale PC assembler where you can specify known Linux-friendly components is a better way. The result is also likely to be more upgradeable and repairable, as it will contain only generic parts, instead of funny stuff specially molded for Dell, HP or whatever.
.. +1 As long as you're not making that suggestion to the manufacturers for their consumer PCs. Just imagine the enhancements they could do then, or look at the nonsense the carriers and manufacturers do to Android phones.
On the other hand, a laptop manufacturer that simply pre-loaded an up-to-date, well-known Linux distribution with NO "enhancements" (apart from harmless ones, like a branded default background image) could now stand out from the crowd, and win friends.
Not doing this was where the original mini laptops went badly wrong. They had oddball Linux versions that didn't have any software repositories, no community, and required the manufacturer to do all support, which they typically did not do well, and soon dropped (my experience with an Asus EE PC 901).
"None of the above" does not work. Not short-term, at any rate: maybe there's a place for a third party in the US system, medium-to-long term.
Won't happen until you switch to a proportional voting system. And that will never happen in the U.S. because both the GOP and the Democrats understand it would erode their power.
Windows is outselling Linux on the desktop 90 to 1, what conclusions would you draw out of that?
Almost nobody explicitly buys Windows. It comes with the PC or laptop, whether you want it or not. Nobody buys Linux either: Red Hat Enterprise Linux and the like are really support contracts (the GPL ensures this). Any consumers using Linux get it on a magazine cover DVD, or more commonly legally download it for free. So I really don't know what to conclude. Maybe it is that attempting to sell operating systems is a very bad business these days?
The keyboard is pretty good,
In WP7, you cannot turn off autocorrection in the keyboard. This is cursed by all Finnish users, because the method of guessing a word used by Windows is a poor match, and if you don't check the text, you may wind up sending quite lunatic texts... The prediction is also useless in Finnish, because our words tend to be long and have varying inflections. By the time WP7 has a correct suggestion, there are seldom more than 2 letters left to type.
(Not sure if other smartphones do any better in this department).
True. Any competent programmer could learn Fortran in a day or two.
Especially if it is Fortran 77 or later. It is a quite approachable conventional language. The earlier versions might be more challenging. For example, it is possible to write Fortran statements with no white space at all except for the mandatory leading indent (saves time when punching cards!), and anything after the 72. column is ignored by classic compilers. Used this feature once to write a program that is both valid Fortran and ANSI C at the same time! I think I still have somewhere Microsoft Fortran for CP/M with which I tested this hybrid program...
It's Lumia, not Lumina we are nostalgic about. About IoT, MS is not in the running because of licensing. Device makers these days want access to the source of the OS; and also zero cost for the OS per unit, and MS cannot compete with Open Source OS's in this game.
Now the ole' Nokia 710 is getting a bit tired it's finally time for a change.
Same situation (as I wrote some time earlier). But now, given Nokia has just licensed the brand and IP to a Foxconn-backed phone company with HQ in Finland, I think I will wait and see if i can get again a Nokia smartphone...
"Oy" in Finnish is an abbreviation that means pretty much the same as "Ltd" in English.
They've eaten Siemens and Motorola in the Network Infrastructure space.
You forgot the latest, Alcatel-Lucent. (Which actually means Nokia is now the owner of the legendary Bell Labs!)
The problem with Lucy Liu as Jane Watson is she plays the role as a too smart character. Dr Watson should be a bit slow, or at least appear to be so in comparison to Holmes.
Still given they don't have the guts for that they should make her the next Doctor.
No, since she's not British.
There have really been just two disasters with catastrophic effects, Chernobyl and Fukushima, both in quite old plants. Oh, and one rather inconsequential one, Three mile island, which killed nobody. New plants really are inherently safer, a a response to concerns raised by the problems. At least in Chernobyl the safety culture seems to have been questionable. Experimenting on a live reactor so that safety systems are intentionally disabled?! At least nobody will try a that again. Fukushima was the victim of a natural disaster, but the plant was not sufficiently prepared for the double whammy of an earthquake and tsunami, in a part of the world where such are known to occur. Maybe we just should not put nuclear power plants in earthquake-prone regions.
Even a worst-case accident in a solar power plant will not leave the surrounding are contaminated for centuries.
But actually I pretty much agree about nuclear power. In *competent hands* modern nuclear power plants are quite safe. The problem is, running them really requires a culture with a strict work ethic, and fanatical focus on quality. And don't build them in tectonically unstable places, or next to a tsunami-ridden ocean...
DARPA didn't invent HTTP or the WWW. One guy at CERN did that.
I'm pretty sure the poster was talking about the underlying protocols (TCP/IP, UDP) whose development indeed was funded by DARPA. Actually ARPA a the time; the net used to be called the ARPANET, and Internet happened when that was opened up to other users besides U.S military, its contractors, and academic institutions.
The great achievement of the "one guy at CERN" was making the data on the internet approachable by the average guy, and in a way that scaled up without central control. And of course making the idea and code available for all for free. Had this been a typical commercial effort, with everything patented, there would have been multiple incompatible and very expensive webs.
But it's still funny to see Pascal old features being introduced as new features in C#.
If you mean nested functions, they were already in Algol 60. Pascal of course copied them from it, Pascal being basically a modernized version of Algol 60 (where "modern" = "circa 1970").
If I remember rightly, the base model had 4K RAM and 8K ROM, so it should be doable.
Wouldn't the RAM alone require 8192 transitors? (each bit in a bistable transitor circuit).
The whole device would fill a warehouse.
but I no longer own anything with a serial port so I'd be hard pressed to use it
There are USB to serial adapters, they don't cost too much.
... as providing a REST API endpoint," explains ...
This REST API rage means darn near everything comes with some kind of web server, with the associated risks.
The future is 0wnable.
You forgot the troll icon...
Actually, what you propose may eventually happen without any conscious standardisation, provided the current economic and political relationships stay in force. Given the choice, European kids usually prefer to pick English as their first foreign language, and learn it at an absolutely frightening speed, thanks to video games and other popular "culture" (this based on first-hand observations of my kid and his pals).
There is simply no way you are going to teach someone who is not a native speaker to have educated native speaker fluency
I disagree, at least partially. Some people have phenomenal talent for picking up a foreign language. I once met an American exchange student that had been in Finland for a year, but his Finnish was almost flawless (which I say as a native Finn). Even less-talented people can master a foreign language if they really try and put years of work into it. Easier if you start early. The hardest past will be perfecting your pronuciation (probably impossible if you start as an adult), but that does not matter for task involving writing.
The City of London has no problem in using Open Source nor does Goldman Sacks [...]
I don't think these organizations ship products containing open source code. The one I had in mind does. This may create more obligations, depending on the particular licenses.
I agree there is a lot of FUD and over-cautiousness about open source use, but a technology company that stuffed any good-looking open source code into their products without anyone competent checking the licenses would be irresponsible. However, the legal clearance should accept that the open source code evolves, and it must be possible to upgrade the open source components without a huge song and dance. For example, the legal eagles could declare that all versions of Foobar 2.x are OK to use in products, provided the license does not change from the one they vetted.
A common reason is that at some point an open source component is embedded into the closed commerical software (possible with many licenses), but forgotten and never updated. Company bureacracy can also seriously contribute to this. In one organization I know, a legal clearance process is required for any included piece of OSS (good practice), but the clearance applies to a specific version only, down to the last version number digit. If you want to update it, if only to get minor bug fixes, you have to request another clearance. You can guess where this leads to...
So it is written in C++. That explains it...
(C++ is one of my least favourite languages: combines all the pitfalls of C with several of its own, pretends to offer higher-level abstractions, which however cannot be protected by the language, and are easily broken by accident.)
Very, very stupid of Paramount: The trekkies are the only reason Start Trek films or TV series make any money at all, and annoying them is not going to make the franchise any more profitable. Maybe their lawyers are concerned the fan fiction would dilute their trademarks or something, but the solution would have been to negotiate a deal where the fan films prominently acknowledge the trademarks are used by the gracious permission of Paramount, but do not pay for them.
Anyone recall the plan to turn PCs into dumb devices where the media could be locked down remotely?
A pretty good description of the iPad and similar. Note that the market for "open" PC.s has been going downhill for years, and they, too, have gradually become less open. Modern chipsets from Intel and AMD actually are always running a little closed OS underneath what you think is the OS (Windows,or Linux, does not matter), it is in full control of the PC, and you can't turn it off, or replace it.
Most of the stuff you associate and expect from a modern phone is now tied into GMS and it's interconnected APIs and services.
So how does CyanogenMod and similar manage to work?
You answered your own question when you mentioned the Fire phone. Which doesn't run Facebook, Uber etc etc, because they rely on Google middleware.
A phone manufacturer deciding to install eg CyanogenMod could create shims to provide those apis, or persuade the vendors of the incompatible apps to tweak them (surely much less work than porting them to a totally different OS). In fact, there is a community effort to create an open replacements for google apis, see nogapps (google it :-).
I have to agree with the grandparent post: the Eu response is overblown. Comparisons to Microsoft and Windows fall down already when you consider that most of Android is readily available in source form for free, and that can be forked just fine. But try suggesting Microsoft that you would like to fork Windows, and see how far they kick you out of their door...
Another factor is there is much less locking down of customers than in the PC world. People frequently switch from iOS to Android or vice versa (some even switch to winphone, or from it). People do not usually have documents in proprietary formats on their phones, and the cloud systems of the major vendors can be accessed by "alien" phones after installing suitable apps (eg. the other day I installed Onedrive support for iPad). And apps are cheaper than for-pay PC applications.
Have you tried to reads a book via Google books? Except for cases where Google has properly acquired rights to the book, or the copyright has expired, all you get is a small amount of surrounding text around your search term. It really is just a card catalogue.
I just tried feeding my one surname to it, and got a very relevant reference to an obscure scholarly treatise on village names in a certain region of Finland. I might go and hunt the actual volume, as I have long wondered about the origins of my rather rare name (I knew it was the name of the ancestral farm, but where did its name come from?) Google books did in a few seconds what would otherwise probably require months of digging in the libraries of universities.
Whether or not the issue here was real or fake, a year ago the Linux port of Steam was hit by a similar issue. Reportedly, it used to have a script with line like
rm -rf "$STEAMROOT"/*
Unfortunately, due to insufficient checking in the script, STEAMROOT could sometimes be undefined, so the line above expands to the file-system nuking command if run as root. If as nonprivileged user, it will delete the user's own home directory, often bad enough.
The moral here is that if you are going to distribute a shell script to other users, you just cannot assume things go well. You have to check for valid input parameters, command exit statuses, and whether environment variables that are needed exist and have reasonable values. This easily makes the script twice as long (or more) than a throwaway script doing the same operations under lucky circumstances. (And guess which versions books and web pages on scripting typically show as examples?).
14,000 in their full time combined forces?
Someone has dropped the ball! The UK has about 150k by comparison.
Well, Sweden is surrounded by friendly nations, they have Finland as a convenient buffer zone towards Russia, they have no past or present overseas territories to defend, and unlike the UK, have stayed out of wars for the past 200 years. Then the cold war ended and perpetual peace appeared to arrive to at least western and northern Europe. So they dropped the ball.
Russia is a big juicy target and an invader can just march right in, theoretically.
But note they have not kept Russian territory, or even haven't marched out in one piece! Just ask Napoleon or Hitler.
The size of the country means it is completely impossible for anyone to conquer Russia, as long as the Russians do not completely drop the ball on defence. Their paranoia is unjustified.
the Earth takes on (potentially radioactive) grape shot?
That is preferable! Because most of the smaller pieces will burn up in the atmosphere without hitting the ground, and the rest do not cause as much destruction as a hit by the the whole cannon ball would have. As for radioactivity, some of it will have dispersed widely in the explosion, and during the round-trip the asteroid makes before the fragments hit us, so we don't get all of it. Some of the short-lived isotopes will also have decayed. Besides, we survived the 1950's bomb tests, which spread much more radioactive dirt around.
Cosmic rays, I guess. Kepler orbits so far from Earth it is not inside our magnetosphere, unlike LEO satellites. Even if it is built with radiation-hardened electronics, occasionally something still gets zapped.
Just pondering the him/her option and debating between 'hanet' or keeping it simpler and reusing 'han'...
Suggest you keep it simple, as your language rationalisation project would quickly run aground if you try to import the whole Finnish system of noun cases ( https://en.wikipedia.org/wiki/Finnish_noun_cases ).
It would also be great if we could introduce a non-gendered nominative term for the English language to replace him/her/his/hers, similar apparently to (some of?) the Scandinavians -
Of the languages spoken in the area, only Finnish and Sami (spoken by the indigenous people of Lapland, and related to Finnish) have gender-neutral personal pronouns.
heck this is the English language, we should go with history and just steal one of theirs!
You are welcome! Here is the Finnish version: "hän" = "he/she".
The "ä" is pronounced like the "a" in "hat".