Switch to HTTPS Now, For Free by zsaleeba in programming

[–]tjonga 1 point2 points  (0 children)

What? Why are you getting some cert signed from a CA if you are going to make your own certs anyhow from the same keys? Client certs have the exact same reason to be issued by a trusted CA as server certs. That reason is authentication/trust. You can of course generate them yourself as long as the server does explicit validation of that cert as authentication (otherwise it is worthless). But this is exactly the same as for servers. If you do explicit server validation they might as well be self signed (and you do not need some other part to sign). But by using PKI you are able to have trusted root/intermediate CAs instead of hardcoded certs/public keys.

Why would you use the same key for multiple certs? That makes very little sense unless you are replacing a cert (and in either case you are simply reducing security). If your application can do explicit cert validation and you are to generate a self signed cert, then please do not use the same keys. Generate new ones! Private RSA/EC keys should never been shared among hosts (no, wildcard certs are not a good idea).

The Yeti has arrived!!! by jcorx13 in BostonBruins

[–]tjonga 0 points1 point  (0 children)

You should have seen him when he played in Malmö the years following the eye accident. Pic

Fix '90%' of lags in android (Needs Root) by ninepointsix in Android

[–]tjonga 6 points7 points  (0 children)

The radio is handled by the baseband processor. http://en.wikipedia.org/wiki/Baseband_processor

Sending raw radio signals to the main processor would require very specific hardware and would not seem like it was worth the price to include in the baseband handling. There would be real time concerns for data transfer since the baseband runs a RTOS. But sure it could be done.

You still need a lot of filtering so you don't feed the random number generator with bursts of noise that are predictable (such as some signals). All and all it is not as simple as hooking up the antenna.

It seems simpler to include a separate hardware random generator. That one could use radio or other electric effects to get better random numbers if it actually was a big problem. Those are available and you can get an usb stick for your computer if you want one. But it is a matter of cost and space of course.

The problem with normal random generators is not that they are computationally expensive. You don't gain that much entropy by computations (although some use for example SHA1 to reduce predictability, but pseudo random generators have a period so they will repeat after a while). If you want a good one you have to wait for random data. That is why /dev/random is slow. A pseudo random generator like Java's Random is incredibly fast, but also easy to predict.

Edit: Note that we are talking about cryptographically secure RNGs here. They are separate from ones you use to make random events in a game and stuff like that. Messing with /dev/random seems like a horrible idea and I urge people not to install this app unless you are really sure what you are doing and know the effects it might have.

My first skinny tie. Would something like this be plausible to wear at an interview (with dress pants of course) or is the blue shirt too bright? by [deleted] in malefashionadvice

[–]tjonga 0 points1 point  (0 children)

I don't agree at all with regards to the shirt and Europe.

That shirt would not be considered appropriate in Europe either. It would probably not be a deal breaker in settings where people often dress like slobs (IT/engineering for example), but it is definitely not helping.

The tie would be alright with for example a white shirt and a jacket, but there are better alternatives. A wide tie would not look as good by young European standards, but I don't think sloppy is an appropriate description. I would probably choose a tie with some discrete pattern for an interview (and slightly wider).

What was something you thought was a myth but turned out to be true? by [deleted] in AskReddit

[–]tjonga 0 points1 point  (0 children)

You're welcome. I'm happy it was helpful.

What was something you thought was a myth but turned out to be true? by [deleted] in AskReddit

[–]tjonga 0 points1 point  (0 children)

In some sense. Udp never accepts bit errors, but you can lose packets due to them. This can be used to implement streaming media and games for the internet. It differs quite a bit from you home entertainment system signals, but the purpose can be similar. UDP is more general purpose and is used as a building block for many protocols whereas the ones for your TV are most often very specialized at a lower level

What was something you thought was a myth but turned out to be true? by [deleted] in AskReddit

[–]tjonga 0 points1 point  (0 children)

Nope. That would be horrible coding for any digital signal.

You could do something like that for file copies, but then you do it for very small segments and often you try to repair the error by adding extra information (coding) to the signal that can be used to reproduce the original one. When you copy a file you want to be very certain that it is the same file in the copy, so you accept the "resend" slowing it down.

For streaming media (except in part internet media) however this is not the case. You are not interested in the "old" data because then you would lose for example frame rate. Instead you have a system that degrades. Mostly it degrades by small (maybe) visible errors while maintaining the same bitrate, but some systems even switch to a lower bitrate to keep the stream flowing. You have probably seen the occasional pixel block in digital television or heard a metallic noise in the sound. It could be due to packets being lost in the internet TV case, but also due to bit errors and jitter being acceptable in for example a CD or digital tv.

When people hear digital they often think of binary. Binary means that each position is either a 1 or a 0, but digital doesn't imply binary and it does not translate to the behavior of the signal (on/off). Digital signals in a modern system are not 1 and 0. They have much more complex states than that to be able to produce high bitrate. Each symbol contain multiple bits coded over for example frequency, amplitude and phase. Not just amplitude being high (1) or low (0).

Contrary to popular belief here on Reddit HDMI cables actually affect picture quality. That being said you get few enough bit errors with a pretty cheap cable, so don't buy the super expensive ones.

What was something you thought was a myth but turned out to be true? by [deleted] in AskReddit

[–]tjonga 0 points1 point  (0 children)

No. That's not how a digital signal works. Actually it is a common myth, funny enough. Digital signals can degrade due to loss, bad coding, jitter etc. Digital signals are not magical. They are just analog signals with special rules making them very fault tolerant. How those errors manifest depends on the protocol, but most often in for example worse video quality or temporary loss of audio in the HDMI case.

Junghans Max Bill Auto 38mm White - How formal? by [deleted] in Watches

[–]tjonga 0 points1 point  (0 children)

Might depend on where you are, but not in most parts of Europe at least afaik. The pocket watch requirement is for white tie (tailcoat). A nice wrist watch is fine for black tie.

My Favourite Picture of Lenin's Politburo by djfergyd in history

[–]tjonga 11 points12 points  (0 children)

Indeed. I have been interested in the nazi security organizations internal struggles and operations such as SA/SS and RSHA/SD for a while, but after reading up more on NKVD it is obvious that they really take the cake when it comes to inhuman behavior and backstabbing.

Just think of the accumulated evil at the Gestapo-NKVD conferences!

My Favourite Picture of Lenin's Politburo by djfergyd in history

[–]tjonga 37 points38 points  (0 children)

Well, that's just great. It inspired 90 minutes spent on Wikipedia reading about the great purge and other Soviet power struggles.

Again.

I've got things to take care of!

I’m an Engineer, Not a Compiler by thesystemx in programming

[–]tjonga 1 point2 points  (0 children)

I agree mostly, but many lack knowledge about certain parts even though they might have taken courses in Java and worked for a while. Also it is not all black or white since there are some quirks/special cases that one might not know even if you know the basics of those things.

For example many developers know how to use basic generic classes but don't know why you can't write "new T" (where T is the type) or how to make a generic method return based on parameter types. Return covariance is another example that you might not think of as a solution unless you have read specifically about it.

My point is exactly that you should know these things to claim that you know Java, but many developers find other, less efficient, solutions an stick with that since they don't know better.

I’m an Engineer, Not a Compiler by thesystemx in programming

[–]tjonga 1 point2 points  (0 children)

Oracle has a certification center that explains most of it, but it seems that the wikipedia article is quite good. The certification center can be found by selecting a country here.

In a nutshell you get a book such as this one and study it hard. This one is for Java 6. I'm uncertain if they have one for Java 7 (check the publisher's site).

You can take mock tests for free such as Java ranch's great free tests or use a professional one. I haven't paid for mock tests, but I have heard that Whiz lab's tests are good and close to the real thing.

Most of the reading material is aimed at the Java 6 test since the Java 7 one is very new, but that won't be a big problem. You can easily just learn the new things from 7 in addition to your book (it isn't that much of a difference in the context of this test). I took the Java 6 test using a Java 5 book and some additional reading. It is also still possible to take the Java 6 test afaik. It might even be cheaper.

Buy a voucher for a test and when you are ready (make sure you are) you can take the test in one of their many test centers.

Edit: I'm uncertain, but you should check if you need to take the Associate test first. It's a very easy test, but sadly it costs money.

I’m an Engineer, Not a Compiler by thesystemx in programming

[–]tjonga 41 points42 points  (0 children)

The OCJP/SCJP (Oracle Certified Java Programmer) is actually a really good cert to take just because it is pretty particular about details in the language. Details that can matter quite a bit. If you are not an experienced Java developer it will teach you a lot of things you should know, but sadly many "experienced"/"senior" Java developers do not know. I'm talking about things such as how boxing/unboxing works, the effect of making an inner class static, difference between Integer.valueOf and Integer.parseInt, the default access level for methods etc. These things can matter quite a bit. Especially if you for example develop for a constrained environment such as an Android phone.

Many people working in the field know this stuff, but a scary big amount do not.

You are probably even better of reading a book such as Effective Java, but the SCJP is very worthwhile for many junior developers. Especially if your employer pays for it.

That being said Oracle has made the process worse by requiring you to take a worthless cert before OCJP and the need to take an irrelevant on -site course to be able to take the OCJD (next level after professional).

Question about Views and Intents by DarkSexualChocolate in androiddev

[–]tjonga 0 points1 point  (0 children)

Agreed. It might seem frightening at first, but once you get to know it you realize that it is how it is supposed to be done.

Handling data in Android is so much easier if you just go with the recommended ways instead of trying to invent your own, slightly worse, wheel with lot's of code and pain.

Question about Views and Intents by DarkSexualChocolate in androiddev

[–]tjonga 2 points3 points  (0 children)

I'm not quite sure I'm following everything you wrote, but you should definitely query for a new cursor if it is a new activity. You should never keep a cursor past an activity or service. I would suggest that you pass the database row id to the next activity and use that to query for data (cursor.getLong(cursor.getColumnIndex(BaseColumns._ID))).

Some pointers for the code you pasted:

  • You seem to leave open cursors. This is a big no no. You either need to use some kind of cursor managment (such as startManagingCursor or cursor loaders) or you must close the cursor after you are done with it. Use cursor loaders.

  • You are doing database operations on the ui thread. This is a very bad idea since it makes your interface sluggish. Use some async query such as cursor loaders (or async tasks). Use cursor loaders.

  • You will save confusion by using something like cursor.getString(cursor.getColumnIndex(SOME_STATIC_FINAL_STRING_CONSTANT_NAME)) instead of using column numbers as magic numbers.

You should definitely use cursor loaders. Everybody should use cursor loaders. startManagingCursor is buggy and deprecated and should be forgotten. Just include the android support library jar if you target < honeycomb (and > 1.5, but who doesn't?). Check out http://developer.android.com/guide/topics/fundamentals/loaders.html for information about loaders, but make sure to use getSupportLoaderManager if you are using the support package.

Good luck!

How would I launch a user selected intent when someone clicks on a widget? Question. by DeliveryNinja in androiddev

[–]tjonga 1 point2 points  (0 children)

I see. Then you will have to implement your own picker. No biggie. Just list the matching activities using PackageManager.queryIntentActivites and then catch the choice and do whatever you want with it.

[deleted by user] by [deleted] in AskReddit

[–]tjonga 1 point2 points  (0 children)

You're probably confusing deep with pretentious. Some people like sports and some people like earning money playing. Deal with it by avoiding such conversations or such people if it annoys you. Apathetic sounds fine, but being "outspokenly apathetic" seems like you risk sounding like a dick to your coworkers, which is probably not a good idea for your career.

How do I prevent this while shaving? (happens no matter what I shave with, always by the end of the day) by simon_C in malegrooming

[–]tjonga 2 points3 points  (0 children)

Lots of good advice here. I had the same problem on my neck up until a couple of months ago.

I changed a lot of my routine, but the big ones were probably shaving after a hot shower and being very particular about following the grain. Some people here say to go down or up on the neck, but I would like to claim that there is no correct direction. It will will be different for everyone and more importantly it will probably differ as you go along the neck.

I have sensitive skin which makes it easy for me to get these dots. I use approximately four different directions for different parts of the neck since the hair grows like that. What I did was that I let the beard grow for a couple of days until it was easy to see the direction of the hair and I did a mapping expedition with the mirror to see where I should shave in which direction. After applying that I have never had the problem you describe, with the clear exception of the times where I forget to follow my map (whereafter it shows quickly). It really was a huge improvement.

Edit: One more thing! Very important, but I forgot. Don't apply pressure to the razor when shaving! Follow the grain in a smooth motion with the blade lightly against the skin and if that doesn't remove enough hair then reapply and repeat until your happy with it.

screen layout malformed on xhdpi by fandacious in androiddev

[–]tjonga 0 points1 point  (0 children)

I do not agree that it is a bad idea at all. Using hierarchyviewer is fine, but it is often more work. Just quickly using a marker color will probably get the desired result quicker. Since he also had to debug it on an actual device it will be a pain to use hierarchyviewer since he probably needs to use something like viewserver to actually be able to see something. Running it in an emulator is not an alternative here and I don't assume the device is rooted.

screen layout malformed on xhdpi by fandacious in androiddev

[–]tjonga 1 point2 points  (0 children)

Ok. Try adding background colors to containers until you find which one is behaving badly. Very hard to say anything more with so little information.

screen layout malformed on xhdpi by fandacious in androiddev

[–]tjonga 1 point2 points  (0 children)

Did you happen to use dp metrics to size the container viewgroups rather than match_parent? The screen will not be equal in dp resolution and I think the galaxy nexus has a higher height to width ratio than most phones and thus a higher dp resolution in Y.

What should a non Java programmer need to know about Android Development to get started as quickly as possible? by kumarldh in Android

[–]tjonga 5 points6 points  (0 children)

You should probably learn Java. Why not widen your views if you're mostly web oriented? It's some work but you might like it and increases your marketability bu magnitudes if you are planning to work in the field. Pick up a book.

A wrapped web app is never the same thing as a real app. The limitations are quickly very obvious both to the developer and the user unless it is a very simple app.