tag:blogger.com,1999:blog-64869202639105677052024-03-05T20:10:33.171+02:00evolve (v) - change, grow, progress, advance, developevolverhttp://www.blogger.com/profile/08367665316105551812noreply@blogger.comBlogger37125tag:blogger.com,1999:blog-6486920263910567705.post-35247079128949694832014-03-15T22:42:00.001+02:002015-11-10T00:10:59.579+02:00Place I usually recommend to people visiting London<span style="font-family: Trebuchet MS, sans-serif;"><br /></span>
<ol>
<li><span style="font-family: Trebuchet MS, sans-serif;"><a href="http://www.southbankcentre.co.uk/">The Southbank Centre</a> - I love this place. Besides libraries and museums, this superb cultural venue is another of those magical places where you're warmly welcome and where you don't need to pay to exist. Go to the 4th floor for a stunning view of the Thames from the balcony.</span></li>
<li><span style="font-family: Trebuchet MS, sans-serif;"><a href="http://www.barbican.org.uk/">The Barbican Centre</a> - the same, plus weird architecture and suspended walkways. Ask at the information desk about the passages you shouldn't miss.</span></li>
<li><span style="font-family: Trebuchet MS, sans-serif;"><a href="http://shop.cyberdog.net/">Cyber Dog in Camden Market</a> - just a really weird shop.</span></li>
<li><span style="font-family: Trebuchet MS, sans-serif;"><a href="http://www.littlegeorgia.co.uk/">Little Georgia</a> restaurant with Georgian / Balkan cuisine in Angel and Broadway Market. Ask for the ajika and plum sauces, mmm.</span></li>
<li><span style="font-family: Trebuchet MS, sans-serif;"><a href="http://london.danslenoir.com/">Dans le Noir</a> restaurant where you eat in the dark. Expensive, but a truly memorable experience.</span></li>
<li><span style="font-family: Trebuchet MS, sans-serif;"><a href="http://www.paramount.uk.net/">Paramount</a> Bar. Best view I know of Central London from above. 360° of classiness. Go at night, it's magical. And you just need to get one drink, so it's cheap - but don't eat in the restaurant unless you're relaxed about a £40-50 dinner. (Phone booking needed - make sure you specify it's for the bar only -, plus relatively smart attire. But they're not that strict, don't worry.)</span></li>
<li><span style="font-family: Trebuchet MS, sans-serif;"><a href="http://www.cityoflondon.gov.uk/things-to-do/green-spaces/hampstead-heath/Pages/default.aspx">Hampstead Heath</a>, <a href="http://www.english-heritage.org.uk/daysout/properties/kenwood/">Kenwood House</a> and <a href="http://www.timeout.com/london/restaurants/brew-house">Brew House Cafe</a>. Get lost in the woods, swim in the lakes, enjoy the wildlife. Gorgeous.</span></li>
<li><span style="font-family: Trebuchet MS, sans-serif;"><a href="https://foursquare.com/v/indian-veg/4b6c6fe8f964a520173a2ce3">Indian Veg</a> in Angel. Cheap Indian vegetarian all-you-can-eat buffet.</span></li>
<li><span style="font-family: Trebuchet MS, sans-serif;"><a href="http://thegaterestaurants.com/islington.php">The Gate</a> vegetarian restaurant in Angel and Hammersmith. Not as cheap, but worth it.</span></li>
<li><span style="font-family: Trebuchet MS, sans-serif;"><a href="http://www.mrfalafel.co.uk/" target="_blank">Mr. Falafel</a>, the best falafel wrap in the known universe! Just go, you won't regret it, to say the least.</span></li>
</ol>
evolverhttp://www.blogger.com/profile/08367665316105551812noreply@blogger.com0tag:blogger.com,1999:blog-6486920263910567705.post-58445184037517868642010-12-23T02:17:00.000+02:002010-12-23T02:17:14.943+02:00Julian Assange in Rap News. Wicked!I wish he had rapped a bit too. But this was pretty cool nonetheless.<br />
<br />
<iframe frameborder="0" height="300" src="http://www.engagemedia.org/Members/thejuicemedia/videos/war%20on%20journalism/embed_view" width="400"></iframe>evolverhttp://www.blogger.com/profile/08367665316105551812noreply@blogger.com0tag:blogger.com,1999:blog-6486920263910567705.post-75950128493286066512010-11-23T22:59:00.020+02:002011-01-20T14:05:40.583+02:00Join the Quest for Truth. A call for interviewees in climate change researchHey everyone!<br />
<br />
I'm studying Sociology at City University in London, and as part of my 3rd year dissertation I've decided to try to understand more about people's interactions with science. In particular, I am focusing on what I call "<span style="font-weight: bold;">the quest for truth</span>". I define it as<br />
<blockquote><span lang="EN-GB"><span style="color: #ff6600; font-weight: bold;">the incessant, sometimes obsessive, pursuit of objective truth in relation to a contentious public debate. </span><span style="font-weight: bold;"><span class="Apple-style-span" style="color: #444444;">I am particularly interested in the issue of climate change.</span></span><br />
</span></blockquote>For this, I am looking for people who have been on a quest for truth, or who are in the middle of it right now.<br />
<br />
<br />
<br />
<br />
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span style="font-size: 21px; font-weight: bold;"><span style="color: #333333;">What do I have to do?</span></span></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span style="font-size: 21px;">If you are or have been on a quest for truth, I would love to interview you</span>, so that we can all understand this process better, and that maybe we can learn something useful.</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">More explicitly, the official criteria are:</div><ul><li>you are informed about the debate in climate change</li>
<li>you proactively seek information about climate change, as opposed to occasionally engaging with the media or social circles</li>
<li>you have ‘changed camps’ at least once (e.g. from not believing to believing, from ‘we need to act now’ to ‘things will work themselves out’, etc.) OR</li>
<li>you are either indecisive or still doubting your position</li>
</ul><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">Respondents will have access to the final research text once it's finalized. This will be my way of saying thank you.</div><br />
<span style="font-size: 130%; font-weight: bold;"><br />
<span style="color: #333333;">But what exactly is this quest for truth?</span></span><br />
<br />
I think that many people go through a process like this at least once. At least once we become so curious, so infuriated or so confused with an issue that we just have to 'get to the bottom of it'.<br />
<br />
And then we start to dig: the more layers we uncover the surer we are we know too little. And the more confused we get, the more we dig.<br />
<br />
News articles and television quickly prove insufficient for our informational needs, and books start to contradict each other, while scientific papers seem to wonder off in their own world. We find ourselves in the middle of bitter disputes over who is wrong and who is right; we find it quite curious that it is only us who haven't realised it's a 'fabricated' debate, that 'they' are merely obscuring the 'well-known' facts.<br />
<br />
Funnily enough, then we start to find others who seem to be on the same journey - from overtly confused politicians to reporters who retract their statements to friends who identify with our journey. We uncover scandals, accusations, and fabrications. The more we read proselytizing between the lines the surer we are it's important to understand 'the truth'.<br />
<br />
<br />
Of course, the quest for truth can be much easier: read the facts, adopt an informed opinion, done.<br />
I did this myself when I was arduously researching the Church of Scientology. Much of the things I read confirmed my opinion, and there was such a small incentive to trust the others that it was a very easy decision to make.<br />
<br />
I am not at all implying that I did the right thing, nor, generally, that there is a 'right' way to go on the quest for truth. In fact, I would do many things differently now.<br />
<br />
<span style="font-style: italic;">But I am interested in the complicated journeys</span>, in the ones which feel like bottomless rabbit holes, which make you sink deeper the more you struggle, like moving sands. Not only because they are longer and richer in valuable lived experience, but also because they are increasingly an integral part of our societies.<br />
<span style="font-size: 130%; font-weight: bold;"><span style="color: #333333;"><br />
<br />
</span></span><br />
<span style="font-size: 130%; font-weight: bold;"><span style="color: #333333;">What kind of truths?</span></span><br />
<br />
From 9/11 to Israel / Palestine, to how money 'really' work, to darwinian evolutionism, to whether humans are 'naturally' monogamous or not, to water flouridation, and not least to <span style="font-weight: bold;">climate change</span>, we seem to be engaging in more and more of these debates.<br />
<br />
<br />
<span style="font-size: 130%; font-weight: bold;"><span style="color: #333333;">But people have been doing this all the time!</span></span><br />
<br />
Of course, people have been debating since time immemorial. But now the sheer amount of information we have access to can truly make it a daunting task (a bit like <a href="http://kaseystewart.com/wp-content/uploads/TheGobblingGluttons.jpg">Where's Wally</a>); the media can influence us to a huge degree; the sciences are losing their golden polish of authority; politics is everywhere; and the potential consequences of many of these issues are overwhelming.<br />
<br />
Not to mention that this process hasn't been studied nearly enough!<br />
<br />
<br />
So don't wait any longer, <a href="mailto:mihai-george.chira.1%20[at]%20city.ac.uk?subject=I%20want%20to%20talk%20about%20the%20quest%20for%20truth">contact me at mihai-george.chira.1 [at] city.ac.uk</a> , or leave a comment to this post.<br />
<br />
Also please send this page to anyone you think might have been on a quest for truth, especially in climate change. We all know people like this, and they ought to be put forward. And please share this article on Facebook and Twitter.<br />
<br />
<br />
Much appreciated!<br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://farm5.static.flickr.com/4027/4531117542_8a0285231c.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="265" src="http://farm5.static.flickr.com/4027/4531117542_8a0285231c.jpg" width="400" /></a></div>evolverhttp://www.blogger.com/profile/08367665316105551812noreply@blogger.com1tag:blogger.com,1999:blog-6486920263910567705.post-32766009980741912252010-10-24T01:18:00.002+02:002010-10-24T01:19:53.363+02:00Shocking quote of the day: black men and education"The relationship between ethnicity, literacy and numeracy is very strong and specific cases extremely negative; for example, being Black and male appears to have a greater impact on levels of numeracy than having a learning disability."<div><br /></div><div>from <a href="http://www.equalityhumanrights.com/key-projects/triennial-review/online-summary/education/">EHRC</a>.</div><div><br /></div><div>At least I'm learning interesting things in my Race and Racism course.</div>evolverhttp://www.blogger.com/profile/08367665316105551812noreply@blogger.com0tag:blogger.com,1999:blog-6486920263910567705.post-35155239430229398612010-06-28T11:16:00.004+03:002010-08-24T15:00:54.712+02:00ActionScript: the htmlText, CSS and embedded fonts fiestaActionscript is usually great for simple font embedding and rendering purposes. Use the text property of a TextField with an embedded font and a TextFormat, and <a href="http://www.adobe.com/devnet/flash/quickstart/embedding_fonts/">it works great</a>. If, however, you want to get all ninja and use htmlText with CSS with embedded fonts, you're in for a bumpy ride.<br /><br />Firstly, you may experience the unnerving phenomenon of text not appearing at all, as soon as you set the embedFonts property to true on the TextFormat object. Fear not, for Flash nuisances are easily tweakable. Check your css file and wherever you have more than one font enumerated in the 'font-family' property, just make it one single font name: the font you embedded. In the article linked above, adobe mention:<br /><br /><blockquote style="font-style: italic;">If using CSS styles to set fonts for TextFields, set the font-family CSS property to the name of the embedded font. The font-family property must contain a single name and not a list of names if you want to specify an embedded font.</blockquote><br />What this might do for you is to show regular text, but completely omit formatted text (bold or italic), or simply replace it with unformatted text. If that happens, you have probably not embedded all the font faces. Read <a href="http://cookbooks.adobe.com/post_Using_rich_HTML_text_formatting_with_embedded_font-16974.html">this article</a> to find out how to embed all versions of a font (regular, bold, italic and bold-italic) within the same font family. If your embedded font already has these formatting inside the font file, try <a href="http://stackoverflow.com/questions/2363903/flash-cs4-b-tag-in-with-htmltext">these tricks</a>. If you're using the Flash IDE, it should be really similar. <a href="http://www.gotoandlearnforum.com/viewtopic.php?f=29&t=21101">This forum thread</a> might help.<br /><br />The next problem which is very likely to occur is for the font to look aliased (i.e. blurry, hard to read). <a href="http://stackoverflow.com/questions/3103493/anti-aliased-htmltext-in-actionscript">The solution</a> is simply to create a TextFormat object with the font defined in the CSS style and assign it to the defaultTextFormat property of the TextField. Makes sense, right? No! I found this after considerable digging. Let me know if it works for you too.<br /><br /><br />Update:<br />if you're using multiple SWFs or RSLs and have issues with fonts, check out <a href="http://blogs.adobe.com/aharui/2010/03/flex_and_embedded_fonts.html">Alex's great post</a> about that.evolverhttp://www.blogger.com/profile/08367665316105551812noreply@blogger.com0tag:blogger.com,1999:blog-6486920263910567705.post-44426856952231690912010-04-13T02:12:00.003+02:002010-04-13T02:35:50.677+02:00Work needs to be questionedAs part of researching issues around poverty for an essay at university, I have conducted 3 online interviews and 2 offline ones, plus a focus group with 9 participants (all members of my extended family).<div><br /></div><div>The questions I asked are these:</div><div><ul><li>What do you think is the cause(s) of poverty in the world?</li><li>What do you think are the obstacles to eliminating poverty?</li></ul><div>A number of interesting answers surfaced, which I will probably discuss at another time. What I wish to point out at this time is one thing which was <i>not</i> mentioned: working, or the institution of wage-labour. The assumption appeared to be that it is a constant of life, a given, or at least that any attempt at altering it is incomprehensibly futile.</div><div><br /></div><div>Black (1985) makes a strong statement (at times too strong) about the negative impacts of work and imagines an alternative, ludic world in his <i><a href="http://www.inspiracy.com/black/abolition/abolitionofwork.html">The Abolition of Work</a></i>. I will argue that an essential omission from his discussion is poverty.</div><div><br /></div><div>Novak (1988) convincingly argues that poverty is endemic to capitalism. In feudalism, people would usually be in the possession of the means through which they produced the food and other necessities. They owned the tools and the animals with which they worked the land. Subservience to the feudal master meant that they payed taxes and levies from the surplus they produced (and sometimes way above that). Nevertheless, Novak emphasizes that these people were more in control of the means of survival than are most workers today.</div><div><br /></div><div>--to be continued--</div></div>evolverhttp://www.blogger.com/profile/08367665316105551812noreply@blogger.com0tag:blogger.com,1999:blog-6486920263910567705.post-72091193085056650582010-01-15T15:10:00.009+02:002010-01-15T15:32:58.970+02:00Flex 3 ProgressBar in polled mode stops working when it reaches 100%The ProgressBar component in Flex 3 (I am using SDK 3.4.1.10084 ) has 3 modes of operation: <i>event</i>, <i>polled</i> and <i>manual</i>. For a project I chose to use the polled mode to display the upload progress of multiple files using two ProgressBar components: one for individual files, and one for the overall progress.<div><br /></div><div><b>The problem</b> was that while the overall progress bar worked correctly, the individual file progress bar completely stopped working when the first file finished uploading. I checked the numbers, and they were fine, so the problem had to lie with the component.</div><div><br /></div><div><b>The explanation</b> is that the timer used to update the progress bar is stopped once the <i>bytesLoaded</i> property equals <i>bytesTotal</i>. Adobe will most surely call this a feature, as it saves resources for most use cases, when the progress bar is used to track a single operation at a time. However, in my case it turned out to be a bug, since I needed to track multiple operations. Had I been aware of it, I would probably have engineered my code to use the <i>event</i> or <i>manual</i> mode. But Adobe have either not documented this, or have hidden it very cleverly.</div><div><br /></div><div><b>The solution</b> in my case was either to prevent the timer from stopping or to restart it after the progress reached 100%. I did not want to keep it going indefinitely, as that would have cause the kind of resource leak which Adobe tried to prevent. So I looked in the ProgressBar class for instances where the timer was restarted, and it seemed that the best way to force a restart would be to toggle the <i>mode</i> property itself when a file finished uploading:</div><div><br /></div><div><div><code>this.currentFileProgressBar.mode = ProgressBarMode.MANUAL;</code></div><code></code><div><code>this.currentFileProgressBar.mode = ProgressBarMode.POLLED;</code></div></div><div><br /></div><div>There would have been <b>other alternatives</b>, of course, but this worked best in my project.</div><div>One of the alternatives is to use the BetterProgressBar component in <a href="http://code.google.com/p/cleverplatypus/">the CleverPlatypus framework</a>, which simply adds a <i>value</i> setter to the progress bar, as you would expect it to have anyway.</div>evolverhttp://www.blogger.com/profile/08367665316105551812noreply@blogger.com2tag:blogger.com,1999:blog-6486920263910567705.post-68916535071944445822009-10-26T03:17:00.006+02:002010-05-28T23:35:32.380+03:00Ce aş face diferit în ŞincaiAcum sunt în Londra, învat Sociologie în anul 2 la City University şi lucrez ca programator pentru a mă întreţine. Am terminat Şincaiul în B, diriginte Boroica.<br /><br />Un exerciţiu interesant pentru mine a fost să îmi imaginez ce aş face diferit în Şincai dacă aş avea ocazia să încep din nou liceul. Întreg articolul este structurat în jurul acestei liste, iar dorinţa este ca descrierea fiecărei acţiuni să scoată în evidenţă o anumită caracteristică a Şincaiului.<br /><br />Ce nu vă pot garanta este că Şincaiul meu are vreo legătură cu experienţa voastră. Sora mea, care acum are 29 de ani şi a terminat la Lucaciu, se simţea bătrână când vedea generaţia cu 7 ani mai tânără decât a ei. Eu m-am simţit bătrân în clasa a XII-a când i-am văzut pe cei de-a IX-a. Fără să intru în detalii, îmi era limpede că valorile (pe care abia începeam să le disting) care mi-au ghidat generaţia sunt ostentativ puse la încercare de un nou val de elevi care acum mă trimite imediat cu gândul la post-modernism. Aşadar, vă rog să fiţi suspicioşi la ce vă transmit.<br /><br /><span style="font-weight: bold;">[Aş profita mai mult de profesori. Mi-aş găsi un mentor]</span><br />Profesorii sunt una dintre cel mai puţin utilizate resurse din Şincai. Nu am să rezolv acest aparent paradox prin referinţă la cunoştinţele enciclopedice deţinute de majoritatea profesorilor din Şincai, şi nici prin scoaterea în evidenţă a gradului ridicat de profesionalism cu care dascălii noştri ne instruiesc - în parte pentru că acestea variază larg, dar mai ales pentru că sunt secundare cauzei pe care o găsesc esenţială. Uitându-mă înapoi îmi dau seama că lucrul cel mai important pe care l-am preluat de la (anumiţi) profesori nu sunt informaţiile concrete (deşi gramatica limbii engleze încă mă bântuie, integralele şi derivatele au încetat demult să îmi neliniştească somnul). Ce rămâne în mine după aceşti ani sunt perspective, metode, paradigme, atitudini, modele situaţionale, inspiraţie. Mi-am rafinat definiţia corectitudinii în urma lecţiilor lui Boroica; am fost iniţiat în arta comediei stand-up în orele lui Moga; am inceput să mă gândesc mai concret la viitor când scriam gândurile bune în orele lui Breban; am inţeles că am dat importanţă diligenţei cu care făceam flotări deoarece lui Cristea i se părea esenţială metoda; am reuşit să schiţez caracteristicile unui lider carismatic în orele lui Pop V.; mi-am scăldat picioarele într-un ocean al dezbaterilor şi am inteles că pot - şi mai apoi că am datoria - să iau o poziţie faţă de toate marile dezbateri din societate în timp ce discutam cu Moga despre rolul religiei în secolul XXI sau despre interacţiunea dintre erudiţie şi împlinire personală. Profesorii în general pot - şi au datoria - să fie mentori pentru elevii pe care îi formează. Împărtăşesc părerea lui Malcolm Gladwell - şcoala, departe de a-ţi da un bagaj considerabil de cunoştinte pe care să le foloseşti ulterior în viaţă, iţi dă mai degrabă o încredere semi-fondată în abilităţile tale, care fără îndoială deschide mai multe uşi mai târziu. Aşadar, în loc să vă uitaţi la profesori ca la nişte maşini al căror rol e să vă spună lecţia din manual cu voce tare, încercaţi să îi vedeţi ca mentori. Şi dacă psihologia ne-a învăţat ceva, este că oamenii încearcă în mod continuu să se ridice la nivelul aşteptărilor celorlalţi. Va merita.<br /><br /><br /><span style="font-weight: bold;">[Aş învăţa mai multă materie - dar nu neaparat materia scolară. Iar prin negare, aş fi mai puţin şmecher]</span><br />Când enumeram efectele şcolii asupra caracterului nostru, am omis în mod deliberat şmecheria, din două motive: unu, pentru că ne este în mare parte caracteristică şi doi pentru că am o viziune ambivalentă asupra eticii şmecherului. Şmecherul, înainte de a îndoi regulile în favoarea lui, activitate care necesită consum energetic, încearcă întâi să se prelingă printre pereţii subţiri lăsaţi de spaţiile nebuloase dintre reguli şi să exploateze aceste zone. Învăţăm să fim şmecheri în familie întâi, şi apoi continuăm să ne perfecţionăm în liceu: inventăm motive pentru care ar trebui să fim scuzaţi de la regimul aplicat întregii clase, sau amplificăm cauze reale la dimensiuni epopeice pentru a sensibiliza actori importanţi în favoarea noastră (de exemplu, eu am folosit olimpiada); cerem frumos să facem referate pentru a umfla notele înainte de sfârşitul semestrului; copiem tema înainte să intre profesorul în clasă; ridicăm mâna la începutul anului la întrebările cele mai simple ca să ne tina minte profesorul drept activi la ore; şi câte şi mai câte. Iar pe voi vă rog să mă scuzaţi dacă vi se par hilare strategiile noastre de modă veche. Suntem doar şmecherii din 2006.<br />Clasa noastră a fost o clasă plină de şmecheri. Motivul principal este că am avut olimpici cu sacii. La matematică, la chimie, la fizică, la engleză, etc. În această situaţie profesorii se purtau cu noi cu mănuşi; ne cam lăsau în pace. Deşi recunoscător în timpul liceului, acest lucru mă nemulţumeste nespus acum. Îmi pare rău ca am privit învăţatul ca pe o povară de care mă debarasam când aveam ocazia. Şi, în mod natural, am ajuns să ştiu doar atât de mult la fiecare materie pentru a nu trece drept ignorant. Sunt multe motive pe care le pot invoca, însă e tardiv pentru mine - dar pentru voi nu.<br />Aşadar, aş învăţa mai mult - la istorie, la filozofie, la geografie, la germană, la biologie. Observaţi omisiunile importante: matematica, româna, chimia. Singura materie la care am invăţat mai mult decât cerea programa şcolară e informatica - şi bine mi-a prins. Aş fi foarte bucuros să scriu un întreg eseu despre beneficiile fiecărei materii menţionate, dar spaţiul nu îmi permite. Aşa că voi lăsa la latitudinea voastră găsirea motivelor şi vă voi sfătui să vă alegeţi măcar o materie la care să învăţati şi să citiţi mult mai mult decât cere manualul. Pentru mine cel mai mare gol este istoria. Pentru voi?<br />Concluzionând asupra eticii şmecherului, voi menţiona doar că mă nemulţmeste prin egoismul necesar, dar mă încurajează prin metoda inovatoare. Şmecheria e legată strâns de increderea în sine, de negociere, de tatonarea limitelor, de customizarea condiţiilor date în beneficiul nostru. Mă încurajează pentru că rezolvarea majorităţii problemelor sociale necesită un anumit grad de îndrăzneală şmecheră (şi spun asta în modul cel mai pozitiv), de încredere şi cutezanţă inteligentă. În situaţia din Israel şi Palestina, de exemplu, care mă interesează în mod special, această şmecherie invăţata în scoală poate fi un ingredient esenţial al liderilor care contribuie la soluţionarea conflictului. În dezbaterea dintre agenţie şi structură mă situez destul de clar în prima tabără - cred că societatea este creată, recreată şi întreţinută de acţiunile fiecăruia dintre noi, şi nu invers. Cred, aţadar, că deşi etica şmecherului trebuie depăşită printr-o etică a responsabilităţii, metoda sa este aplicabilă într-o serie largă de situaţii. Cultivaţi-vă, aşadar, şmecheria - dar folosiţi-o inteligent şi etic.<br /><br /><br /><span style="font-weight: bold;">[Aş citi mai mult. Ştiri, filozofie, sociologie şi istorie mai ales. M-aş gândi mai mult la statutul meu de elev]</span><br />De când am venit în Londra - şi de fapt cu mult inainte de asta - mi-a devenit dureros de clar că nu am citit nici pe departe cât aş fi vrut. Până acum priveam clasicii cu circumspecţie şi cu o oarecare emotie; 'nu îi voi putea inţelege încă', îmi spuneam. 'Şi, de altfel, nici nu am timp'. Prin clasici eu mă gândesc mai mult la Platon, Descartes sau Weber. Dar nici beletristica nu strică, nici literatura de specialitate. De când am început să citesc am descoperit - într-un proces analog proverbului 'mâncând iţi vine pofta' - o resursă aparent inepuizabilă de întrebări şi dileme care ies la iveală din mine din ce în ce mai vocal. Şi aici revin la şcoală. Dacă vorbiţi frumos cu doamna bibliotecară să îl aducă pe Foucault în câteva copii, veţi vedea că instituţia în care vă aflaţi are istoric legături puternice cu clinicile de psihiatrie şi cu închisorile, cu un sistem de represie şi socializare care a trebuit inventat şi perfecţionat pentru a răspunde nevoilor noului jucător pe scena luptei de putere - statul. Şcoala a obţinut un control foarte eficient (gândiţi-vă doar la raportul numeric dintre elevi şi profesori) asupra corpului vostru în primul rând şi asupra minţii voastre în al doilea. Ieşim prin cealaltă parte a furcilor caudine ale şcolii obişnuiţi să ascultăm de superiori, disciplinaţi, uşor de condus, obişnuiţi cu program fix şi regulat de muncă, bucuroşi de oscioarele pe care ni le aruncă sistemul. Suntem, aşadar, bine pregătiţi să mergem la serviciu. Care 'serviciu', la rândul său, este <a href="http://deoxy.org/endwork.htm">o invenţie nou-nouţă în istoria societăţii umane</a>. Dar să nu merg prea departe. Ce e important să scot la iveală este că profesorii, deşi poate mulţi nu doresc asta, sunt actori principali în perpetuarea sistemelor sociale prevalente acum. Deşi acest lucru nu este rău în sine, multitudinea problemelor sociale care asteaptă o soluţie nu poate fi eliminată păstrând aceeaşi structură în funcţionare. Iar rolul meu şi al vostru e să aruncăm cu atenţie un şurub în locul potrivit în marea maşinărie şi să facem câte o rotiţă sau două să o ia înapoi.<br /><br /><br /><span style="font-weight: bold;">[Aş profita de colegi mai mult]</span><br />Aşa cum Silicon Valley e un musuroi de antreprenori, genii şi finanţatori într-ale tehnologiei, sau cum Academia Nick Bolletieri e fabrică de campioni de tenis, Şincaiul este un butoi de fermentare al spumei spumelor. În mare parte şi mai eficient decât în alte locuri, în Şincai este predominantă meritocraţia. Calitatea oamenilor cu care interacţionaţi este ridicată, atât în ce îi priveşte pe elevi cât şi pe profesori. A profita de acest lucru este esenţial pentru liniştea emoţională subsecventă. Eu am început o firmă în timpul liceului cu un coleg de an, am făcut campanii de reciclare cu colegii de clasă, am înfiinţat un consiliu al elevilor sprijinit de profesori. Farmecul unui loc ca Şincaiul este că ai la îndemână toţi oamenii necesari pentru a face lucrurile să se întâmple.<br /><br /><br /><span style="font-weight: bold;">Concluzia </span>nu este una neprevăzută. În mare, aş profita doar mai mult de lucrurile pe care Şincaiul le are deja. Şi am scris întreg eseul acesta pentru a vă încuraja pe voi să o faceţi. Cred că tot ce trebuie e o masă critică de elevi şi profesori pentru a înclina balanţa către efervescenţa şi atmosfera elitist-constructivă care încă stă latentă în zidurile Şincaiului. Fiecare aniversare este o amintire a acestui lucru.<br /><br /><br /><object width="425" height="344"><param name="movie" value="http://lb.brainient.com/flash/v2/YoutubeWrapper.swf?user_id=64&video_id=NWUFjb8w9Ps&hl=en_US&fs=1&rel=0&width=425&height=344"><param name="allowFullScreen" value="true"><param name="allowscriptaccess" value="always"><embed src="http://lb.brainient.com/flash/v2/YoutubeWrapper.swf?user_id=64&video_id=NWUFjb8w9Ps&hl=en_US&fs=1&rel=0&width=425&height=344" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>evolverhttp://www.blogger.com/profile/08367665316105551812noreply@blogger.com1tag:blogger.com,1999:blog-6486920263910567705.post-17974235287944981942009-09-10T12:30:00.003+02:002009-09-10T13:02:20.592+02:00Javascript injection from Flex into the HTML wrapper - problems with IE, of courseHere are some tips which might save someone some headaches (which you inevitably get when you start working with Internet Explo<span style="font-weight: bold;">d</span>er).<br /><br />First and foremost, if you want to communicate from Flex to (regular) Javascript using ExternalInterface in Internet Exploder (I was testing on version 6), you had better put an id attribute on the [object] and [embed] elements, or else it will either silently fail, or give you the wonderfully descriptive and logical error message <span style="font-weight: bold;">'null' is null or not an object</span>. If I didn't know any better, I'd say it's rather philosophical. Oh, and it's always at character 118, line 1. I dare you to find it :)<br />You find this information if you read the first note on <a href="http://livedocs.adobe.com/flex/3/langref/flash/external/ExternalInterface.html">the Adobe documentation page for ExternalInterface</a>.<br /><br />When I said 'regular' earlier, I meant javascript that's already embedded in the page. Now, if you want to do nifty stuff like Javascript injection, you would probably use <a href="http://www.abdulqabiz.com/blog/archives/2006/06/16/a-mxml-component-that-embeds-javascript-in-html/">Abdul Qabiz's fantastic component</a>. The reason I needed it was that our Flex application needed to be completely independent of the html wrapper it happened to find itself in, but also needed to open IFrames and move them around and do all kinds of nifty stuff (you can tell I like this word). That meant that the script would have to be embedded at runtime in the page by Flash.<br /><br />Sounds doable, right? In Firefox, yes. In IE, haha, you've got another thing coming. IE and 'simplicity' have proven to be at opposite ends of the spectrum, time and time again.<br /><br />I won't drone on about the specifics too much. But here are some major points to keep in mind:<br /><ul><li>for IE6 at least, only use double quotes only in the JavaScript file you are loading. If not - you guessed it - it silently fails.</li><li>don't try to use document.createElement("iframe"), because <a href="http://msdn.microsoft.com/en-us/library/ms536389%28VS.85%29.aspx">apparently there is a bug in IE for this particular function with this particular argument</a> (read the first comments, where you will also find the workaround).</li></ul>For me the workaround didn't work yet... I'm trying to tweak it somehow to get it going. And it's great how you feel completely in the dark when it comes to these things, as the documentation seems to be lacking. It would have been great if IE6 had had the <a href="http://blogs.msdn.com/ie/archive/2006/03/24/560095.aspx">public bug tracking application IE7 and 8 do</a>. But it would have probably crashed very early on, due to overuse.evolverhttp://www.blogger.com/profile/08367665316105551812noreply@blogger.com0tag:blogger.com,1999:blog-6486920263910567705.post-58227299523057701392009-08-12T13:30:00.003+03:002009-08-12T15:40:19.403+03:00Ideas for optimizing flash / flex applicationsOptimizing the memory consumption, processor cycles used and even user experience in a flash application is as complex as it is important. Not very many projects out there reserve time for the explicit task of optimizing the application, which is why I think developers should incorporate some of these techniques in their daily development, or in the initial planning of the architecture of the application.<br /><br />A good place to start for optimization advice is Adobe's advice for <a href="http://livedocs.adobe.com/flex/3/html/help.html?content=performance_06.html">reducing SWF file size in Flex applications</a>. A lot of the ideas there pertain well to improving user experience as well - as is, for instance, splitting the application in modules, loading external swcs, and loading content at runtime where possible. Adobe also offer a rather valuable tool for Flex developers, the linker dependencies xml which you can export as part of the compilation process. Here's an AIR application called <a href="http://www.kahunaburger.com/2008/03/08/air-link-report-visualizer/">AIR Link Report visualizer</a> which will spare you from having to read plain xml by presenting dependencies in nicely arranged lists and offering a nifty visualisation chart showing you the breakdown of the packages used in your application.<br /><br /><span style="font-weight: bold;">User experience</span> is given a lot of attention in this <a href="http://www.gotoandlearn.com/play?id=112">tutorial about SWF framerate optimization</a> done by <a href="http://theflashblog.com/">Lee Brimelow</a>.<br /><br />As <span style="font-weight: bold;">processor cycles</span> are concerned, it usually comes down to fine-grained changes in your code. For me, this is the fun part.<br />Depending on your current knowledge, you might want to start off with <a href="http://gskinner.com/talks/resource-management/">Grant Skinner's great presentation about resource management</a>.<br /><a href="http://wiki.joa-ebert.com/index.php/Main_Page">A comprehensive list of possible code optimizations</a> is maintained by Joa Ebert, read it with both eyes. Also watch out for valuable links to more details on particular subjects, such as this list of bitwise operations: <a href="http://graphics.stanford.edu/%7Eseander/bithacks.html">Bit Twiddling Hacks</a>. Next, you can get your head around the debate about the int / uint / Number types in Flash by reading <a href="http://www.gskinner.com/blog/archives/2006/06/types_in_as3_in.html">Grant Skinner's discussion on them</a> (prompted by <a href="http://kuwamoto.org/2006/06/15/avoid-ints-in-actionscript/">this blog post</a>), and <a href="http://www.nbilyk.com/optimizing-actionscript-3">this post</a> which also looks at flash player versions for a more detailed approach.<br /><br />I will keep adding to this list as I discover new articles on the topic. If you have your favourites, show them off.evolverhttp://www.blogger.com/profile/08367665316105551812noreply@blogger.com0tag:blogger.com,1999:blog-6486920263910567705.post-69946090952488806172009-08-10T18:02:00.005+03:002009-08-11T15:21:47.895+03:00Running the ftp ant task in eclipse with version 2.0 of the Apache Commons-Net library...doesn't work!<br /><br />(In case you are not familiar with running ant in eclipse, read both parts of the very good O'reilly article on that topic: <a href="http://onjava.com/pub/a/onjava/excerpt/anttdg2_ch11/index.html">part1</a>, <a href="http://onjava.com/pub/a/onjava/excerpt/anttdg2_ch11/index1.html">part2</a>).<br /><br />Now, if you want to use the ftp ant task in eclipse (which is not a core ant task), you will need to install some more java classes. Read <a href="http://www.sixfive.co.uk/index.cfm/2007/8/9/Using-the-Ant-FTP-Task-in-Eclipse">this article</a> for the details. <span style="font-weight: bold;">However</span>, keep in mind that you need version 1.4.1 of the Apache <a href="http://commons.apache.org/downloads/download_net.cgi">Commons-Net library</a>, and not 2.0, which at the time of writing is the latest version (I'm using eclipse 3.4.0). If you use version 2, however, and you get something like this from eclipse:<br /><br />Could not create type ftp due to java.lang.UnsupportedClassVersionError: org/apache/commons/net/ftp/FTPClientConfig (Unsupported major.minor version 49.0)<br /><br />it means you're stubborn :). So use version 1.4.1.<br /><br /><span style="font-style: italic; color: rgb(204, 0, 0); font-weight: bold;font-family:trebuchet ms;" >UPDATE</span><br />Courtesy of Gary, a Java informed friend, here's the real reason for the error:<br />"<span style="font-style: italic;">The error 'Unsupported major.minor version 49.0' means that java 5 is required. Its possible that you have configured somewhere to use java 1.4 (v4).</span><br /><span style="font-style: italic;">if you make sure you have java 5 installed and configure eclipse to use this version then you should be okay.</span>"evolverhttp://www.blogger.com/profile/08367665316105551812noreply@blogger.com0tag:blogger.com,1999:blog-6486920263910567705.post-50487796260753606352009-06-07T00:04:00.005+03:002009-06-07T01:19:07.853+03:00Israel and Palestine: do we really need more evidence?If you needed any more evidence that Israel is engaging in violent, unethical and systematically planned harassment against the Palestinians, you should watch "People and the Land" (<a href="http://www.youtube.com/watch?v=gUDCrBxQL4U">part 1</a>, <a href="http://www.youtube.com/watch?v=6BzQ9yfF5xU">part 2</a>, <a href="http://www.youtube.com/watch?v=cKS1tMuvfSY">part 3</a>, <a href="http://www.youtube.com/watch?v=0DSsEMbpluE">part 4</a>, <a href="http://www.youtube.com/watch?v=clDsDmBYeXs">part 5</a>, <a href="http://www.youtube.com/watch?v=N4WNFPeTbK8">part 6</a>). It is not an incredibly good documentary, but it makes its point.<br /><br />In fact, you would have to be a very poor film maker not to get this message across. What is happening is blatantly clear to any person with a droplet of sense. Israel policy and American support for it are unmoved by UNSC resolutions condemning it, by human rights organisations recording their consistent violations of basic human rights, by the suffering of the Palestinians and by the pressure of the international community.<br /><br />Liz Coleman, <a href="http://www.bennington.edu/">Bennington College</a>'s president, in <a href="http://www.ted.com/talks/liz_coleman_s_call_to_reinvent_liberal_arts_education.html">her speech at TED 2009</a> about the dying-out liberal arts education in the USA, mentions (at min 5:23) five processes or goals which further erode the link between education and civic engagement: "Oversimplifications of civic engagement", "Idealisation of the expert", "Fragmentation of knowledge", "Technical mastery" and "Neutrality". Of these the second and last are key to why the situation in Palestine is allowed to continue internationally. "Experts" like Alan Dershowitz fuel an artificial debate, where there is nothing left to prove. Pressure groups against the occupation are scattered, while <a href="http://video.google.com/videoplay?docid=2894821400057137878&ei=JuIqSpySDtL2-Abs0_yzCQ">Israeli lobbying is well organised and powerful</a>. And both their influences in the international community are decided neither by just argument or evidence, but by power flows. <a href="http://www.youtube.com/watch?v=F91XF6bSDRQ">America has been pumping money into Israel like there's no tomorrow</a> (also watch, if you haven't, <a href="http://www.youtube.com/watch?v=N4WNFPeTbK8">part 6 of People and Land</a>), and simultaneously using its veto right in the United Nations Security Council to prevent resolutions against Israel from being adopted (tens of times, in almost all cases it being the only state to disagree). Even so, Israel is on top of the international 'villains', with <a href="http://www.haaretz.co.il/hasen/pages/ShArt.jhtml?itemNo=218044&contrassID=2&subContrassID=1&sbSubContrassID=0&listSrc=Y">32 UNSC resolutions violations</a>, all related to the Palestinian "problem".<br /><br />This is a clear-cut case. It is simple and straighforward. It is true that both sides are engaging in such activities, but Israel is by far the champion. It should be made to take a break.<br /><br />Perhaps I will be urged by some to go back to my programming. I am also aware that my knowledge of the issue is still limited. But I am stretching my imagination to its limits in trying to figure out what piece of undiscovered evidence can demonstrate my ignorance or blind partisanship. I am going for the stretch by reading, in paralel, Dershowitz's "<a href="http://www.amazon.com/Case-Israel-Alan-Dershowitz/dp/047146502X">The case for Israel</a>" and Chomsky's "<a href="http://www.amazon.com/Fateful-Triangle-Palestinians-Updated-Classics/dp/0896086011">Fateful Triangle</a>". If you have any other suggestions, I am open.<br /><br />So, do we really need more evidence?evolverhttp://www.blogger.com/profile/08367665316105551812noreply@blogger.com2tag:blogger.com,1999:blog-6486920263910567705.post-91533547513084352342009-06-06T14:36:00.003+03:002009-06-06T15:10:45.478+03:00Home shweet home: watch Luc Besson's new movieYouTube are hosting, promoting and showing <a href="http://youtube.com/homeproject">"Home"</a>, the documentary by Luc Besson about the environmental issues threatening our planet, <a href="http://www.youtube.com/blog?gl=GB&hl=en-GB&entry=q9vwCs2Unp8">they have recently announced on their blog</a>.<br /><br />I have just finished watching it, and I have mixed thoughts about it. On the one hand I think it's quite a bad production, and I have yet to understand why Luc received awards for it (maybe for the breadth of his research if nothing else). On the other hand, I do think that, given the current campaign to see it, a mass viewing would be beneficial.<br /><br />Firstly, the film struck me as 'cheesy' - the narrator(ess) is trying to be inspiring and awe-inducing, but the result is something we've all seen and heard tens of times; and when it spans 90 minutes, it becomes really old really fast. Secondly, there are quite a few unsupported claims there, do listen to what she sais with both ears. And thirdly, the actual narrated text is gradeschool material (not necessarily in content, but in form) - the sentences are overly simple, repetitions and truisms abound ("Everything is linked" said a gazillion times), and if it weren't for the great images, the film could have been summarised in 5 minutes.<br /><br />Now this is not to say that the message of the film ("We are threatening the Earth, and unless we change radically we are bound to endanger our existence; the first steps have been taken, but much more commitment is needed") is not a valid one (in fact, I believe in it quite a lot) or that the intentions of the producers are to brainwash people into doing something about the ecologic crisis (I would endorse that, to be honest). In fact, there were some moments in the film when I felt I had to spring to my feet and start doing something - and surely forget about the beef wrap I was eating, which was so blatantly contributing to deforestation of the Amazon rainforests. I do sincerely believe that the more people will see this film, the more "commitment" we will make as a species for living in sync with nature. But I also believe firmly that other such films (the only example I can think of right now is the very good documentary <a href="http://www.imdb.com/title/tt0478324/">We Feed The World</a>), were they equally promoted, would induce a much bigger change. I just feel a lot of people will see "Home" as propagandistic (which it is) and will also disregard the actual issues underlying its creation (or not watch it in the first place).<br /><br />And now comes the philosophico-ethical question - is it 'right' to promote material which you regard as inappropriate in itself in order to further a goal which you believe in, just because you think that particular material has the greatest chance of making an impact through quantitative access to it, rather than through its quality? What about the law of unintended consequences?<br /><br />I will answer 'yes' to this one, and I urge you to <a href="http://youtube.com/homeproject">see "Home"</a> and discuss it (and be quick, it is up there only until the 14th of June).<br />What would you answer?evolverhttp://www.blogger.com/profile/08367665316105551812noreply@blogger.com0tag:blogger.com,1999:blog-6486920263910567705.post-35094491439239221502009-04-28T15:58:00.005+03:002009-04-28T16:23:26.813+03:00PureMVC improved: commands can be singletonsWhile working with PureMVC on some games in Flash CS3 I thought it would be quite useful to be able to specify that some commands should not be recreated each time they are run (as is the default behaviour), but rather only once, and the same instance should be used all throughout. In games where certain commands occur often (eg. the one associated with the message 'Deal' in card games) this would be an important memory save.<br /><br />So I set out to adapt PureMVC. I tweaked the Controller::executeCommand function the most, with some meddling with Controller:registerCommand, Facade::registerCommand, and their respective interfaces. Overall, only 4 files changed, with only the controller suffering essential functionality alteration. The only change in the API is that when you use registerCommand in your implementation of the Facade, you now have a third parameter, called 'singleton', of type Boolean, which defaults to false. If it is set to true, only one instance of that particular command will be created and then reused all throughout the life of the application.<br /><br />Example of singleton command initialization:<br /><br /><code>this.registerCommand(STARTUP, StartupCommand, true);</code><br /><br /><br />You can download the changed PureMVC framework <a href="http://mihai.chira.googlepages.com/TweakedPureMVC.zip">here</a>.evolverhttp://www.blogger.com/profile/08367665316105551812noreply@blogger.com0tag:blogger.com,1999:blog-6486920263910567705.post-91895593274730077712009-03-06T20:56:00.008+02:002009-03-20T15:57:26.542+02:00Flash preloader mayhem. bytesTotal equals 0 or bytesLoaded and the misterious missing Content-Length header<p>There are times in programming when when the simplest of things turn out to be the most difficult to achieve.</p><p>I experienced this some days ago when I wanted to implement a preloader for a game I'd been working on.</p><p>After an unsatisfactory attempt at a first-frame preloader (the combination with PureMVC was to be fatal to me :), I went for the external one. Namely, there is a very small swf, which is the 'host', and which loads the actual game while displaying the loading progress. With no more fuss from PureMVC, and everything working fine, the progress bar appeared at 0%, as expected. It was good, simple and quick, like a preloader should. I happily deployed the game and test it in the browsers.</p><p>None of them worked! All of them displayed an empty progress bar, and after some seconds the game suddenly appeared. My gosh, what could it be, I wondered. I placed some strategic traces, only to learn that the bytesTotal property of the Loader.contentLoaderInfo object was either equal to the bytesLoaded property (only in Firefox), or simply 0. This was the strangest thing I'd seen in quite a bit of time...</p><p><br />After some extensive Googling around, I found some hints of what might be wrong. The <a href="http://livedocs.adobe.com/flex/3/langref/flash/net/URLLoader.html#bytesLoaded">Adobe documentation for the URLLoader class</a> (which I had not used) mentioned that "a missing Content-Length header will result in bytesTotal being indeterminate" (nothing of the sort was mentioned for the Loader class, which I <em>had</em> used). This prompted me to open <a href="http://www.charlesproxy.com/">Charles</a> and spy on the headers returned by the server for the loader and for the game itself. Indeed, there was a single difference between them: the game's response was missing a "Content-Length" header. Eurika!</p><p>This, in turn, called for an .htaccess file to set things straight (I was using Apache 2). I dug some more and I discovered <a href="http://httpd.apache.org/docs/2.2/mod/mod_proxy_http.html">mod_proxy_http in the Apache documentation</a>. They mention that the variables <strong>proxy-sendcl</strong> and <strong>proxy-sendchunks</strong> are responsible for the Content-Length header, which apparently works in conjunction with an operation called 'chunking', performed by Apache when serving larger files, whereby it starts sending the file to the requester before buffering it (which would allow it to know its size), making the whole process quicker. I presently set out to alter them, by using the SetEnv command: <code>setenv proxy-sendcl 1</code>. I put this in the .htaccess, and I made sure the variables were set by using a phpinfo() call in a test php script. Nothing changed! Then I added the other one: <code>setenv proxy-sendchunks 0</code>, hoping to finally force Apache to cut it out with the chunking. Didn't work this time etiher, everything looked pretty much the same. It dawned on me at this point that I didn't know the correct values for these variables (maybe it wasn't numbers, but rather some predefined enums? the documentation didn't say). But I had already wasted too much time on a preloader and decided to call for help from our hosting company. They suggested, quite strangely, that I turn gzipping off, by using this line in the .htaccess: <code>SetEnv no-gzip dont-vary</code>. I was quite sceptical of the solution, because the loader swf was being gzipped by Apache anyway and it did have its "Content-Length" header where it needed it. However, surprise surprise, the preloader started working! It was smooth and silky, as I was hoping.<br /></p><p>Now, I still don't understand what gzipping had to do with <code>proxy-sendcl</code>. I have sent them an email back for clarification, I will be forever grateful if they can illuminate me. And I shall undoubtedly share my findings, so keep posted - or, if you know and are willing to help, drop a comment!</p><p></p><p>I hope this saves someone some precious time.</p>evolverhttp://www.blogger.com/profile/08367665316105551812noreply@blogger.com3tag:blogger.com,1999:blog-6486920263910567705.post-52905017832017143862009-02-27T07:17:00.000+02:002009-02-27T07:17:53.219+02:00Why should we study history?I will start off the discussion with the bold assertion that I do not know history. (There you go, I just stripped myself of any authority of writing this article).<br /><br />Nevertheless, there circulates around young people today an association between history and residue, between history and waste of time. The historical foundations of university subjects are regarded as 'filler courses' and are studied, by the truly diligent, the week before the exam. Except when it comes to football or cars, knowing history rather than craft is seen as trivial and truly useless. While this may be grounded on the empowering belief that 'we know better', my contention is that the attitude is societally deleterious.<br /><br />The whole debate started due to my customary nosiness. I was surrounded by four people at a dinner - two students of economics and banking and two studying aeronautical engineering. Feeling blissfully ignorant about the content of the latter, exotically sounding subject, I started to ask my companions what aeronautical engineering practically entails. They were, quite naturally of people busying themselves with relatively new occupations, relatively usure of what exactly they were doing - or how to explain it to a layman such as myself. Indeed, they would rather assert what they were not doing. So my question of whether they would eventually get down and dirty and build actual aeroplanes was met with a definite 'nooo!'. 'We are more like designers of aeroplanes, we come up with the concept'. 'All right', I said, 'that means you are more like the architects, and the aeroplane mechanics are like the builders, right?'. 'Yeah, something like that' (At a later point in the discussion the same person let me know that they 'just apply the formulas and voila, the aeroplane is built', which had the numbing effect of restoring me to deep confusion, the exact point I had started from). At this point, to make my hard-headedness less obvious, I inquired whether they had heard of Traian Vuia, of whom I knew had invented the jet plane - and was Romanian, so I could win status points with him. All hell broke loose.<br /><br />With faces reminiscent of European students at their first Chinese class, eyebrows swung into the air, jaws slightly dropping, bulging eyeballs, body poised forward like cheetas before leaping for a wounded antelope, the two aeronautical engineers seemed by this time ready to present their fingers, perhaps with complimentary audio effects. 'Whaaat?! Why should I know that? Like what was that anyway? Is that like even a real person?' and so on and so forth. On my hearing that they don't learn any history of their subject at University, and moreover that they see no use for it whatever, I swiftly pulled the comando knife out of the sole of my left shoe - where I keep it just for these occasions -, leapt on the table and, before the girl could blink, I swung the cool, sharp blade toward her neck, stopping nanometres in front of her throbbing jugular. I was going to give her a good reason to study history.<br />Well, no I didn't. But I amaze myself how it always surprises me (you see how I dodged the double 'surprise', he?) when people have different opinions than mine. I mean, the nerve on them. And this time it was serious. I was just about to set things straight with a flawless rhetoric, when the bill was presented to us and the tension evaporated (worthwhile to notice this is one of the very few instances when money alleviate tension).<br /><br />Indeed, why should we study history? It's a freakin good question, if you think about it. What good can history possibly do us, what problems will it solve? History is inescapably a has-been, and has-beens don't matter in the modern world. We are looking at the future now, with a lens from the present. The past was yesterday or last weekend in the pub. Get a grip, shake off that naivité and let go of history. As one memorable Richard put it, Bygones! (those fans of Ally McBeal out there will surely resonate).<br /><br />*to be continued*evolverhttp://www.blogger.com/profile/08367665316105551812noreply@blogger.com2tag:blogger.com,1999:blog-6486920263910567705.post-17814233249872693602009-02-27T07:09:00.002+02:002009-02-27T07:13:13.161+02:00Sexual contentionsIf you got here from reading my essay, know that I only wanted to emphasise that those cited ideas were mine, and not the subject of plagiarism ;). And thanks for the scrutiny, I always appreciate a thorough reading.evolverhttp://www.blogger.com/profile/08367665316105551812noreply@blogger.com0tag:blogger.com,1999:blog-6486920263910567705.post-83015630745581600932009-02-05T15:26:00.013+02:002009-02-26T22:40:59.931+02:00Pure MVC - the good, the bad and the ugly<p>I just finished my first Flash game built with <a href="http://puremvc.org/component/option,com_wrapper/Itemid,144/">PureMVC for ActionScript3.0</a> (sorry, it's a work project and not released yet).</p><p></p><p>I'm going to share some bad experiences and some good experiences about it. Let's start with the bad ones, because they're most fun to read.</p><p>As <a href="http://www.insideria.com/2009/01/frameworkquest-2008-part-6-the.html">Tony says</a>, PureMVC makes you write quite a bit of boilerplate code in the beginning. I expected that anyway, sice I had just learned the system. But it's true, it is far from a pleasant prospect to imagine having to write it again. If I will use it in the future, I will most probably copy the entire project and start changing, or even create a 'blank setup', with all the initialization code ready for ordinary applications.<br /></p><p>One of the complications is that when sending messages through the facade (a similar publish /subscribe mechanism to Cairngorm Events), any command and any mediator can respond and act upon them (proxies can't). This makes it difficult to know who and what is doing at certain stages of the application, especially when the project is getting bigger. There is no central point to see who is doing the work at "APPLICATION_INIT", for instance, because any and all mediators can listen to this event, and that signaling code is <em>in the particular classes</em> (through the <span style="font-family:courier new;">listNotificationInterests</span> method). I found myself using Ctrl+H in Eclipse (which searches through all project files) more often than should be the case for a good framework (or for a programmer with good memory - I should <a href="http://www.mezediet.com/2006/03/eat_fish_to_imp.html">eat more fish</a>).</p><p>A subsequent, unforseen oddity comes to life when linking to other mediators in a mediator. I wonder if this verges on bad practice, but on a few occasions I needed to link mediators directly, and in one instance I realised I had circular referencing between two mediators. This would generally be no particular problem, but the way PureMVC recommends registering Mediators is not compatible with such referencing. Namely, you register them in sequence in the top-level ApplicationMediator, as part of an application initializing command. This means that the circular referencing will break, because the second mediator will not have been created yet when we attempt to retrieve it in the constructor of the first.<br />My way around this was to move the mediators registration code at the end of the application initialization and then to send a "MEDIATORS_REGISTERED" message, which could be listened by all mediators who may be in danger of circular linkage. This had the nice effect of bloating almost all my mediators' class code.<br /></p><p>Also, when coding commands which need to wait for view components to finish animating, it becomes cumbersome when other entities (commands or mediators) need to act when that animation finishess. For instance, a card placeholder needs to change colour when the card reaches it. You don't want to lose state in the command by just registering a new command to execute at the end of the animation, because you need to use previously obtained information. You basically have to dispatch two 'messages' in the view component's mediator -> one through the facade (eg. "<span style="font-family:courier new;">CARD_RECHED_DESTINATION</span>"), for the interested mediators, and the other, a regular Flash event (for instance <span style="font-family:courier new;">Event.COMPLETE</span>). The command will then respond to the Flash event and continue its functionality. (Alternatively you can dispatch the facade message in the waiting command; but what if that animation is at other times triggered by different commands as well? You still need the message to be sent out...).</p><p></p><p>Now moving on to good things.</p><p>What's cool is that once you've gone through the initial scaffolding, it is very easy to add bits of functionality in the application. That is, if you leverage copy-paste, because something like <span style="font-family:courier new;">_cardsMediator = CardsMediator(facade.retrieveMediator(CardsMediator.NAME));</span> is not fun to write 5-10 times per class. Also, the linking between visual components becomes a breeze, because most of the times they will respond to existing notifications.</p><p>Also, if I am to think about my application generally, I feel it is very solid, robust. I have had very few bugs caused by my misusing the framework, so from this point of view PureMVC does not stand in your way.</p><p></p><p>Will post back with more insights.</p>evolverhttp://www.blogger.com/profile/08367665316105551812noreply@blogger.com0tag:blogger.com,1999:blog-6486920263910567705.post-44390021507846912722008-07-30T20:40:00.003+03:002008-07-30T20:55:16.356+03:00Take the survey!<a title="The Web Design Survey, 2008" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.alistapart.com/articles/survey2008"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBWDa_C5Vaif1IbSy_lnD_HRI51_aQpIoIDLHbid9_ek7fwapUT6EsmGZ6Tgn1H0pJjr0U9B2m_PUkgOCflsQ8JDukq4aO_uqjg_z5K2va5X7S-HkUjXHftfSVD-aTut8KIeusRrbTldiW/s400/i-took-the-2008-survey.gif" alt="" id="BLOGGER_PHOTO_ID_5228866750807116866" border="0" /></a>evolverhttp://www.blogger.com/profile/08367665316105551812noreply@blogger.com0tag:blogger.com,1999:blog-6486920263910567705.post-50291900807640549442008-05-12T06:27:00.014+03:002008-05-12T10:13:07.374+03:00How to clone (duplicate) an object in ActionScript 3For a project I needed to clone an object of unknown type. And by clone I mean to create a new instance of that same type and then fill out all its properties (including getters and setters) to mirror the original object.<br /><br />Thanks to a friend, I discovered the <a href="http://livedocs.adobe.com/flex/2/langref/flash/utils/package.html#describeType%28%29">describeType </a>function in AS3. But this alone will only take care of the copying part. To create an object of the same type as another one we use <a href="http://livedocs.adobe.com/flex/2/langref/flash/utils/package.html#getDefinitionByName%28%29">getDefinitionByName</a>.<br /><br />Although Flash reflection is pretty basic, with a little work it will do the trick.<br /><br />Get the <a href="http://mihai.chira.googlepages.com/cloneTest.zip">application files</a>.<br /><br />Here's the code:<br /><br /><div style="overflow-x:scroll"><br /><pre><br /><br /><span style="color: rgb(128, 128, 48);"><</span>?xml version<span style="color: rgb(128, 128, 48);">=</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 230);">1.0</span><span style="color: rgb(128, 0, 0);">"</span> encoding<span style="color: rgb(128, 128, 48);">=</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 230);">utf-8</span><span style="color: rgb(128, 0, 0);">"</span>?<span style="color: rgb(128, 128, 48);">></span><br /><span style="color: rgb(128, 128, 48);"><</span>mx:<span style="color: rgb(187, 121, 119);">Application</span> xmlns:mx<span style="color: rgb(128, 128, 48);">=</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 230);">http://www.adobe.com/2006/mxml</span><span style="color: rgb(128, 0, 0);">"</span> layout<span style="color: rgb(128, 128, 48);">=</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 230);">absolute</span><span style="color: rgb(128, 0, 0);">"</span> xmlns:local<span style="color: rgb(128, 128, 48);">=</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 230);">*</span><span style="color: rgb(128, 0, 0);">"</span> creationComplete<span style="color: rgb(128, 128, 48);">=</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 230);">init()</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(128, 128, 48);">></span><br /><br /><span style="color: rgb(128, 128, 48);"><</span>mx:Script<span style="color: rgb(128, 128, 48);">></span><br /> <span style="color: rgb(128, 128, 48);"><</span>!<span style="color: rgb(128, 128, 48);">[</span>CDATA<span style="color: rgb(128, 128, 48);">[</span><br /><br /> import mx<span style="color: rgb(128, 128, 48);">.</span>controls<span style="color: rgb(128, 128, 48);">.</span><span style="color: rgb(187, 121, 119);">Alert</span>;<br /><br /> private var source:<span style="color: rgb(187, 121, 119);">DataObject</span> <span style="color: rgb(128, 128, 48);">=</span> new <span style="color: rgb(187, 121, 119);">DataObject</span><span style="color: rgb(128, 128, 48);">(</span><span style="color: rgb(128, 128, 48);">)</span>;<br /> private var cloneObject:<span style="color: rgb(187, 121, 119);">DataObject</span>;<br /><br /><br /> private <span style="color: rgb(128, 0, 0); font-weight: bold;">function</span> init<span style="color: rgb(128, 128, 48);">(</span><span style="color: rgb(128, 128, 48);">)</span>:void <span style="color: rgb(128, 0, 128);">{</span><br /><br /> source<span style="color: rgb(128, 128, 48);">.</span><span style="color: rgb(187, 121, 119); font-weight: bold;">name</span> <span style="color: rgb(128, 128, 48);">=</span> 'John Doe';<br /> source<span style="color: rgb(128, 128, 48);">.</span>howMany <span style="color: rgb(128, 128, 48);">=</span> <span style="color: rgb(0, 128, 0);">4.5</span>;<br /> source<span style="color: rgb(128, 128, 48);">.</span>when <span style="color: rgb(128, 128, 48);">=</span> new <span style="color: rgb(187, 121, 119);">Date</span><span style="color: rgb(128, 128, 48);">(</span><span style="color: rgb(0, 140, 0);">0</span><span style="color: rgb(128, 128, 48);">)</span>;<br /> source<span style="color: rgb(128, 128, 48);">.</span>complexProp <span style="color: rgb(128, 128, 48);">=</span> new <span style="color: rgb(187, 121, 119);">DataObject</span><span style="color: rgb(128, 128, 48);">(</span><span style="color: rgb(128, 128, 48);">)</span>;<br /> source<span style="color: rgb(128, 128, 48);">.</span>complexProp<span style="color: rgb(128, 128, 48);">.</span><span style="color: rgb(187, 121, 119); font-weight: bold;">name</span> <span style="color: rgb(128, 128, 48);">=</span> '<span style="color: rgb(187, 121, 119); font-weight: bold;">Name</span> in sub<span style="color: rgb(128, 128, 48);">-</span><span style="color: rgb(128, 0, 0); font-weight: bold;">object</span>';<br /> <br /> cloneObject <span style="color: rgb(128, 128, 48);">=</span> UtilFunctions<span style="color: rgb(128, 128, 48);">.</span>clone<span style="color: rgb(128, 128, 48);">(</span>source<span style="color: rgb(128, 128, 48);">)</span> as <span style="color: rgb(187, 121, 119);">DataObject</span>;<br /> <br /> <span style="color: rgb(187, 121, 119);">Alert</span><span style="color: rgb(128, 128, 48);">.</span>show<span style="color: rgb(128, 128, 48);">(</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 230);">Clone:\nname = </span><span style="color: rgb(128, 0, 0);">"</span> <span style="color: rgb(128, 128, 48);">+</span> cloneObject<span style="color: rgb(128, 128, 48);">.</span><span style="color: rgb(187, 121, 119); font-weight: bold;">name</span> <span style="color: rgb(128, 128, 48);">+</span> <span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 230);">\nhowMany = </span><span style="color: rgb(128, 0, 0);">"</span> <span style="color: rgb(128, 128, 48);">+</span> cloneObject<span style="color: rgb(128, 128, 48);">.</span>howMany <span style="color: rgb(128, 128, 48);">+</span> <span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 230);">\nwhen = </span><span style="color: rgb(128, 0, 0);">"</span> <span style="color: rgb(128, 128, 48);">+</span> cloneObject<span style="color: rgb(128, 128, 48);">.</span>when <span style="color: rgb(128, 128, 48);">+</span> <span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 230);">\ncomplexProp.name = </span><span style="color: rgb(128, 0, 0);">"</span> <span style="color: rgb(128, 128, 48);">+</span> cloneObject<span style="color: rgb(128, 128, 48);">.</span>complexProp<span style="color: rgb(128, 128, 48);">.</span><span style="color: rgb(187, 121, 119); font-weight: bold;">name</span><span style="color: rgb(128, 128, 48);">)</span>;<br /> }<br /><br /> <span style="color: rgb(128, 128, 48);">/</span><span style="color: rgb(128, 128, 48);">*</span><span style="color: rgb(128, 128, 48);">*</span><br /><br /> <span style="color: rgb(128, 128, 48);">*</span> describeType will produce this <span style="color: rgb(128, 128, 48);">(</span><span style="color: rgb(128, 0, 0); font-weight: bold;">for</span> a <span style="color: rgb(187, 121, 119);">DataObject</span> instance<span style="color: rgb(128, 128, 48);">)</span>:<br /> <span style="color: rgb(128, 128, 48);">*</span><br /> <span style="color: rgb(128, 128, 48);">*</span> <span style="color: rgb(128, 128, 48);"><</span><span style="color: rgb(187, 121, 119); font-weight: bold;">type</span> <span style="color: rgb(187, 121, 119); font-weight: bold;">name</span><span style="color: rgb(128, 128, 48);">=</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 230);">DataObject</span><span style="color: rgb(128, 0, 0);">"</span> base<span style="color: rgb(128, 128, 48);">=</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 230);">Object</span><span style="color: rgb(128, 0, 0);">"</span> isDynamic<span style="color: rgb(128, 128, 48);">=</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 230);">false</span><span style="color: rgb(128, 0, 0);">"</span> isFinal<span style="color: rgb(128, 128, 48);">=</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 230);">false</span><span style="color: rgb(128, 0, 0);">"</span> isStatic<span style="color: rgb(128, 128, 48);">=</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 230);">false</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(128, 128, 48);">></span><br /><br /> <span style="color: rgb(128, 128, 48);"><</span>extendsClass <span style="color: rgb(187, 121, 119); font-weight: bold;">type</span><span style="color: rgb(128, 128, 48);">=</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 230);">Object</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(128, 128, 48);">/</span><span style="color: rgb(128, 128, 48);">></span><br /> <span style="color: rgb(128, 128, 48);"><</span>accessor <span style="color: rgb(187, 121, 119); font-weight: bold;">name</span><span style="color: rgb(128, 128, 48);">=</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 230);">isHandicap</span><span style="color: rgb(128, 0, 0);">"</span> access<span style="color: rgb(128, 128, 48);">=</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 230);">writeonly</span><span style="color: rgb(128, 0, 0);">"</span> <span style="color: rgb(187, 121, 119); font-weight: bold;">type</span><span style="color: rgb(128, 128, 48);">=</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 230);">Boolean</span><span style="color: rgb(128, 0, 0);">"</span> declaredBy<span style="color: rgb(128, 128, 48);">=</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 230);">DataObject</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(128, 128, 48);">/</span><span style="color: rgb(128, 128, 48);">></span><br /><br /> <span style="color: rgb(128, 128, 48);"><</span>variable <span style="color: rgb(187, 121, 119); font-weight: bold;">name</span><span style="color: rgb(128, 128, 48);">=</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 230);">howMany</span><span style="color: rgb(128, 0, 0);">"</span> <span style="color: rgb(187, 121, 119); font-weight: bold;">type</span><span style="color: rgb(128, 128, 48);">=</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 230);">Number</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(128, 128, 48);">/</span><span style="color: rgb(128, 128, 48);">></span><br /> <span style="color: rgb(128, 128, 48);"><</span>accessor <span style="color: rgb(187, 121, 119); font-weight: bold;">name</span><span style="color: rgb(128, 128, 48);">=</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 230);">complexProp</span><span style="color: rgb(128, 0, 0);">"</span> access<span style="color: rgb(128, 128, 48);">=</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 230);">readwrite</span><span style="color: rgb(128, 0, 0);">"</span> <span style="color: rgb(187, 121, 119); font-weight: bold;">type</span><span style="color: rgb(128, 128, 48);">=</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 230);">DataObject</span><span style="color: rgb(128, 0, 0);">"</span> declaredBy<span style="color: rgb(128, 128, 48);">=</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 230);">DataObject</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(128, 128, 48);">/</span><span style="color: rgb(128, 128, 48);">></span><br /><br /> <span style="color: rgb(128, 128, 48);"><</span>variable <span style="color: rgb(187, 121, 119); font-weight: bold;">name</span><span style="color: rgb(128, 128, 48);">=</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 230);">name</span><span style="color: rgb(128, 0, 0);">"</span> <span style="color: rgb(187, 121, 119); font-weight: bold;">type</span><span style="color: rgb(128, 128, 48);">=</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 230);">String</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(128, 128, 48);">/</span><span style="color: rgb(128, 128, 48);">></span><br /> <span style="color: rgb(128, 128, 48);"><</span>variable <span style="color: rgb(187, 121, 119); font-weight: bold;">name</span><span style="color: rgb(128, 128, 48);">=</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 230);">when</span><span style="color: rgb(128, 0, 0);">"</span> <span style="color: rgb(187, 121, 119); font-weight: bold;">type</span><span style="color: rgb(128, 128, 48);">=</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 230);">Date</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(128, 128, 48);">/</span><span style="color: rgb(128, 128, 48);">></span><br /><br /> <span style="color: rgb(128, 128, 48);"><</span><span style="color: rgb(128, 128, 48);">/</span><span style="color: rgb(187, 121, 119); font-weight: bold;">type</span><span style="color: rgb(128, 128, 48);">></span><br /> <span style="color: rgb(128, 128, 48);">*</span><br /> <span style="color: rgb(128, 128, 48);">*</span> <span style="color: rgb(128, 128, 48);">*</span><span style="color: rgb(128, 128, 48);">/</span><br /><br /> ]]<span style="color: rgb(128, 128, 48);">></span><br /><br /><span style="color: rgb(128, 128, 48);"><</span><span style="color: rgb(128, 128, 48);">/</span>mx:Script<span style="color: rgb(128, 128, 48);">></span><br /><span style="color: rgb(128, 128, 48);"><</span><span style="color: rgb(128, 128, 48);">/</span>mx:<span style="color: rgb(187, 121, 119);">Application</span><span style="color: rgb(128, 128, 48);">></span><br /></pre></div><br /><br />And the UtilFunctions.as file:<br /><br /><div style="overflow-x:scroll"><br /><pre><br /><br />package<br /><span style="color: rgb(128, 0, 128);">{</span><br /> import flash<span style="color: rgb(128, 128, 48);">.</span>utils<span style="color: rgb(128, 128, 48);">.</span>describeType;<br /> import flash<span style="color: rgb(128, 128, 48);">.</span>utils<span style="color: rgb(128, 128, 48);">.</span>getDefinitionByName;<br /> import flash<span style="color: rgb(128, 128, 48);">.</span>utils<span style="color: rgb(128, 128, 48);">.</span>getQualifiedClassName;<br /><br /> public <span style="color: rgb(128, 0, 0); font-weight: bold;">class</span> UtilFunctions<br /> <span style="color: rgb(128, 0, 128);">{</span><br /><br /> <br /> public static <span style="color: rgb(128, 0, 0); font-weight: bold;">function</span> newSibling<span style="color: rgb(128, 128, 48);">(</span>sourceObj:<span style="color: rgb(128, 0, 0); font-weight: bold;">Object</span>):<span style="color: rgb(128, 128, 48);">*</span> <span style="color: rgb(128, 0, 128);">{</span><br /> <span style="color: rgb(128, 0, 0); font-weight: bold;">if</span><span style="color: rgb(128, 128, 48);">(</span>sourceObj<span style="color: rgb(128, 128, 48);">)</span> <span style="color: rgb(128, 0, 128);">{</span><br /><br /> var objSibling:<span style="color: rgb(128, 128, 48);">*</span>;<br /> try <span style="color: rgb(128, 0, 128);">{</span><br /> var classOfSourceObj:<span style="color: rgb(128, 0, 0); font-weight: bold;">Class</span> <span style="color: rgb(128, 128, 48);">=</span> getDefinitionByName<span style="color: rgb(128, 128, 48);">(</span>getQualifiedClassName<span style="color: rgb(128, 128, 48);">(</span>sourceObj<span style="color: rgb(128, 128, 48);">)</span><span style="color: rgb(128, 128, 48);">)</span> as <span style="color: rgb(128, 0, 0); font-weight: bold;">Class</span>;<br /> objSibling <span style="color: rgb(128, 128, 48);">=</span> new classOfSourceObj<span style="color: rgb(128, 128, 48);">(</span><span style="color: rgb(128, 128, 48);">)</span>;<br /> <span style="color: rgb(128, 0, 128);">}</span><br /><br /> catch<span style="color: rgb(128, 128, 48);">(</span>e:<span style="color: rgb(128, 0, 0); font-weight: bold;">Object</span>) <span style="color: rgb(128, 0, 128);">{</span><span style="color: rgb(128, 0, 128);">}</span><br /> <br /> <span style="color: rgb(128, 0, 0); font-weight: bold;">return</span> objSibling;<br /> }<br /> <span style="color: rgb(128, 0, 0); font-weight: bold;">return</span> null;<br /> }<br /> <br /> public static <span style="color: rgb(128, 0, 0); font-weight: bold;">function</span> clone<span style="color: rgb(128, 128, 48);">(</span>source:<span style="color: rgb(128, 0, 0); font-weight: bold;">Object</span>):<span style="color: rgb(128, 0, 0); font-weight: bold;">Object</span> <span style="color: rgb(128, 0, 128);">{</span><br /><br /> var clone:<span style="color: rgb(128, 0, 0); font-weight: bold;">Object</span>;<br /> <span style="color: rgb(128, 0, 0); font-weight: bold;">if</span><span style="color: rgb(128, 128, 48);">(</span>source<span style="color: rgb(128, 128, 48);">)</span> <span style="color: rgb(128, 0, 128);">{</span><br /> clone <span style="color: rgb(128, 128, 48);">=</span> newSibling<span style="color: rgb(128, 128, 48);">(</span>source<span style="color: rgb(128, 128, 48);">)</span>;<br /> <br /> <span style="color: rgb(128, 0, 0); font-weight: bold;">if</span><span style="color: rgb(128, 128, 48);">(</span>clone<span style="color: rgb(128, 128, 48);">)</span> <span style="color: rgb(128, 0, 128);">{</span><br /> copyData<span style="color: rgb(128, 128, 48);">(</span>source, clone<span style="color: rgb(128, 128, 48);">)</span>;<br /> <span style="color: rgb(128, 0, 128);">}</span><br /> <span style="color: rgb(128, 0, 128);">}</span><br /> <br /> <span style="color: rgb(128, 0, 0); font-weight: bold;">return</span> clone;<br /> }<br /> <br /> public static <span style="color: rgb(128, 0, 0); font-weight: bold;">function</span> copyData<span style="color: rgb(128, 128, 48);">(</span>source:<span style="color: rgb(128, 0, 0); font-weight: bold;">Object</span>, destination:<span style="color: rgb(128, 0, 0); font-weight: bold;">Object</span>):void <span style="color: rgb(128, 0, 128);">{</span><br /><br /> <span style="color: rgb(105, 105, 105);">//copies data from commonly named properties and getter/setter pairs</span><br /> <span style="color: rgb(128, 0, 0); font-weight: bold;">if</span><span style="color: rgb(128, 128, 48);">(</span><span style="color: rgb(128, 128, 48);">(</span>source<span style="color: rgb(128, 128, 48);">)</span> <span style="color: rgb(128, 128, 48);">&</span><span style="color: rgb(128, 128, 48);">&</span> <span style="color: rgb(128, 128, 48);">(</span>destination<span style="color: rgb(128, 128, 48);">)</span><span style="color: rgb(128, 128, 48);">)</span> <span style="color: rgb(128, 0, 128);">{</span><br /><br /> try <span style="color: rgb(128, 0, 128);">{</span><br /> var sourceInfo:XML <span style="color: rgb(128, 128, 48);">=</span> describeType<span style="color: rgb(128, 128, 48);">(</span>source<span style="color: rgb(128, 128, 48);">)</span>;<br /> var prop:XML;<br /> <br /> <span style="color: rgb(128, 0, 0); font-weight: bold;">for</span> each<span style="color: rgb(128, 128, 48);">(</span>prop in sourceInfo<span style="color: rgb(128, 128, 48);">.</span>variable<span style="color: rgb(128, 128, 48);">)</span> <span style="color: rgb(128, 0, 128);">{</span><br /><br /> <span style="color: rgb(128, 0, 0); font-weight: bold;">if</span><span style="color: rgb(128, 128, 48);">(</span>destination<span style="color: rgb(128, 128, 48);">.</span>hasOwnProperty<span style="color: rgb(128, 128, 48);">(</span>prop<span style="color: rgb(128, 128, 48);">.</span>@<span style="color: rgb(187, 121, 119); font-weight: bold;">name</span><span style="color: rgb(128, 128, 48);">)</span><span style="color: rgb(128, 128, 48);">)</span> <span style="color: rgb(128, 0, 128);">{</span><br /> destination<span style="color: rgb(128, 128, 48);">[</span>prop<span style="color: rgb(128, 128, 48);">.</span>@<span style="color: rgb(187, 121, 119); font-weight: bold;">name</span><span style="color: rgb(128, 128, 48);">]</span> <span style="color: rgb(128, 128, 48);">=</span> source<span style="color: rgb(128, 128, 48);">[</span>prop<span style="color: rgb(128, 128, 48);">.</span>@<span style="color: rgb(187, 121, 119); font-weight: bold;">name</span><span style="color: rgb(128, 128, 48);">]</span>;<br /> <span style="color: rgb(128, 0, 128);">}</span><br /><br /> <span style="color: rgb(128, 0, 128);">}</span><br /> <br /> <span style="color: rgb(128, 0, 0); font-weight: bold;">for</span> each<span style="color: rgb(128, 128, 48);">(</span>prop in sourceInfo<span style="color: rgb(128, 128, 48);">.</span>accessor<span style="color: rgb(128, 128, 48);">)</span> <span style="color: rgb(128, 0, 128);">{</span><br /> <span style="color: rgb(128, 0, 0); font-weight: bold;">if</span><span style="color: rgb(128, 128, 48);">(</span>prop<span style="color: rgb(128, 128, 48);">.</span>@access <span style="color: rgb(128, 128, 48);">=</span><span style="color: rgb(128, 128, 48);">=</span> <span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(0, 0, 230);">readwrite</span><span style="color: rgb(128, 0, 0);">"</span><span style="color: rgb(128, 128, 48);">)</span> <span style="color: rgb(128, 0, 128);">{</span><br /> <span style="color: rgb(128, 0, 0); font-weight: bold;">if</span><span style="color: rgb(128, 128, 48);">(</span>destination<span style="color: rgb(128, 128, 48);">.</span>hasOwnProperty<span style="color: rgb(128, 128, 48);">(</span>prop<span style="color: rgb(128, 128, 48);">.</span>@<span style="color: rgb(187, 121, 119); font-weight: bold;">name</span><span style="color: rgb(128, 128, 48);">)</span><span style="color: rgb(128, 128, 48);">)</span> <span style="color: rgb(128, 0, 128);">{</span><br /> destination<span style="color: rgb(128, 128, 48);">[</span>prop<span style="color: rgb(128, 128, 48);">.</span>@<span style="color: rgb(187, 121, 119); font-weight: bold;">name</span><span style="color: rgb(128, 128, 48);">]</span> <span style="color: rgb(128, 128, 48);">=</span> source<span style="color: rgb(128, 128, 48);">[</span>prop<span style="color: rgb(128, 128, 48);">.</span>@<span style="color: rgb(187, 121, 119); font-weight: bold;">name</span><span style="color: rgb(128, 128, 48);">]</span>;<br /> <span style="color: rgb(128, 0, 128);">}</span><br /><br /> <span style="color: rgb(128, 0, 128);">}</span><br /> <span style="color: rgb(128, 0, 128);">}</span><br /> <span style="color: rgb(128, 0, 128);">}</span><br /> catch <span style="color: rgb(128, 128, 48);">(</span>err:<span style="color: rgb(128, 0, 0); font-weight: bold;">Object</span>) <span style="color: rgb(128, 0, 128);">{</span><br /><br /> ;<br /> <span style="color: rgb(128, 0, 128);">}</span><br /> }<br /> }<br /> }<br />}<br /></pre></div><br /><!-- ***** BEGIN LICENSE BLOCK ***** - Version: MPL 1.1/GPL 2.0/LGPL 2.1 - - The contents of this file are subject to the Mozilla Public License Version - 1.1 (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - http://www.mozilla.org/MPL/ - - Software distributed under the License is distributed on an "AS IS" basis, - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - for the specific language governing rights and limitations under the - License. - - The Original Code is the Colorer Library. - - The Initial Developer of the Original Code is - Cail Lomecb <cail@nm.ru>.<br /> - Portions created by the Initial Developer are Copyright (C) 1999-2005<br /> - the Initial Developer. All Rights Reserved.<br /> -<br /> - Contributor(s):<br /> -<br /> - Alternatively, the contents of this file may be used under the terms of<br /> - either the GNU General Public License Version 2 or later (the "GPL"), or<br /> - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),<br /> - in which case the provisions of the GPL or the LGPL are applicable instead<br /> - of those above. If you wish to allow use of your version of this file only<br /> - under the terms of either the GPL or the LGPL, and not to allow others to<br /> - use your version of this file under the terms of the MPL, indicate your<br /> - decision by deleting the provisions above and replace them with the notice<br /> - and other provisions required by the LGPL or the GPL. If you do not delete<br /> - the provisions above, a recipient may use your version of this file under<br /> - the terms of any one of the MPL, the GPL or the LGPL.<br /> -<br /> - ***** END LICENSE BLOCK ***** -->evolverhttp://www.blogger.com/profile/08367665316105551812noreply@blogger.com1tag:blogger.com,1999:blog-6486920263910567705.post-52760117953460336772008-04-20T21:39:00.002+02:002008-04-20T22:40:15.825+02:00Funny quotesI thought I'd share some nice quotes I keep saving online (using the <a href="http://www.esnips.com/download/">eSnips toolbar</a>).<br /><br /><ul><li>It's OK for you to make noise. Otherwise, we feel like we are fucking a ninja (<a href="http://www.craigslist.org/about/best/sea/561877622.html">Craigslist</a>)</li><li>Cel mai necinstit lucru, in viatza, este modul in care aceasta se termina. Adica viatza e grea si-tzi ocupa tot timpul. Ce capetzi la sfarshitul ei? O moarte. Asta ce-i, un bonus??? Eu cred ca ciclul vietzii e de-a-ndaratelea. Ar trebui intai sa mori, apoi sa mergi intr-un azil de batrani. Esti dat afara de acolo pe motiv ca esti prea sanatos, te duci, iti iei pensia, apoi, cand incepi sa lucrezi, primeshti un ceas de aur in prima zi de lucru. Munceshti patruzeci de ani pana devii suficient de tanar. Te apuci de baut, mergi la show-uri, si esti gata pentru liceu, apoi scoala primara, devii copil, te joci, n-ai responsabilitatzi, devii bebelush, apoi itzi petreci ultimapoi itzi petreci ultimele noua luni plutind cu toate facilitatzile dupa care termini totul printr-un orgasm (mass mess)</li><li>Of course, if they have time machines in the future they'll probably have a separate reference manual just for Cambridge. This has always been a fussy place, a town of i dotters and t crossers, where you're liable to get both your grammar and your ideas corrected in the same conversation. (Paul Graham - <a href="http://www.paulgraham.com/say.html">What you Can't Say</a>)</li><li>I've seen occasional articles about how to manage programmers. Really there should be two articles: one about what to do if you are yourself a programmer, and one about what to do if you're not. And the second could probably be condensed into two words: give up. (Paul Graham - <a href="http://www.paulgraham.com/gh.html">Great Hackers</a>)<br /></li></ul>evolverhttp://www.blogger.com/profile/08367665316105551812noreply@blogger.com0tag:blogger.com,1999:blog-6486920263910567705.post-70541859062108479892008-03-21T17:44:00.008+02:002008-03-21T18:55:41.270+02:00How to get the Class of any Object in ActionScript 3 and FlexHere's a small trick I recently learned. It's very helpful in some situations.<br /><br /><span style="font-weight: bold;">If you need to know the class of a random object</span>:<br /><br /><code> private function getObjectClass(obj:*):Class {<br /> var className:String = getQualifiedClassName(obj);<br /> var classOfObj:Class = ApplicationDomain.currentDomain.getDefinition(className) as Class;<br /><br /> return classOfObj;<br />}</code><br /><br /><span style="font-weight: bold;">And creating another instance of that object is just a step forward</span>:<br /><br /><code>private function newInstanceOf(obj:*):Object {<br /> var objectClass:Class = getObjectClass(obj);<br /> <br /> if(objectClass) {<br /> return new objectClass();<br /> }<br /> <br /> return null;<br /> }</code><br /><br /><br /><span style="font-weight: bold;">Notice: </span>this last trick will work only if you know for sure that the constructor for those objects don't need any parameters (either have none defined, or all have default values). If you're not sure, consider wrapping the code inside a try-catch block. If, however, you <span style="font-style: italic;">know</span> that the constructor will require arguments, please tell me how you solved this, I'm still thinking about an elegant solution.<br /><br />Here's a <a href="http://mihai.chira.googlepages.com/asobjectclass"><span style="font-weight: bold;">full working example</span></a> written for Flex3.<br /><br />Hope it helps.evolverhttp://www.blogger.com/profile/08367665316105551812noreply@blogger.com0tag:blogger.com,1999:blog-6486920263910567705.post-25539573418655676822008-01-27T23:04:00.000+02:002008-01-27T23:21:28.377+02:00Book recommendation: 'The Underground History Of American Education', by John Taylor GattoIf you're into education and you're tired of reading articles, blog posts, quotes, snips and snippets, here's a book to quench your curiosity - <a href="http://johntaylorgatto.com/chapters/index.htm">'The Underground History Of American Education', by John Taylor Gatto</a>.<br /><br />After a career in the middle of the system, Gatto is now an open opponent of education as we know it (and have felt it). He is quick to peek behind the scenes and point out the 'real' interests of such a system.<br /><br />Of course, after twelve years in public schooling, seeing an ex insider (both as a student and as a teacher) mess it all up like that is savourous beyond words. He touches on many things I had myself felt were wrong, but just though it was the way it was supposed to be and let it rest (and looking at things trough Gattoish eyes, I was helped into [not] thinking that).<br /><br />However, two of his essays <a href="http://www.cantrip.org/gatto.html">[1]</a>, <a href="http://www.cantrip.org/againstschool.html">[2]</a> (although I enjoyed them) made me a bit wary - some of his language seems to verge on paranoia and conspiracy theory. They're valuable nonetheless; just read them carefully and critically.<br /><br />Anyway, I plan to read the book too in the near future. If you have already done it, please let me know of what you thought of it.evolverhttp://www.blogger.com/profile/08367665316105551812noreply@blogger.com0tag:blogger.com,1999:blog-6486920263910567705.post-40347839358987026112008-01-11T03:01:00.000+02:002008-01-11T03:22:58.796+02:00My first haxe projectToday I started work on my first <a href="http://haxe.org/">haxe </a>project (first after "hello world", that is). It is (will be) a website which will show all the events in the town I live in at any given time.<br /><br />Working in haxe (the neko part) seems to be surprisingly straightforward. Although it didn't simplify the work needed a lot more than php does, for instance, haxe has more appeal to me; it appears lightweight, while php seems heavy. It kept me up until this hour and I'm eager to learn more.<br /><br />However appealing though, I will refrain from using haxe for the javascript part. I have come to this decision after quite a heated debate with myself. The reasons:<br /><br /><ul><li>First, it's a pretty small project, at least at the beginning. We want to get it out as soon as possible and then build features on it as it grows.</li><li>Second, although haxe itself is easy to use, it only offers the basic functionality as javascript is concerned. It cannot be compared to a javascript framework such as <a href="http://www.prototypejs.org/">prototype</a> or <a href="http://extjs.com/">extjs</a>. I don't expect that from it either - it's not meant to be such a library (yet, I hope). I also thought about integrating haxe for js and one of these frameworks, but it's too complicated for what I need right now. Maybe in the future.</li><li>Third, I want to learn extjs :)</li></ul>I want to have a word with the author of <a href="http://hxblog.motion-twin.com/">hxBlog</a>, maybe I can learn some things quicker and skip some trial and error iterations :) After having studied the source code that is (it's there, on the website, in case you're interested).evolverhttp://www.blogger.com/profile/08367665316105551812noreply@blogger.com1tag:blogger.com,1999:blog-6486920263910567705.post-32544762783750183812008-01-06T21:03:00.001+02:002008-01-06T21:11:26.936+02:00Spreading the word for Digital MaoismI've just finished reading <a href="http://edge.org/3rd_culture/lanier06/lanier06_index.html">'Digital Maoism' by Jaron Lanier</a> and I felt the urge to share. Do read it, I promise it's valuable. Broadly and minimally speaking, it's about collectivism as opposed to individualism, both online and offline, with very interesting examples and insights.<br /><br />I'm not saying it's all correct, let alone true (in fact I have some points I would argue with him on), but it is just so refreshingly alive. I like people who challege. He does it in a very artistic, but coherent and documented way. One cannot easily disregard his opinions.<br /><br />I highly recommend this to anyone working in Scrum project management environments (this may shed some light on the entire process) and to those who love Wikipedia, Digg, and other such aggregators. That is, if you're brave enough to face a real challenge.<br /><br />Cheers all, tell me how it was.evolverhttp://www.blogger.com/profile/08367665316105551812noreply@blogger.com0