Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 18 Jan 2008
Offline Last Active Yesterday, 01:38 PM

Posts I've Made

In Topic: UDP - Custom Checksum or Built-In?

Yesterday, 05:38 AM

I don't think it's much of an issue. Generally, you will want some kind of checksum (or rather a MAC)  to be on the safe side where it matters. Such as when downloading a huge file, or for making sure your executables or data files are undamaged and untampered.


But... as part of your application-level network protocol... no.


Ethernet typically has something like 10-8 to 10-10 bit error rate (depending on what kind of network, and depending on whom you ask, some claim on your LAN you can expect 10-12, but... whatever). IEEE 802 functional requirements as of 1991 requires (5.6.1) 10-8 or better for a device to be compliant, so 10-10 is probably not a too unreasonable expectation today.

Anyway, seeing how your traffic goes over the internet and you don't know how barely standards-conforming cables somewhere on the internet may be, I will assume the worst case, 10-8.


Ethernet frames are terminated by a 32-bit CRC which guarantees (neglecting collisions) to capture all single- double- and triple-bit errors. That doesn't mean that 4-bit or 5-bit errors cannot (or will not) be detected, it just isn't guaranteed by the mathematical model. This means that (neglecting collisions) in order to have a "silent" bit error, i.e. one that isn't directly discarded by the hardware and actually makes it to the IP layer, you need to have at least 4 bit errors in one frame.


Assuming no jumbo frames (internet, eh!) you have a maximum of 1,500 bytes, or 12,000 bits in a frame (well, a bit more, something like 1536 bytes or such... but makes no difference). In order to encounter a single silent bit error in that frame, you thus need 4 bit errors happening among 12,000 bits on the wire. 1/3,000 is quite a different number from 10-8. Also, if you aren't doing bulk transfers, your frames will usually be smaller than the maximum size, so it's even less likely to have this happen (same number of bit errors on the wire, but more frames, more checksums, more interpacket gaps).


Or, look at it from the opposite side. A gigabit ethernet can push 81,247 frames over the wire each second (that's for maximum-sized frames, the likelihood of getting errorneous bits is smaller with smaller frames, both because you have more checksums and because the interframe gaps which are always 96 bits relatively grow in size). The 81,246 Interpacket gaps correspond to 7,799,616 bits (which are harmless, the network card doesn't look at them). If you count in preambles and destination MAC, which is reasonable because it is "harmless", too (any bit error there and the packet will not arrive), it's 16,899,376 bits (about 1.7%) which can contain errors and be totally harmless to begin with.


At a BER of 10-8, a billion bits will contain 10 error bits. Actually only 9.9 bits if we consider the "harmless" locations, there is about a 10% chance that we only have 9 bits to  deal with (the tenth disappears in an interpacket gap). But let's be pessimistic. Let's say 10. That's up to 10 packets but in that case the CRC is guaranteed to pick them up, or if we assume a "somewhat malicious" clustering of our bad bits so actually 4 of them make it into a single packet, we have a maximum of 2 packets where it's not guaranteed that the CRC will pick it up. IEEE 802 requires (5.6.2) a maximum tolerable likelihood for that case too, which is 10-14.


(cough) On the other hand, if we assume that the bad bits cluster up in such a way, we should also consider that there's a fair chance they disappear alltogether in a single interpacket gap, too... :)


So, we have 2 out of 81,247 frames (0.002%) that are problematic. They contain an error and we don't know for sure that the network card will discard the frame (it probably will, but we don't know... there is a 10-14 chance that it won't).  That's in the worst, theoretical case, on a network that only just barely conforms to a 25 year old standard.


Unless you plan to do a transmission that saturates your gigabit link for about 1.58 million years, that 10-14 chance should be no biggie, you can let the TCP or UDP checksum deal with that.

In Topic: CO2 warming effect Contradiction

27 April 2016 - 09:56 AM

Those are all awesome ideas, but I don't think they are realistic.


More CO2, more trees.

The amount of CO2, or rather the amount of carbon and oxygen, is a given. There is never any more nor any less of it. It only depends whether you have it bound (e.g. inside a plant) or floating free. The problem with more CO2 is not that it's harmful in any significant way. The problem is that it very minutely increases temperature and thus very radically changes the climate and climate zones.


Those trees couldn't care less whether there's a little more or less CO2, but we do because we are adapted to some particular climate, and some particular cycle, as are the highly specialized animals and plants that we cultivate for food. The highly specialized houses that we live in are made for exactly one particular climate, etc etc. The tiniest change will be extremely painful to say the least. Trees will always grow, even after we're gone.


How about limiting family size worldwide to 2 kids per family?

In most European countries, governments would be very happy if families even had 2 kids each. China does that "2 kids max" thingie since pretty much forever, and to no avail. Africa... well... good luck with your idea.


claiming the oceans to build city islands Solution: this is still urban expansion, but instead of expanding in to the forest they are expanding in to the seas, so same solution as above

This is particularly awesome because
a) you need huge amounts of sand (no, the huge amounts of sand that the UAE have are not suitable for that due to its microstructure)
b) that sand is stolen by sand pirates
c) as you build artificial isles in point A, isles disappear in point B
d) disappearing isles mean territories change (go ask Vietnam how intelligent it was to sell billions of tons of sand to Singapore)
e) ocean rises a few centimeters, and everything you built up expensing a lot of energy is... gone


How about removing and disbanding all Antarctica and Arctic research bases

What you call "research bases" are in reality outposts. They exist so the nations that hold them can plant their flag onto uninhabited ground and claim the natural resources. No outpost, no claim on the unexplored lands. Not going to happen.


Artificially cutting down of trees in many countries due to huge urban expansion rates.

What about cutting down trees to produce pellets because they are soooooooooo eco-friendly? You should rather kill all those fucking Greens that come up with bullshit ideas like cutting down 300 year old trees for burning, and call that "sustainable". I question how it can be sustainable to use something that nature produces in 300 years for fuel.

What about burning down several square kilometers of rain forest to no avail every day (as bad as it is to use trees for producing energy, they're not even doing that, they just burn the forest down so it's gone...). What about cutting down trees and selling them to China to make... toilet paper.

In Topic: Future of economics, Step 1

27 April 2016 - 04:33 AM

The lender does not "create" it, and neither did you.

Banks can create it and the borrower is the reason why the bank creates it.

Where does this money come from? It comes right out of your pocket.

--Somebody else's pocket.
Iit doesn't matter if if the money came from your pocket or from someone else's pocket before being in yours. What matters is that it didn't suddenly materialize out of nowhere.

You should think about the thing in more "classical" terms because it's much more obvious when you think of money in the classic, physical sense. Think 15th-16th century if you will. If you wanted, you could go back another thousand or two thousand years earlier, but let's not go back too far, let's stay with... Shylock. Who is probably the most famous money lender ever. The coolest one, anyway.

You need 3,000 ducats for some reason: ships, trading in faraway lands, women, luxury watches, you know. So you ask Shylock to lend you those. You're lucky you didn't spit on him, so he isn't asking a pound of your flesh. Shylock obviously wants his money back, but also he needs to live, so he agrees only after you agreeing to pay a little interest of 300 ducats on top of that.
You find 300 ducats a bit steep, but Shylock insists: "I had three guys not pay back their debt last month, so I need to take a little extra from all others, both to make up my losses, and to cover that risk for the future. And with all those people spitting on me, I spend a fortune at the dry-cleaners every week".

Now, you really need that money so you agree to this deal, and unless you want to end up in front of the Doge in chains, you gotta find those additional 300 ducats somewhere. You don't create them because if the Doge gets aware of you doing that, you lose your head. They must come from someone's pocket. And, they likely were in yet someone else's pocket before that. At some point in time, they were minted by the Lord High Coin Minter by order of the Doge.

Every ducat has "Contains gold worth one pound of silver" printed on it, which is an obvious lie, it would need to be nearly twice as heavy for that, but since it has the Doge's seal, that's fine anyway. Nobody wants those heavy coins any more, they're not practical. As long as the Doge promises that in principle there's a pound of silver in each coin, everybody is happy. They're a lot easier to carry around now than they used to be. And the Doge is happy, too, because he needs more coins to pay his curtisans than he has gold for.

Incidentially, none of your ships sink, and everything goes as you wished. Three months later you have 4,000... err... 3,500 ducats, so you will even get to keep, um, 200 ducats after paying back Shylock, which is 100 ducats after tax. Of course you don't carry that huge amount of gold around all the time, Schmuyle keeps them for you, safely in his treasure chest.

So you want to pay back Shylock and ask Schmuyle for 3,300 ducats. He replies: "Oh, but I know Shylock, we go to the strip club together every Sabbat. I will write 'Tis be good for 3,300 ducats, me friend' on this paper, and he will happily accept".

The truth is, of course, that Schmuyle lost your money rolling dice, but nobody knows that his treasure chest is empty. You could say Schmuyle's treasure chest is a bit like Schrödinger's treasure chest. You don't know for sure what's inside, but as long as you don't look, nobody dies.

Now, you believe that he created money out of nowhere, but he did not. He bluffed, and nobody called his bluff. Shylock accepts the promise, and eventually some guy will pay back his debts with Schmuyle, and there will be some gold inside his treasure chest again. Maybe.

Shylock isn't bothered because he knows Schmuyle. He is a nice chaber, and as long as Shylock can in principle have that money any time he wants, this is fine. Maybe next time someone asks for money to pay Schmuyle, he might as well give them a piece of paper, too. Shylock doesn't want to look inside that treasure chest, it's all good the way it is. The piece of paper takes up less storage than a sack full of gold, too.

That's how banks still work nowadays, and they still don't create money. They take existing money by making promises on money that they don't have, and this works as long as there is not a sufficiently high number of people (or sufficiently wealthy people) who want their money. But it's still only just a promise (or fraud, if you want to call it that), not "creating money".

The Government can get a loan from its Central Bank, but the taxpayers repay those loans and the interest on those loans. It simply adds more burden unto the public.

Yes, but the government controls the central bank, and the fact that the central bank has the word "bank" in it is inconsequential. It is not truly a bank. It is the money-making authority. Government doesn't need to take a loan. They can just print the money they need, both to satisfy their immediate demands, and to kill their existing debt.
This is what Schäuble (with considerable help from Draghi) is doing right now. When asked how he intended to eliminate debt as promised, merely by trying not to add more, he laughed and said: "You really don't know how this works, do you. Inflation will do the rest". And that is true. Inflation will indeed do away with the debt, but not at the cost of the tax payer or the public as you say.
It will do so at the cost of everybody who owns money. Those who don't own money do not lose anything (in fact, those who have debt lose their debt, which could be seen as "gaining" money).
But that's OK because we hate everybody who owns something, that's just right, isn't it. If you have money, you must be some kind of criminal anyway, and if you save you're stupid, so you deserve losing it.

Which should illustrate why debt is artificial too.

Not at all. You want something that you don't have. You have nothing to give in return (no money, no goods) but you want it anyway, so you promise to pay back later. There you go, debt. It's not artificial in any way.
It's the natural consequence of people legitimately wanting something in return when asked to give something of value away.

In Topic: Future of economics, Step 1

25 April 2016 - 07:11 AM

Swiss Franc

How so?

Because people had money (billions) invested in financial instruments that were based on the Franc being pegged against the Euro.

Well yes, this lost me a few two-digit grand. But about half of that value is "back" in the mean time, and you needed not do anything but sit on it and let time pass. Notably, the exchange rate recovered (and still is recovering) despite the EU Ship steered by Cap'n Merkel having rammed several huge icebergs since then and still heading for an even bigger one, with the captain having both eyes closed and the first mate being under deck. With someone who is only marginally able at steering the Big Ship (that's admittedly a challenge, given the available alternatives), the Franc would probably only be worth 0.50 Euros now. With Switzerland's biggest industry (secret fraudulent bank accounts) being history, it's still possible that this will happen. Time will show if chocolate, luxury wristwatches, and custom-made hunting rifles alone are enough to keep a currency stable.

Hedge fonds
OK, but that one isn't surprising. Hedge fonds are... well, what do you call them, shady investments? Money burners? Hedgefond managers do deliberately dangerous, haphazard investments all the time knowing that if all goes well they are the hero of the day. On the other hand side, if things go bad, they only lost someone else's money, and they can tell them "Oh, but you knew this was a risk investment".

horror stories in the press about low paid teachers who found themselves 300k in debt from only a 10k position
That's highly dubious. This is only possible if they took up loans to do their "investments" or if they did futures or huge short sales.

If you take up a loan to speculate, then you deserve not only end up in debt, but you also deserve getting 30 beats with a bamboo stick. And the banker who gave you a loan for that, too. That's just asking for trouble.

Futures and short sales... well, nobody will let a low paid teacher trade futures or go short (no way!). Heck, they're not even allowing me to sell short. You gotta be something like... dunno, a bank owner or something to do that.

Which leaves only "normal" investments that these teachers could have taken. Like stocks, options, or fonds. Any of which will be worth zero in the very worst case, but will never leave you in debt.

When 100k is loaned, perhaps 105k is owed. The 100k is spent, but needs to be returned to the bank someday. But what about the extra 5k, where it will come from? [...]
Meanwhile, nobody is wondering "Where did the bank get all that money?". The answer; they made it up. Don't trivialize this, not only can they can make up money when a borrower asks for a loan, they expect so much in return. The borrower can't keep any of it - it's all debt.
Not sure if I don't understand you, or if you don't understand how money works... but in any case it's all a bit queer. :D

If you take up a loan, then you agree to pay back more than you have received. Why? Well obviously because the lender wants to live too, and it's you who is asking for something. Where does this money come from? It comes right out of your pocket. The lender does not "create" it, and neither did you. You must have gotten that money from somewhere (earned, stolen, whatever).

The only one who (legitimately) creates money out of nothing is the central bank. Or, more concretely, the government. But that has nothing to do with any loans that you may or may not have or with any interest that you may or may not need to pay. The government (sadly) can just print more money whenever it feels like doing so (note that "print" is not necessarily to be taken literally, they can just as well "print" money logically).

All other money that is gained by anyone (banks included) is lost by someone else else. Just like every loaf of bread that I take from you is gone from your pocket. Zero sum game. I win some, that means you lost some.

Now, it admittedly gets somewhat funny when governments take up debt. They are taking up a debt and either never pay back at all (taking up loans to pay the interest for loans that pay interests of loans that pay interests), or pay it back with money that they can print as they please. Wealth out of nowhere!

Well, of course not, that would be nice. The system stays a zero-sum game. There is a finite amount of property / value and adding more currency to that simply means each discrete amount of currency is worth less (inflation). Which means nothing more and nothing less than all the poor fools who own money get a little less value for their money. If 1 currency could buy 1 cheese before, it can now only buy 9/10 cheese.

Every now and then, government will just say "OK, seriously now, we kinda... need to readjust the currency", and everybody will be angry because over night they've lost 90% of the "value" that they rightfully own. But time goes on, and 20 years later nobody talks about it any more. Plus, there's nothing you can do anyway. Governments are criminals, they wouldn't be in government if they weren't. There's none who are any better than the others (though some are worse than others), it's simply a sad reality. There are two kind of people in this world, those who are stupid and work their ass off, and there's those who are better than everybody else. Not much has changed during the last 1,000-2,000 years really, except nowadays it's no longer the guy with the biggest sword who rules, but the most professional liar.

In Topic: How do I link my DLLs to Code Blocks?

23 April 2016 - 05:28 PM

This doesn't have much to do with Code::Blocks, but with properly installing the Allegro libraries, which unluckily is, indeed a process of "copying around DLLs". Note that copying headers and import libraries to places where Code::Blocks will find them isn't enough (you probably thought that this is it for "installing" the library, but it is only half the story).

There are mainly two places where the DLLs can be copied, the system32 directory, or the directory the program is in. Actually, putting the DLLs into the system directory is the "correct thing" seeing how they are shared libraries, and there is not much sharing if every program has its own libs in its own directory. However, in practice, one usually does exactly the opposite.

Normally, when you build a library and run something like "make install", this should already place the DLLS in the system directory. Which is both good and bad. Good because you can immediately run any program that uses them (so, not much stalling development), but bad because when you deploy your software, you must remember that this has to be done on the end user's computer, too (having libs in the program's dir, you can just zip everything up and be good).

I'm not very familiar with Allegro, only having used it once ages ago... is there not an option to make a monolithic build? That would mean only one DLL needing to be copied around, less trouble.