Jump to content

passfig

Active Members
  • Posts

    187
  • Joined

  • Last visited

Everything posted by passfig

  1. Ganditi-va in primul rand la cine vreti voi sa fiti si nu mai luati totul "la misto".
  2. Ai mai alergat pana acum? Daca nu atunci nu conteaza...cumpara pantofi de alergat de la nike in genul celor pusi de gio33 si vezi cum te simti. Daca nu ai mai alergat si nu esti obisnuit cu un efort sustinut (sala e o frectie pe langa 10 km indiferent ce program faci) , atunci iti spun ca incaltarile or sa fie ultima ta problema. Atat timp cat nu ai niste japite de tenisi fara strop de talpa si calcai esti ok. Daca ai mai alergat atunci cat si ce probleme ai avut? Eu am avut o pereche adidas (nu ii mai gasesti pe net) pe care ii am de 6 ani si se tin inca bine, de alergat am alergat in ei mai putin de 2 ani pentru ca materialul era putin desprins inauntru si aveam o batatura nasoala. Apoi mi-am luat o pereche de Air Icarus+ de la nike (au fost ~300 lei) cu care alerg de un an si ceva. Sunt ok, nimic extraordinar, dar isi fac treaba. Alt sfat: poarta ciorapi grosi cum gasesti in magazinele de sport, protejezi si interiorul pantofului si piciorul. Eu sunt claaaar egiptean si cred ca am pronatie exagerata, cand eram mic ai mei imi spuneau ca am platfus, dar cand am mai slabit si talpa a luat o forma mai fireasca. Odata ce sistemul circulator ajunge sa faca fata efortului vei alerga bine infierent de talpa. Mie mi-a luat ~o luna sa ma obisnuiesc si sa imi faca cu adevarat placere sa alerg. Legat de teren, sunt din Bucuresti nu sunt prea multe optiuni, alerg la Parlament (dau ture, deci pe trotuar), imi place sa alerg pe un traseu circular si variat (este si un deal destul de abrupt acolo). Am alergat si la sala pe timpul verii acum 2 ani intr-o atmosfera dinaia halucinanta intr-o camera mare unde mai erau vreo 12 oameni fiecare cu aroma lui. Alergatgul pe banda e o gluma. M-am lungit cu postul scuze, scurt si la obiect, nu lua ceva mai scump de 350 de lei si du-te cat mai repede sa alergi, nu te mai gandi la detalii, o sa le observi pe parcurs, alege orice traseu unde nu sunt caini! Spor!
  3. Imi place initiativa site-ului si poate mai intram pe el daca nu faceai reclama de doi bani. In schimb pentru ca m-a deranjat titlul imi permit sa pun si eu o recomandare. Filmul The book thief. Este un film bun, linistit, placut despre povestea unei fete austriece care a avut de suferit din cauza ca pe nazisti i-a mancat in cur sa inceapa un razboi. Naratorul este moartea. Hotul de carti (2013) - IMDb Cartea o sa o gasiti gratuit pe net cu siguranta: oferta GRATUITA (wiki)
  4. algorithmic complexity attacks and libc qsort() 2014-06-11 - New York An algorithmic complexity attack is a denial of service attack that triggers worst case behaviour in code that is otherwise expected to perform well. The canonical example would be the widely published attacks against hash table implementations, where carefully crafted inputs made snappy O(1) operations deteriorate into O(n) time sinks. Several major programming language implementations and web frameworks were vulnerable. Quicksort is also commonly mentioned in this context. Its expected O(nlogn) and worst case O(n2) makes it a prime candidate. When we previously looked at libc qsort() implementations it became clear that while many different algorithms are in use, quicksort is by far the most common choice. This is so for good reasons. In addition to the average-case complexity, quicksort is cache friendly and optimizes well. In this post we’ll have a look at how to trigger worst case performance in a couple of libc qsort() implementations. Breaking BSD Inspecting a diff between the qsort() of 4.4BSD-Lite and that of current day FreeBSD reveals that very little has changed since 1994. Some K&R syntax has been removed, some macros have been introduced, support for the reentrant qsort_r() has been added and a couple of variables have been renamed. Other than that, the code is pretty much the same. Number of comparisons per qsort() implementation when sorting 2^22 increasing elements. This isn’t a cause for concern in and of itself. As we saw in the previous post, the implementation performs very well and appears to have stood the test of time. It is particularly good on partially sorted inputs, which are commonly encountered in practice. In the chart above it outperforms several other major C libraries. We’ll soon discuss why, but first a little background on quicksort and how BSD has implemented it. Quicksort 101 The basic flow of quicksort is as follows: Select a pivot element Partition the data around the pivot; smaller elements to the left, larger to the right Recursively quicksort each partition As long as the partitions end up being of roughly the same size, we can expect the algorithm to run in O(nlogn). An ideal pivot selection would always pick the median element, since that produces perfectly balanced partitions. The worst possible pivot selection is that which results in highly skewed partitions; the goal of each round is not to merely shave off a few elements, the goal is to split the problem in half. Selecting the true median in each round of partitioning is unfortunately prohibitively expensive. It can be done in linear time but the constant factors are just too high for this to make any sense in practice. BSD qsort() approximates the true median by sampling up to 9 elements, like so: pivot = median(median(v[0], v[n/8], v[n/4]), median(v[n/2 - n/8], v[n/2], v[n/2 + n/8]), median(v[n-1 - n/4], v[n-1 - n/8], v[n-1])) Like most of the BSD quicksort, this pivot selection is based on Bentley and McIlroy’s Engineering a Sort Function. This paper covers many of the less obvious aspects of how to implement quicksort. Well worth a read if you’re into the whole sorting thing. When a partition or an original input is sufficiently small, it can pay off to switch to a low overhead algorithm. In the BSD case, this algorithm is insertion sort and it is chosen whenever n<7. While the time complexity of insertion sort is quadratic, its low constant factor makes it really shine on such small inputs. Now this is all well and good, but BSD goes one step further. The BSD deviation As mentioned before, the BSD qsort() outperforms its competition on sorted and partially sorted inputs. This is due to a pretty simple heuristic: whenever a partitioning round finishes without rearranging any elements, we switch to insertion sort! In other words, whenever an input is perfectly partitioned around the approximated median, BSD qsort() assumes that the input is nearly sorted and pulls the insertion sort trigger. Insertion sort in turn, while quadratic in the worst case, is in fact linear on nearly sorted inputs, so excellent performance can be expected. As it turns out, this heuristic also opens up for a very nasty worst case behaviour. Consider an input created by the following snippet of code: for (i = 0; i < n/2; i++) v = n/2 - i; v[n/2] = n/2 + 1; for (i = n/2 + 1; i < n; i++) v = n + n/2 + 1 - i; The plot below visualizes this input for n=64. BSD qsort() input which will trigger premature switch to insertion sort and significant performance degradation. Feed this into the BSD pivot selection and the element at position n/2 will pop out. Since the data is already perfectly partitioned around this element, no other elements will be rearranged, qsort() will assume that it’s facing a nearly sorted input and will switch to insertion sort. The data is however far from sorted and the algorithm will exhibit catastrophic quadratic behaviour. Number of comparisons performed by BSD qsort() on random and worst case inputs. Notice how doubling the input size roughly quadruples the number of comparisons performed. This is of course the trademark of an O(n2) algorithm. 4.4BSD-Lite has many descendants and both OpenBSD (5.5) and DragonflyBSD (3.8.0) seem to behave exactly like FreeBSD on these inputs. Many other software projects, both free and proprietary, have also incorporated this implementation. But not NetBSD! A 2009 commit removed the switch to insertion sort, citing ”catastrophic performance for certain inputs”. Similar modifications can be found in e.g. PostgreSQL and OSX. Breaking almost any quicksort The same McIlroy who co-authored Engineering a sort function (the article mentioned above; the one you should read) also wrote A Killer Adversary for Quicksort. In a nutshell, this article describes a simple adversarial program, antiqsort, which reduces almost any quicksort implementation to quadratic performance. If an implementation is susceptible, then simply linking against libc and running once is sufficient to produce a worst case input. But there’s no point in rehashing the article - it really is both well-written and accessible - so let’s instead have a look at what antiqsort can do to the NetBSD qsort(). McIlroy vs NetBSD Number of comparisons performed by NetBSD 6.0 qsort() when faced with antiqsort killer inputs. Blam! Quadratic complexity. The absolute numbers aren’t quite as bad as for the regular BSD qsort(), but it is quadratic and that’s bad enough. The visualization of the FreeBSD killer input was inspired by similar graphics for Digital Unix in McIlroy’s article. As it turns out, the corresponding visualization for NetBSD is not even remotely as pretty. antiqsort killer input of size 64 for NetBSD 6.0 qsort() Good looks are however of no consequence here. McIlroy’s adversary can generate these inputs of any size for (almost) any quicksort just by linking and doing a single round of sorting. The only caveat is that if the implementation is randomized, then we lose the ability to “replay” the input at a later time. Again, not a big problem in practice since very few C libraries bother with randomization of their sort function. McIlroy vs the world Let’s have a look at how the McIlroy adversary fares against a couple of other libc quicksort implementations. Bear in mind that quicksort is not the default code path of glibc qsort(). It prefers using mergesort and only falls back to quicksort when certain memory limits come into play. More on that and on the other implementations in the previous post. Some inputs are beautiful. Some aren’t. They all trigger quadratic complexity. Can this be exploited? If this was such a big deal then we would probably be seeing algorithmic complexity attacks against qsort() all the time in the wild. And we don’t. Very few programmers would willingly call qsort() on untrusted user input. This is not even remotely as serious as the previously mentioned hash table attacks. With that said, calling the BSD qsort() on a 216 killer input is about 1000 times slower than on a random input of the same size. Most benchmarks are unlikely to test such an edge case so it is at least conceivable that this vector might some day be exploited in a denial of service attack. A “real world” example One example of a potential real world issue lies in how some software implements directory listings. It is common to order directory entries by e.g. name or timestamp and it is common to create that ordering by calling qsort(). This applies to many implementations of the venerable ls(1) utility as well as the autoindex functionality of some web servers. To exploit this we need the ability to create files and the ability to control the order in which directory entries are read (e.g. by means of readdir(3) or fts_read(3)). The latter is simplified by BSD’s Unix File System (UFS), where directory entries are effectively returned in the order that they were created. Here’s the time consumption for listing 215 random entries on a FreeBSD 9.1 box: $ time ls -1 random/ > /dev/null real 0m0.065s user 0m0.022s sys 0m0.004s Very snappy and unlikely to cause any concern in a benchmark. Let’s see what happens when we create and list a killer input of the same size: $ mkdir killer $ for i in $(seq -w 16384 1); do touch killer/$i; done $ touch killer/16385 $ for i in $(seq -w 32768 16386); do touch killer/$i; done $ time ls -1 killer/ > /dev/null real 0m5.866s user 0m5.719s sys 0m0.006s A pretty dramatic performance drop and almost exactly what we would expect. If the 216 killer results in a factor 1000 drop, then 215 should give about factor 250. Here we saw a drop from 0.022s to 5.719s user time, so factor 260 slower. Whether or not an attack based on this approach can actually be carried out in the wild is a question that we leave unanswered. The ability to create arbitrarily named files is typically reserved for trusted users, so perhaps not. TL;DR Plain BSD qsort() can easily be tricked into running insertion sort on its whole input with terrible performance as a consequence. There exists a simple technique for triggering similar behaviour in almost any quicksort implementation, including those of most major libc implementations. Exploiting this in an algorithmic complexity attack in the wild is likely not trivial but is under certain circumstances conceivable. That was all. Over and out. Copyleft © 2014 Mats Linander, all rights reversed algorithmic complexity attacks and libc qsort() | matslina
  5. Simona Halep a facut cea mai frumoasa finala de le French Open din ultimii 13 ani. Desi a pierdut a fost prima ei finala la varsta de 22 de ani. Sharapova speaks: "This is the toughest grand slam final I've ever played and all credit to Simona, who played a terrific match. I never thought seven or eight years ago that I would win more Roland Garroses than any other grand slam. I dunno ... I'm so emotional right now that I can't even talk." Fair enough, we'll leave it there, so. That's all from me at the end of a terrific tennis match - one of the best I've seen in quite some time. Maria Sharapova v Simona Halep: French Open 2014 final – as it happened | Sport | theguardian.com Halep, 22, really does look at home on the big stage, a well-prepared athlete with excellent foot speed, good anticipation and the ease of execution familiar to all champions. She rarely looks off balance, even on the few occasions when she is sent the wrong way (as when she slipped and recovered at advantage point in the fifth game of the first set). It is a precious gift. There was no hint of the suggested stage fright, either. After mis-hitting an early forehand, she nonchalantly twirled her racket, one-handed, like a gunslinger reholstering a smoking six gun. It screamed composure, which sometimes had been missing from her game earlier in the tournament. Maria Sharapova wins French Open after three-set Simona Halep battle | Sport | The Observer Setul secund a fost unul dintre cele mai bune v?zute la aceast? edi?ie de la Roland Garros: a durat 72 de minute ?i a fost pres?rat cu puncte magnifice reu?ite de micu?a ?i inimoasa noastr? juc?toare! Balan?a a înclinat când într-o parte când în cealalt?, iar Simona s-a ridicat de fiecare dat? la în?l?imea unei finale de Grand Slam. Halep a pierdut finala de la Roland Garros, dup? un joc pasionant! Sharapova, campioan? a doua oar? Finala de la Roland Garros, edi?ia 2014, a fost cea mai echilibrat? ?i spectaculoas? din ultimii 13 ani ?i una dintre cele mai lungi din istorie. Tenisul practicat de cele dou? sportive a fost înalt? calitate, iar cei aproape 15.000 de spectatori - mul?i dintre ei români - prezen?i în tribunele arhipline ale arenei Philippe Chatrier au aplaudat de multe ori în picioare evolu?iile din teren. A fost pentru prima oar?, din 2001, când finala feminin? a French Open s-a disputat în trei seturi. "A fost cea mai grea final? din cariera mea. Felicit?ri, Simona", a spus dup? meci ?arapova, de nou? ori finalist? a unui Grand Slam. SIMONA HALEP - Maria ?arapova 4-6, 7-6(5), 4-6. Cristian Tudor Popescu: "Simona a câ?tigat, chiar dac? înving?toare a fost ?arapova" - Gandul
  6. Tu iti tunezi calculatorul ca sa rulezi linux )) asta e tare. De obicei oamenii pun linux ca sa tuneze calculatoarele prea vechi. Inafara de un upgrade la RAM (inca 512) nu merita sa mai faci altceva. Ai un sistem ok pe care sa inveti. De la bun inceput trebuia sa incerci sa instalezi in dual boot windows-ul si linux-ul si inca ar trebui sa faci asta. Cu timpul, daca iti place, vei ajunge sa folosesti doar linux-ul si pe windows sa te joci cand ai timp. Uite laboratoarele de la Calculatoare din anul intai de linux si programare pe linux: linux programare sunt ok zic eu, mai rar gasesti in limba romana lectii de genul. Daca vrei idei cu ce sa faci si sa te dai mare la liceu, invata sa programezi in linux. Fa un fisier .c sau .cpp, scrie cod si compileaza-l din terminal. Gasesti in cursurile alea ce si cum, iar cand nu te mai descurci, cauti pe net. Distributiile de linux nu conteaza asa mult la inceput, eu zic sa pui ceva care sa te faca sa te simti totusi confortabil, nu sa te faca sa urasti calculatorul. Mie mi-a luat cam o luna sa ma acomodez cu ubuntu can l-am instalat prima data.
  7. Nu e vorba de sateliti conventionali. Am vazut acum ceva vreme un proiect care avea la baza raspberry pi :raspPI, iar ce vor ei sa foloseasca este documentat aici: wiki. Ideea mi se pare foarte buna si ar fi un experiment interesant. Probabil ca asta si vrea sa fie pentru inceput, lanseaza cativa zeci de sateliti dinastia sa vada cum merge. In 10 ani o sa vezi cocioabele de chirpici cu antene pentru wireless pe langa alea pentru TV.
  8. Clar...incep programatorii sa moara de foame ca prea multi stiu C++, sunt nevoiti sa invete php sa plateasca facturile. Saptamana trecuta a venit o programatoare de la google la facultate sa faca o prezentare (foloseste C++ si python) si ne-a zis ca abia dupa 7-8 ani a putut sa spuna ca e un programator bun. c++ 3d nici eu nu stiu, e mai tridimensional asa sau cum? Daca esti pasionat de ce faci, esti ambitios si realist banii or sa vina de la sine, uneltele conteaza mai putin. Nu de pe urma limbajului castigi bani. Uita-te pe siteurile gen bestjobs sau asta/ si decide singur, ideal ar fi sa incerci multe lucruri.
  9. Nu incerc sa fac reclama la site, dar imi cautam un wallpaper nou si mi-am adus aminte de el. Au in galerie unele poze superbe. Romania este o tara foarte frumoasa. LINK1 LINK2
  10. passfig

    Fun stuff

    incearca sa ascunda o ghinda:
  11. Dar la un Stokes te bagi? 6.49 ii) http://i.imgur.com/boQ4xbw.jpg
  12. Pai da, dar nu ai mufa de ethernet la el, nu poti sa torni internet in el cum fac eu si nici sa ii legi un hdd . Eu cubie-ul il folosesc ca server/home sharing/stream video pe tv. Dupa sesiune o sa pun pe Android splashtop si incerc sa ma joc pe calculator din sufragerie, sper sa nu mearga sacadat. Stiu ca mini PC-urile alea sunt mai puternice si daca te limitezi la partea de smart tv atunci eu zic ca unul dinala este perfect, desi sa sti ca, cubie-ul cu al sau dual core A20 a avut o singura data probleme cu un HD 1080p de vreo 20GB. Mie smart tv-urile mi se par o prostie, toate lucrurile tind sa devina aceeasi chestie: computere. Cu banii de pe un smartTV iti iei tv calumea, un miniPC si iti mai pui un tv si in bucatarie. Acum depinde de buget, comoditate si aspect (cubie-ul e bagat intr-o cutie de adidasi din care ies vreo 20 de fire, arata hilar). Btw, pe miniPC-uri poti sa instalezi cateva distributii de linux.
  13. Eu am cubieboard 2 pentru asa ceva si imi place tare mult .
  14. Arata bine, incepe astazi. Hello everyone! Felicity, the annual festival of IIIT Hyderabad, brings to you Felicity Threads 2014, the tenth annual edition of the celebration of spirit of computing and engineering. We bring to you a wide range of online contests in various fields of programming and mathematics. Our series of online events includes contests on algorithmic programming (Codecraft), parallel programming (Kernel Cruise), combinatorial search and game playing bot design (Strange Loop), and an unconventional programming challenge (Time Limit Exceeded). Our second event, after Gordian Knot, a math contest, is Break In. Break In, is a Jeopardy-style Capture The Flag (CTF) contest, starting on 1800 IST (1230 UTC), January 11, Saturday for 36 hours. It will be filled with challenges from diverse areas of systems programming and security (description here [1]). Participants will have to crawl the depths of the web, pry open encrypted exchanges and reverse engineer binaries to finally emerge victorious. The only prerequisite to participate is the urge to learn. Let us learn and rejoice the spirit of computing and engineering together. There are exciting prizes for the event too! So be prepared for some and to know more about Threads, visit us at : Threads | Felicity [2] Sincerely, Threads 2014 Team Links: ------ [1] Break In | Threads [2] Threads | Felicity
  15. O aplicatie pe care o recomand si nu a aparut deja pe aici este ulisten. Simplu: asculti muzica de pe youtube fara sa fi nevoit sa ti video-ul deschis. Face doar stream audio.
  16. Ati ajuns pe THN DefCamp 2013 - International Hacking and Information Security Conference in Romania - The Hacker News
  17. Daca vrei sa fie mai eficient trebuie sa folosesti backtrack pentru generare, in nici un caz nu 15 for-uri, algoritmul ruleaza de 29*30*31*...*40 ori..gandeste-te ce inseamna asta. Cauta backtrack-ul pe net pentru ca daca vrei sa programezi ai nevoie sa il intelegi, se preda in liceu in clasa a 11-a. Poate fi facut cu recursivitate si fara.
  18. Nici o natie nu a facut atat rau Romaniei cum au facut rusii (da, nici macar ungurii) si romanii uita lucrul asta. Noi avem avioane de hartie si tancuri de lemn...ar trebui sa ne vedem doar interesul nostru si sa asteptam. Doar fiindca spunem mai repede ca altii ca ne aliem cu unii sau altii nu o sa ne ajute cu nimic, nu o sa ne dea nimeni nimic, Romania a fost facuta de rusine de toti. Nimeni nu ne-a ajutat (cel mult UE), parerea mea: sa nu facem absolut nimic. Nu Romania a facut legile dupa care Siria este acum judecata si nu Romania este in masura sa puna in aplicare acele legi. In plus, nu vad ce e atata agitatie, daca USA ataca Siria, Rusia sau China or sa stea sa se uite, cel mult le dau arme din razboiul mondial sa se apere. Oricine intra in conflict cu USA are o mare problema, iar Siria este un aliat prea mic ca sa merite riscul. uitati-va la astea: Interactive Globe: Small Arms Imports & Exports List of countries by military expenditures - Wikipedia, the free encyclopedia
  19. passfig

    Bac :D

    La bac nu e cazul sa risti nimic, inveti si mergi la sigur.
  20. Cauta pe sub pat si in debara monede si mai pune un leu, daca iti iei bundle-ul in urmatoarele 6 ore diseara mai primesti cateva. In seara asta se aduga jocuri noi (cel putin asa e traditia, dupa o saptmana mai baga niste jocuri si toti cei care au bundle-ul le primesc). Nici 5$ nu e mult dar 1$...3-4 lei. in plus, banii vostri se duc la caritate, nu o sa isi cumpere vreun gras masina cu ei (probabil).
  21. passfig

    Fun stuff

  22. Se va rezolva, s-a mai intamplat si inainte. Treaba este ca jocurile indie nu sunt mereu foarte finisate si asta nu e o surpriza avand in vedere ca sunt facute de 3-4 oameni.
  23. 1) Age of mythology - great fun 2) Red Alert 2 3) Civilization V 4) 1701 A.D. 5) Rome Total War Zici ca joci 10 minute cand ai timp, intr-un joc ca Civilization sau 1701 A.D. ai sa pierzi lejer 3 ore fara sa observi. AOM (1) este ideal pentru ca poti sa termini in 30 de minute lejer . Oricum toate sunt bune pentru ca poti da save si continua ziua urmatoare.
  24. Uite ce au primit astia de la HB: Nu vreau sa imi bat joc de topic, dar asta nu e tutorial, este cel mult o stire - humblebundle are cel mai de succes bundle de cand exista. In plus in cateva zile dispare. Bundle-ul principal dureaza 15 zile (parca) si apare cam o data pe luna. Exista si weekly bundle care evident este saptamanal si care nu este la fel de consistent. Legat de bundle-ul mare, dupa prima saptamana se adauga inca 2-3 jocuri noi pe care le primiti automat daca deja ati cumparat bundle-ul. Daca nu il aveti, jocurile noi aparute le puteti obtine doar daca platiti mai mult decat media (over the average). Puteti plati si 0.01$ dar ideal este 1$ pentru ca primiti si key-uri pentru steam . Bundle-ul curent este special pentru ca EA nu a cerut nici un ban, aproape totul merge la caritate.
  25. eu folosesc google wallet, de curiozitate cam cate ai comandat de nu te mai lasa?
×
×
  • Create New...