<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>ivucica blog</title>
	
	<link>http://blog.vucica.net</link>
	<description>a programmer's thoughts</description>
	<lastBuildDate>Sun, 19 Feb 2012 18:31:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<atom:link rel="salmon" href="http://blog.vucica.net/?salmon=endpoint" /><atom:link rel="http://salmon-protocol.org/ns/salmon-replies" href="http://blog.vucica.net/?salmon=endpoint" /><atom:link rel="http://salmon-protocol.org/ns/salmon-mention" href="http://blog.vucica.net/?salmon=endpoint" />		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/KhaoticOne" /><feedburner:info uri="khaoticone" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://superfeedr.com/hubbub" /><geo:lat>45.839623</geo:lat><geo:long>16.082461</geo:long><creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/3.0/</creativeCommons:license><image><link>http://khaoticone.blogspot.com/</link><url>http://www.gravatar.com/avatar/9dd37fe19111e25842a4fd0aea245d1a</url><title>KhaoticOne Blog</title></image><feedburner:emailServiceId>KhaoticOne</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Sloboda</title>
		<link>http://feedproxy.google.com/~r/KhaoticOne/~3/dEoGX-RZFWE/sloboda.html</link>
		<comments>http://blog.vucica.net/2012/02/sloboda.html#comments</comments>
		<pubDate>Sun, 19 Feb 2012 15:42:18 +0000</pubDate>
		<dc:creator>Ivan Vučica</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[croatian]]></category>
		<category><![CDATA[sloboda]]></category>

		<guid isPermaLink="false">http://blog.vucica.net/?p=656</guid>
		<description><![CDATA[Nikada prije kao u zadnjih desetak godina nije bilo vidljivija borba između sigurnosti i slobode. Svijet se danas bori s čudovištima terorizma, straha i ekonomske nesigurnosti, a pojedinci prihvaćaju propagandu koja plašenjem protiv terorizma i ekonomske nesigurnosti uspijeva progurati novo čudovište &#8212; čudoviše sigurnosti prije svega. U svijetu u kojem velike banke potezima koji prosječnom [...]]]></description>
			<content:encoded><![CDATA[<p>Nikada prije kao u zadnjih desetak godina nije bilo vidljivija borba između sigurnosti i slobode. Svijet se danas bori s čudovištima terorizma, straha i ekonomske nesigurnosti, a pojedinci prihvaćaju propagandu koja plašenjem protiv terorizma i ekonomske nesigurnosti uspijeva progurati novo čudovište &#8212; čudoviše sigurnosti prije svega.</p>
<p>U svijetu u kojem velike banke potezima koji prosječnom građaninu izgledaju apstraktno i nerazumljivo lako je reći kako je sve to krivica kapitalizma, kako je koncept korporacije problem i kako je nužno &#8220;zaštititi&#8221; plaće, &#8220;zaštititi&#8221; građane, &#8220;zaštititi&#8221; način života, i slično. Takozvani &#8220;društveni darvinizam&#8221; poprima negativne konotacije, a borba za slobodu načina života pretvara se u uništenja slobode neke druge osobe.</p>
<p>Pojedine društvene skupine koje smatraju kako je sloboda izvor dobra, a kako je kontrola izvor lošega, bivaju demonizirane. Kao nekakva hidra spominju se upravo velike tvrtke koje bi iskoristile slobodu za povećanje profita i iskorištavanja. Teško mi je izbjeći izraz &#8220;liberalizacija&#8221;, ali pokušavam &#8211; zbog negativnih konotacija, te zbog toga što današnji liberali pokušavaju podmetnuti borbu za prava kao borbu za slobodu.</p>
<p>Knjiga autorice Ayn Rand nazvana &#8220;Atlas slegnu&#8221; (Atlas Shrugged), kao i sama autorica, demoniziraju se radi protivljenja zaštiti, radi zauzimanja za slobode. Istovremeno, unutra se nalazi naizgled inverzna formulacija takozvanog zlatnog pravila koje je popularizirao poznati govornik i vjerska figura, Isus Krist. Isto je govorio i Konfucije. Zlatno pravilo glasi: &#8220;Čini drugome ono što želiš da drugi čini tebi.&#8221; Naizgled inverzno, ali jednakoznačno: &#8220;Ne čini drugome ono što ne želiš da drugi čini tebi.&#8221;</p>
<p>Ayn Rand pak postavlja to malo drugačije: &#8220;Kunem se svojim životom i svojom ljubavlju prema njemu kako nikada neću živjeti radi drugog čovjeka, niti tražiti drugoga da živi radi mene.&#8221; Prejednostavno je iz ovoga izvući potpunu suprotnost zlatnom pravilu. S druge strane, promotrimo to malo drugačije. Nemojmo krenuti od naizgled bitnijeg prvog dijela zakletve, nego krenimo od drugog dijela zakletve.</p>
<p>&#8220;Neću tražiti drugoga da živi radi mene.&#8221; Osoba koja uistinu voli drugu osobu neće zahtijevati ništa od te osobe. Osoba koja uistinu voli drugu osobu neće ništa tražiti, ali istovremeno neće pristajati na jednostrane zahtjeve druge osobe. Ovakva zakletva odaje povjerenje u ljudsko poštenje, u ljudsku suradnju. Odaje uvjerenost i neizbježnost ljudske sebičnosti, ali je (kao i ljudsko poštenje) prihvaća i podrazumijeva.</p>
<p>Svi zakoni i kontrole koje donosimo podrazumijevaju ljudsku sebičnost. Podrazumijevaju borbu protiv nje, ili je iskorištavaju do te mjere da sebičnost koristi jednoj strani. Kao mali ljudi, borimo se za zaštitu svoje sebičnosti od tuđe sebičnosti. Borimo se protiv dijela svoje prirode umjesto da ga prihvatimo i damo mu slobodu. Borimo se protiv onoga što možemo iskoristiti za vlastiti boljitak.</p>
<p>Podrazumijevamo li Randinu zakletvu danu kroz usta Johna Galta kao suštu suprotnost Isusovoj varijanti zlatnog pravila (&#8220;Čini drugome ono što drugi želiš da čini tebi&#8221;) lako je ostati šokiran. Ali ono što najviše želimo sebi jest sloboda i uspjeh. Ako želimo slobodu i uspjeh za sebe, trebamo li negativcima dozvoliti da nas povuku za sobom i natjeraju da se borimo samo za sigurnost, ali nauštrb svoje i tuđe slobode?</p>
<p>Trebaju li postojati zakoni i kontrole? Svakako &#8211; to je civilizacijski doseg. Ali kao što ne prihvaćamo sve odredbe Hamurabijevog zakonika u ime zaštite inače svetog privatnog vlasništva (smrtna kazna za provalu, smrtna kazna za krađu iz hrama, trideseterostruka kazna za krađu stoke, …), tako ne bismo trebali nekritički prihvaćati niti sve odredbe uvedene u ime zaštite prava na toleranciju, zaštite radničkih prava, zaštite sigurnosti u prijevozu i slično. Treba raspraviti o svakoj odredbi &#8212; a ponajviše o tome da li je uopće potrebna.</p>
<p><b>Umjesto isključivo raspravljanja o tome koliko zaštitna odredba koristi, raspravimo i koliko donosi loših stvari.</b></p>
<p>Lako je dati argument kako navedene zaštite postoje radi prejakog utjecaja velikih korporacija, i radi zaštite malih ljudi, te da je glas za ukidanje zaštita ustvari glas za oštećenje malih ljudi.</p>
<p>Pri tome se može zanemariti kako su <b>velike korporacije nastale u uvjetima gdje zaštita postoji, te im očito zaštita koristi</b>. To znači kako <b>velikim korporacijama manjak zaštite ne bi pomogao, nego odmogao</b> te da je <b>velikim korporacijama u interesu borba protiv slobode</b>.</p>
<p>Kako onda možemo ukidanje zaštitnih odredbi automatikom povezati s borbom za jačanje velikih korporacija?</p>
<p>Koliko nas košta provođenje svih tih zaštitnih mjera? Nisu li upravo velike zaštitne mjere i velika prava razlog velikim porezima? Ne stvaraju li veliki porezi veći problem opstanku malih tvrtki nego opstanku velikih tvrtki?</p>
<p>Kad zahtijevate neto plaću od 10.000kn, radi društvenih davanja i poreza ustvari zahtijevate bruto plaću od skoro 20.000kn. <b>Vaš rad za koji zaradite 5.000kn ustvari, znači, vrijedi 10.000kn.</b></p>
<p>Nije li teže maloj tvrtki opravdati zaposlenje osobe za 10.000kn nego za 5.000kn? Ukoliko država uzima PDV od 25%, to znači da dodatna četvrtina neto plaće radnika odlazi državi. Zarađeni novac kojim radnik ne može raspolagati penje se na oko 67%. Dakle poslodavac isplaćuje poprilično pristojnu količinu novca, a radnik je nezadovoljan. Onaj tko trlja ruke je država.</p>
<p>Što tek s ostalim porezima, prirezima i ostalim davanjima? Što s cijenom benzina? Što s cijenom cigareta protiv kojih se, kao, toliko borimo &#8212; a ovisnici vrlo lijepo popunjavaju državni proračun?</p>
<p>Jako je lijepo moći otići u bolnicu i primiti besplatnu njegu. Ako HZZO odluči da pokriva lijek i liječenje, naravno. Ako odluči da ne pokriva, onda smo odjednom šokirani koliko to liječenje ustvari košta.</p>
<p>Jako je lijepo voziti se gradskim cestama i zanemariti koliko je to plaćeno iz prireza.</p>
<p>Jako je lijepo nekoliko godina osiguravati studentima i učenicima besplatni javni prijevoz ZETa, umjesto da se borimo za istinski potrebnu optimizaciju usluge javnog prijevoza (primjerice rjeđi tramvaji i busevi, dijeljenje hrpe otkaza) te time smanjenje troškova javnog prijevoza. Ne bismo li time mogli osigurati manju cijenu karte, čime bismo &#8220;socijalno&#8221; opravdali vrlo potrebno uvođenje češćih kontrola karata?</p>
<p>Zašto dajemo benefite učenicima, studentima i starijim osobama u vidu jeftinijih voznih karata ZETa &#8212; a ne onima koji uistinu financiraju infrastrukturu i saniraju dugove ZETa i Zagrebačkog Holdinga? <b>Dakle &#8212; kako možemo društvenom pravednošću nazvati to da su karte najskuplje upravo za one kojima su najpotrebnije: radnicima?</b></p>
<p>Socijalna briga i socijalno razumijevanje su potrebni društvu i temelj su civilizacije. Ali socijalna briga, socijalno razumijevanje i <b>borba za svaki oblik sigurnosti (pa time i socijalni) se već godinama pretvaraju u teror nad slobodnim, uspješnim građanima koji moraju financirati borbe protiv neuspjeha ili fantoma opasnosti.</b></p>
<p>Upravo socijalnom brigom predvođenom od raznih sindikata i velikih boraca za prava (koji sami ne rade ništa korisno) pretvaramo se <b>ne u društvo poštenja i nagrade za rad</b>, nego u <b>društvo koje živi za drugoga, a nikad za sebe</b>.</p>
<p>Srednja klasa je pod ofenzivom s vrha i s dna. Velike tvrtke pridonose eroziji sve manje srednje klase, te otežavaju mobilnost niže u srednju klasu. A istome pridonose i takozvani borci za prava radnika koji nauštrb srednje klase i potencijalne srednje klase isisavaju gdje god mogu i što god mogu.</p>
<p>Trebaju li mljekari tražiti državnu zaštitu? Ili trebaju pregovarati izravno sa svojim otkupljivačem? Trebaju li se boriti za bolju tržišnu cijenu mlijeka i odbiti prodavati mlijeko po cijeni koju ne mogu financirati? Ukoliko prijeti &#8220;propast&#8221;, ne trebaju li radije pokušati proizvoditi mlijeko za manje novce? Ako uistinu ne mogu &#8212; zašto ne bi zatvorili vrata i proizvodili nešto drugo?</p>
<p>Ako je problem što im je država osiguravala opstanak poticajima i obećavanjem uspjeha odnosno osiguranja, nije li problem upravo to da je država činila takvo nešto umjesto proizvođača mljekarskih proizvoda? </p>
<p><b>Promijenimo postavku. Nemojmo smatrati da se netko drugi mora boriti za nas i hraniti nas. Povratimo vjeru u sebe i druge.</b></p>
<p><b>Zarađujmo strahom i poštenjem, a ne krađom i prisilom.</b></p>
<p><b>Umjesto za sigurnost, molim vas, neka se borimo za slobodu da si sami osiguramo sigurnost. Štitimo samo ono što moramo štititi.</b></p>
<p><a href="http://www.youtube.com/watch?v=yCM_wQy4YVg&#038;t=51m55">Ron Paul na 51m55s odlično sumarizira.</a></p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<div class="plus-one-wrap"><g:plusone href="http://blog.vucica.net/2012/02/sloboda.html"></g:plusone></div>
<p><a href="http://feedads.g.doubleclick.net/~a/EUH0cBPQsnrrpeVrztTVeYkQZjw/0/da"><img src="http://feedads.g.doubleclick.net/~a/EUH0cBPQsnrrpeVrztTVeYkQZjw/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/EUH0cBPQsnrrpeVrztTVeYkQZjw/1/da"><img src="http://feedads.g.doubleclick.net/~a/EUH0cBPQsnrrpeVrztTVeYkQZjw/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=dEoGX-RZFWE:voJIG5ZLcHs:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=dEoGX-RZFWE:voJIG5ZLcHs:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=dEoGX-RZFWE:voJIG5ZLcHs:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?i=dEoGX-RZFWE:voJIG5ZLcHs:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=dEoGX-RZFWE:voJIG5ZLcHs:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?i=dEoGX-RZFWE:voJIG5ZLcHs:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=dEoGX-RZFWE:voJIG5ZLcHs:XAVGb8Xj5zA"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=XAVGb8Xj5zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/KhaoticOne/~4/dEoGX-RZFWE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.vucica.net/2012/02/sloboda.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.vucica.net/2012/02/sloboda.html</feedburner:origLink></item>
		<item>
		<title>Nastavak na pismo vezano za ACTA</title>
		<link>http://feedproxy.google.com/~r/KhaoticOne/~3/o329LkTu6Fw/nastavak-na-pismo-vezano-za-acta.html</link>
		<comments>http://blog.vucica.net/2012/02/nastavak-na-pismo-vezano-za-acta.html#comments</comments>
		<pubDate>Wed, 15 Feb 2012 22:33:17 +0000</pubDate>
		<dc:creator>Ivan Vučica</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ACTA]]></category>
		<category><![CDATA[croatian]]></category>

		<guid isPermaLink="false">http://blog.vucica.net/?p=640</guid>
		<description><![CDATA[Kako sam naveo u updateu na prethodni post s tekstom pisma, izuzetno me iznenadila pažnja koju je pismo privuklo. Uglavnom sam bio u šoku zbog silne pažnje, te se nadao da nisam napisao nešto što će (uz toliku pažnju) izazvati negativne reakcije. Rano ujutro u nedjelju, 12. veljače 2012., sam čak primio odgovor od Predsjednika. [...]]]></description>
			<content:encoded><![CDATA[<p>Kako sam naveo u updateu na <a href="http://blog.vucica.net/2012/02/otvoreno-pismo-predsjedniku-rh-ivi-josipovicu-vasa-podrska-acta-i.html">prethodni post s tekstom pisma</a>, izuzetno me iznenadila pažnja koju je pismo privuklo. Uglavnom sam bio u šoku zbog silne pažnje, te se nadao da nisam napisao nešto što će (uz toliku pažnju) izazvati negativne reakcije. </p>
<p>Rano ujutro u nedjelju, 12. veljače 2012., sam čak primio odgovor od Predsjednika. Već samim time moja izvorna želja je ostvarena, a to je da nakon što Predsjedniku iznesem i drugačije mišljenje &#8212; ono bude i pročitano. Želim istaknuti da u svemu ovome nema političke obojenosti. Iz poštovanja prema privatnoj korespondenciji, odgovor neću objaviti osim na izričit zahtjev pošiljatelja (dakle Predsjednika).</p>
<p>Osvrnut ću se tek na to da sam izuzetno sretan zbog Predsjednikove otvorenosti prema javnoj diskusiji nasuprot <a href="http://dnevnik.hr/vijesti/hrvatska/uzimanje-s-interneta-jednako-je-uzimanju-hrane-u-trgovini.html">brzom davanju izjave</a>, da sam izuzetno sretan zbog namjere da se detaljno prouče problemi. Postoji i jedna mala negativnost, a to je shvaćanje piratstva kao krađe iz trgovine.</p>
<p>Mišljenja sam kako se radi o postupku koji pokazuje nekulturu i nepoštovanje prema autoru djela, ali ne i kako se radi o postupku usporedivom s krađom iz trgovine.</p>
<p>Predsjednik mi je dobro ukazao da pojedine stvari u mojem pismu nisu točne. Zahvalan sam na tome, kao i na upozorenju da bih trebao prvo pročitati sam izvorni dokument. Primjerice, &#8220;three strikes&#8221; je u aktualnom ugovoru iz svibnja 2011. izbačen (dok se u <i>leakanom</i> dokumentu iz siječnja 2010. i dalje jasno vidi taj prijedlog jedne od država-autora, SAD-a.)</p>
<p>Nakon detaljnog proučavanja (koliko to moj nepravnički i neekonomistički um može), a iz perspektive kako konzumenta tako i stvaratelja digitalnih sadržaja, i dalje stojim iza toga da je ugovor nastao u štetnom duhu, uz štetne namjere. Iz <i>drafta</i> iz siječnja 2010. vidi se kako samo zahvaljujući upornosti pojedinih država-autora, kao što je Meksiko, ovaj ugovor danas nije još i štetniji.</p>
<p>Piratstvo je, ukupno, negativna pojavnost. Postoje pozitivne strane: učenje koristeći ilegalni softver, širenje malo poznatog autora koji zatim profitira više na koncertima nego da piratstva nema, i  slično. Ipak, u ljudskoj svijesti prečesto je danas stav &#8220;sve je ok, ja nikome ne škodim ili dijelim s prijateljem&#8221;. Nemam ništa protiv dijeljenja s prijateljima! Dapače. No često se to pretvori u bizarne pojavnosti kao što je tvrdnja da je $0.99 ili $1.99 previše platiti za igru.</p>
<p>Dragi prijatelji, ako nije problem platiti za kavu, shvatite da čak i iza male (ali ispolirane) igre zna stajati više mjeseci rada. Da, igra za koju ne želite nagraditi autora s manje od jedne kave ($0.99) ili manje od jednog piva ($1.99) ustvari je vjerojatno plod višemjesečnog rada, i to vjerojatno više od jedne osobe, i to najčešće ne nekoga tko vozi Porsche. Mislim, možete procijeniti po igri da li je izrađena po narudžbi megakorporacije ili kao plod želje za stvaranjem nekoliko malih autora.</p>
<p>No što ACTA ovdje čini? Prvo, shvatimo koliko je ACTA krivo usmjeren sporazum. Ona u isti koš trpa <i>counterfeiting</i> (proizvodnju robe s lažnom robnom markom), <i>piracy</i> (neovlašteno reproduciranje glazbenih, filmskih, književnih i softverskih djela) te <i>patents</i> (sustav za zaštitu izumitelja davanjem monopola na proizvod). Kako ne bih pojašnjavao što je ovdje problem, idemo jednu malu mozgalicu: sjednite i razmislite za sebe koliko je slična prodaja lažne Nike tenisice (koja bi bila tenisica i bez Nike znaka) u usporedbi s kopiranjem pjesme, te koliko su oba primjera slični s proizvodnjom lebdećeg automobila bez izumiteljevog dopuštenja.</p>
<p>Sad kada vidimo da se radi o različitim problemima s potrebom različitih pristupa (a ako se to ne vidi, molim čitatelja da još malo razmisli) &#8212; što ACTA čini? Proglašava velik broj stvari kriminalnim &#8211; odnosno kaznenim &#8211; djelom. Čuli ste možda za pojam &#8220;kino rip&#8221;? Znate, kad ekipica prošverca kameru u kino, i snimi film iz publike? E, da, ACTA recimo baš to izdvaja kao veliki problem i kriminalno djelo. Zamislite takvu snimku i recite mi da li je tu išta kriminalno osim kvalitete snimke. A osoba koja će otrpiti gledanje takve snimke ili će poslije otići u kino (makar inače ne bi), ili ne bi gledala u kinu iovako ili onako.</p>
<p>Ne radi se o tome da li je počinjena loša, amoralna, nepoštena radnja. Jest. (Kao i odnos prema kupcu kad CD i DVD koštaju 50kn-100kn, no nećemo sad o tome.) Ali proglašavati takve stvari kriminalom u vrijeme kada je se u svijetu (a posebice kod nas) kontinuirano događa stvarni kriminal i korupcija je smiješno. Trebamo li se ugledati na SAD gdje je, kroz regulaciju lobiranja, praktički <i>legalizirana korupcija</i>, ali <i>ljudi bivaju osuđeni na plaćanje $1.920.000 radi nedopuštenog kopiranja 24 pjesme</i>?</p>
<p>Trebam li uopće pričati o tome da je <a href="http://dmca.cs.washington.edu/">moguće &#8220;smjestiti&#8221; drugome, čak i printeru, činjenje djela piratizacije</a>? Trebam li pričati o tome da će bilo kakav automatski sustav u principu imati i veliku stopu pozitiva (kao što je mom dobrom prijatelju legalno preuzimanje Ubuntua bilo prepoznavano kao piratizacija)? Trebam li pojašnjavati da ako u kućanstvu imate 10 računala, a jedan izlazni router (i vjerojatno samo 1 IP adresu), nije moguće otkriti koje računalo, a kamoli osoba, je točno počinila djelo?</p>
<p>Uz takve probleme, treba li riskirati da se potpisivanjem ACTAe obvežemo na prilagodbu zakonodavstva na način da vlastite građane proglašavamo kriminalcima zbog nečega gdje niti jedna osoba nije <a href="http://www.ezadar.hr/clanak/luka-ritz-ubijen-iz-dosade">pretučena i ubijena</a>, silovana, maltretirana, pokradena? Kućni pirati su monstrumi koliko su i obični ljudi monstrumi. Kriminalci? To baš nisu.</p>
<p>Pa imamo i indikacija o tome da bi ISPovi pod režimom ACTAe mogli radije podleći cenzuri, a korisnici autocenzuri, kako ne bi riskirali <i>infringement</i> ili kršenje prava.</p>
<p>Bilješke o nekim od ostalih problema pročitajte dolje.</p>
<p>(Mini update: A umjesto da se borimo protiv piratstva na sve moguće načine, prepoznajmo da je kvalitetne hrvatske i &#8220;yu&#8221; filmove i serije teško pronaći i kupiti. Kao i hrvatske e-bookove. A bogme isto vrijedi i za strane filmove, serije i e-bookove. Što to govori? Usluga, a ne borba. Mrkva, a ne batina.)</p>
<p>Za kraj, osim vezano za piratstvo i slobodu govora, posebno je zanimljiva i druga perspektiva, vezano za generičke lijekove, zamjenske autodijelove, zamjenske boje za printer, i slično. Preporučam tekst Radoslava Dejanovića: <a href="http://www.monitor.hr/clanci/acta-ad-acta/161209/">ACTA ad acta</a>, objavljen na Monitor.hr, a koji je po mnogočemu i kvalitetnije štivo od mojih naklapanja, za koja mi je najbitnije da su malo potakla raspravu. </p>
<hr />
<h2>Male bilješke o problemima</h2>
<p>Bilješke su nastale iz perspektive programera, jer to i jesam. </p>
<div>- Članak 27 paragrafi 5, 6, 7 po uzoru na američki DMCA <strong>zabranjuje zaobilaženje zaštite protiv kopiranja</strong>. To znači da skupo plaćenu dozvolu za preslušavanje sadržaja stečenu kupovinom medija ili digitalnog sadržaja građanin može lako izgubiti oštećenjem medija na kojem je sadržaj spremljen. <strong>Naime &#8212; zabranjeno mu je zaobići zaštitu radi izrade sigurnosne kopije! </strong>Što ćemo sa &#8220;zaobilaženjem zaštite&#8221; ugrađene u neke mobilne operacijske sustave, a što je jedini način da se u mobilni uređaj unese vlastiti programski sadržaj kojeg pojedini proizvođači ne žele dozvoliti na uređaju?</div>
<div></div>
<div>- Isti članak 27 sadrži paragraf 8 koji kaže da potpisnica može napraviti izuzetke iz pravila. <strong>Da li će se prepoznati istinska kulturna dobra</strong> za koja će se napraviti iznimke? Naime, mnoge računalne igre iz 80ih godina spremljene na disketama ne bi se nikada očuvale da nije zaobiđena zaštita koja je ovisila o tim danas efektivno izumrlim medijima.</div>
<div></div>
<div>- Članak 27 paragraf 4 govori o tome da <strong>pružatelj mrežnih usluga mora dati podatke</strong> o &#8220;sumnjivoj&#8221; osobi, o potencijalnom prekršitelju. Dakle, moraju se dati privatne informacije pojedinca, iako je jedno sveučilište izvijestilo kako su uspješno s udaljene lokacije lažirali to da je njihov mrežni pisač neovlašteno preuzimao sadržaje. Znači da je lako nekome &#8220;smjestiti&#8221;: <a href="http://dmca.cs.washington.edu/" target="_blank">http://dmca.cs.<wbr>washington.edu/</wbr></a></div>
<div></div>
<div>- Članak 14 paragraf 2 pokazuje zašto je loše miješati copyright, trademark i patente. Navodi se iznimka za nekomercijalno prenošenje male osobne prtljage, te kako to ne treba pregledavati. No, za digitalne sadržaje smatra se da se izvoze i uvoze preko granica. Znači, malu količinu sadržaja se neće kontrolirati ako je preuzeta za nekomercijalne potrebe, ali veliku količinu hoće? Na prvi pogled, nepromišljen paragraf.</div>
<div></div>
<div>- Članak 9 paragraf 1 uvodi &#8220;<strong>izgubljene prodaje</strong>&#8220;, dakle &#8220;<strong>moguću</strong> dobit&#8221;, kao valjani argument. Neovlašteno proizvedena kopija je rijetko uistinu moguća dobit. Slučaj &#8220;Capitol v. Thomas&#8221; u kojem je za 24 neovlašteno kopirane pjesme gđa. Thomas-Rasset kažnjena s $222.000, zatim povećano na $1.920.000, pa smanjeno na $54.000, pa povećano na $1.500.000, pa opet smanjeno na $54.000. To znači da mora platiti $2.250 po pjesmi. Ukoliko se ostalo pri $1.920.000, koliko godina bi gđa. Thomas-Rasset morala otplaćivati tih 24 pjesme?</div>
<div></div>
<div>- Članak 10 paragraf 2 mi izgleda opasan zbog mogućnosti da se <strong>uništava oprema</strong> korištena za proizvodnju neovlaštenih materijala (vjerojatno samo na counterfeitanje i piratiziranje). Navodi se da se to čini u slučaju da je oprema primarno korištena za proizvodnju neovlaštenih materijala. Tko garantira ograničenje da se u ostalim slučajevima oprema <strong>neće</strong> uništiti?</div>
<div></div>
<div>- Članak 5 odjeljak (l) ističe da izraz &#8220;<strong>nositelj prava uključuje savez ili udruženje</strong>&#8220;. Zašto se jednostavno nije istaknulo da nositelj prava može biti i pojedinac?</div>
<div></div>
<div>- Članak 11 omogućuje kršenje privatnosti na temelju &#8220;osnovane sumnje&#8221;, koja u slučaju piratizacije digitalnim kanalima može, s nekim tehnologijama, biti &#8220;osnovana&#8221; pod navodnicima, odnosno teško dokaziva.</div>
<div></div>
<div>- Sekcija 3 fusnota 4: Ukoliko dobro shvaćam, ovo se primarno odnosi na EU i Schengenski režim. Ako članica EU koja je dio Schengenskog režima <strong>ne potpiše sporazum</strong>, druge članice prema njoj <strong>moraju uvesti kontrolu granice</strong> (ukinuti Schengenski režim)? Kaže otprilike: “Potpisnice trebaju uvesti granične preglede, ali ne s drugim potpisnicama s kojima su ukinute granične kontrole.” Znači &#8212; ako s nekom državom imamo ukinute granične kontrole, ali ta država nije potpisnica ACTA (čime se ne zadovoljavaju uvjeti iz fusnote 4), obvezujemo se imati granične kontrole kako je propisano ostatkom ACTA.</div>
<div></div>
<div>- Članak 23 paragraf 5: <strong>Kazne za &#8220;pomagače&#8221;</strong>. Ako npr. Google pomogne nekome da skine moju igru, neka završe u zatvoru Larry Page i Sergey Brin, a Google neka se ugasi?  Ako T-Portal objavi link na YouTube video s pjesmom, pomažu li u &#8220;commercial scale&#8221; piratizaciji? Ako TV kuća prenese snimke iz ratne zone bez da zatraži pravo na to od autora, treba li kriminalno goniti autora TV priloga, urednika emisije, te samu TV kuću?</div>
<div></div>
<div>- Članak 23 paragraf 1 spominje izraz &#8220;<strong>na komercijalnoj razini</strong>&#8221; (commercial scale) no ne precizira što to znači. Što jest komercijalna skala? Ukoliko osoba koristi tehnologiju BitTorrent, automatski šalje male komadiće datoteke na potencijalno tisuće adresa. Znači, ukoliko se osobi &#8220;smjesti&#8221; da koristi BitTorrent (makar ustvari nije ni svjesna da se to događa na njenoj opremi), vlasti mogu automatski protumačiti da je vršena protupropisna redistribucija na &#8220;komercijalnoj razini&#8221;.</div>
<div></div>
<div>- Članak 23 paragraf 3 želi <strong>kriminalno goniti nekoga tko snima kamerom film u kinu</strong>. Kao netko tko nije pravnik pretpostavljam da bi to značilo da osoba ulazi u popis osoba koje su &#8220;kažnjavane&#8221;. Da se malo našalim, jedino što tu može biti <strong>kriminalno </strong>jest sama loša kvaliteta tako nastale snimke.</div>
<div></div>
<div>- Članak 31 potiče potpisnice na širenje protupiratske propagande. <strong>Ovo je dobro</strong> u umjerenim količinama. Organizacije RIAA i MPAA iznose nebulozne brojke u SAD, i ustvari rade suprotno od kvaitetnog promicanja poštenog odnosa prema autorima.</div>
<div></div>
<div>- Da se malo odmaknemo od piratstva, i da pogledamo nešto za što smatram da ACTA može uistinu koristiti (a to je proizvodnja fizičkih proizvoda s lažnom robnom markom): članak 20 paragraf 2 kaže kako <strong>nije dovoljno ukloniti </strong>lažnu robnu marku kako bi se proizvod mogao staviti na tržište. Zar uklanjanjem robne marke taj proizvod nije postao &#8220;legalan&#8221;? Zar nije dovoljno kazniti proizvođača?</div>
<div></div>
<div>- Način na koji će funkcionirati &#8220;Komisija za ACTAu&#8221; je malo čudan i iz nekih dijelova ugovora (članak 36 paragraf 2) proizlazi kao da bi možda, potencijalno, ta komisija mogla nadzirati samu sebe i proširivati ACTA. Čini se kako to nije slučaj u zadnjem draftu, ali da se krenulo od toga, te da su neke potpisnice uspješno uspjele lobirati da se smanji utjecaj odbora. Ipak, članak 42 određuje kako potpisnice mogu predlagati promjene, no ne ograničava se da sam odbor ne može predlagati promjene. Ipak, ovo je samo dojam.</div>
<div></div>
<div class="plus-one-wrap"><g:plusone href="http://blog.vucica.net/2012/02/nastavak-na-pismo-vezano-za-acta.html"></g:plusone></div>
<p><a href="http://feedads.g.doubleclick.net/~a/iEHB1zFUXkxUQL_ZCw1qg6TBstc/0/da"><img src="http://feedads.g.doubleclick.net/~a/iEHB1zFUXkxUQL_ZCw1qg6TBstc/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/iEHB1zFUXkxUQL_ZCw1qg6TBstc/1/da"><img src="http://feedads.g.doubleclick.net/~a/iEHB1zFUXkxUQL_ZCw1qg6TBstc/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=o329LkTu6Fw:w5_TvsA77iQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=o329LkTu6Fw:w5_TvsA77iQ:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=o329LkTu6Fw:w5_TvsA77iQ:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?i=o329LkTu6Fw:w5_TvsA77iQ:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=o329LkTu6Fw:w5_TvsA77iQ:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?i=o329LkTu6Fw:w5_TvsA77iQ:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=o329LkTu6Fw:w5_TvsA77iQ:XAVGb8Xj5zA"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=XAVGb8Xj5zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/KhaoticOne/~4/o329LkTu6Fw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.vucica.net/2012/02/nastavak-na-pismo-vezano-za-acta.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.vucica.net/2012/02/nastavak-na-pismo-vezano-za-acta.html</feedburner:origLink></item>
		<item>
		<title>Otvoreno pismo Predsjedniku RH Ivi Josipoviću: “Vaša podrška ACTA-i”</title>
		<link>http://feedproxy.google.com/~r/KhaoticOne/~3/adaghl632Q0/otvoreno-pismo-predsjedniku-rh-ivi-josipovicu-vasa-podrska-acta-i.html</link>
		<comments>http://blog.vucica.net/2012/02/otvoreno-pismo-predsjedniku-rh-ivi-josipovicu-vasa-podrska-acta-i.html#comments</comments>
		<pubDate>Fri, 10 Feb 2012 13:12:39 +0000</pubDate>
		<dc:creator>Ivan Vučica</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ACTA]]></category>
		<category><![CDATA[croatian]]></category>

		<guid isPermaLink="false">http://blog.vucica.net/?p=638</guid>
		<description><![CDATA[UPDATE 16. veljače 2012. 20:30 Jučer sam objavio najavljeni follow-up. UPDATE 13. veljače 2012. 12:50 Jučer rano ujutro primio sam odgovor od Predsjednika. S obzirom da poštujem privatnost komunikacije, te da nije ničime indicirano kako se radi o pismu namijenjenom javnoj objavi, neću objavljivati tekst odgovora, osim na zahtjev Predsjednika ili njegovog Ureda. Ono što [...]]]></description>
			<content:encoded><![CDATA[<p><b>UPDATE 16. veljače 2012. 20:30</b><br />
Jučer sam objavio <a href="http://blog.vucica.net/2012/02/nastavak-na-pismo-vezano-za-acta.html">najavljeni follow-up</a>. </p>
<hr />
<b>UPDATE 13. veljače 2012. 12:50</b></p>
<p>Jučer rano ujutro primio sam odgovor od Predsjednika. S obzirom da poštujem privatnost komunikacije, te da nije ničime indicirano kako se radi o pismu namijenjenom javnoj objavi, <b>neću objavljivati tekst odgovora, osim na zahtjev Predsjednika ili njegovog Ureda</b>.</p>
<p>Ono što ću učiniti je objaviti <b>svoj</b> skraćeni odgovor na odgovor, koji će nastati temeljem Predsjednikovih pozitivnih komentara, ali i kritika nekih stvari koje sam iznio u pismu. Vjerojatno neću objaviti kompletan odgovor koji ću uputiti, nego nešto što će efektivno biti korekcije i dopune originalnog pisma.</p>
<p>Posljednjih nekoliko dana je vrlo šokantno iskustvo za mene, s obzirom da je ideja bila potaknuti na promišljanje Predsjednika i ograničen skup ljudi koji inače prate moj rad. <b>U trenutku slanja i objave na blogu nisam očekivao veliku pažnju prema pismu, i ostajem u nadi da pažnja neće biti skrenuta na mene osobno.</b> Svakako nisam očekivao veliko širenje teksta po webu, niti toliku pažnju. U najavljenom followupu ću pojasniti neke stvari i manje greške nastale na temelju, između ostaloga, toga da nisam pravnik i da ne pratim izuzetno detaljno međunarodnu politiku.</p>
<p>I dalje stojim iza temeljne poruke pisma: <b>Problem je loša usluga, a rješenje nije zabrana i agresivna borba.</b></p>
<hr />
<p>Danas sam uputio ovo otvoreno pismo putem e-maila Predsjedniku RH kao izraz razočaranja njegovom podrškom ACTAi.</p>
<hr />
<p>Poštovani gospodine Predsjedniče!</p>
<p>Na pisanje ovog otvorenog pisma potaknut sam neugodnim iznenađenjem kada sam pročitao vijest o tome da ste kao jedan od političara koji se pokušava založiti za građanske slobode dali podršku ACTA-i.</p>
<p> <a href="http://dnevnik.hr/vijesti/hrvatska/uzimanje-s-interneta-jednako-je-uzimanju-hrane-u-trgovini.html">http://dnevnik.hr/vijesti/hrvatska/uzimanje-s-interneta-jednako-je-uzimanju-hrane-u-trgovini.html</a></p>
<p>Kao jedan od sudionika u predivnom procesu stvaranja računalnih sadržaja, kao mali programer za međunarodno tržište na kojeg piratstvo i osobno može utjecati, kao student, ali ponajviše kao osoba koja razumije tehničku i društvenu stranu računalnih mreža, razočaran sam time da dajete podršku ovakvom ugovoru. Još više sam iznenađen kao netko tko vjeruje u potrebu za transparentnim donošenjem propisa, zakona i ugovora &#8211; što ACTA svakako nije. Najviše sam iznenađen kao netko tko vjeruje u osobne slobode, te u ljudsku prirodu.</p>
<p>Morate biti svjesni da u većini slučajeva nije moguće odrediti točnu osobu koja je počinila računalno piratstvo. ACTA se igra s propisima kao što je isključivanje osobe s Interneta nakon tri prekršaja. Velik udio privatnih kućanstava koje imaju bežičnu računalnu mrežu nije zaštićen, ili je neadekvatno zaštićen. Malo tehnički potkovanija osoba može bez problema koristiti tuđu mrežu za čin piratstva, a bez da se tu osobu može identificirati. Drugim sudionicima na Internetu (uključujući i davatelju Internetskih usluga kao što su T-Com, Iskon, AMIS) će proces izgledati kao da vlasnik veze na Internet čini piratstvo. Što ukoliko osoba to čini na računalu u tvrtki? Da li su vlasnici mreža koje su nesigurne zbog tehničke &#8220;nepotkovanosti&#8221; vlasnika, odnosno tvrtke, odgovorne za ono što pojedinac napravi u njihovo ime? Možemo li i trebamo li zabraniti pristup Internetu?</p>
<p>Podsjećam kako je u SAD bilo slučajeva da su starije osobe koje imaju računalo isključivo za, primjerice, čitanje vijesti optužene za piratizaciju zato jer je unuk, bez njihova znanja, vršio neovlašteno preuzimanje sadržaja s Interneta. Podsjećam kako su na pojedinim sveučilištima u SAD obavijest o izvršenju neovlaštenog kopiranja dobili &#8212; mrežni printeri. </p>
<p>Kako se uz takvu nepouzdanost identifikacije možemo pouzdati u &#8220;tri puta i letiš van&#8221; pravilo?</p>
<p>Kućni pirati također ne oštećuju izravno vlasnike autorskih prava. Ništa nije ukradeno &#8220;kao u trgovini&#8221;, kako ste Vi izjavili. Vjerujem da ste svjesni kako izradom nove kopije nikome nije uništen original; krađa kruha u trgovini izravno oštećuje trgovinu u smislu da taj kruh ne može prodati nekome drugome. Vlasnici autorskih prava vjerojatno piratu ne bi ikako uspjeli prodati svoj proizvod; rijetke su situacije kada osoba kupi proizvod onda kada ga ne može neovlašteno besplatno preuzeti. Jednostavno odustane, i pronađe alternativni sadržaj koji može besplatno preuzeti.</p>
<p>Osobe koje piratiziraju i čuju, vide ili isprobaju kvalitetan sadržaj znaju ga i kupiti, makar to ne bi nikad učinili da piratizacija nije pomogla. Piratizacija pomaže malom kvalitetnom umjetniku, izvođaču i programeru za kojeg se inače ne bi čulo &#8212; ne bi se čulo jer nema veliku marketinšku &#8220;mašineriju&#8221; koja bi ga promovirala. Ukoliko vidim piratiziranu igru kod svojeg prijatelja i svidi mi se, možda ću se odlučiti na kupnju. Ukoliko čujem piratiziranu pjesmu ili je čak sam piratiziram, možda odlučim otići na koncert. Ukoliko je nikad nisam vidio, nemam izbora nego opredijeliti se za velike, bogate izvođače i njihove izdavače, neovisno o tome koliko su nekvalitetni. Jedina alternativa mi je ne odabrati ništa. Tko je tada profitirao? Nitko.</p>
<p>Internet je također slobodan medij. Predivan je zato jer je slobodan. Jedinstven je jer je dvosmjeran. Ukoliko se pirate počne loviti jače nego sada, a bez da se Internet pretvori u ograničeni konzumeristički kanal umjesto u slobodni anonimni komunikacijski kanal, vjerujte mi kad kažem da će se to pretvoriti u igru mačke i miša. Što god se pokuša učiniti kako bi se uništilo bilo koju grupu na Internetu, vjerujte da se sva ograničenja nekako može zaobići. Netko će pronaći rješenje. Već sada postoje tzv. &#8220;darkneti&#8221;, slobodne mreže koje su &#8220;skrivene unutar Interneta&#8221;.</p>
<p>Molim Vas da imate na umu kako Vam sve ovo govorim kao privatna osoba koja se bavi izradom softvera. Molim Vas da imate na umu kako je i vlasnik najveće Internetske trgovine računalnih igara Steam, Gabe Newell, izjavio kako je problem piratstva ustvari problem loše usluge. Koliko puta ste htjeli pogledati kupljeni film s DVDa da bi Vas dočekale reklame? Na VHSu je bilo trivijalno preskočiti reklame &#8212; no na DVDu je gledanje reklama često nemoguće zaobići. Ukoliko neka usluga omogući jeftino kupovanje filma bez odlaska do trgovine, bez gledanja ogromne količine reklama, ne znači li to da je lakše platiti kako bih zauvijek i uz garantiranu brzinu mogao preuzimati taj sadržaj?</p>
<p>Umjesto da zagovarate ACTA, pokušajte zagovarati poboljšanje usluge hrvatskim korisnicima. Pokušajte zagovarati dolazak usluga kao što su iTunes Music Store i iTunes Book Store u Hrvatsku. Pokušajte zagovarati dolazak hrvatskog sadržaja na te i slične usluge. Olakšajte hrvatskim korisnicima da ne budu pirati umjesto da im se prijeti oštrim kaznama, a možda i zatvorom.</p>
<p>Piratizacija je problem. Ali ACTA nikako nije rješenje za ičije probleme. Rješenje i za ponuđače i za korisnike je to da se jednostavno ponudi bolja usluga na slobodnom tržištu. iTunes Music Store je to dokazao: ljudi su pohrlili kupovati pjesme po cijeni $0.99 jer je izvedeno na jednostavan način, i jer se na jednostavan način moglo pjesme prebaciti na svirač glazbe iPod. Steam je također to dokazao: na bilo kojoj rasprodaji ostvaruju se rekordne prodaje i zarade. </p>
<p>Možda ste čuli za &#8220;<a href="http://www.humblebundle.com/">Humble Indie Bundle</a>&#8220;, ilitiga &#8220;Skromni paket nezavisnih&#8221;? To su paketi igara napravljeni od malih studija za razvoj računalnih igara. U svakom paketu nalazi se najčešće po 5 ili više igara za tri računalne platforme, te mogućnost doniranja u dvije humanitarne organizacije. Prodaja traje oko dva tjedna. Dosad je bilo, čini mi se, 6 paketa.</p>
<p>Kupac može unijeti bilo koju svotu novca za kupnju igara. (Za neke male svote transakcijski troškovi koje nameće kartična kuća su zasigurno veći.) Što mislite, kolike su zarade po paketu? </p>
<p>Svi osim jednog paketa donijeli su više od $1.000.000. Neki su donijeli i više od $2.000.000. Prosječni kupac daje oko $4.50.</p>
<p>Dakle: usluga je ključ, a ne dodatna zaštita! Zakoni za zaštitu već postoje. Nerealno, nepraktično i implicitno autokratski ih je provoditi na privatnim korisnicima, a ACTA pokušava upravo to. ACTA pokušava nametnuti promjenu ponašanja slobodnim građanima koji nikoga nisu ubili, oštetili ili ozlijedili. Financijska šteta ne postoji, nego neostvarena, moguća, fantomska dobit.</p>
<p>Podrška ACTAi je podrška ograničenju slobodi. Podrška ACTAi je podrška preuveličavanju štete od piratizacije. Stoga se nadam da je Vaš izraz podrške ACTAi lapsus koji ćete što prije ispraviti.</p>
<p>&#8211;<br />
Ivan Vučica<br />
student i programer<br />
ivan@vucica.net</p>
<div class="plus-one-wrap"><g:plusone href="http://blog.vucica.net/2012/02/otvoreno-pismo-predsjedniku-rh-ivi-josipovicu-vasa-podrska-acta-i.html"></g:plusone></div>
<p><a href="http://feedads.g.doubleclick.net/~a/BqGQyFRM2HUSHtzcYXtT-xIHkUo/0/da"><img src="http://feedads.g.doubleclick.net/~a/BqGQyFRM2HUSHtzcYXtT-xIHkUo/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/BqGQyFRM2HUSHtzcYXtT-xIHkUo/1/da"><img src="http://feedads.g.doubleclick.net/~a/BqGQyFRM2HUSHtzcYXtT-xIHkUo/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=adaghl632Q0:6gFXyrXOV_I:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=adaghl632Q0:6gFXyrXOV_I:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=adaghl632Q0:6gFXyrXOV_I:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?i=adaghl632Q0:6gFXyrXOV_I:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=adaghl632Q0:6gFXyrXOV_I:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?i=adaghl632Q0:6gFXyrXOV_I:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=adaghl632Q0:6gFXyrXOV_I:XAVGb8Xj5zA"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=XAVGb8Xj5zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/KhaoticOne/~4/adaghl632Q0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.vucica.net/2012/02/otvoreno-pismo-predsjedniku-rh-ivi-josipovicu-vasa-podrska-acta-i.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://blog.vucica.net/2012/02/otvoreno-pismo-predsjedniku-rh-ivi-josipovicu-vasa-podrska-acta-i.html</feedburner:origLink></item>
		<item>
		<title>NSMutableDictionary without automatic retaining of contained objects</title>
		<link>http://feedproxy.google.com/~r/KhaoticOne/~3/WD-_VoLZFsM/nsmutabledictionary-without-automatic-retaining-of-contained-objects.html</link>
		<comments>http://blog.vucica.net/2012/01/nsmutabledictionary-without-automatic-retaining-of-contained-objects.html#comments</comments>
		<pubDate>Wed, 25 Jan 2012 21:00:45 +0000</pubDate>
		<dc:creator>Ivan Vučica</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Core Foundation]]></category>
		<category><![CDATA[Foundation]]></category>

		<guid isPermaLink="false">http://blog.vucica.net/?p=632</guid>
		<description><![CDATA[There may arise a situation where you absolutely can&#8217;t do something without either doing ugly hacks with overriding -release (which you should never, ever do), or using non-Objective-C constructs such as C++&#8217;s std::map (shudder), or rolling out your own key-value storage data structure (evil NIH syndrome strikes again). The Reason The only valid reason I [...]]]></description>
			<content:encoded><![CDATA[<p>There may arise a situation where you absolutely can&#8217;t do something without either doing ugly hacks with overriding <code>-release</code> (which you should never, ever do), or using non-Objective-C constructs such as C++&#8217;s <code>std::map</code> (shudder), or rolling out your own key-value storage data structure (evil NIH syndrome strikes again).</p>
<h2>The Reason</h2>
<p>The only valid reason I can think of for doing this is to avoid a cyclic reference. For example, an object must be stored in a dictionary, but should be automatically removed from it upon being <code>-dealloc</code>&#8216;ed. This is exactly what I&#8217;m doing in a game I&#8217;m slowly working on in order to cache OpenGL textures. I tried hacking this by overriding <code>-release</code> and monitoring </code>-retainCount</code>. Any Objective-C developer worth the name will know that's a pretty dumb thing to do: <code>-retainCount</code> is a pretty shaky thing to depend on, due to various compiler optimizations, and overriding <code>-release</code> can only cause issues. (Yes, that includes overriding <code>-release</code> to force yourself and your teammates never to destroy a singleton. I actually saw that being done in production code. Pretty nasty stuff.)</p>
<p>Pretty much invalid reasons are:</p>
<ul>
<li><b>storing non-Objective-C pointers or data types</b>. If you're making use of <code>NSMutableDictionary</code>, you're probably making use of Objective-C and Foundation. So make use of the reference counting mechanism built into the framework by wrapping the non-Objective-C data type into something that can be swallowed by the framework nice and easy. Create a thin wrapper around this data by subclassing <code>NSObject</code></li>
<li><b>not wanting to deal with the reference counting system</b>. Oh, so you're one of those people who don't like to use <code>-retain</code>/<code>-release</code>/<code>-autorelease</code>? You find them abhorrent? Go and cry to your mommy; the reference counting system is one of the most powerful mechanisms enabled by Objective-C and provided by Foundation. Shunning it is no good.</li>
</ul>
<p>Oh, and if you're one of the ARC-loving <strike>pansies</strike> developers, sorry; I have no idea what effect this'll have on your funny-colored little world. Because we're about to dive into the mean world of Core Foundation.</p>
<p>This also, sadly, means I have no idea how this'll work with GNUstep.</p>
<h2>The Explanation</h2>
<p>So you may have heard that Core Foundation equivalents of Foundation classes are "toll-free bridged". What does this mean?</p>
<p>This means that if you create a <code>CFArray</code>, you can use the resulting pointer as an <code>NSArray</code>, and vice versa. This is pretty handy if you're writing code that interacts with Mac OS X's kernel. When writing something that talks to Bluetooth subsystem (say, a new Bluetooth service), you will use C functions that accept and return <code>CFDictionary</code> instances. Oh, sir, yes they do.</p>
<p>So to clean up your code of all those nasty <code>CFDictionary*()</code> function calls, and make it look all nice and Objective-C-ish, what can you do? You just pass the resulting <code>CFDictionary</code> pointer as the first thing in the brackets (you know, where you usually put an Objective-C message target?) and you use plain old Foundation message sends to do operations with the dictionary. To get rid of the warning, you can cast it either prior to the message send or in-line when performing the send.</p>
<pre class="syntax objective-c">
  CFDictionaryRef dict; // same as CFDictionary *

  // . . . initialize it here . . .

  [((NSDictionary*)dict) valueForKey:@&quot;someKey&quot;];
  // ...or alternatively:
  NSDictionary * theDict = (NSDictionary*)dict;
  [dict valueForKey:@&quot;someKey&quot;];
</pre>
<p>And you can also do the opposite thing! You can create an <code>NSDictionary</code> and pass it off as a <code>CFDictionary</code>.</p>
<pre class="syntax objective-c">
  NSDictionary * dict = [[NSDictionary alloc] initWithObjectsAndKeys:@&quot;value&quot;, @&quot;key&quot;, nil];

  // . . . use it here . . .

  // now we'd have to do [dict release].
  // or, we could have autoreleased the object right after
  // initializing it.
  // but let's be fancy.
  CFDictionaryRef cfDict = (CFDictionaryRef)dict;
  CFRelease(cfDict);
</pre>
<h2>The Solution</h2>
<p>So how do we actually create a <code>NSMutableDictionary</code> whose objects won't be retained nor released? </p>
<p>It turns out to be wonderfully simple. You see, <code>CFDictionaryCreateMutable()</code> is a C function. And C doesn't have a concept of reference counting built deep down into its core. So when you create a dictionary for use with C code, in a C-only program, you probably don't want the dictionary to try to send messages to pointers which are not really Objective-C objects.</p>
<p>And as we have demonstrated each <code>CFDictionary</code> is actually an <code>NSDictionary</code>.</p>
<p>If you are using a C function, it's a good idea to actually default to C behavior: no retaining and no releasing. It might also be a good idea to allow one to use a third-party reference counting mechanism? </p>
<p>That's exactly what was done here. When calling <code>CFDictionaryCreateMutable()</code>, you feed it an allocator which can be used to allocate memory instead of the default one, the default capacity (just like <code>-initWithCapacity:</code>), and two pointers which describe just how the dictionary should behave when retaining, releasing, describing, copying, hashing and comparing values and keys.</p>
<p>First thing I did, and that seems to work quite well, is just pass <code>NULL</code> for the last two pointers. That is, it works quite well when your keys are constant strings which won't be released that easily. I haven't experienced a crash even when they aren't, but let's not risk it.</p>
<p>So let's see.</p>
<pre class="syntax objective-c">
NSMutableDictionary * ourDictionary = (NSMutableDictionary*)CFDictionaryCreateMutable(nil, 0, NULL, NULL);
</pre>
<p>Good, but let's improve it by passing a pointer to a default structure  for copying and releasing keys. Note that <code>NSMutableDictionary</code> also copies its keys. Exploring why it does so should be an exercise for the reader.</p>
<pre class="syntax objective-c">
NSMutableDictionary * ourDictionary = (NSMutableDictionary*)CFDictionaryCreateMutable(nil, 0, &amp;kCFCopyStringDictionaryKeyCallBacks, NULL);
</pre>
<p>Now our keys are copied and released where appropriate, while the values are left untouched.</p>
<p>Optionally, explore using <code>kCFTypeDictionaryKeyCallBacks</code> in situations where your keys may be other <code>CFType</code>-derived objects. (That is, not just <code>CFString</code>s/<code>NSString</code>s.) Don't use this if there is even a remote chance of your key being a mutable object.</p>
<div class="plus-one-wrap"><g:plusone href="http://blog.vucica.net/2012/01/nsmutabledictionary-without-automatic-retaining-of-contained-objects.html"></g:plusone></div>
<p><a href="http://feedads.g.doubleclick.net/~a/wlclDrcneYiaWHhG0Esa_bW5En0/0/da"><img src="http://feedads.g.doubleclick.net/~a/wlclDrcneYiaWHhG0Esa_bW5En0/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/wlclDrcneYiaWHhG0Esa_bW5En0/1/da"><img src="http://feedads.g.doubleclick.net/~a/wlclDrcneYiaWHhG0Esa_bW5En0/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=WD-_VoLZFsM:tRKSXEMGFsI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=WD-_VoLZFsM:tRKSXEMGFsI:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=WD-_VoLZFsM:tRKSXEMGFsI:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?i=WD-_VoLZFsM:tRKSXEMGFsI:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=WD-_VoLZFsM:tRKSXEMGFsI:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?i=WD-_VoLZFsM:tRKSXEMGFsI:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=WD-_VoLZFsM:tRKSXEMGFsI:XAVGb8Xj5zA"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=XAVGb8Xj5zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/KhaoticOne/~4/WD-_VoLZFsM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.vucica.net/2012/01/nsmutabledictionary-without-automatic-retaining-of-contained-objects.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.vucica.net/2012/01/nsmutabledictionary-without-automatic-retaining-of-contained-objects.html</feedburner:origLink></item>
		<item>
		<title>Overriding HTTP user agent for calls to -initWithContentsOfURL:</title>
		<link>http://feedproxy.google.com/~r/KhaoticOne/~3/PGlwAo3o8aw/overriding-http-user-agent-for-calls-to-initwithcontentsofurl.html</link>
		<comments>http://blog.vucica.net/2011/12/overriding-http-user-agent-for-calls-to-initwithcontentsofurl.html#comments</comments>
		<pubDate>Tue, 20 Dec 2011 17:32:06 +0000</pubDate>
		<dc:creator>Ivan Vučica</dc:creator>
				<category><![CDATA[network programming]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[arrayWithContentsOfURL]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[dictionaryWithContentsOfURL]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[initWithContentsOfURL]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[method swizzling]]></category>
		<category><![CDATA[NSURL]]></category>
		<category><![CDATA[NSURLRequest]]></category>
		<category><![CDATA[stringWithContentsOfURL]]></category>
		<category><![CDATA[swizzling]]></category>

		<guid isPermaLink="false">http://blog.vucica.net/?p=621</guid>
		<description><![CDATA[Perhaps you need to override the HTTP user agent whenever you call -initWithContentsOfURL: from classes such as NSString, NSDictionary or NSArray, or one of this method&#8217;s convenience wrappers such as +stringWithContentsOfURL:, +dictionaryWithContentsOfURL: or +arrayWithContentsOfURL:. So let&#8217;s consider how this can be accomplished under iOS. From what I can see, there is no easy and &#8220;clean&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>Perhaps you need to override the HTTP user agent whenever you call <code>-initWithContentsOfURL:</code> from classes such as <code>NSString</code>, <code>NSDictionary</code> or <code>NSArray</code>, or one of this method&#8217;s convenience wrappers such as <code>+stringWithContentsOfURL:</code>, <code>+dictionaryWithContentsOfURL:</code> or <code>+arrayWithContentsOfURL:</code>. So let&#8217;s consider how this can be accomplished under iOS.</p>
<p>From what I can see, there is no easy and &#8220;clean&#8221; way apart from adding a category on the classes where you need to support this and writing your own implementation of <code>-initWithContentsOfURL:</code> and convenience functions (with a slightly different name, of course). These implementations would use <code>NSURLConnection</code>&#8216;s <code>+sendSynchronousRequest:returningResponse:error:</code>. Of course, as with <code>-initWithContentsOfURL:</code> you&#8217;d use this replacement method in a background thread to maintain UI responsiveness.</p>
<p>You&#8217;d have to write a reimplementation of <code>-initWithContentsOfURL:</code> because the first place you can change this is <code>NSURLRequest</code>, or more specifically, its mutable variant <code>NSMutableURLRequest</code>, using the <code>-setValue:forHTTPHeaderField:</code>. But, if you have tons of code, you probably can&#8217;t easily change it to use the new method.</p>
<p>So I dug in and, with a few smart tricks (such as feeding a broken non-<code>NSURL</code> as a <code>NSURL</code> to figure out which methods get called, then implementing them as necessary), I figured out which of several ways for fetching web content is actually used in <code>NSString</code>&#8216;s implementation of <code>-initWithContentsOfURL:</code>. These could have been <code>NSURLConnection</code> or some low level messing with <code>CFNetwork</code>. </p>
<p>It turned out not to matter since <code>NSURLRequest</code> is generated out of the <code>NSURL</code> passed to the method. Customizing the user agent turned out to be just a matter of taking all <code>NSURLRequest</code>s, forcing them to become mutable copies in form of instances of <code>NSMutableURLRequest</code> during the initializer and setting the user agent at that time. Specific initializer appearing in iOS implementation used in iOS 5 Simulator that ships with Xcode 4.2.1 appears to be <code>-initWithURL:cachePolicy:timeoutInterval:</code>. </p>
<p>It&#8217;s an enormous hack, but I decided to simply <a href="http://www.cocoadev.com/index.pl?MethodSwizzling">swizzle this method out</a>. Swizzling <code>NSURLConnection</code>&#8216;s class method  <code>+sendSynchronousRequest:returningResponse:error:</code> did not appear to work &#8211; the original method still got called despite my best efforts to figure out what went wrong with swizzling, so I gave up on it. If you can see a mistake in my class swizzling code, please tell me about it in the comments section below.</p>
<p>I definitely have no idea whether or not your app will be rejected for this, but from what I know, method swizzling is not illegal.</p>
<pre class="syntax objective-c">
//  NSURLRequest+UserAgentFix.m

#define YOUR_USER_AGENT @&quot;Your User Agent&quot;
#import &quot;NSURLRequest+UserAgentFix.h&quot;
#import &quot;NSObject+ISSwizzling.h&quot;
@implementation NSURLRequest (UserAgentFix)
+(void)load
{
    [self swizzleMethod:@selector(initWithURL:cachePolicy:timeoutInterval:)
             withMethod:@selector(initWithURL2:cachePolicy:timeoutInterval:)];
}
-(id)initWithURL2:(NSURL *)URL cachePolicy:(NSURLRequestCachePolicy)cachePolicy timeoutInterval:(NSTimeInterval)timeoutInterval
{
    self = [self initWithURL2:URL cachePolicy:cachePolicy timeoutInterval:timeoutInterval];

    if(!self)
        return nil;

    if([self class] == [NSURLRequest class])
        self = [self mutableCopy];

    if([self class] == [NSMutableURLRequest class])
    {
        NSMutableURLRequest * req = self;
        [req setValue:YOUR_USER_AGENT forHTTPHeaderField:@&quot;User-Agent&quot;];
    }

    return self;
}
@end
</pre>
<pre class="syntax objective-c">
// NSURLRequest+UserAgentFix.h

#import &lt;Foundation/Foundation.h&gt;

@interface NSURLRequest (UserAgentFix)

@end
</pre>
<pre class="syntax objective-c">
// NSObject+ISSwizzling.h

#import &lt;Foundation/Foundation.h&gt;

@interface NSObject (ISSwizzling)
+ (BOOL)swizzleMethod:(SEL)origSelector withMethod:(SEL)newSelector;
+ (BOOL)swizzleClassMethod:(SEL)origSelector withMethod:(SEL)newSelector;

@end
</pre>
<pre class="syntax objective-c">
// NSObject+ISSwizzling.m

#import &lt;objc/runtime.h&gt;
#import &quot;NSObject+ISSwizzling.h&quot;

@implementation NSObject (ISSwizzling)
+ (BOOL)swizzleMethod:(SEL)origSelector withMethod:(SEL)newSelector
{
    Method origMethod = class_getInstanceMethod(self, origSelector);
    Method newMethod = class_getInstanceMethod(self, newSelector);

    if (origMethod &amp;&amp; newMethod) {
        if (class_addMethod(self, origSelector, method_getImplementation(newMethod), method_getTypeEncoding(newMethod))) {
            class_replaceMethod(self, newSelector, method_getImplementation(origMethod), method_getTypeEncoding(origMethod));
        } else {
            method_exchangeImplementations(origMethod, newMethod);
        }
        return YES;
    }
    return NO;
}
+ (BOOL)swizzleClassMethod:(SEL)origSelector withMethod:(SEL)newSelector
{
    Method origMethod = class_getClassMethod(self, origSelector);
    Method newMethod = class_getClassMethod(self, newSelector);

    Class class = object_getClass((id)self);

    if (origMethod &amp;&amp; newMethod) {
        if (class_addMethod(class, origSelector, method_getImplementation(newMethod), method_getTypeEncoding(newMethod))) {
            class_replaceMethod(class, newSelector, method_getImplementation(origMethod), method_getTypeEncoding(origMethod));
        } else {
            method_exchangeImplementations(origMethod, newMethod);
        }
        return YES;
    }
    return NO;
}

@end
</pre>
<p>Tested on iOS 5 Simulator with <code>NSString</code>&#8216;s <code>+stringWithContentsOfURL:</code>.</p>
<div class="plus-one-wrap"><g:plusone href="http://blog.vucica.net/2011/12/overriding-http-user-agent-for-calls-to-initwithcontentsofurl.html"></g:plusone></div>
<p><a href="http://feedads.g.doubleclick.net/~a/_JYi-UZiYOJ3T0CKmOJ687tm1Nw/0/da"><img src="http://feedads.g.doubleclick.net/~a/_JYi-UZiYOJ3T0CKmOJ687tm1Nw/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/_JYi-UZiYOJ3T0CKmOJ687tm1Nw/1/da"><img src="http://feedads.g.doubleclick.net/~a/_JYi-UZiYOJ3T0CKmOJ687tm1Nw/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=PGlwAo3o8aw:_9JUKKwR_qQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=PGlwAo3o8aw:_9JUKKwR_qQ:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=PGlwAo3o8aw:_9JUKKwR_qQ:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?i=PGlwAo3o8aw:_9JUKKwR_qQ:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=PGlwAo3o8aw:_9JUKKwR_qQ:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?i=PGlwAo3o8aw:_9JUKKwR_qQ:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=PGlwAo3o8aw:_9JUKKwR_qQ:XAVGb8Xj5zA"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=XAVGb8Xj5zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/KhaoticOne/~4/PGlwAo3o8aw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.vucica.net/2011/12/overriding-http-user-agent-for-calls-to-initwithcontentsofurl.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.vucica.net/2011/12/overriding-http-user-agent-for-calls-to-initwithcontentsofurl.html</feedburner:origLink></item>
		<item>
		<title>Why GNU/Linux is not successful on desktops</title>
		<link>http://feedproxy.google.com/~r/KhaoticOne/~3/WBtF2DXAxMg/why-gnulinux-is-not-successful-on-desktops.html</link>
		<comments>http://blog.vucica.net/2011/11/why-gnulinux-is-not-successful-on-desktops.html#comments</comments>
		<pubDate>Fri, 04 Nov 2011 12:46:17 +0000</pubDate>
		<dc:creator>Ivan Vučica</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[gnu/linux]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[usability]]></category>

		<guid isPermaLink="false">http://blog.vucica.net/?p=616</guid>
		<description><![CDATA[I used Debian for a long time. I used it as a desktop OS. I did a lot of development and tinkering. I don&#8217;t have time for tinkering anymore, and I was lucky enough to get a Mac. I was inspired to write this short outline of my views why GNU/Linux is, sadly, not right [...]]]></description>
			<content:encoded><![CDATA[<p>I used Debian for a long time. I used it as a desktop OS. I did a lot of development and tinkering. I don&#8217;t have time for tinkering anymore, and I was lucky enough to get a Mac.</p>
<p>I was inspired to write this short outline of my views why GNU/Linux is, sadly, not right for an average user on the desktop, by <a href="https://twitter.com/ambivalentcase/status/132415860110393344">a tweet from @ivan_gustin</a> (retweeted by @ambivalentcase) that mentioned <a href="http://www.muktware.com/news/2862">Linus Torvalds&#8217; thoughts on the same subject</a> from LinuxCon Europe 2011.</p>
<p>Let me point out: <b>I WANT STRONG LINUX.</b> I want freedom, I want power. What I don&#8217;t want is ground slipping below my feet.</p>
<p><b>Technical issues</b></p>
<p>Torvalds is spot on here. You can&#8217;t give the end-user a machine that might or might not work. Things are extremely improved here, and were already good back in 2006.</p>
<p>Greatest issue, however, are regressions and constant feeling of land moving under user&#8217;s feet. I can&#8217;t in good faith press that &#8220;update&#8221; button and be nearly certain that the machine will work after the update is performed. Ubuntu is doing very well here if you update within the same release. Next release may or may not work. However, I have had almost no upgrade of a graphics card driver that didn&#8217;t require some sort of tinkering in console afterwards and messing with Xorg.conf.</p>
<p>Linux is awesome because it recognizes almost every piece of software that you throw at it.</p>
<p><b>User interface keeps changing</b></p>
<p>Look at OS X Tiger. Then look at OS X Leopard. Then look at OS X Snow Leopard. Then look at OS X Lion.</p>
<p>If you go from one version to the next one, you get the user experience that is different, but not very different. Apart from performance issues, what was a major adoption blocker for Windows Vista? A radical reworking of the UI.</p>
<p>People don&#8217;t like changes to UI that are forced on them. If I just want, for example, a better mail client that let&#8217;s-say comes with Ubuntu 11.04, why am I expected to get used to Ubuntu Unity? If I just want the terminal to keep working and be improved, why do the GNOME team force me to upgrade not just the terminal, but the entire desktop, if I want a complete and integrated user experience? Oh, and that new desktop environment in GNOME 3 is, of course, completely different from GNOME 2. </p>
<p>And GNOME 3 and Ubuntu Unity are just reruns of the KDE 4 saga.</p>
<p>KDE 4 decided to make everything modular. GNOME 3 and Ubuntu Unity decided to develop a UI that is usable on both tablets and desktops. What happens next? Someone bright decides that desktop users must use a media center-like interface?</p>
<p><b>Features that disappear</b></p>
<p>I really don&#8217;t like it when a package suddenly gets removed from Debian. Remember <a href="http://www.xmms.org/">XMMS</a>? A beautiful clone of Winamp whose only flaw was that it was written with GTK1. Someone thought it was a good idea to rewrite it as a server that plays the music, and a client that controls the playing and called this XMMS2. End-user&#8217;s client was, of course, seriously flawed and buggy, and its only boon was that it was written with GTK2. (That didn&#8217;t help it, because it was unskinnable and it was ugly.) Debian removed original XMMS because it was &#8220;unmaintained&#8221;. Great move!</p>
<p>Same thing happened to BitchX. Users who realized this were directed to use other command line IRC clients, such as irssi, which is far less usable and far uglier. At least to me.</p>
<p><b>Things changing, changing, changing, moving around, breaking down</b></p>
<p>I&#8217;m not exactly a kid anymore. I don&#8217;t have time or will to continuously tinker with stuff I already tinkered with. I just want things to work. </p>
<p>I don&#8217;t want to worry about packages conflicting.<br />
I don&#8217;t want to worry that after an upgrade, a package will be removed due to a conflict.<br />
I don&#8217;t want to worry that after an upgrade, my graphics card and my wireless card suddenly stop working because, hey, the kernel was upgraded and previously installed modules no longer work with the new kernel.<br />
I don&#8217;t want to worry that after an upgrade, I will have to relearn basically everything because some dimwit decided to &#8220;fix&#8221; what was not broken: the previously extremely usable UI.<br />
I don&#8217;t want to worry that after an upgrade, no icons appear on my desktop.</p>
<p><b>Applications and features</b></p>
<p><b>Hello. Meet my friend, Anna.</b> She&#8217;s a graphics artist. She heavily uses Photoshop on a Mac. She needs, at the very least, effects applied on layers. She also needs to work with other designers&#8217; PSD files.</p>
<p>What option does she have on Linux? GIMP? Seriously?</p>
<p>I can use GIMP. I like GIMP. Unfortunately, Anna cannot. </p>
<p><b>Hello. Meet aunt Silvia.</b> She&#8217;s a 60 year old woman taught to work with Microsoft&#8217;s Word 2007 for Windows.</p>
<p>Can she use either Word for Mac, or OpenOffice? Let me tell you, she cannot.</p>
<p>You cannot force her to use it. She does not want to learn, even if she will pirate the software. (She does not understand that your refusal to install pirated Windows and Office is a moral choice. She will think you are a jerk.)</p>
<p><b>Hello. Meet Tom.</b> Tom writes a lot of documentation. Tom got used to one thing that Macs do really well: drag and drop. He grabs almost anything, drags it, presses F3 to show <a href="http://www.blogsdna.com/12646/using-expose-from-the-mac-os-x-application-switcher.htm">Exposé</a>, points to a window, presses space so he doesn&#8217;t have to wait for the window to be zoomed into, and drops it.</p>
<p>It works great with, for example, word processing.</p>
<p>Screenshotting is also nice. Keyboard shortcut is extremely nasty and unergonomic, but being able to get any <i>portion</i> of a screen, or a nice image of a window (complete with a shadow) is just a few keytaps away, and it&#8217;s integrated into what would be a &#8220;window manager&#8221; under GNU/Linux or other X11 environments. You can easily get the screenshot in a file on the desktop, or you can get it into the clipboard for quick pasting into the mail client.</p>
<p>And under GNU/Linux, you have to worry if dragging-and-dropping, copying-and-pasting will even work between programs under same desktop environment &#8212; situation is way worse when you have to do content exchange between different environments. Can I be sure that an image put into clipboard under Konqueror will be pasteable into GIMP or Thunderbird? </p>
<p>Exposé doesn&#8217;t seem useful until you realize how useful it is with drag-drop, especially when you press space. I can&#8217;t remember any use for desktop cube effect except that it made me feel warm deep inside. (Yep, I still love desktop cube. Sometimes I perform &#8216;switch user&#8217; on OS X just to watch the default desktop cube animation.)</p>
<p><b>Hello. Meet me.</b> I&#8217;m a developer, and what I&#8217;m about to say is unfair. I love Objective-C. I love the concept of building the UI in an Interface Builder. I don&#8217;t need Objective-C <i>per se</i>, as long as I can use similar software building practices.</p>
<p>Java seems awfully close.</p>
<p>Except it isn&#8217;t. It&#8217;s static and restrictive where it shouldn&#8217;t be.</p>
<p><a href="http://www.gnustep.org/">GNUstep</a> folks are great, and they&#8217;re doing great job. But they don&#8217;t really have the resources to build a good IDE, nor prepare good introduction for new Objective-C developers. C++ developers have the very nice <a href="http://www.codeblocks.org/">Code::Blocks/<a>, which is wonderful, until you need to develop a GUI app.</p>
<p>I also want to sell my software. I love doing free software/open source work, but sometimes a person has to live off something. My end users expect good quality packaging, an easy to install app, and support that will last even if I don&#8217;t update the app manually. <a href="http://developer.ubuntu.com/">Developer portal for Ubuntu</a> is an excellent step forward for distribution, but building a quality .deb package is still difficult. <a href="http://www.appup.com/">Intel&#8217;s AppUp</a> is confusing and little-known. I&#8217;m also from Croatia &#8212; can you folks send me cash to my country? (AppUp had issues with that &#8212; or so I&#8217;m told.)</p>
<p><b>Hello. Meet Harry.</b> He&#8217;s a 14-year old gamer who wants to play StarCraft II, Call of Duty: Modern Warfare 2 and Portal 2.</p>
<p>I&#8217;ve had mostly bad experiences with Wine. Sure, you can play singleplayer original StarCraft. You can even play it in multiplayer! However, what if something goes wrong? Also, have you tried playing using Battle.net?</p>
<p>Have you tried playing Rise of Nations? Have you tried any other old title that uses DirectPlay? Did you see how many titles work, but their installers don&#8217;t work?</p>
<p>What happens when Harry&#8217;s graphics card drivers don&#8217;t start? Does he want to worry whether or not he may update nVidia&#8217;s drivers? Does he want to worry where the installer will put the launch icons? What happens when the .desktop file (the shortcut for launching apps) doesn&#8217;t work? I can probably get the title to work with Wine, but will Harry be able to?</p>
<p>And let me tell you, Harry won&#8217;t be happy when the 60 EUR game he just bought doesn&#8217;t work and he has to tinker with the computer to get it to run.</p>
<p><b>Conclusion</b></p>
<p>Who is GNU/Linux for?</p>
<p>Enthusiasts and people who use computers only for Skype, surfing, mail.</p>
<p>That&#8217;s not the massive user base that pushes the desktops and desktop usage forward. User base that pushes desktops and desktop usage forward are home power users, gamers, business users, artists, developers. Even a person who can do word processing with one package cannot use it with another these days.</p>
<p>And you know what &#8220;people who use computers only for Skype, surfing, mail&#8221; can use?</p>
<p>A tablet or (shudder) a netbook.</p>
<p>Either an Android tablet, an iPad or a Chromebook will do for them.</p>
<p><b>Solution</b></p>
<p>* Stabilize the UI. (Apple faced backlash for its reworking of scrollbars.)<br />
* Be careful before making drastic incompatibility moves. (Apple faced backlash for removing Rosetta, breaking TurboTax 2007.)<br />
* Stabilize the ABI. (Apple often ships very old versions of libraries. Removing Rosetta allowed removal of old PowerPC-only code.)<br />
* Help the developers. (You are a free software enthusiast and that&#8217;s fine. But don&#8217;t think everyone is. If I want to ship paid software, and I have a market, don&#8217;t lock me out.)</p>
<p>Don&#8217;t break stuff, don&#8217;t change stuff. Help the dev. </p>
<p>I admire <a href="http://www.linuxgamepublishing.com/">Linux Game Publishing</a>&#8216;s struggle in face of licensing issues (for example, SDL&#8217;s LGPL), in face of incompatibility, in face of historic disregard for ABI. It&#8217;s difficult to package executables that are easily relocatable to different places in the filesystem &#8211; because, since the software is open source, you can simply recompile the program for the new location. (Dependency on dynamic libraries put in fixed locations is the biggest issue.)</p>
<div class="plus-one-wrap"><g:plusone href="http://blog.vucica.net/2011/11/why-gnulinux-is-not-successful-on-desktops.html"></g:plusone></div>
<p><a href="http://feedads.g.doubleclick.net/~a/cNkATdXICfcudzgEHattlgg13l8/0/da"><img src="http://feedads.g.doubleclick.net/~a/cNkATdXICfcudzgEHattlgg13l8/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/cNkATdXICfcudzgEHattlgg13l8/1/da"><img src="http://feedads.g.doubleclick.net/~a/cNkATdXICfcudzgEHattlgg13l8/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=WBtF2DXAxMg:sUczcA1UUY8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=WBtF2DXAxMg:sUczcA1UUY8:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=WBtF2DXAxMg:sUczcA1UUY8:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?i=WBtF2DXAxMg:sUczcA1UUY8:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=WBtF2DXAxMg:sUczcA1UUY8:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?i=WBtF2DXAxMg:sUczcA1UUY8:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=WBtF2DXAxMg:sUczcA1UUY8:XAVGb8Xj5zA"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=XAVGb8Xj5zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/KhaoticOne/~4/WBtF2DXAxMg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.vucica.net/2011/11/why-gnulinux-is-not-successful-on-desktops.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.vucica.net/2011/11/why-gnulinux-is-not-successful-on-desktops.html</feedburner:origLink></item>
		<item>
		<title>NSURLConnection submits GET instead of POST with HTTP 301 Moved Permanently error</title>
		<link>http://feedproxy.google.com/~r/KhaoticOne/~3/QN5PrzKfJPA/nsurlconnection-submits-get-instead-of-post-with-http-301-moved-permanently-error.html</link>
		<comments>http://blog.vucica.net/2011/10/nsurlconnection-submits-get-instead-of-post-with-http-301-moved-permanently-error.html#comments</comments>
		<pubDate>Mon, 17 Oct 2011 14:48:14 +0000</pubDate>
		<dc:creator>Ivan Vučica</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.vucica.net/?p=600</guid>
		<description><![CDATA[If NSURLConnection seems to submit via GET instead of via POST, you may want to check whether server responded with HTTP 301 code. It appears that NSURLConnection forgets all about having to POST if it&#8217;s redirected. Strange. Note that I&#8217;m currently using RestKit, so it may be a bug in RestKit, too. Doesn&#8217;t seem that [...]]]></description>
			<content:encoded><![CDATA[<p>If <code>NSURLConnection</code> seems to submit via <code>GET</code> instead of via <code>POST</code>, you may want to check whether server responded with HTTP 301 code. It appears that <code>NSURLConnection</code> forgets all about having to <code>POST</code> if it&#8217;s redirected. Strange.</p>
<p>Note that I&#8217;m currently using RestKit, so it may be a bug in RestKit, too. Doesn&#8217;t seem that way.</p>
<div class="plus-one-wrap"><g:plusone href="http://blog.vucica.net/2011/10/nsurlconnection-submits-get-instead-of-post-with-http-301-moved-permanently-error.html"></g:plusone></div>
<p><a href="http://feedads.g.doubleclick.net/~a/8AhzgdAwa1NT3lwuKWBCjQ8Ym8g/0/da"><img src="http://feedads.g.doubleclick.net/~a/8AhzgdAwa1NT3lwuKWBCjQ8Ym8g/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/8AhzgdAwa1NT3lwuKWBCjQ8Ym8g/1/da"><img src="http://feedads.g.doubleclick.net/~a/8AhzgdAwa1NT3lwuKWBCjQ8Ym8g/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=QN5PrzKfJPA:kV5QtppREJg:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=QN5PrzKfJPA:kV5QtppREJg:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=QN5PrzKfJPA:kV5QtppREJg:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?i=QN5PrzKfJPA:kV5QtppREJg:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=QN5PrzKfJPA:kV5QtppREJg:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?i=QN5PrzKfJPA:kV5QtppREJg:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=QN5PrzKfJPA:kV5QtppREJg:XAVGb8Xj5zA"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=XAVGb8Xj5zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/KhaoticOne/~4/QN5PrzKfJPA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.vucica.net/2011/10/nsurlconnection-submits-get-instead-of-post-with-http-301-moved-permanently-error.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.vucica.net/2011/10/nsurlconnection-submits-get-instead-of-post-with-http-301-moved-permanently-error.html</feedburner:origLink></item>
		<item>
		<title>Autosaving Core Data managed object context</title>
		<link>http://feedproxy.google.com/~r/KhaoticOne/~3/ySvuusjpTAQ/autosaving-core-data-managed-object-context.html</link>
		<comments>http://blog.vucica.net/2011/10/autosaving-core-data-managed-object-context.html#comments</comments>
		<pubDate>Tue, 04 Oct 2011 09:42:49 +0000</pubDate>
		<dc:creator>Ivan Vučica</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Core Data]]></category>
		<category><![CDATA[managed object context]]></category>
		<category><![CDATA[NSManagedObjectContext]]></category>
		<category><![CDATA[NSManagedObjectContextObjectsDidChangeNotification]]></category>
		<category><![CDATA[NSNotificationCenter]]></category>
		<category><![CDATA[NSTimer]]></category>

		<guid isPermaLink="false">http://blog.vucica.net/?p=601</guid>
		<description><![CDATA[This has nothing to do with Lion autosaving. It has everything to do with the fact that Apple&#8217;s template for Core Data saves the managed object context only at exit. I&#8217;m proposing the following solution. Note that while you&#8217;re at it, you may want to move most of Core Data related code that Apple&#8217;s &#8220;shoebox&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>This has nothing to do with Lion autosaving. It has everything to do with the fact that Apple&#8217;s template for Core Data saves the managed object context only at exit.</p>
<p>I&#8217;m proposing the following solution. Note that while you&#8217;re at it, you may want to move most of Core Data related code that Apple&#8217;s &#8220;shoebox&#8221; Core Data template puts in the AppDelegate. Put it in a singleton class called <code>Database</code>. Expose <code>+sharedDatabase</code>, and <code>#define DB [Database sharedDatabase]</code> in the header. This was somewhat unrelated, but it&#8217;s worth mentioning. </p>
<p>Back to autosaving.</p>
<p>We&#8217;ll use <code>NSNotificationCenter</code> and we&#8217;ll observe for the notification that our managed object context has changed. </p>
<pre class="syntax objective-c">
    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(handleManagedObjectContextChange:)
                                                 name:NSManagedObjectContextObjectsDidChangeNotification
                                               object:managedObjectContext];
</pre>
<p>Then we&#8217;ll save after some time, but ignore any errors. Delay is important because notification occurs while the context is dirty, and you cannot really save it at that time. Scheduling a timer is a good way to delay saving a bit to occur later when the execution comes to the runloop. Plus, it also allows us to group several changes by letting us cancel the timer in case another change flows in.</p>
<p>I added an <code>NSTimer *saveDelayTimer</code> to instance variables of my <code>Database</code> class. If you are keeping the managed object context in your app delegate, you can add it there, too.</p>
<p>So let&#8217;s take a look at implementations of notification handler, and timer handler.</p>
<pre class="syntax objective-c">
-(void)handleManagedObjectContextChange:(NSNotification*)note
{
    /*
    NSSet *updatedObjects = [[note userInfo] objectForKey:NSUpdatedObjectsKey];
    NSSet *deletedObjects = [[note userInfo] objectForKey:NSDeletedObjectsKey];
    NSSet *insertedObjects = [[note userInfo] objectForKey:NSInsertedObjectsKey];
     */

    [saveDelayTimer invalidate];
    [saveDelayTimer release];
    saveDelayTimer = [[NSTimer scheduledTimerWithTimeInterval:1
                                                       target:self
                                                     selector:@selector(quickSave:)
                                                     userInfo:nil
                                                      repeats:NO] retain];
}
-(void)quickSave:(id)userInfo
{
    // save without UI-displayed errors
    NSError *error = nil;
    [managedObjectContext save:&amp;error];
    if(!error)
        NSLog(@&quot;Quicksave successful&quot;);
    else
        NSLog(@&quot;Quicksave failed: %@&quot;, error);

    [saveDelayTimer invalidate];
    [saveDelayTimer release];
    saveDelayTimer = nil;
}
</pre>
<hr />
<b>UPDATED Oct 5th 2011, 13:16</b></p>
<p>However, this is bad.</p>
<p>Upon saving <code>managedObjectContext</code>, any currently-being-edited, but bound-via-Cocoa Bindings text fields <b>will get unfocused</b>. Let&#8217;s keep the focus, text selection and scroll offset!</p>
<pre class="syntax objective-c">
-(void)quickSave:(id)userInfo
{
    // store focus and selection
    IRAppDelegate *appDelegate = [NSApp delegate];
    NSTextField * focusedTextField = nil;
    NSTableView * focusedTableView = nil;
    NSInteger focusedTableViewColumn = 0, focusedTableViewRow = 0;
    NSRange selection;
    NSRect visibleRect;
    if([appDelegate.mainWindowController.window.firstResponder isKindOfClass:[NSText class]])
    {
        NSText * textBox = (NSText*)appDelegate.mainWindowController.window.firstResponder;
        NSTextField * textField = [textBox parentTextField];
        if(textField)
        {
            // there is a text field that's focused
            focusedTextField = textField;
            selection = [textBox selectedRange];
            visibleRect = [textBox visibleRect];
        }
        NSTableView * tableView = [textBox parentTableView];
        if(tableView)
        {
            // there is a table view that's focused
            focusedTableView = tableView;
            focusedTableViewColumn = [tableView editedColumn];
            focusedTableViewRow = [tableView editedRow];
            selection = [textBox selectedRange];
            visibleRect = [textBox visibleRect];
        }
    }

    [appDelegate.mainWindowController.window endEditingFor:nil];

    // save without UI-displayed errors
    NSError *error = nil;
    [managedObjectContext save:&amp;error];
    if(!error)
        NSLog(@&quot;Quicksave successful&quot;);
    else
        NSLog(@&quot;Quicksave failed: %@&quot;, error);

    [saveDelayTimer invalidate];
    [saveDelayTimer release];
    saveDelayTimer = nil;

    // restore selection
    [focusedTextField becomeFirstResponder];
    [[focusedTextField currentEditor] setSelectedRange:selection];
    [[focusedTextField currentEditor] scrollRectToVisible:visibleRect];

    [focusedTableView becomeFirstResponder];
    [focusedTableView editColumn:focusedTableViewColumn row:focusedTableViewRow withEvent:nil select:YES];
    [[focusedTableView currentEditor] setSelectedRange:selection];
    [[focusedTableView currentEditor] scrollRectToVisible:visibleRect];
}
</pre>
<p>This uses a small category for finding the owner of <code>NSText</code> (the actual textbox that appears when you begin editing table view or a text field).</p>
<pre class="syntax objective-c">
// NSText+IRFindParentTextOwner.h

#import &lt;AppKit/AppKit.h&gt;

@interface NSText(IRFindParentTextOwner)
-(NSTextField*)parentTextField;
-(NSTableView*)parentTableView;
@end
</pre>
<pre class="syntax objective-c">
// NSText+IRFindParentTextOwner.m

#import &quot;NSText+IRFindParentTextOwner.h&quot;

@implementation NSText(IRFindParentTextOwner)
-(NSTextField*)parentTextField
{
    NSText *textBox = self;

    for (NSResponder *parent = textBox.nextResponder; parent; parent = parent.nextResponder)
    {
        if([parent isKindOfClass:[NSTextField class]])
        {
            return (NSTextField*)parent;
        }
    }
    return nil;
}

-(NSTableView*)parentTableView
{
    NSText *textBox = self;
    for (NSResponder *parent = textBox.nextResponder; parent; parent = parent.nextResponder)
    {
        if([parent isKindOfClass:[NSTableView class]])
        {
            return (NSTableView*)parent;
        }
    }
    return nil;
}

@end
</pre>
<div class="plus-one-wrap"><g:plusone href="http://blog.vucica.net/2011/10/autosaving-core-data-managed-object-context.html"></g:plusone></div>
<p><a href="http://feedads.g.doubleclick.net/~a/5ZVmKc_fnEWDLSyncQUWmeb7ySE/0/da"><img src="http://feedads.g.doubleclick.net/~a/5ZVmKc_fnEWDLSyncQUWmeb7ySE/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/5ZVmKc_fnEWDLSyncQUWmeb7ySE/1/da"><img src="http://feedads.g.doubleclick.net/~a/5ZVmKc_fnEWDLSyncQUWmeb7ySE/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=ySvuusjpTAQ:F7QQvqbHzWw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=ySvuusjpTAQ:F7QQvqbHzWw:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=ySvuusjpTAQ:F7QQvqbHzWw:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?i=ySvuusjpTAQ:F7QQvqbHzWw:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=ySvuusjpTAQ:F7QQvqbHzWw:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?i=ySvuusjpTAQ:F7QQvqbHzWw:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=ySvuusjpTAQ:F7QQvqbHzWw:XAVGb8Xj5zA"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=XAVGb8Xj5zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/KhaoticOne/~4/ySvuusjpTAQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.vucica.net/2011/10/autosaving-core-data-managed-object-context.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.vucica.net/2011/10/autosaving-core-data-managed-object-context.html</feedburner:origLink></item>
		<item>
		<title>Getting year, month and day out of NSDate</title>
		<link>http://feedproxy.google.com/~r/KhaoticOne/~3/RaBkDNtlJAk/getting-year-month-and-day-out-of-nsdate.html</link>
		<comments>http://blog.vucica.net/2011/09/getting-year-month-and-day-out-of-nsdate.html#comments</comments>
		<pubDate>Mon, 26 Sep 2011 13:48:42 +0000</pubDate>
		<dc:creator>Ivan Vučica</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[NSDate]]></category>

		<guid isPermaLink="false">http://blog.vucica.net/?p=595</guid>
		<description><![CDATA[For some reason, Apple didn&#8217;t provide an easy way to extract day, month and year from an NSDate. Probably because they think OS X shouldn&#8217;t be Western-centric and presume a Gregorian calendar (although they could have simply extracted this data from current locale). Here is a simple category that allows just that. // NSDate+IVDateComponents.h #import [...]]]></description>
			<content:encoded><![CDATA[<p>For some reason, Apple didn&#8217;t provide an easy way to extract day, month and year from an NSDate. Probably because they think OS X shouldn&#8217;t be Western-centric and presume a Gregorian calendar (although they could have simply extracted this data from current locale). Here is a simple category that allows just that. </p>
<pre class="syntax objective-c">
// NSDate+IVDateComponents.h

#import &lt;Cocoa/Cocoa.h&gt;

@interface NSDate (IVDateComponents)

@property (nonatomic, readonly) NSInteger year;
@property (nonatomic, readonly) NSInteger month;
@property (nonatomic, readonly) NSInteger day;
@end
</pre>
<pre class="syntax objective-c">
// NSDate+IVDateComponents.m

#import &quot;NSDate+IVDateComponents.h&quot;

@implementation NSDate (IRDateComponents)
-(NSInteger)year
{
	unsigned units = NSYearCalendarUnit;
	NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
	NSDateComponents *components = [calendar components:units fromDate:self];

	return [components year];
}
-(NSInteger)month
{
	unsigned units = NSMonthCalendarUnit;
	NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
	NSDateComponents *components = [calendar components:units fromDate:self];

	return [components year];
}
-(NSInteger)day
{
	unsigned units = NSDayCalendarUnit;
	NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
	NSDateComponents *components = [calendar components:units fromDate:self];

	return [components day];
}
@end
</pre>
<p>Note that this code <b>is</b> very Western-centric and always presumes the Gregorian calendar. Sue me.</p>
<div class="plus-one-wrap"><g:plusone href="http://blog.vucica.net/2011/09/getting-year-month-and-day-out-of-nsdate.html"></g:plusone></div>
<p><a href="http://feedads.g.doubleclick.net/~a/LiI3FcBy6h8vYPJAnBBK429kulQ/0/da"><img src="http://feedads.g.doubleclick.net/~a/LiI3FcBy6h8vYPJAnBBK429kulQ/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/LiI3FcBy6h8vYPJAnBBK429kulQ/1/da"><img src="http://feedads.g.doubleclick.net/~a/LiI3FcBy6h8vYPJAnBBK429kulQ/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=RaBkDNtlJAk:2UUSCzJ2XRY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=RaBkDNtlJAk:2UUSCzJ2XRY:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=RaBkDNtlJAk:2UUSCzJ2XRY:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?i=RaBkDNtlJAk:2UUSCzJ2XRY:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=RaBkDNtlJAk:2UUSCzJ2XRY:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?i=RaBkDNtlJAk:2UUSCzJ2XRY:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=RaBkDNtlJAk:2UUSCzJ2XRY:XAVGb8Xj5zA"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=XAVGb8Xj5zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/KhaoticOne/~4/RaBkDNtlJAk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.vucica.net/2011/09/getting-year-month-and-day-out-of-nsdate.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.vucica.net/2011/09/getting-year-month-and-day-out-of-nsdate.html</feedburner:origLink></item>
		<item>
		<title>Isključivanje govorne pošte u Hrvatskoj</title>
		<link>http://feedproxy.google.com/~r/KhaoticOne/~3/49kHFEYFPUI/iskljucivanje-govorne-poste-u-hrvatskoj.html</link>
		<comments>http://blog.vucica.net/2011/07/iskljucivanje-govorne-poste-u-hrvatskoj.html#comments</comments>
		<pubDate>Sat, 30 Jul 2011 09:09:48 +0000</pubDate>
		<dc:creator>Ivan Vučica</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.vucica.net/?p=580</guid>
		<description><![CDATA[Vipnet: Za isključenje usluge potrebno je isključiti sva preusmjerenja unosom koda ##002#. T-Mobile: za deaktivaciju usluge utipkajte: #70# Tele2: Za deaktivaciju utipkajte *134*0# i pritisnite tipku za poziv Bonbon: deaktivacija: #70# (izvor: red-gsm.net)]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.vipnet.hr/privatni-pretplatnici/pozivi/vip-sekretarica">Vipnet</a>: Za isključenje usluge potrebno je isključiti sva preusmjerenja unosom koda ##002#.</p>
<p><a href="http://www.t-mobile.hr/2/20-20-10-50-00.asp">T-Mobile</a>: za deaktivaciju usluge utipkajte: #70#</p>
<p><a href="http://www.tele2.hr/mobilna_telefonija/govorna_posta.html">Tele2</a>: Za deaktivaciju utipkajte *134*0# i pritisnite tipku za poziv</p>
<p>Bonbon: deaktivacija: #70# (izvor: <a href="http://www.red-gsm.net/t49850/">red-gsm.net</a>)</p>
<div class="plus-one-wrap"><g:plusone href="http://blog.vucica.net/2011/07/iskljucivanje-govorne-poste-u-hrvatskoj.html"></g:plusone></div>
<p><a href="http://feedads.g.doubleclick.net/~a/4WLKcWX0u6HfdOaUVNQfYiMV4tc/0/da"><img src="http://feedads.g.doubleclick.net/~a/4WLKcWX0u6HfdOaUVNQfYiMV4tc/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/4WLKcWX0u6HfdOaUVNQfYiMV4tc/1/da"><img src="http://feedads.g.doubleclick.net/~a/4WLKcWX0u6HfdOaUVNQfYiMV4tc/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=49kHFEYFPUI:cbxuDqFxfIM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=49kHFEYFPUI:cbxuDqFxfIM:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=49kHFEYFPUI:cbxuDqFxfIM:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?i=49kHFEYFPUI:cbxuDqFxfIM:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=49kHFEYFPUI:cbxuDqFxfIM:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?i=49kHFEYFPUI:cbxuDqFxfIM:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=49kHFEYFPUI:cbxuDqFxfIM:XAVGb8Xj5zA"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=XAVGb8Xj5zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/KhaoticOne/~4/49kHFEYFPUI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.vucica.net/2011/07/iskljucivanje-govorne-poste-u-hrvatskoj.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.vucica.net/2011/07/iskljucivanje-govorne-poste-u-hrvatskoj.html</feedburner:origLink></item>
		<item>
		<title>Getting WiX to upgrade existing MSI product</title>
		<link>http://feedproxy.google.com/~r/KhaoticOne/~3/vLwUvVAEns8/getting-wix-to-upgrade-existing-msi-product.html</link>
		<comments>http://blog.vucica.net/2011/07/getting-wix-to-upgrade-existing-msi-product.html#comments</comments>
		<pubDate>Mon, 25 Jul 2011 12:54:49 +0000</pubDate>
		<dc:creator>Ivan Vučica</dc:creator>
				<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://blog.vucica.net/?p=574</guid>
		<description><![CDATA[I&#8217;ve previously built installers using MakeMSI. It was fun. However, while submitting to an online store, the installer was rejected due to a problem with uninstallation. Since I have no idea what might be going wrong, and there isn&#8217;t much one can do to adjust uninstallation with MakeMSI, I decided to go another route, and [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve previously built installers using MakeMSI. It was fun. However, while submitting to an online store, the installer was rejected due to a problem with uninstallation. Since I have no idea what might be going wrong, and there isn&#8217;t much one can do to adjust uninstallation with MakeMSI, I decided to go another route, and I&#8217;ve decided to try out WiX &#8211; Windows Installer XML. In the process, I&#8217;ve learned much more about MSI than I wanted to know, and than I knew with MakeMSI (although that was already more than I wanted to know).</p>
<p>To upgrade an existing product, MSI installers use something called &#8220;upgrade codes&#8221;, versions and languages. MSI installers are databases plus CAB archives packed together. Table called &#8220;Upgrade&#8221; defines conditions under which a MSI will be upgraded: the minimum version, maximum version, language and action taken (plus some more attributes). This table is used by an action called &#8220;<a href="http://msdn.microsoft.com/en-us/library/aa368600%28v=vs.85%29.aspx">FindRelatedProducts</a>&#8220;. Actions taken are specified in tables such as &#8220;InstallExecuteSequence&#8221; and &#8220;InstallUISequence&#8221;. These tables specify the &#8220;Action&#8221;, &#8220;Sequence&#8221; (smaller sequence means earlier execution) and the &#8220;Condition&#8221;. You can view all these tables using a tool called Orca.</p>
<p>That&#8217;s what MSI does. There is a reason I talked about this; please bear with me. However, we jsut want to get WiX to fill out the tables properly. This entire post is my understanding of something called a &#8220;major upgrade&#8221;.</p>
<p>First of all, each product has an ID and an upgrade code. A product contains a package which may or may not have its ID (I omitted it). You will want the product ID to be autogenerated &#8211; replace it with a *. If the product ID does not change, Windows Installer will complain with: &#8220;Another version of this product is already installed&#8221;.</p>
<p>Upgrade code must be unique per product, and must remain the same in future upgrades. This, along with the version (also specified in the product), is actually used to track multiple product versions. First three segments of a version are used by Windows Installer, so &#8220;1.0.0.0&#8243; and &#8220;1.0.0.1&#8243; are the same, but &#8220;1.0.0.0&#8243; and &#8220;1.0.1.0&#8243; are not the same to Windows Installer.</p>
<p>To generate &#8220;FindRelatedProducts&#8221; action, you need to add the following somewhere in your &lt;Product&gt;:</p>
<pre class="syntax xml">
&lt;MajorUpgrade
	DowngradeErrorMessage=&quot;A later version of this product is already installed. Setup will now exit.&quot;/&gt;
</pre>
<p>So, having set the product ID to &#8220;*&#8221;, having set the upgrade code to what I used in MakeMSI, and having incremented version, the thing still does not work.</p>
<p>In cases like this, you will want to log the installation:</p>
<pre class="syntax cmd">
msiexec /lvx* log.txt /i game.msi
</pre>
<p>This specifies: &#8220;Hey, I&#8217;d like to log verbosely, extra debugging information, and all other log messages. Save this to log.txt. Run installation of game.msi.&#8221;</p>
<p>In there, I found this:</p>
<pre class="syntax">
MSI (c) (10:20) [13:55:10:955]: Doing action: FindRelatedProducts
MSI (c) (10:20) [13:55:10:955]: Note: 1: 2205 2:  3: ActionText
Action 13:55:10: FindRelatedProducts. Searching for related applications
Action start 13:55:10: FindRelatedProducts.
MSI (c) (10:20) [13:55:10:959]: FindRelatedProducts: current install is per-user.  Related install for product 'GUID HERE' is per-machine.  Skipping...
MSI (c) (10:20) [13:55:10:959]: FindRelatedProducts: current install is per-user.  Related install for product 'GUID HERE' is per-machine.  Skipping...
Action ended 13:55:10: FindRelatedProducts. Return value 1.
</pre>
<p>As you can see, default installer built by WiX installs per-user, while default installer built by MakeMSI installs per-machine. A per-user installer will not upgrade a per-machine product.</p>
<p>We need to <a href="http://www.joyofsetup.com/2008/04/01/new-wix-feature-setting-package-installation-scope/">set the package&#8217;s install scope</a>&#8220;:</p>
<pre class="syntax xml">
&lt;Package
	....
	InstallScope=&quot;perMachine&quot;/&gt;
</pre>
<p>I&#8217;ll try to update this post with the finished .wix later on. Remind me if I forget to.</p>
<p>References:</p>
<ul>
<li><a href="http://blogs.technet.com/b/alexshev/archive/2008/02/15/from-msi-to-wix-part-8-major-upgrade.aspx">http://blogs.technet.com/b/alexshev/archive/2008/02/15/from-msi-to-wix-part-8-major-upgrade.aspx</a></p>
<li><a href="http://wix.tramontana.co.hu/tutorial/upgrades-and-modularization">http://wix.tramontana.co.hu/tutorial/upgrades-and-modularization</a>
<li><a href="http://weblogs.sqlteam.com/mladenp/archive/2010/02/23/WiX-3-Tutorial-Generating-filedirectory-fragments-with-Heat.exe.aspx">http://weblogs.sqlteam.com/mladenp/archive/2010/02/23/WiX-3-Tutorial-Generating-filedirectory-fragments-with-Heat.exe.aspx</a>
</ul>
<p>Note that above links might NOT be first parts of the articles.</p>
<div class="plus-one-wrap"><g:plusone href="http://blog.vucica.net/2011/07/getting-wix-to-upgrade-existing-msi-product.html"></g:plusone></div>
<p><a href="http://feedads.g.doubleclick.net/~a/XYZDeUFvw_bkx30TZMRM5XC3VQs/0/da"><img src="http://feedads.g.doubleclick.net/~a/XYZDeUFvw_bkx30TZMRM5XC3VQs/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/XYZDeUFvw_bkx30TZMRM5XC3VQs/1/da"><img src="http://feedads.g.doubleclick.net/~a/XYZDeUFvw_bkx30TZMRM5XC3VQs/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=vLwUvVAEns8:wJxmn2Rin-Q:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=vLwUvVAEns8:wJxmn2Rin-Q:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=vLwUvVAEns8:wJxmn2Rin-Q:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?i=vLwUvVAEns8:wJxmn2Rin-Q:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=vLwUvVAEns8:wJxmn2Rin-Q:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?i=vLwUvVAEns8:wJxmn2Rin-Q:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=vLwUvVAEns8:wJxmn2Rin-Q:XAVGb8Xj5zA"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=XAVGb8Xj5zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/KhaoticOne/~4/vLwUvVAEns8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.vucica.net/2011/07/getting-wix-to-upgrade-existing-msi-product.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.vucica.net/2011/07/getting-wix-to-upgrade-existing-msi-product.html</feedburner:origLink></item>
		<item>
		<title>WARNING: skipping plugin for GC</title>
		<link>http://feedproxy.google.com/~r/KhaoticOne/~3/5RBh34KowHc/warning-skipping-plugin-for-gc.html</link>
		<comments>http://blog.vucica.net/2011/07/warning-skipping-plugin-for-gc.html#comments</comments>
		<pubDate>Thu, 14 Jul 2011 19:27:41 +0000</pubDate>
		<dc:creator>Ivan Vučica</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.vucica.net/?p=570</guid>
		<description><![CDATA[If you&#8217;re using or writing a custom plugin for Xcode, and you&#8217;re getting &#8220;WARNING: skipping plugin for GC&#8221; in Console.app, you need to recompile it with garbage collection set to &#8220;supported&#8221;, and you need to add key/value pair to Info.plist: XCGCReady set to YES. Source: CocoaDev]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re using or writing a custom plugin for Xcode, and you&#8217;re getting &#8220;WARNING: skipping plugin for GC&#8221; in Console.app, you need to recompile it with garbage collection set to &#8220;supported&#8221;, and you need to add key/value pair to Info.plist: XCGCReady set to YES.</p>
<p>Source: <a href="http://www.cocoadev.com/index.pl?XCodeVersionThreeDotOne">CocoaDev</a></p>
<div class="plus-one-wrap"><g:plusone href="http://blog.vucica.net/2011/07/warning-skipping-plugin-for-gc.html"></g:plusone></div>
<p><a href="http://feedads.g.doubleclick.net/~a/NM01RhLGjO7mtmeSqPvvHn9V9G8/0/da"><img src="http://feedads.g.doubleclick.net/~a/NM01RhLGjO7mtmeSqPvvHn9V9G8/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/NM01RhLGjO7mtmeSqPvvHn9V9G8/1/da"><img src="http://feedads.g.doubleclick.net/~a/NM01RhLGjO7mtmeSqPvvHn9V9G8/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=5RBh34KowHc:R4WKoPOD3Zk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=5RBh34KowHc:R4WKoPOD3Zk:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=5RBh34KowHc:R4WKoPOD3Zk:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?i=5RBh34KowHc:R4WKoPOD3Zk:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=5RBh34KowHc:R4WKoPOD3Zk:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?i=5RBh34KowHc:R4WKoPOD3Zk:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=5RBh34KowHc:R4WKoPOD3Zk:XAVGb8Xj5zA"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=XAVGb8Xj5zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/KhaoticOne/~4/5RBh34KowHc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.vucica.net/2011/07/warning-skipping-plugin-for-gc.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.vucica.net/2011/07/warning-skipping-plugin-for-gc.html</feedburner:origLink></item>
		<item>
		<title>Developing Objective-C apps for Android using Mac OS X</title>
		<link>http://feedproxy.google.com/~r/KhaoticOne/~3/G7O6lRkoqhE/developing-objective-c-apps-for-android-using-mac-os-x.html</link>
		<comments>http://blog.vucica.net/2011/06/developing-objective-c-apps-for-android-using-mac-os-x.html#comments</comments>
		<pubDate>Fri, 24 Jun 2011 19:50:28 +0000</pubDate>
		<dc:creator>Ivan Vučica</dc:creator>
				<category><![CDATA[Hindarium]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Objective-C]]></category>

		<guid isPermaLink="false">http://blog.vucica.net/?p=556</guid>
		<description><![CDATA[I&#8217;m no fan of Java, and in fact, I&#8217;m not a fan of Android. When I originally heard Google is working on a Linux phone, I rejoiced. When I heard that Java would be the base of the userland, and that no existing program for Linux would be directly supported, my heart sank. In the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.vucica.net/wp-content/uploads/2011/06/Screen-shot-2011-06-24-at-21.32.32.png"><img class="size-medium wp-image-558 alignright" title="Developing Objective-C apps for Android using Mac OS X" src="http://blog.vucica.net/wp-content/uploads/2011/06/Screen-shot-2011-06-24-at-21.32.32-210x300.png" alt="" width="210" height="300" /></a>I&#8217;m no fan of Java, and in fact, I&#8217;m not a fan of Android. When I originally heard Google is working on a Linux phone, I rejoiced. When I heard that Java would be the base of the userland, and that no existing program for Linux would be directly supported, my heart sank. In the meantime I became a big fan of Objective-C, Cocoa, Cocoa Touch, Mac, and all related technologies and projects.</p>
<p>So, I want to keep working in Objective-C. I sat down and studied my options. We have the Android SDK, we have the Android NDK, and a third party offering called <a href="http://code.google.com/p/android-gcc-objc2-0">Android NDK GCC 4.2.1 with Objective-C support</a>.</p>
<p>Studying all this takes a while. Well, more than a while. I spent a day or two wrapping my head around all this, reading Android documentation. All this not counting stuff that I read, heard and discussed in previous months on this subject.</p>
<p>Android SDK is documented well enough, as long as you stick to Java. Android NDK is not particularly well documented, but solidly enough. Playing with the Objective-C is however a bit more complex, especially since Android NDK by itself does not come with Objective-C support turned on. Authors of the add-on compiler for Objective-C did not publicly document its proper use at all. Its use is nearly ungoogleable. </p>
<p>Since I&#8217;d hate to see you, my little lemon drops, spend as much time as I did on studying all this, here is something that will help you understand the complexities of the design of NDK, and how to combine all this with the Objective-C compiler.</p>
<ul>
<li>PDF: <a href="http://ivan.vucica.net/public/android-objc/Android%20Obj-C.pdf">Developing Objective-C apps for Android using Mac OS X</a>
<li>TAR.GZ: <a href="http://ivan.vucica.net/public/android-objc/android-objc-test.tar.gz">Sample project</a>
</ul>
<p>Proficiency with GNU Make and Objective-C is highly recommended.<br />
Proficiency with Java and Android is not required (I have none). </p>
<p>Not much in this article depends on Mac OS X apart from the paths, and the fact that there is no prebuilt Objective-C compiler for platforms other than Mac OS X. Parts that are about SDK and NDK should cleanly apply to Linux version of the Android SDK and NDK. It probably cannot easily apply to Windows.</p>
<p><b>Update on December 7, 2011:</b> I just learned about a great presentation by Jackie Gleason (@LifeIsTooShort) on the same subject: <a href="https://docs.google.com/present/view?id=dfj692w3_351gq89x8fv">Adding Objective-C Support to the Android NDK</a></p>
<p>If you wish to do so, you can donate me via PayPal for writing this PDF. Definitely not mandatory, though! </p>
<div style="width: 200px; border: 2px solid black; ">
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<table>
<tr>
<td>
<input type="hidden" name="on0" value="Donation choice">Donation choice</td>
</tr>
<tr>
<td>
<select name="os0">
<option value="One buck">One buck $0.99</option>
<option value="Three bucks">Three bucks $2.99</option>
<option value="Five bucks">Five bucks $4.99</option>
</select>
</td>
</tr>
</table>
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIIGQYJKoZIhvcNAQcEoIIICjCCCAYCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYAdmoFlM+qy7ao1Wq0i7tXw2lWVBfwXEgcIL+IDJdinSxaWOU5Jw63IMiwK81xkuPavMb+HhjTGUHbUWicmIcVj8Jpkv/oBsorVayagN2C/NVF4bbl/clt+RONdh6ktcNTiEUPgySMB6GfCq2X0WHZeysxNOfXQb4Dy+F66nE/B/zELMAkGBSsOAwIaBQAwggGVBgkqhkiG9w0BBwEwFAYIKoZIhvcNAwcECC6typtO3iNZgIIBcOpGfFt1Z3Pp3Kp8PJv0E9EP8pTGllEVYISm3LCglBoC6S1GdUVQqMKXv/K5twyvf9bqKI5RuKbpkGg1lrTxhJArVGL1csL164pzdL1Nw3krnMf1x4/Dww1w9ei8FsZGX7vYQvdrdMULCUQ/POM3mSSjRPVyUbJYzoqu0f3W02gKAh1UrCq0qFw5pTlS9WpGcoHGjNd6C8K639ZfEgJ2UYpfU/Er4Vix8x/KYMwOuelHiM6dk6LOU++Kcv+XHZbSF7zy1MQPDlsI+8t8Y6mwi83PNEYM4j9Dl5ulb2HHPeYxJ93puvQbHMF6XP6a0Yo03ZT6RTp9x3lNns0QhFmIti2N63IKklSfU4qgDYLEcDv5vdUWGCHPyX+azOvRogb/TkaQGZaXklqPf1ZR4SQGDprLEffymVsz1qqfoXGH2V02oKRuxtdUASRSRK686fe/uGmVBN2aOVBkMBlmF6+smyp1NgSR0AWCtUFEFAmSdrXioIIDhzCCA4MwggLsoAMCAQICAQAwDQYJKoZIhvcNAQEFBQAwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMB4XDTA0MDIxMzEwMTMxNVoXDTM1MDIxMzEwMTMxNVowgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDBR07d/ETMS1ycjtkpkvjXZe9k+6CieLuLsPumsJ7QC1odNz3sJiCbs2wC0nLE0uLGaEtXynIgRqIddYCHx88pb5HTXv4SZeuv0Rqq4+axW9PLAAATU8w04qqjaSXgbGLP3NmohqM6bV9kZZwZLR/klDaQGo1u9uDb9lr4Yn+rBQIDAQABo4HuMIHrMB0GA1UdDgQWBBSWn3y7xm8XvVk/UtcKG+wQ1mSUazCBuwYDVR0jBIGzMIGwgBSWn3y7xm8XvVk/UtcKG+wQ1mSUa6GBlKSBkTCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb22CAQAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCBXzpWmoBa5e9fo6ujionW1hUhPkOBakTr3YCDjbYfvJEiv/2P+IobhOGJr85+XHhN0v4gUkEDI8r2/rNk1m0GA8HKddvTjyGw/XqXa+LSTlDYkqI8OwR8GEYj4efEtcRpRYBxV8KxAW93YDWzFGvruKnnLbDAF6VR5w/cCMn5hzGCAZowggGWAgEBMIGUMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbQIBADAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMTEwNjI0MTk0ODIyWjAjBgkqhkiG9w0BCQQxFgQU8pQpkHM6iJCazOBhEkcXsVUMtCEwDQYJKoZIhvcNAQEBBQAEgYCqT2OOSLFzGxUeOLhY3R4k9d+A63X7CoR18vSn7i3q9oSIiQUUcxoqbqawJV2ixcHD207U9VOLk8eiqzobt1JXomFSooUYR3K30SEhBOrftscHStFVLpai9SWBwtMcB1+wLBaSwd/lExbfnZI25ohrgjIMHiJOkh7AhXSeKKaISg==-----END PKCS7-----<br />
"><br />
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1"><br />
</form>
</div>
<p>You can also send me other amounts directly via PayPal to address: ivucica@gmail.com</p>
<div class="plus-one-wrap"><g:plusone href="http://blog.vucica.net/2011/06/developing-objective-c-apps-for-android-using-mac-os-x.html"></g:plusone></div>
<p><a href="http://feedads.g.doubleclick.net/~a/32RoL8_xw5gPQGefAD31zCDpuY0/0/da"><img src="http://feedads.g.doubleclick.net/~a/32RoL8_xw5gPQGefAD31zCDpuY0/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/32RoL8_xw5gPQGefAD31zCDpuY0/1/da"><img src="http://feedads.g.doubleclick.net/~a/32RoL8_xw5gPQGefAD31zCDpuY0/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=G7O6lRkoqhE:KADemPBSiJU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=G7O6lRkoqhE:KADemPBSiJU:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=G7O6lRkoqhE:KADemPBSiJU:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?i=G7O6lRkoqhE:KADemPBSiJU:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=G7O6lRkoqhE:KADemPBSiJU:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?i=G7O6lRkoqhE:KADemPBSiJU:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=G7O6lRkoqhE:KADemPBSiJU:XAVGb8Xj5zA"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=XAVGb8Xj5zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/KhaoticOne/~4/G7O6lRkoqhE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.vucica.net/2011/06/developing-objective-c-apps-for-android-using-mac-os-x.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://blog.vucica.net/2011/06/developing-objective-c-apps-for-android-using-mac-os-x.html</feedburner:origLink></item>
		<item>
		<title>Please support for DemandProgress.org in opposing U.S. PROTECT IP act</title>
		<link>http://feedproxy.google.com/~r/KhaoticOne/~3/QaFWU1MWsVE/please-support-for-demandprogress-org-in-opposing-u-s-protect-ip-act.html</link>
		<comments>http://blog.vucica.net/2011/06/please-support-for-demandprogress-org-in-opposing-u-s-protect-ip-act.html#comments</comments>
		<pubDate>Tue, 21 Jun 2011 19:44:15 +0000</pubDate>
		<dc:creator>Ivan Vučica</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[activism]]></category>
		<category><![CDATA[demandprogress]]></category>
		<category><![CDATA[protect ip]]></category>

		<guid isPermaLink="false">http://blog.vucica.net/?p=553</guid>
		<description><![CDATA[From what I heard about PROTECT IP, it&#8217;s a dangerous piece of legislation that threatens people who live in the United States. But it does not threaten just the US and what is supposed to be its core principle &#8211; freedom. As something related to the Internet, it also threatens people and businesses worldwide. I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>From what I heard about PROTECT IP, it&#8217;s a dangerous piece of legislation that threatens people who live in the United States. But it does not threaten just the US and what is supposed to be its core principle &#8211; freedom. As something related to the Internet, it also threatens people and businesses worldwide.</p>
<p>I&#8217;ve customized the <a href="http://demandprogress.org/">DemandProgress.org</a>&#8216;s template letter to US Congressmen that you should sign today, no matter if you are a United States citizen, or, like me, not:</p>
<blockquote><p>
I am a concerned foreigner, a citizen of Croatia and I urge you to reject S. 968, the PROTECT IP Act.  I am deeply concerned by the danger the bill poses to Internet security, free speech online, and innovation.  The PROTECT IP Act is dangerous and short-sighted, and I urge you to join Senator Wyden and other members of Congress in opposing it.</p>
<p>Despite not being a citizen of the United States, I urge you to consider the fact that any Internet-related legislation in a nation such as the United States will have implications for persons and businesses worldwide, especially on their liberties. It will affect your own citizens as well, in a way that they will not have the same freedoms as people elsewhere.</p>
<p>United States prides itself in its freedom and protection of human rights. Do not be blinded by people looking only after their own profits. </p>
<p>Oppose this dangerous legislation which can and WILL be horribly, horribly misused!
</p></blockquote>
<p>It may be a piece of US legislation, but US Congress needs to know that it will be deciding something not just for people that elected it. It will be deciding something that may badly affect people that did not elect it.</p>
<p><a href="http://act.demandprogress.org/sign/pipa_letter/?referring_akid=.487155.PQ3BrF&#038;source=mailto">Please send a similar letter now</a> by filling out a simple online form.</p>
<p>I don&#8217;t normally do donations or activism, but I feel this is important, so I also made a <a href="https://www.paypal.com/us/cgi-bin/webscr?cmd=_flow&#038;SESSION=EA6iO5DecAZq0u-mavFeRmGXlQRCExGm8hYF-Mm52gVjGBd4LeKHJ8YGZFG&#038;dispatch=5885d80a13c0db1f8e263663d3faee8d422be6d275c375afb284863ba74d6cdc">small donation</a>.</p>
<p>n.b. I did not actually read the PROTECT IP text, but I trust other people&#8217;s judgment on this particular issue.</p>
<div class="plus-one-wrap"><g:plusone href="http://blog.vucica.net/2011/06/please-support-for-demandprogress-org-in-opposing-u-s-protect-ip-act.html"></g:plusone></div>
<p><a href="http://feedads.g.doubleclick.net/~a/PjOoPsYc2lgAtGgibmoiB-aAcbw/0/da"><img src="http://feedads.g.doubleclick.net/~a/PjOoPsYc2lgAtGgibmoiB-aAcbw/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/PjOoPsYc2lgAtGgibmoiB-aAcbw/1/da"><img src="http://feedads.g.doubleclick.net/~a/PjOoPsYc2lgAtGgibmoiB-aAcbw/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=QaFWU1MWsVE:vDJEBaqohnU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=QaFWU1MWsVE:vDJEBaqohnU:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=QaFWU1MWsVE:vDJEBaqohnU:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?i=QaFWU1MWsVE:vDJEBaqohnU:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=QaFWU1MWsVE:vDJEBaqohnU:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?i=QaFWU1MWsVE:vDJEBaqohnU:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=QaFWU1MWsVE:vDJEBaqohnU:XAVGb8Xj5zA"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=XAVGb8Xj5zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/KhaoticOne/~4/QaFWU1MWsVE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.vucica.net/2011/06/please-support-for-demandprogress-org-in-opposing-u-s-protect-ip-act.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.vucica.net/2011/06/please-support-for-demandprogress-org-in-opposing-u-s-protect-ip-act.html</feedburner:origLink></item>
		<item>
		<title>Avoiding memory leak in OpenAL and crash in OpenAL for Mac</title>
		<link>http://feedproxy.google.com/~r/KhaoticOne/~3/tBb1Jm53IIQ/avoiding-memory-leak-in-openal-and-crash-in-openal-for-mac.html</link>
		<comments>http://blog.vucica.net/2011/06/avoiding-memory-leak-in-openal-and-crash-in-openal-for-mac.html#comments</comments>
		<pubDate>Fri, 10 Jun 2011 11:58:08 +0000</pubDate>
		<dc:creator>Ivan Vučica</dc:creator>
				<category><![CDATA[debugging]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[troubleshooting]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[OpenAL]]></category>

		<guid isPermaLink="false">http://blog.vucica.net/?p=517</guid>
		<description><![CDATA[UPDATE: We&#8217;re still seeing the crash on Mac. Procedure described does fix the memory leak, though. UPDATE 2: Crash on Mac is caused by what appears to be a bug in Apple&#8217;s code relating to queueing commands for execution on dedicated audio thread, and mutex lock breaking down. Since mutex lock seems to stop working, [...]]]></description>
			<content:encoded><![CDATA[<p><b>UPDATE:</b> We&#8217;re still seeing the crash on Mac. Procedure described does fix the memory leak, though.</p>
<p><b>UPDATE 2:</b> Crash on Mac is caused by what appears to be a bug in Apple&#8217;s code relating to queueing commands for execution on dedicated audio thread, and mutex lock breaking down. Since mutex lock seems to stop working, it&#8217;s only natural that a threading-related crash occurs.</p>
<hr />
When calling alSourceStop(), you might forget to unbind a buffer from the source. Did you unbind it? </p>
<pre class="syntax c++">alSourcei(this-&gt;sourceId, AL_BUFFER, AL_NONE);</pre>
<p><del>If you get a crash on Mac with call stack containing OALSource::Play() and/or ending with OALSource::PrepBufferQueueForPlayback(), this is most probably a good fix. Looks like OpenAL on Mac might have a race condition somewhere unless you do this.</del></p>
<p>See difference between revision 293 and 294 in <a href="http://libxal.googlecode.com/">libxal</a>, in file audiosystems/OpenAL/OpenAL_Player.cpp.</p>
<div class="plus-one-wrap"><g:plusone href="http://blog.vucica.net/2011/06/avoiding-memory-leak-in-openal-and-crash-in-openal-for-mac.html"></g:plusone></div>
<p><a href="http://feedads.g.doubleclick.net/~a/nO1yq6vdGyeBPUG17USvIJkLSR0/0/da"><img src="http://feedads.g.doubleclick.net/~a/nO1yq6vdGyeBPUG17USvIJkLSR0/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/nO1yq6vdGyeBPUG17USvIJkLSR0/1/da"><img src="http://feedads.g.doubleclick.net/~a/nO1yq6vdGyeBPUG17USvIJkLSR0/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=tBb1Jm53IIQ:dPSDDXdb2tQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=tBb1Jm53IIQ:dPSDDXdb2tQ:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=tBb1Jm53IIQ:dPSDDXdb2tQ:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?i=tBb1Jm53IIQ:dPSDDXdb2tQ:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=tBb1Jm53IIQ:dPSDDXdb2tQ:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?i=tBb1Jm53IIQ:dPSDDXdb2tQ:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/KhaoticOne?a=tBb1Jm53IIQ:dPSDDXdb2tQ:XAVGb8Xj5zA"><img src="http://feeds.feedburner.com/~ff/KhaoticOne?d=XAVGb8Xj5zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/KhaoticOne/~4/tBb1Jm53IIQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.vucica.net/2011/06/avoiding-memory-leak-in-openal-and-crash-in-openal-for-mac.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.vucica.net/2011/06/avoiding-memory-leak-in-openal-and-crash-in-openal-for-mac.html</feedburner:origLink></item>
	</channel>
</rss>

