Posts

Showing posts from 2010

Concatenate rows in Oracle

Recently, I had to concatenate and put in one line (comma separated) the results of a query in Oracle. After one version using replace, xmlagg and xmlelement which had several problems and some reading online I compiled the following code: select rtrim(dbms_xmlgen.convert(xmlagg(xmlelement(e, mycolumn || ', ')).extract('//text()').getClobVal(), 1), ', ') from mytable The extract/getClobVal trick came from "ORA-19011 Character string buffer too small when used with XMLAGG function": http://oracle.ittoolbox.com/groups/technical-functional/oracle-dev-l/ora19011-character-string-buffer-too-small-when-used-with-xmlagg-function-3882635 The dbms_xmlgen.convert trick came from "HOWTO: Avoid Conversion of Escape Codes": http://www.liberidu.com/blog/?p=635 Enjoy :-)

Little batch file for StatSVN

StatSVN retrieves information from a Subversion repository and generates various tables and charts describing the project development. You can get the software this page: http://www.statsvn.org/downloads.html Inside the archive (statsvn-0.7.0.zip) you have a readme.txt and a statsvn.jar . It would've been nice to be able to run StatSVN directly so I played a bit to create this bat file: set home=%cd% set /p project=Project folder: set report=report cd /d %project% del svn.log svn log --xml -v > svn.log cd /d %home% rd /s /q %report% java -jar statsvn.jar -output-dir %report% %project%\svn.log %project% del %project%\svn.log %report%\index.html Just create the bat file in the folder where you extracted StatSVN, run it, paste your project's folder path and wait for the magic to happen. The report will be generated in a folder named report and the report's index.html should be opened in your browser.

Universe to science, and vice versa

Image
We live in our Universe. We all study it and learn about it so that we can live in it. Human civilization systematized all knowledge into sciences like mathematics (from Greek: learning , study , science ), physics (from Greek: nature ), biology, chemistry, etc. The system of sciences is helping us understand where we are, but it is also enabling us to influence the World. The result? We have the Universe and our tiny, dense information structure called sciences. The Universe is "building" the sciences through us and gets influenced by the sciences through us. You can call the sciences, one dimension of our contribution as a society. You can also call the sciences a living organism that moves around and interacts with its environment. Here is an ugly sketch of the pyramid of influences: All the dots are in the Universe. The black ones are the inanimate objects. The red ones are the people on Earth. The blue ones are the objects of science. What is interesting to note here i

Those little tiny spots on the canvas

During our lives, while learning about the world, we see that everything is composed of something else. Everything evolves into something else. Things change. And then, there are singularities. Singularities are points of the world that the human cannot perceive into. There is The Big Bang that came from a single point. There are those quantum particles that space is "composed of" (maybe not a good example ^^). All those points hide an unimaginable amount of wow. Maybe those points are even more important than all the unknown worlds and undiscovered features of the world we are somewhat able to observe now. What I thought about today is the " Technological Singularity ". The advancement in speed, intelligence, etc. will ultimately bring humans to a new frontier where a new era will begin. This brings thoughts about the end of all things just like any other singularity out there. It's tempting. Our society is a platform, a test-tube, for those scientific endeavor

Крачка назад във вечния танц

Последните дни излезе новината, че Светия Синод на Българската православна църква иска задължително обучение по религия в училище. Хайде нова акция... Светият Синод иска задължително обучение по религия в училище: http://dariknews.bg/view_article.php?article_id=592334 ДСБ подкрепи искането за задължително обучение по религия: http://dariknews.bg/view_article.php?article_id=593318&audio_id=63200 Негово Високопреосвещенство Ловчанският митрополит Гавраил: http://www.vsekiden.com/77609 Ясно е, че в последно време, политическия елит е застанал зад Светия Синод и може би това е плода на разговорите им. Предполагам има и още, но само бъдещето ще покаже. Какво наблюдаваме в исторически план? Религията, подкрепяна от вярата на народа, е успяла да съхрани българския дух. Комунизмът унищожава религията, за да може хората да вярват само в него и да го подкрепят. Когато той си заминава, хората първоначално се опитват да вярват в държавата. Цялата тази смяна на правителства и партии

SMS за милиони

Днес получих следния SMS: Mtel Vi predstavia: Unikalna oferta ot SMS za Milioni! BEZPLATEN SMS s Vasheto EGN na nomer 9999 i moje da spechelite 20 000 leva oshte dnes! Ne e za izpuskane! Стори ми се доста съмнителна цялата работа и се разтърсих. Намерих следните форуми и статии: Номер 9999: http://www.ipmart-bg.com/archive/index.php/t-28709.html МТел продължава да спами* с SMS за милиони: http://varnanews.info/index.php?option=com_content&view=article&id=472:-sms-&catid=44:newsbulgaria&Itemid=91 Внимание, МТел събира ЕГН-та противозаконно: http://varnanews.info/index.php?option=com_content&view=article&id=468:2010-09-23-06-21-08&catid=44:newsbulgaria&Itemid=91 Бихте ли си дали ЕГН-то на номер 9999: http://www.mobilebulgaria.com/forum/307145/1/0/0/%D0%B1%D0%B8%D1%85%D1%82%D0%B5-%D0%BB%D0%B8-%D1%81%D0%B8-%D0%B4%D0%B0%D0%BB%D0%B8-%D0%B5%D0%B3%D0%BD-%D1%82%D0%BE-%D0%BD%D0%B0-%D0%BD%D0%BE%D0%BC%D0%B5%D1%80-9999 Оказва се, че става въпрос за играта SMS за мили

Universe, Mind, AGI, mumbo jumbo

The Universe. It's there. The mind is in the Universe. It's part of the Universe. It's the Universe. We make the abstraction that what we do is decided by us. Just as the Earth can think of herself as orbiting the Sun. Earth is part of the Universe, so are we. All is natural. AGI is in the Universe. It's part of the Universe. It's the Universe. We make the abstraction that if a computer does something that seems intelligent to us, it has a mind similar to ours. What is happening actually? What is all this mumbo jumbo? Can I please have another view on the matter? The U(niverse) can have virtual U(s) in it. The creators of those U(s) are the "thinkers". They make a dense representation of the U and act upon the real U "intelligently" according to their will. For example our knowledge is that dense representation. Our will is actually the next move that was given to us. But it was given by the same U. We cannot be intelligent and be part of the U.

AGI on the WWW and graph visualization

If you have noticed, recently a lot of web sites have acquired Facebook's like button . At first I didn't see the broad implications of this tiny button if it wasn't for a f8 LIVE video I watched last week. At this year's f8 LIVE , Mark Zuckerberg and Bret Taylor introduced the Open Graph protocol . For the total nubs, graphs are (according to Wikipedia's article on Graph theory ) mathematical structures used to model pairwise relations between objects from a certain collection. Now, I have read about graphs here and there. They're visible in the following fields: My dictionaries' future projects all ended up in graph-like structures. My recent reading of articles on AGI (Artificial General Intelligence) have also been related to graphs. If our gray matter is the synthesizing algorithm (see my article on the brain , in bulgarian) then it's cooperation with white matter (being a network layer) forms a good candidate for saying that our intelligence and

Evolution

It turns out that I have already written down some ideas on the matter: Развитието на Света (Еволюция) What (most) sciences are all about Biology, Sociology, Chemistry, History, Astrophysics, Physics... Evolution , Galaxy formation and evolution , Human evolution , Technological evolution (1)... Studying what is now, how it came to be and how it will change. How do you call this phenomenon: Universal evolution or General evolution? I think simply Evolution will do. Please fix Wikipedia's article on evolution and all those references to evolution theory concerning only living beings. Ervin László is said to be one of the men whose "goal was to explore whether it might be possible to use the chaos theory to identify a new general theory of evolution". He's the man behind the Akashic Field Theory which states that an informational field can explain why our universe appears to be fine-tuned as to form galaxies and conscious lifeforms; and why evolution is an informed,

Consciousness, language and my dictionary software

Image
Previously, I had written some articles in Bulgarian on the Hierarchical Temporal Memory (HTM) model introduced by Jeff Hawkins . I really liked the idea of Hawkins to mimic the function of the neocortex and its aptitude for cause inference so I wanted to present it in my native language. Currently, I'm designing my next version of the dictionary software ( AEnglish Dictionary ) that I have developed some years ago. At first there might not be an obvious link between the two subjects but whenever I think on how to store and use a dictionary database in a good way, I always end up with questions on how do we, humans, do it. In general I'm inclining to try to mimic some function of the neocortex. If I'm allowed to cite Wikipedia's article on the neocortex : "It is involved in higher functions such as sensory perception, generation of motor commands, spatial reasoning, conscious thought and language." When I first got introduced with HTM, I instantly found that

Java has it wrong since 2002

If you ever made the mistake in Windows 7 to move your Desktop folder from C:\Users\%username% to D:\ (or some other folder) you might notice that Java applications start to flood your D drive (the root of Desktop) with configuration folders with names like .myapp . The explanation: when Java provides the user profile path to applications, it simply looks for the Desktop's path and strips the folder name. Why would I want to move the folder in first place? Simply because I want to have my data on my D drive. At last Microsoft have provided the means to do it and now Sun/Oracle are in the way of being absolutely free to decide where you want to store your data. What's really annoying is that the issue with Java exists since December 2002. Although there are 3-4 bugs related to this one and a lot of comments have been posted on the Internet, the bug is prioritized as 4 (low)!? I'm not sure if voting counts but I have given my voice here: http://bugs.sun.com/bugdatabase/view

Земеделие

Не знам защо, но като ми кажат земеделие се сещам за Месопотамия. Наскоро разглеждах появата и развитието на земеделието в Европа и стигнах до годината 7 000 пр.н.е., Балканския полуостров. Днес обаче прочетох за експедициите до Манхатан и как през 16 век индианците там отглеждали царевица. Голямо озадачение от моя страна! Тези индианци кога са започнали да се занимават със земеделие. Тикви, царевица, картофи... оказва се, че това са били също хилядолетни култури. Потърсих в Уикипедия и попаднах на статията History of agriculture . Явно тази технология на хората е повсеместна и се е развила на цялата територия на Земята. При това става въпрос за 10 000 пр.н.е. Споменава се дори датиране от 20 000 пр.н.е., което според мен е обосновано, тъй като няма как тази техника да се е появила през 10 000 пр.н.е. и да се е разпространила бързо навсякъде. Досега не съм мислил за земеделието като толкова глобален феномен. Явно то отдавна е част от културата на хората и им е помагало при всички им пр

Problem with Undo and Bulgarian (Phonetic)

Проблем с Undo и Bulgarian (Phonetic) Днес попаднах на решението на един много странен проблем. Пише си човек на кирилица в Word и опита ли се да използва комбинацията Ctrl+Z, вместо връщане на промените получава дублиране на промените. Много дразнещо е компютъра да ти прави напук. Оказа се обаче, че компютъра не бил виновен. Днес реших, че ще разнищя въпроса. Google отново помогна като ме насочи към следния форум : http://social.answers.microsoft.com/Forums/en-US/vistaperformance/thread/78e5d52e-0fea-4d44-8e22-c01d6cf60576/ Проблемът е ясен. От въвеждането на Bulgarian (Phonetic) в Windows Vista, се получава неудобството, че при ползването на тази клавиатурна подредба, Ctrl+Z и Ctrl+Y са разменени. Според мен това е очевиден бъг, тъй като Bulgarian (Phonetic Traditional) и Bulgarian (Typewriter) са си наред в моя Windows 7. Надявам се да има лесен начин Microsoft да пуснат поправка и да го направят, все пак проблема е от повече от година. Problem with Undo and Bulgarian (Phonetic) Tod

Нашият мозък

Image
Здравейте, в тази статия ще попиша малко за неща около нашия мозък, които съм прочел и видял в Интернет. Може от време на време да включа и някое мое разсъждение. Невронната мрежа В нашия мозък има милиарди неврони. Всеки от тях може да се свързва с другите неврони при определени условия и да си предават сигнали. Идеята е проста. Идват импулси от тялото, тези импулси минават през мрежа от неврони, мрежата от неврони обикновено претърпява малка промяна като реакция на този стимул и може да изпрати обратно импулси на тялото. Способността на невронната мрежа да променя реакцията си спрямо импулсите идващи от тялото определя живота на организма и способността му да оцелява. Ако при ДНК, мутацията се извършва веднъж в живота на съществото, то в този случай има и придобити възможности. Компютърът Компютърът представлява една памет, един процесор и входно/изходни канали. Идеята е проста. Процесорът променя или чете паметта, когато получи съответен сигнал. Процесорът разполага с няколко прости

Развитието на Света (Еволюция)

Еволюция идва от латинската дума evolutio („разгръщане“, „разкриване“). В английския език се превежда като " unrolling and reading of a scroll, reading of a book". Думата е развила значението си на английски до развитие, развой . Подготвям една статия за човешкия мозък и при като направих сравнение с компютрите стигнах до следното заключение. Развитието на процесорите и архитектурите е успоредно на развитието на нервната система при организмите. Развитието на едно ново устройство от нас е като развитието на едно ново същество или нова функция на някой организъм в природата. Чрез нас природата продължава хода си и колкото и да се мислим, че сме се самоосъзнали, имаме още какво да постигнем. Само с напредък в науката ще достигнем до пълно самосъзнание, защото науката е точно това: познанието, което ни прави нещо повече от същество с първични инстинкти. Ум и знание! Природата е създала ДНК, а после и нашата мозъчна кора. Това е теорията за еволюцията в биологията. Ако говорим за

Трябва и акъл!

Image
1. Не става само с ядене, трябва и акъл! Познатата ни фраза от рекламата на една банка е много добро начало за тази статия. Турската дума "акъл" е навлязла в разговорната реч и означава няколко неща: ум, разум, разсъдък, съвет. Хората сме уникални с това колко добре (според нас) си служим с нашия ум. Докато бездомните кучета и котки, които се навъртат около нас, главно използват главата си, за да си набавят достатъчно храна да преживяват, човешкия ум неспирно работи за някаква по-висша цел, с известни изключения разбира се. Каква е разликата според науката? Главната причина за разлика в интелекта между нас и другите бозайници е, че ние просто имаме по-голям мозък. И както добре знаете от Мечо Пух: Колкото повече, толкова повече! Тук е необходимо да се поясни, че най-важна за интелекта на един бозайник е външната част от мозъка, която се нарича мозъчна кора (познатите ни мозъчните гънки или сиво вещество). Тя също така е и най-новата, от еволюционна гледна точка, част на на

ГМО от Магаданския институт

Едни приятели ми пратиха следната статия за овцо-прасчовци: http://xaxor.com/index.php/funny-pics/7806-Funny--Sheep-pigs Сетих се за една друга статия на Магаданския научен институт, в която надълго и нашироко се рекламираше големия напредък направен от учените им в областта на ГМО (генетично модифицираните организми). При това не говорим за растения, а животни. Не мога да си спомня всичко в детайли, но общото ми впечатление беше, че прасето в Магадан е издигнато на пиедестал и е основен обект на изследванията там. Науката толкова е напреднала, че то вече е станало универсално животно. Ето и примерите: Учените отдавна нямат проблем със студените вечери в Магадан, защото техните баби са им оплели пуловери от свинска вълна. Да не говорим, че те носят пуловерите и през летните си почивки на Азорските острови и това не е чудно като узнаете, че за подобния на Adidas ClimaCool ефект. В обедното менюто в стола на института има такива специалитети като Мариновани свински крилца и Терин от гъш

HTM theory and Spaghetti code

HTM theory is a very interesting view of how people think and why they are so intelligent. Today I stumbled upon some Spaghetti code in a software project I'm working on. There was a method of more than a thousand lines. As I was scrolling through this behemoth of thought, I started seeing some patterns. I immediately remembered HTM theory and how it modeled human perception. You receive some information through time (scroll the text) and you find patterns in it. What can be done here? Refactoring. When you're at the top of the " see" pyramid you can already make high level processing of the whole method of thousand lines. You can " see " that there are some duplications of code. If you're not used to techniques of procedure/object oriented programming you might try to struggle to memorize all these repetitions. But someone who's familiar with refactorings such as extracting a method will quickly evaluate the gains of removing a lot of unnecessary

Multimedia and RIA on the Web

Current state for multimedia and RIA is browser add-ons: Flash (Flex), Silverlight, JavaFX Future possibility is built-in support: HTML5 ( canvas tag) + JavaScript Example: IE9 supports Direct2D and if used for canvas tag you get built-in "flash-like" platform that can use the GPU ^.^