Better HN
topnewbestaskshowjobs
Log inSign up

hackermom

1,708 karma · joined Jan 14, 2010 (16y ago) · 672 submissions

Submissions

comment 16y ago · link · parent

Joke all you want - this just may be the kind of turn one or other DB actor on the market will take.

comment 16y ago · link · parent

SQLite outperforms it by far. That could also weigh in a little :)

comment 16y ago · link · parent

I have nothing but good things to say about SQLite. Small. No dependencies. Lightning fast. Public domain. I use it exclusively for all things databases where the customer for whatever reason does not demand one of the other players. I'm glad to see a major actor in the DB industry picking up on it.

comment 16y ago · link · parent

jSCrypto uses AES-128 only, a 10-round cipher with a small keysize, to which there are a number of side-channel attacks available. AES is also a very slow performer due to its computationally demanding nature, and still it does not supply additional benefits from the large amount of work it puts into scrambling data - a perfect example of another case of this would be the good old DES standards, with its measly 56-bit (7 bytes) keys, which are computationally more demanding than newer, safer ciphers, yet still so easily broken.

In comparison to this, a cipher that is both fast and also secure would be f.e. Blowfish, a 16-round cipher supporting 448-bit (56 bytes) keys, while still, on 448-bit keys, operating about 25% faster than the not quite as secure AES-128 does with its 128-bit (16 bytes) keys. Blowfish is entirely free of patents, whereas most of the cipher modes of AES are patented.

The second most important factor in a cipher's security is its keysize. If the cipher withstands all cryptoanalysis on its full amount of rounds, the last resort is brute force, and with brute force every extra bit of keysize matters to the feasibility and practical possibility of breaking the data. 128 bits of AES is today broken with modern parallel means in ridiculously short times (read: hours). Every extra bit of key theoretically (but not always practically) doubles the work required; a 129-bit key is twice as large as a 128-bit key; a 130-bit key is four times larger than a 128-bit key; a 448-bit key is 320 times larger than a 128-bit key.

comment 16y ago · link · parent

Here; I un-obfuscated it and commented the HTML5 parts for you. I leave the hardcore maths for you to unravel, 'coz maths on this level aren't my thing :-)

There isn't really anything "HTML5" about this demo - it only uses the Canvas feature to output the rendered image on the screen, which can also be done in other non-HTML5 ways (although not as fast):

  <html>
  <head>
  <script type="text/javascript">
  
  // we need to output the canvas tag here, in order to make the js engine
  // instantly aware of the "R" id so that the canvas can be addressed at once
  document.write( '<canvas id="R" width="64" height="64" style="width: 4in; height: 4in; background: #ffffff;">' );
  
  // array N and object K now exposes an API for interacting with the canvas
  var N = [ K = R.getContext('2d') ];
  
  // pulls image data from x/y 0,0 w/h 64,q of canvas K into ImageData object I
  for( t = B = 127, I = K.getImageData(0, 0, q = 64, q); t--; $ = Math.cos )
  {
      N[t] = t / 43 & 1;
  }
  
  function sponge()
  {
      t++;
      for( i = y = -1; y < 1; y += A )
      {
          for( x = -1; x < 1; x += A = 1/32, I.data[i += 4] = h + h )
          {
              for( m = C = $(a = t / 86),
                   S = $(a + 8),
                   c = $(b = t / B),
                   s = $(b + 8),
                   u = x * C + S,
                   v = y * c - u * s,
                   u = u * c + y * s,
                   w = C - x * S,
                   X = q + 9 * $(a + b),
                   Y = q + 9 * $(b - a),
                   Z = t,
                   h = B; --h && m < q; X += u, Y += v, Z+= w )
              {
                  for( m = 1; N[X * m & B] + N[Y * m & B] + N[Z * m & B] < 2 && m < q; m *= 3);
              }
          }
      }
      // render ImageData object I onto canvas K, at x/y position 0,0
      K.putImageData( I, 0, 0);
  }
  
  // try to run the frame renderer, sponge(), once every 20 milliseconds
  setInterval( 'sponge();', 20 );
  
  </script>
  </head>
  
  <body bgcolor="#000000" text="#ffffff">
  </body>
  </html>

comment 16y ago · link · parent

It's been nice knowing you all.

comment 16y ago · link · parent

This is a really great idea. My only gripe is that it uses AES (due to that being the only cipher in jsCrypto).

comment 16y ago · link · parent

The two game series are called Brain Age, and Big Brain Academy. Both are great fun - and helpful.

comment 16y ago · link · parent

Very interesting approach. For those who are interested in more "different" math, google (or wikipedia) for "vedic math" (from Sanskrit Véda, "knowledge"); an ancient Indian system of mathematics a bit different from the typical western teachings, said to better adhere to how the human mind works. Some amazingly efficient techniques for arithmethics on both paper and in head are to be found there.

comment 16y ago · link · parent

A swedish student, Thomas Jönsson, performed a similar "polyphasic sleep" experiment 2 years ago. He slept 2.5 hours per day; 25 minutes every 4th hour. His aim was to improve his potential and performance on a wide front, and he increased results in several contexts (learning, and physical exercise being the most notable ones). He kept his experiment going for about 6 months. He was 23 years old at the time.

comment 16y ago · link · parent

Hm. Is it just me, or does it feel like describing a path with plain ol' tab completion isn't really bothersome, impractical or "a lot of keystrokes"? And since when weren't aliases good enough? I definitely see the use for this under Windows, but in a real nix shell? -shrug-

comment 16y ago · link · parent

  <?php
  
  $entries = 500000;
  
  $db = new pdo( 'sqlite::memory:' );
  
  $db->exec( 'create table abc (a integer, b integer, c integer);' );
  
  $db->beginTransaction();
  while( $entries-- )
  {
      $a = mt_rand( 1, 99 );
      $b = mt_rand( 100, 999 );
      $c = mt_rand( 10000, 99999 );
      $db->exec( "insert into abc values ($a,$b,$c);" );
  }
  $db->commit();
  
  $start = microtime( true );
  $results = $db->query( "select a from abc where b=$b and c=$c;" )->fetchAll( PDO::FETCH_ASSOC );
  echo count( $results ) . ' match, ' . round( microtime(true) - $start, 4 ) . 's to complete without index' . PHP_EOL;
  
  // build an index
  $db->exec( 'create index i1 on abc (c);' );
  
  $start = microtime( true );
  $results = $db->query( "select a from abc where b=$b and c=$c;" )->fetchAll( PDO::FETCH_ASSOC );
  echo count( $results ) . ' match, ' . round( microtime(true) - $start, 4 ) . 's to complete with index' . PHP_EOL;
  
  $db = null;
  
  ?>
  
  mombook:~ hackermom$ php index_test.php
  1 match, 0.1118s to complete without index
  1 match, 0.0001s to complete with index

comment 16y ago · link · parent

This is slightly besides the topic, but since it can be of much help it's worth to mention in case someone learns something: primary keys are indexes per their own nature. The KEY keyword is actually an alias for INDEX in pretty much all RDBMS. So, if you can't index an already large database for whatever reason, and happen to have a primary key column that could be used in a similar way, you're suddenly better off. It's also the fastest index available.

comment 16y ago · link · parent

I think the general rant I'd throw comes down to the fact that this guy is a "software engineer". He constructs code as if he was designing a mechanical machine, which is just awkward and inefficient. Don't get me wrong on the whole "software engineering vs programming" thing, but I discern good, fast, efficient code from bulky, clunky (but still working) code; you can't "drive car" with a sailing yacht, you can't "breakdance" the Waltz, and you can't go "industrial engineer" on programming - sure, it'll get you somewhere, but it's just not the best way for the end purpose's fullest efficiency - AND EFFICIENCY MATTERS.

Play with this a bit: http://pastebin.com/wauSARbt

1000 plots, averages to 35 fps on my 2.25ghz Macbook on Safari 4.0.3, and this requires more computational power per object plotted than a smart version of the "bouncing balls" effect he tries to do.

comment 16y ago · link · parent

Good grief! This is big... I mean, where will I now get my daily fix of dancing cats and piano playing dogs?

Jokes aside, it is a little strange.

comment 16y ago · link · parent

I think his conclusion should be taken with a big grain of salt, because, if you look ahead, to the inevitable future, Flash will probably not be anywhere close to as big an actor as it is today, while Canvas will without doubt grow and grow. But I guess if time stood still, which seems to be the case with most Flash protagonists.....

comment 16y ago · link · parent

I took a look at his Javascript code, in the "HTML" example, and it was far from as well written as it could be - I could easily do the same effect with a whole lot better framerate. I am not sure how fair a test this is.

comment 16y ago · link · parent

How? Whatever does Google Search have to do with YouTube? Google Search is not affected in any way what so ever by neither Google's nor Mozilla's love or hate for h.264. Also, YouTube is fully enjoyable with Flash. No matter how I twist and turn your response, I just can't see the red line you're trying to draw here.

comment 16y ago · link · parent

Gruber nails it again. Mozilla's hypocrisy is as always overly evident. Their stance is fuelled by sheer greed, obviously - it's about money, about them not wanting to cut down on their yearly economical influx, not about being "open and free", as their actions of trying to sweep the bleeding case of Flash under the carpet is so obviously telling.

I wonder, did any of the non-Mozilla developers, whose work spans the majority of the project today, ever see a single dime of the _tens of millions_ of USD (yes, that's their revenue) going into the Mozilla Foundation from their search engine sponsor choice? No, I didn't think so either.

comment 16y ago · link · parent

Died from sorrow, not from old age.

comment 16y ago · link · parent

I've always had the opinion that "engineer" is what the americans call a programmer. I also maintain that the largest reason behind the increasing and worrysome trend of downright lousy and inefficient software is due to it being "engineered", or should I say "overengineered", rather than just programmed. I blame a bad part of "software engineering" for this downwards spiral, but not "software engineering" itself, even if there's always a very clear distinction in what software was done by a programmer, and what software was made by an "engineer", with the latter pretty much always being the clunky and inefficient one.

comment 16y ago · link · parent

What a stupid, contradictive, misleading and deceitful reply from Mozilla (surprised? they are after all interested in stuffing their pockets). And, yeah, I _will_ stick to my ideals: good video; H.264. Please stay out of HTML5, Theora.

add.: I really misread both source and addressee on this one. Seems I cannot manage both breakfast and news digest at the same time. I'll still stick with H.264, though... and breakfast.

comment 16y ago · link · parent

In 1999, when I was 19 years old, I started working at a "web buraeu", as we called them in my country back then. I did html, asp, php, graphics, design. All that. A jack of all trades, sort of, as I've always been talented with pretty much anything technical, and as it was a small company that needed its employees to "pitch in" where they could. I worked with this company for 1.5 years, until march 2001, when me and two others had to leave because of shortage of work. At this point I had developed a sociophobia and various, severe stress disorders, among them panic attacks. I took a position with another "web bureau" 2 months later to try maintain an income. 9 months later, in march 2002, just having had my 22nd birthday, I was broken down to the point that I often needed help with grocery shopping and most other daily errands related to the outside of my home. In late 2003, the side-effects hit their climax; on average I left my apartment 3-4 times per month - just to take the trash out. Today, march 2010, I have still not fully recovered my ability to work in the capacity normally implied by a "9 to 5". My normal hours in the two jobs that broke me down ranged between 10 to 14 hours per day, and I worked most saturdays and sundays as well.

comment 16y ago · link · parent

Creatine supplements for meat-eaters increase physical stamina. It's one of the most sold products in "power sports" along with protein supplements. Ask the jocks to get the word from the horse's mouth, then tell me they too suffer a Creatine deficiency. :)

comment 16y ago · link · parent

But, I never argued that they benefit better with Creatine. You haven't read my posts. And just as vegetarians get a boost from it, so do meat-eaters, who also perform better when supplementing Creatine - ask 10 athletes (body builders in particular) and you will find at least 5 who uses it and can vouch for increased stamina from it. Does this, too, mean that they don't get enough? Surely it should, by the logic you've been using, and at this point you are contradicting yourself. From this we can simply draw the conclusion that everyone benefits from more of this in their systems, but it doesn't point to a deficiency of any kind, just as with my example of how artificially increased oxygen levels in the blood doesn't mean we don't get "enough" naturally.

The point I trying to make just flies by you; You don't KNOW what is enough, you don't KNOW what is too little. You can't say any of this based solely on the proof that _anyone_ performs BETTER when you ADD MORE. This is _not_ synonymous with a deficiency. And the research pointed to doesn't even bring up the specific vegetabilic diets held by the vegetarian subjects of the research, which is a very important detail missing for solidifying the "facts" the research is trying to bring forth. It's a very clear case of "correlation is not causation".

comment 16y ago · link · parent

I don't like how the author of the article angles the irresponsible actions of those in charge of the factory, as being the fault of Apple and Nokia. There is a consistent tone of "Apple/Nokia uses illegal chemical n-hexane in factories". Simple sensationalism.

comment 16y ago · link · parent

I consider it just a small leap in logic compared to your knee-jerk parallel regarding money in the wallet.

We know that increased oxygen in the blood speeds up healing of damaged tissue - this is why you get a tube up your nose blowing extra oxygen into your respiratory system when you come out of surgery. Does this by your logic mean that we're persistently oxygen deficient in our natural state, just because ADDING oxygen gives a higher effect?

What IS the nominal level of creatine in the body? Do you know? I don't. Pure creatine supplement from meat ingestion can so far only be proven to be an _added aid_, rather than going by the logic that vegetarians turn dumb when they stop eating red meat.

comment 16y ago · link · parent

I just don't see where you are going with that text in the context of Creatine production. Vegetarians HAVE Creatine in their system, fully produced by the body. They just don't have the same amount as the meat-eaters, __because red meat contains Creatine itself, as a form of Creatine supplement__. Ergo, vegetarians are fully capable of producing the necessary amount of Creatine they need, by the ingestion of the required components. (otherwise there'd be no Creatine in their bodies.)

comment 16y ago · link · parent

Just thought I'd add this...

Creatine is naturally produced in the human body by amino acids. Just because you're a vegetarian, it doesn't mean you suffer a shortage of the particular amino acids required for producing creatine. Most vegetarians fall under the "ovo-lacto" umbrella, meaning they will eat egg and milk, and pretty much anything else made by animals, just not the animals themselves - being a vegetarian myself, I often say: "I'll eat food made by animals, just not food made OF animals" - and many vegetarians also use various "fullworthy" protein supplements containing all the essential amino acids, guaranteeing them all the components needed to produce creatine while being a vegetarian.

I myself use protein supplements to ensure, together with food, that I get a bit more than 1 gram of fullworthy protein per kilo body weight a day, and that is an amount that actually even meat-eaters, without supplements, can have a hard time reaching on a daily basis.

Addendum:

Digging a little bit on Wikipedia, I found the three amino acids (of which only one is essential) that Creatine is produced from in the body:

Arginine (non-essential) - vegetabilic sources: "wheat germ and flour, buckwheat, granola, oatmeal, peanuts, nuts (coconut, pecans, cashews, walnuts, almonds, Brazil nuts, hazelnuts, pinenuts), seeds (pumpkin, sesame, sunflower), chick peas, cooked soybeans."

Glycine (non-essential) - synthesized in the human body from Serine, also a non-essential amino acid.

Methionine (essential) - vegetabilic (and animalic) sources: "High levels of methionine can be found in sesame seeds, Brazil nuts, fish, meats and some other plant seeds; methionine is also found in cereal grains."

Judging from this, it seems that a vegetarian has to maintain a really lousy and unhealthy diet in order to suffer a Creatine shortage. Maybe the test subjects were university students on a Ramen diet.

comment 16y ago · link · parent

i really enjoyed that the news item linked to the robots.txt file :) it's nerdy, it's short, it's clear and concise, all in one :)
1
1920212223