External Content not shown. Further Information.
So I wrote a simple wavefront parser using POSIX regular expressions. It suddenly stopped working, while I was trying to port the whole thing to Qt. The parser itself is not very beautiful, but it did its job well so far, so why change it?
Well, I found out the problem lies in the following line:
sscanf(mytokens[1+i], "%lf", coords+i);
The variable mytokens[1+i]
contains a string that contains a float,
say, -0.697203
. coords
is an array of float values. However,
suddenly, it always contained zero. I added the following line to
debug this issue:
fprintf(stderr, "%s %lf\n", mytokens[1+i], coords+i);
The output consisted of lines of the form
-0.212040 0,000000
1.092960 0,000000
-0.679962 0,000000
-0.110031 0,000000
1.123250 0,000000
I noticed that the second numbers all have a comma as separator -
which is common in Germany. And my locale is set to de_DE.UTF-8
. And
sscanf
seems to also parse according to this locale.
Running my application with LANG=C
worked again.
Update:
Maybe I should have given the solution to the problem. Well, the
locale is set by Qt apparently. I could set it using setlocale(3)
,
but then I would risk clashes with other parts of Qt.
Instead, as I use C++ anyway, I used a std::stringstream
, and its
method imbue
. A quick and dirty replacement for sscanf
looked like
static void parse_double (const string& dbl, double& ret) {
locale l("C");
stringstream ss;
ss.imbue(l);
ss << dbl;
ss >> ret;
}
In Because Reading Is Fundamental, the author talks about the culture of online discussions. He comes to the conclusion that there is far too much talking already, and we badly need to incentivize listening and reading, and supports it by an experiment performed by Ars Technica. An article (which I did not read entirely) which contains the line If you have read this far, please mention Bananas in your comment below. We're pretty sure 90% of the respondants to this story won't even read it first. Apparently, the assumption was correct.
On the other hand, such articles are lengthy, and you usually get the relevant information by just looking over it. Even worse, for many news sites, you can predict most of the content. And most "heated discussions" just contain the same arguments over and over again.
Furthermore, it seems like many writers consider their writings an art, use complicated grammar and lots of lengthy phrases, where a short text with only the relevant information would be sufficient.
I admit, I am tired of reading. There is so much information, produced by so many pressure groups who think their topic is the most important. Complicated software, complicated telephone charges, complicated taxes, laws so complicated not even the high courts are sure what they actually mean. One has to apply noise-filters to cope with this flood of (dis)information. If your text is written in a way that people who are interested in that topic (and who you probably wrote the text for) do not read it carefully, this might be a flaw in your text rather than a flaw in the persons.
I could have wrote this as a comment on CodingHorror, but I do not want to register yet another account, and support yet another software project that tries to replace IRC and SMTP and forces me to activate javascript just for writing and reading comments.
Mein Paket blieb also beim Zoll kleben. Das ärgerte mich erstmal natürlich. Ich hatte heute eigentlich etwas besseres zu tun, als das Zollamt zu suchen, und mein Paket abzuholen. Insbesondere habe ich mit viel Bürokratie und langen Wartezeiten gerechnet. Nunja. Ich will hier mal das Zollamt mit den üblichen Lieferservices vergleichen. Natürlich beziehe ich mich auf keinen speziellen Lieferservice.
Lieferservice | Zoll | |
---|---|---|
Häufige Gründe für Nichtauslieferung | Nichtantreffen. Bote hat keine Lust. Angekündigter Lieferzeitraum stimmte nicht mit wirklichem Lieferzeitraum überein. | Embargos. Artenschutz. Sicherheit. Steuern. |
Filialstandord | Irgendwo in den Städten versteckt. | Irgendwo in den Industriegebieten versteckt. |
Mitarbeiter | Oft genervt und überarbeitet. | Freundlich. Gelassen. |
Lagerzeitraum | Höchstens 7 Tage. | 2 Wochen |
Lagerkosten | Keine | 50ct pro Tag, ab 10 Tagen |
Ohgoddohgoddohgodd die armen Tippsen in meiner momentanen Sort-of-Wahl-Heimat kommen mal wieder mit Linux nicht zurecht - "Egal in welches Referat ich komme, überall kriege ich bestätigt, dass die Mitarbeiterinnen und Mitarbeiter darunter leiden." - die Ärmsten. Es ist aber auch schwierig geworden, mit der vielen IT.
Computer machen ja alles so viel schwerer. Da muss man regelmäßig in Excelkurse damit man auch ja nicht vergisst was man auf den Klick genau auswendig gelernt hat. Das war früher viel einfacher. Zumindest klingt es gut, sich so herauszureden.
Früher wurde von Menschen noch verlangt, dass sie das Werkzeug, das sie benutzen, halbwegs verstehen. Da gab es die Zeiten wo man noch Stenografie können musste, aber so weit muss man garnicht zurück, um in der Zeit der mechanischen Schreibmaschinen zu landen.
Die hatten keinen Rechtschreibscanner. Die hatten keine Möglichkeit der Korrektur (außer Tipp-Ex, aber auch nicht bei offiziellen Schreiben). Man musste manuell das Papier einlegen und wissen welche Hebel man betätigen muss. Wenn man was Besonderes, zum Beispiel mehrere Farben wollte, gab es kaum einen Standard, jede Maschine ist anders. Man musste wissen, wenn das Farbband zu Ende ging, und sich rechtzeitig Neues besorgen - von der richtigen Marke.
Nur: Damals hat sich keiner beschwert. Wenn jemand nicht zurecht kam mit dem Büroequipment, dann eignete er sich einfach nicht für den Job. Ein Handwerker muss schließlich auch mit seinem Werkzeug zurechtkommen, und jeder, der mal versucht hat, einen Bagger zu bedienen, sollte wissen, dass das nicht so einfach ist wie es aussieht.
Seit sich Computer durchgesetzt haben, ist aber an jeglicher Inkompetenz von Büroangestellten immer grundsätzlich die IT schuld.
Update: Mir wurde grade das hier gemailt. Es handle sich um "sachfremde Einzelmeinungen". Lustig finde ich hierbei: "Es ist leider üblich geworden, alle Mängel und Wartezeiten in der städtischen Verwaltung auf die LiMux-Umstellung zu schieben" - ziemlich genau das was ich gesagt habe :3
Everyone knows: The longer your URL, the better. The whole title of your webpage, along with parts of its content, should at least be put into it. Furthermore, a whole bunch of ids from several tracking-services (feedburner, google analytics) must me included (of course, this does not mean that the website should not also use cookies and referrers). The URL should fill at least three lines of common contemporary browser window sizes. Additionally, try to include punctuation marks, so the URL will be wrapped by common text renderers, and the usual automatic URL-matchers do not recognize it. If somebody wants a link to your page, he can use an url shortener.
In those days it is essential that people find your website. Be sure to include all words that are barely related to your page's topic, even if they are not contained, so users can find your page. You might also include results from other search engines into your website, like links to shopping sites, if your visitor wants to buy something.
Even if your website is completely static, it needs JS. Ideally, it should not even show any content without JS - if possible, make it get caught in an infinite redirection loop. Include JS from as many different TLDs and SLDs as possible. Let scripts load other scripts on demand. If scripts from some domain are not allowed, let the page remain in an indefinite state. Use the newest version of JQuery, but be careful to still not be compatible with older browser versions, except IE6, which is - of course - mandatory. Add handlers for common key combinations like Ctrl-W and Ctrl-Tab, so the user does not accidentally navigate away from your page. Add widgets that appear and follow the user, so he cannot accidentally scroll away from your navigation bar. If you are hosting an image gallery, use JS to implement an automatic slideshow that reloads the page and displays a random image every few minutes, even though the URL explicitly points to a certain image.
Your users will understand that nothing is for free, so you may include advertisements from many different networks. As these networks are often pay-per-click, it is totally fine to move them in front of your content, with a close-button that will open an external popup window. Some people like to open websites in the background and keep them there for a while. Since your scripts are reloading the page automatically, this costs you traffic, and so it is legit to use advertisements that make sound - nothing is for free. Furthermore, the content of your page may be split into many small parts, so the reader has to do many klicks to read it, and even more ads can be shown.
Never host downloads directly. There are lots of services like rapidshare or dropbox that will do that for you. If you really need to host content yourself - or maybe you are a content hoster - try to provide special download management software that optimizes your download - nobody wants to do large downloads directly in the browser, since browsers tend to crash, and the resume-functionality is broken in vitally any of them. These applications should require the newest version of Windows, since it is the most widespread, and therefore the most secure, operating system, and it is included in most new computers you can buy, so it is accessible to everyone. Some people are unfair and are only interested in your content, and not watching your ads at all. Therefore, make sure to hide the actual download links, and put links to your advertisement partner's software - again, nothing is for free.
Make sure that hyperlinks out of your website always run through your own redirection service first, which gets its information through a Referrer-header, and cookies, and HTML5 offline storage. For lowering of network traffic, you should additionally use URL shoortening services (tinyurl, tinyarrows, etc). However, a link to another website must have a good reason. Under no circumstances should you give sources of anything you include. The internet is a collection of knowledge, not a library.
Add a navigation panel with the links you consider important to the top of your page, as well as several sidebars with widgets, all following the current focus, such that they are always shown. Even on a 24'' widescreen, your visitors will thank you to just see a small 600px stripe of content in the middle of their screens, because everyone knows that this is easier to read. On small screens, these elements might disturb the experience, so when you detect a mobile device, add a popup that gives a link to an app for your website. For your app, you can port the relevant parts of your website to PhoneGap or Apache Cordova. Don't forget to provide a pro version that is ad free.
Using text is a simple way of assuriung that common search engines will index your page correctly. If you do not do sophisticated SEO in your meta-tags, at least some parts of your website should consist of real text. On the other hand, an important property of modern websites is that they need to look exactly the same under all circumstances. Some nice text designs are not possible with standard CSS, so it is good practice to just put the designed text into an image. This is especially important when you are a restaurant and publish your menu, so you cannot search through it. Sometimes you want text to be at a certain position, or you want text to appear not only on your website, but also on some image board. Then it is also common practice to put this text into your image. Also, for scientific texts that contain mathematical formulae, use images. Be sure to use a font that is not recognized by OCR, otherwise others might just pirate your text.
Generally, if you want comics and funny images, just upload them to an image hoster like flickr or 9gag, and include them in your personal webpage. You don't even have to give explicit links to original funny videos, even if you found them on youtube: Just make a gif-file out of them, most image-hosters support gif-files. If the dialogue is important, add subtitles. Remember to remove copyright notices and signatures, and maybe add your own, so the user does not get confused. Alt-attributes for images are there for witty notes, make sure not to put too much information about the image itself into the alt-attribute. Don't use the title-attribute for that, as it is a fairly modern attribute and might confuse older browsers.
Unfortunately, the common image hosters mostly have a size limit, so sometimes, you just cannot upload the whole video as a gif. So in some cases, it is the easiest thing to just embed the original video from a video hoster. If the user does not allow embedding, use your webcam to film the video playing, or some screencasting software, and upload the video from it, and then embed this video.
Videos and music should start auto-playing right over, so the user does not have to do an additional click, and can enjoy your website right away.
If you have a news site, an educational or a governmental website, or you are just legally obleged to, you might be interested in making your website accessible to disabled people. These people have a hard time reading text on images, or navigating through complex menu structures. Thankfully, there is JS: You can implement your own screen reader and braille output, as well as your own subtitle renderer. For mentally disabled people, just add a phone number, so they can ask you questions if they do not understand something. For foreigners, add translation links to Google translate.
You should add a doctype declaration on top of your html files, so it is not rejected by software that needs real XHTML. If there are some minor mistakes in your file, that is no problem, because high-quality software can deal with this.
When it comes to the internet, we are all on uncharted waters. (Angela Merkel)
Ernsthaft, es geht mir langsam auf die Nerven. Die NSA kriegt ihren eigenen Gesichtserkennungscluster, Gesichtsbuch macht ein psychologisches Experiment mit uns, und alles was unseren Politikern momentan einfällt ist eine Zerschlagung von Google.
Gesichtserkennung ist immernoch etwas relativ kompliziertes, was im Wesentlichen die großen Unternehmen können. Denn Gesichtserkennung und generell Strukturerkennung ist eine Problemart, die man einfach am besten dadurch lösen kann, dass man viel Geld draufschmeißt.
Es müsste nicht so sein: Finanziert offene Forschungsprojekte, die dafür sorgen, dass jeder der es will Zugang dazu hat. Wenn es möglich ist dass ein Geheimdienst sich einen Cluster hinstellt für Gesichtserkennung, muss sowas doch auch möglich sein. Wir kriegen dadurch viele neue "Fachkräfte", außerdem kriegt die Gesellschaft die Kontrolle zurück.
Ähnlich ist es mit Suchmaschinen. China und Russland machen es vor, leider wohl eher mit dem Ziel, besser zensieren zu können. Wir haben "staatliches Fernsehen", für das wir einen ganzen Haufen GEZ-Gebühren zahlen, auch wenn wir es nicht konsumieren, und das zu unverschämten Konditionen. Warum können wir hier kein ähnliches Modell haben, das uns eine staatliche Suchmaschine gibt die uns nicht trackt, und private Suchmaschinen die damit konkurrieren, wie Privatsender es schließlich auch tun.
Überhaupt, wir brauchen wieder mehr Infrastruktur, die der Gesellschaft gehört, und nicht irgendwelchen Unternehmen die wirtschaften müssen, und zwar spätestens dann, wenn es so essenziell geworden ist, wie eben Suchmaschinen es heute sind. Offenbar hat man das zur Blütezeit des Fernsehens und des Telefons noch gewusst. Aber so etwas können heutige Politiker offenbar nicht mehr auf die Beine stellen. Das Zerstören funktionierender Strukturen klingt ja auch einfacher. Ich fürchte nur, dass sie sich da an Google die Zähne ausbeißen werden. Außerdem fürchte ich, dass Google nicht das schlechteste marktführende Unternehmen ist, und es nicht die beste Idee ist, Platz für ein Anderes zu schaffen.
Was ich damit sagen will: Kriegt lieber mal eueren Arsch hoch und setzt etwas auf! Es ist euer Job! Hat man früher schließlich auch geschafft.
Back from the land of the snaileaters. Well, snails appear to be more like decoration than actual food. I did not eat them anyway, since they are animals, and I guess they are capable of feeling pain.
The first french guy I met who actually spoke a language I could understand (English) was my arabian-looking taxi driver, who was probably a muslim. I did not ask him about that, for obvious reasons. We talked about the traffic in Paris - I was shocked about the rudeness of the drivers there, which was even worse than in Munich. He told me about traffic lights with integrated cameras who would take a picture of drivers passing a red light. It was interesting, and he was very friendly.
So, as I was in Paris anyway, I decided to use my free time to watch some sights and take some pictures. There is a lot of local street art in Paris, and it is hidden in places you will not expect it.
Not only is there a lot of art, they have very decorative bins.
And accessibility.
The buildings are nice.
And Eiffel Towers ...
Thousands of them ...
And a very big one, too ...
I was also at the Louvre museum. On my way to it, I saw some bridges with locks on it. This is a new ritual that is done in Germany too, but in Paris the bridges look like hedges made of metal.
Paris is truly the town of love! Just look at this guy:
In front of the Louvre museum, they have four sockets for tourists to let them take pictures of themselves doing the Hitler greeting.
Somehow I did not feel comfortable with that, and decided to have a breakfast before going inside. There I met some nice girls who stole money from my wallet. I would have expected this in, like, Brazil or something, rather than in Paris. But on the other hand, there are also gamblers in the streets I wouldn't have expected in Paris ...
And of course, this can happen in every town. Still, Paris will always be the first town where money was stolen from me. At least they knew how to get money. This guy obviously didn't:
In the Lovre, of course, I had to watch the Mona Lisa. It surely is a nice picture, but I don't actually know why it is hyped so much. There is a lot of nice art in this museum, even for philistines (like me ...). I found the following piece of art especially appealing, since it reminded me of ... well ... watch for yourself ...
So ... Yeah. Nice town.
There are a lot of bad excuses for oversleeping, but I think I have found the most stupid: My alarm clock crashed.
Well, to be honest, I use an Android app, and it crashed for some strange reason. In the future, I will use my single-purpose alarm-clock again and find other reasons to oversleep.
However, if you think about it, this is not even a first world problem anymore. It is a problem that goes into the digital world, the world where new SciFi-like technology rules - let us call it the zeroth world.
It is everywhere where fast (mobile) internet is available, and where everybody has a smartphone and a tablet and communicates through it.
I have just had a real zeroth-world-problem.