Pewnego dnia bogaty ojciec zabrał swojego syna na wycieczkę w biedne rejony wiejskie żeby pokazać mu jak to jest być biednym. Spędzili razem kilka dnia i nocy w jednym z gospodarstw u rodziny, która ledwo wiązała koniec z końcem.
Po wyprawie ojciec zapytał swojego syna jak mu się podobało. "Tato, dziękuję, naprawdę mi się bardzo podobało!", odpowiedział syn. "Czy widziałeś jak biedni są niektórzy ludzie?", zapytał ojciec. "Tak tato, widziałem.", odpowiedział syn.
"Synu, czy wyciągnąłeś jakieś wnioski z tego pobytu w tej biednej wsi?", zapytał ojciec. Syn odpowiedział: "Tak, tato. Widziałem, że oni mają cztery psy, a my tylko jednego. My mamy basen za domem do połowy naszego ogrodu, oni mają strumyk bez końca. My mamy lampiony importowane z Chin, a oni mogą oglądać gwiazdy w nocy. My mamy małą posesję i z naszego tarasu możemy tylko zobaczyć co najwyżej ulicę, a oni mogą wpatrywać się w bezkresny horyzont. My mamy służących, a oni pomagają innym. My kupujemy nasze jedzenie, oni uprawiają swoje pola, mają własne warzywa, owoce i hodują krowy, które dają im świeże mleko. My mamy wysoki płot wokoło naszego domu, oni mają przyjaciół, którym w pełni ufają i żyją jak jedna duża rodzina." Ojciec zaniemiał po takiej niespodziewanej odpowiedzi syna, wtedy syn jeszcze dodał: "To pokazało mi jak my tak naprawdę jesteśmy biedni."
To co dla jednych jest bezcennym bogactwem, dla innych jest nie nie warte nawet złamanego grosza. To jak bogaci jesteśmy zależy od naszej perspektywy. Czasami potrzebna jest perspektywa dziecka, żeby przypomnieć sobie co tak naprawdę jest ważne i wartościowe w naszym życiu.
Luźne tłumaczenie z: "A Wealthy Father Is Floored By His Son’s Wisdom And Compassion"
Sunday, 12 January 2020
Sunday, 5 January 2020
Camera not working on Surface Book with Windows 10
Quick fix:
1. Uninstall any third party anti-virus applications (e.g., McAfee).
2. Go to: Settings->Recovery->Advanced startup->Restart now->Troubleshoot->Advanced options->Startup settings->Safe mode-> (after reboot) press F4 (or 4) for going into the Safe Mode.
https://support.microsoft.com/en-us/help/12376/windows-10-start-your-pc-in-safe-mode
3. In the Safe Mode, open the Device Manager. Uninstall ALL the drivers related to the cameras.
4. Restart your computer.
(Worked on Surface Book with Windows 10, I was unable to run Ubuntu properly on this laptop).
If your camera fails with this error 0A00F424F then do the following:
1. Create a new folder: C:\Users\<your user name>\OneDrive\Pictures\Camera Roll
(replace the <your user name> with your name)
Alternatively, you can also create the folder: C:\Users\adzie\Pictures\Camera Roll
2. Right click on the created folder Camera Roll and select: Include in library->Camera Roll
1. Uninstall any third party anti-virus applications (e.g., McAfee).
2. Go to: Settings->Recovery->Advanced startup->Restart now->Troubleshoot->Advanced options->Startup settings->Safe mode-> (after reboot) press F4 (or 4) for going into the Safe Mode.
https://support.microsoft.com/en-us/help/12376/windows-10-start-your-pc-in-safe-mode
3. In the Safe Mode, open the Device Manager. Uninstall ALL the drivers related to the cameras.
4. Restart your computer.
(Worked on Surface Book with Windows 10, I was unable to run Ubuntu properly on this laptop).
If your camera fails with this error 0A00F424F then do the following:
1. Create a new folder: C:\Users\<your user name>\OneDrive\Pictures\Camera Roll
(replace the <your user name> with your name)
Alternatively, you can also create the folder: C:\Users\adzie\Pictures\Camera Roll
2. Right click on the created folder Camera Roll and select: Include in library->Camera Roll
Labels:
surface windows camera
Location:
Chicago, IL, USA
Thursday, 26 December 2019
Recenzja książki: "I wtedy wspiąłem się na drzewo", ale dlaczego z niego zszedł?
Są lekkie książki, które łatwo się czyta i szybko zapomina. Większość biografii porusza wiele kwestii, ale żadnej głębiej nie rozważa. Książka o założycielu Rossmanna również wpisuje się bardzo wyraźnie w tą kategorię, choć można znaleźć perełki, które na dłużej pozostaną w naszej pamięci. Na pewno zaczyna się od ciekawości: cóż taki Rossmann mógł robić na drzewie i dlaczego tam w ogóle wszedł? Czy wystarczające jest wytłumaczenie, że akurat był sobie wysoki dąb, na który nasz bohater bez trudu mógł się wspiąć i zrobił to w ramach chwilowego przypływu odwagi oraz sprzeciwu wobec przełożonych? Mówi się, że prawdziwego mężczyznę poznaje się po tym jak kończy a nie po tym jak zaczyna. Prawdziwy powód dlaczego pan Rossmann zszedł z tego drzewa wydaje się bardziej absurdalny niż powód dla którego tam wszedł. Pan Rossmann to typ mola książkowego i mogę sobie wyobrazić dlaczego historia tego kto był jego prawdziwym ojcem jest opisana obszernie i bardzo przypomina motyw przewodni książki "Bogaty i biedny ojciec". Inna sprawa dotycząca braku bycia za pan brat z nowymi technologiami, nie używanie laptopa czy smartphonea, to obecnie bardzo popularna tematyka książek w Stanach Zjednoczonych. Cal Newport napisał wiele pozycji na ten temat, na przykład "Praca w skupieniu" (ang. "Deep work") jak również "Cyfrowy minimalizm" (ang. "Digital minimalism"). Pan Rossmann nie posiada smartphonea i nie zabija czasu na czekaniu wpatrując się w błyszczący ekran, lecz po prostu czeka i rozmyśla, ma wówczas czas dla siebie. Przypomina to także postawę innych słynnych businessmanów, np. pana Warren Buffetta, który również nie ma komputera w swoim biurze, ale tylko telefon. Na pewno pomaga to w unikaniu zbyt pochopnych decyzji, gdyż decyzja podjęta emocjonalnie nie może być natychmiast zmaterializowana w elektronicznym medium ale musi przejść sito co najmniej kilku minutowego buforu myśli, który wiąże się z wykonaniem telefonu lub zgłoszeniem zadania do pracowników. Niektóre tematy, choćby wspomniany problem ojcostwa Rossmanna przewija się w kilku punktach w książce, lub zostaje zapowiedziany, zapewne jak zachęta odkryta kilka stron lub rozdziałów dalej. Zapewne struktura tej książki nie grzeszy matematyczną precyzją. Mimo wszystko, jak na prawdziwą biografię przystało, dowiadujemy się o panu Rossmannie wiele, począwszy od "trudnego" dzieciństwa, poprzez jego "burzliwą" młodość, pełen sukcesów wiek średni, po "wczesną starość", która wydała nam tego doświadczonego businessowego i życiowo człowieka. Pytanie jest następujące, dla kogo jest ta książka? Na pewno dla szerokiej publiczności, począwszy od ludzi którzy zaczynają prowadzić business i mają kilka godzin wolnego czasu. Główny przekaz za niemieckim filozofem Schopenhauerem brzmi: "Nigdy się nie poddawaj. Ci przegrywają, którzy za szybko się poddają." Nie tuzinkowe są również strategie jak zniszczyć konkurencję na rynku sprzedaży detalicznej - zainwestuj jak największą możliwą sumę pieniędzy w nowe sklepy i poprzez kupowanie produktów na wielką skalę po niższej cenie, obniż ceny w punktach sprzedaży. Słowo Rossmann stało się synonimem słowa Rossmann w Polsce. Relatywnie co do liczny ludności, mamy więcej punków Rossmanna w Polsce niż w Niemczech. To pokazuje że naszemu bohaterowi taki podbój rynku powiódł się, a nawiasem pisząc Polacy wydają się większymi konsumpcjonistami niż Niemcy i zarobione za granicą pieniądze trafiają z powrotem do zachodniej kieszeni. Krąg się nam zamyka. Abstrahując od szczegółów finansowych, wielu młodych ludzi może zobaczyć tu przykładna postawę, nie tylko głównego bohatera, ale także opisanych przygód, np. pewnej Żydówki, której niemiecki oficer pomógł przewieźć cały rodzinny majątek do Szwajcarii. Co więcej, pan Rossmann ma bogate doświadczenia życiowe i przemyślane wiele zdarzeń z jego przeszłości. Przykład dziadków Wilkensonów ukazuje nam małżeństwo liberalnej kobiety (socjaldemokratki) z konserwatystą (centro-prawicowym), których gorące debaty przyczyniły do wzajemnego i lepszego poznania się, do nie kończących się tematów do dyskusji. Przy czym, potrafili oni szanować swoje odmienne poglądy. Na pewno nie jest to wzór związku małżeńskiego, ale wyraz przykładu, że dwoje ludzi może pokochać się nie tylko wtedy gdy są do siebie bardzo podobni, szczególnie pod względem wartości, ale również pewne znaczące różnicę mogę ich do siebie przyciągnąć, niczym dwa bieguny magnesu. Babcia Wilkensonowa, zwana również "Wielką Babcią" miała nietuzinkowy sposób wyrażania się, który wręcz bawi swoją bezpośredniością i dobitnością. Przygody Rossmanna w Rosji to również całą seria śmiesznych zdarzeń. Takie fragmenty umilają lekturę tej książki. Książka zaczęła się od wysokiego C na drzewie i wcale nie brakowało w życiu naszego bohatera ciekawych przygód, które wypełniły ponad 300 stron. Na koniec jednak robi się trochę poważniej. Pan Rossmann również dba o sprawy Afryki, suwerenności państw, edukacji, czy wspierania młodych i zdolnych młodych ludzi. Możemy się od niego nauczyć, jak wprowadzać słowo w czyn, pomagać tak, by ta pomoc dotarła do właściwych osób, jak wierzyć w swoje ideały i je realizować. Czy zgadzasz się z panem Rossmannem czy nie, na pewno ma on wiele do powiedzenia i rysuje nam obraz świata, na który warto spojrzeć przez jego okulary.
Location:
Warsaw, Poland
Tuesday, 18 June 2019
How to describe a graph?
This is a lesson given by Prof. Aaron Elmore and taught as the Santa
Barbara's style, though I already learnt most of this at EPFL with
Prof. Anastasia Ailamaki. This is an easy mnemonic to remember it:
W - what or why am I showing this?
A - axes, describe both the vertical and horizontal axes
L - lines or bars, show them one by one
T - trends
E - exceptions
R - recap what you showed in the graph or give a final conclusion, preferably a punchline
W - what or why am I showing this?
A - axes, describe both the vertical and horizontal axes
L - lines or bars, show them one by one
T - trends
E - exceptions
R - recap what you showed in the graph or give a final conclusion, preferably a punchline
Tuesday, 12 February 2019
Lessons on earnig a dollar or a talent a day
Every day you must work hard to tire yourself out so that when you go sleep you feel that you did everything you could and can sleep soundly. You gain a point every single day and your value grows. If your aim is to reach the cumulative increase in your score by 1000 points then you have to set your heart on making the point on a daily basis for 3 years. Some say another day, another dollar. Others point out that you should use your talents and multiply them. This is very abstract and detached from practice. How can we dissect the talent into measurable bits and pieces? What is important for a man to achieve in terms of short and long term goals and to obtain the highest final reward? The basic principle borrowed from Greek philosophers beautifully draws the picture of a man who develops each aspect of his life in harmony. The major parts of a human being are his body and mentality. You must exercise you muscles and move your body to the point that you feel pain. Only then will you truly connect to the nature that is reflected in you since a seed needs to die in order to become a plant. Your brain is the most important muscle. Thus, it deserves your uttermost attention. Do not neglect it in any circumstances. This muscle has to be exercised to an extreme, it has to become better every day, without any exception. There is no break for this part of you. Your body needs control. Run, lift weights, stretch your muscles but also take lessons on dancing or martial arts so that you are able to express yourself through your movements. Even better, when you play an instrument, your fingers and brain are connected to produce sounds that give pleasure to your aural senses. This multifaceted act is one of the most elegant ways in which you can exercise muscles and give pleasure to yourself simultaneously. Reading books, writing, or solving coding problems are other very engaging activities for you brain. Set goals for every day and fulfill them, grow every day, earn a dollar or add another talent to your treasury.
Thank you Son for your motivating words.
Words are powerful. They have the ability to inspire, motivate, and persuade; or discourage, dismiss, and dissuade.
Thank you Son for your motivating words.
Words are powerful. They have the ability to inspire, motivate, and persuade; or discourage, dismiss, and dissuade.
Saturday, 3 November 2018
My 4th day after Geneva Cursillo in 2014
I was asked to sign up for an hour of palanca. It should be a form of a prayer or a sacrifice that can give a lever to the Cursillo participants and enable them to achieve more or even beyond their expectations during the 3 day retreat. This time I was trying to reflect on what was my take-away from the Cursillo weekend.
It all began in Switzerland. My Cursillo weekend was in November in 2014. Tony Shave, whom I got to know at CERN during my internship in 2012, was my sponsor and invited me to take part in the event. I had never heard about such a movement before but was encouraged by Tony to attend the Cursillo weekend. Back then, I lived in Lausanne and came to Geneva on Thursday. I was expected a retreat and spending 3 days in calm atmosphere filled with prayers. It occurred to be a special time that is imprinted in my memory. I was surprised that there is such a place in Geneva, surrounded by trees and in the middle of a green circle, where you can feel as if you were outside of any city and far away from any traffic noise. From the very first moment, I had an impression that it was not a typical retreat but that people there, with God's help, wanted us to experience the life in God's grace. On Thursday's night, the introductions were held. We were paired and had to learn as much as possible about another person, then instead of presenting ourselves, we had to present our partners. This was a very effective way to get to know each other. Early in the morning on Friday, I was woken up by a small choir. Of course, I yearned for a little bit more sleep, however, probably this was the most gentle way of waking somebody up. We started early in the morning and the day was filled with activities. We had rollos, the way of the cross and really interesting conversations in my group. We were talking about priorities in our lives. Thankfully enough, I had a very good mnemonic that learned from my housemate, Richard Holt. You should remember about 3Ms, they are: Master, Mission and Mate. Master represents God, Mission is your main goal in life, and Mate is your wife or best friend. This is almost in line with the Gospel. Interestingly enough, this very Sunday, we will here what Jesus thought us as the 2 most important commandments, that are kept in unity: "The first is this: 'Hear, O Israel! The Lord our God is Lord alone! You shall love the Lord your God with all your heart, with all your soul, with all your mind, and with all your strength.' The second is this: 'You shall love your neighbor as yourself.' There is no other commandment greater than these." This was a good start from the fundamentals. The rollos were going deeper into the life in faith. Jamie Antonelli gave an excellent presentation on how to become an effective Christian leader and be more involved in the Church community. I think that nothing is more persuasive than his own involvement in music ministry with his wife Nicole. The talk about the science and faith was the closest one to my heart. In computer science community, we are always insisting on the fact that the universe was created when God pressed Enter :) When I consider this topic more seriously, the first thought that comes to my mind is about the encyclical "Fides et Ratio" ("Faith and Reason") promulgated by Pope John Paul II. When I delve deeper into this theme, my life as a researcher was always filled with the scientific beauty of reasoning and the confirmation of natural laws by experiments. However, would you test your best friend many times to verify if he or she is your best friend? I suppose, not really. Similarly, we cannot or should not test God. The entrance into the beauty of Jesus' teaching is through the gate of faith. The one act of believing in Jesus opens the door to the abundant love and life in His Kingdom. This unity of Christians in the Kingdom of God was what I encountered during Cursillo. I come from Poland, where most people, officially more than 90%, are Catholics, and attending masses on Sundays is very natural. I was exposed to lack of any religion during my studies in Denmark in Copenhagen. On the other hand, Cursillo was the time when different denominations met under the same roof and people from diverse religious backgrounds found a common ground. Our Saturday's meditations, the quieting, mystical experience of Taizé prayers were even more conducive to the ecumenical encounter. This was an excellent preparation for my 4th day, my PhD in the US at the University of Chicago. I live in Hyde Park, a district in the southern part of Chicago. We have as many denominations here as you can imagine. To name a few: Holy Trinity Church, Saint Thomas the Apostle Catholic Church, Augustana Luteran Church, First Unitarian Church of Chicago, The Church of Jesus Christ of Latter-day Saints, and so on. The knowledge about other denominations that I gained during Cursillo opened me more to the beauty of Christianity in its richness of endeavors to be closer to God. I found a leaflet about Taizé prayer in Hyde Park Union Church. I had no hesitation in going there and found fellowship and reflections on the Word of God that allowed me to see Jesus from a different perspective.
I made many friends during the Cursillo weekend. For me, the the unity within group of people from different denominations that can learn from each other and support each other in was the main message home. Above all, this was time when my friendship with Jesus Christ was strengthened. A few months after Cursillo weekend, Tony took me to Taizé in France. There is a beautiful icon of friendship there. I received a replica of the icon from Tony and found a prayer on the back of the icon in many languages. We pray to God in so different ways, using various words and languages, we walk to Him from many paths of Christian denominations. We are all friends in faith.
"I do not call you servants any longer, because the servant does not know what the master is doing; but I have called you friends, because I have made known to you everything that I have heard from my Father." (John 15:15).
It all began in Switzerland. My Cursillo weekend was in November in 2014. Tony Shave, whom I got to know at CERN during my internship in 2012, was my sponsor and invited me to take part in the event. I had never heard about such a movement before but was encouraged by Tony to attend the Cursillo weekend. Back then, I lived in Lausanne and came to Geneva on Thursday. I was expected a retreat and spending 3 days in calm atmosphere filled with prayers. It occurred to be a special time that is imprinted in my memory. I was surprised that there is such a place in Geneva, surrounded by trees and in the middle of a green circle, where you can feel as if you were outside of any city and far away from any traffic noise. From the very first moment, I had an impression that it was not a typical retreat but that people there, with God's help, wanted us to experience the life in God's grace. On Thursday's night, the introductions were held. We were paired and had to learn as much as possible about another person, then instead of presenting ourselves, we had to present our partners. This was a very effective way to get to know each other. Early in the morning on Friday, I was woken up by a small choir. Of course, I yearned for a little bit more sleep, however, probably this was the most gentle way of waking somebody up. We started early in the morning and the day was filled with activities. We had rollos, the way of the cross and really interesting conversations in my group. We were talking about priorities in our lives. Thankfully enough, I had a very good mnemonic that learned from my housemate, Richard Holt. You should remember about 3Ms, they are: Master, Mission and Mate. Master represents God, Mission is your main goal in life, and Mate is your wife or best friend. This is almost in line with the Gospel. Interestingly enough, this very Sunday, we will here what Jesus thought us as the 2 most important commandments, that are kept in unity: "The first is this: 'Hear, O Israel! The Lord our God is Lord alone! You shall love the Lord your God with all your heart, with all your soul, with all your mind, and with all your strength.' The second is this: 'You shall love your neighbor as yourself.' There is no other commandment greater than these." This was a good start from the fundamentals. The rollos were going deeper into the life in faith. Jamie Antonelli gave an excellent presentation on how to become an effective Christian leader and be more involved in the Church community. I think that nothing is more persuasive than his own involvement in music ministry with his wife Nicole. The talk about the science and faith was the closest one to my heart. In computer science community, we are always insisting on the fact that the universe was created when God pressed Enter :) When I consider this topic more seriously, the first thought that comes to my mind is about the encyclical "Fides et Ratio" ("Faith and Reason") promulgated by Pope John Paul II. When I delve deeper into this theme, my life as a researcher was always filled with the scientific beauty of reasoning and the confirmation of natural laws by experiments. However, would you test your best friend many times to verify if he or she is your best friend? I suppose, not really. Similarly, we cannot or should not test God. The entrance into the beauty of Jesus' teaching is through the gate of faith. The one act of believing in Jesus opens the door to the abundant love and life in His Kingdom. This unity of Christians in the Kingdom of God was what I encountered during Cursillo. I come from Poland, where most people, officially more than 90%, are Catholics, and attending masses on Sundays is very natural. I was exposed to lack of any religion during my studies in Denmark in Copenhagen. On the other hand, Cursillo was the time when different denominations met under the same roof and people from diverse religious backgrounds found a common ground. Our Saturday's meditations, the quieting, mystical experience of Taizé prayers were even more conducive to the ecumenical encounter. This was an excellent preparation for my 4th day, my PhD in the US at the University of Chicago. I live in Hyde Park, a district in the southern part of Chicago. We have as many denominations here as you can imagine. To name a few: Holy Trinity Church, Saint Thomas the Apostle Catholic Church, Augustana Luteran Church, First Unitarian Church of Chicago, The Church of Jesus Christ of Latter-day Saints, and so on. The knowledge about other denominations that I gained during Cursillo opened me more to the beauty of Christianity in its richness of endeavors to be closer to God. I found a leaflet about Taizé prayer in Hyde Park Union Church. I had no hesitation in going there and found fellowship and reflections on the Word of God that allowed me to see Jesus from a different perspective.
I made many friends during the Cursillo weekend. For me, the the unity within group of people from different denominations that can learn from each other and support each other in was the main message home. Above all, this was time when my friendship with Jesus Christ was strengthened. A few months after Cursillo weekend, Tony took me to Taizé in France. There is a beautiful icon of friendship there. I received a replica of the icon from Tony and found a prayer on the back of the icon in many languages. We pray to God in so different ways, using various words and languages, we walk to Him from many paths of Christian denominations. We are all friends in faith.
"I do not call you servants any longer, because the servant does not know what the master is doing; but I have called you friends, because I have made known to you everything that I have heard from my Father." (John 15:15).
Labels:
Geneva Cursillo Taize Tony
Location:
Chicago, IL, USA
Thursday, 9 November 2017
Thoughts on a paper: Parallel Data Analysis Directly on Scientific File Formats
The main motivation behind the paper is: the data processing pipeline that scientists deal with has established HDF5 format as the most ubiquitous one. A plethora of tools support the HDF5 format for simulations, visualizations and other data processing tasks. However, there is no analysis tool that would provide a rich query capabilities that can be found in a typical database management system (DBMS) via SQL. Loading data from HDF5 to a database is expensive and then the results of a processing in a DBMS would have to be converted back to HDF5 to be able to proceed further on in the data analysis pipeline.
The main contribution of the paper is the architecture and implementation of a new system. It is a database query engine that works over the HDF5 file format. The system used before the tool was introduced was PostgreSQL. It is a bit surprising that the query engine over HDF5 is row-based. The HDF5 format is array-based and the queries run by scientist are analytical so either an array-based or even a column-based systems would fit better in this case. When you compare results of benchmarks of OLAP-like queries for PostgreSQL and MonetDB, the performance difference is stunning, with MonetDB being an order of magnitude faster.
The paper targets a very specific use case - scientific data analysis. It seems to be one of the best places where the NoDB idea https://cacm.acm.org/magazines/2015/12/194619-nodb/fulltext can be applied. Regarding the implementation details, SDS/Q system implements the positional maps, which were proposed in NoDB. Clearly, the outcome is not as expected - because the positional maps perform poorly in this case. Why? The authors mention the inherent cost of performing random point lookups over HDF5 data. It seems to be more about at least 3 things: the queries run (workload), the underlying file format, and the experiments themselves to approve/disapprove a given technique. Let me comment on the two former differences. The queries run in the NoDB paper are aggregates that scan the whole input file. Moreover, the tables in NoDB have hundreds of columns. It can be the case that when you do such a scan, you can just jump over the file but still preserving the forward pass through the file and, overall, a sequential access to disk. On the other hand, SDS/Q indicates random accesses. The data storage from HPC (High Performance Computing) environment is able to support massively parallel I/O where many processes/threads access data from the storage simultaneously, but in case of singe program accessing data randomly, the cost of such access is more expensive than just a sequential one.
Mistakes: a claim in section 4.2 that the checkpointing frequency was increased to speed-up the data loading process to PostgreSQL is incorrect. Actually, a reverse statement is correct: the checkpointing should be less frequent and the intervals as well as the amount of data modified (threshold) to trigger a checkpoint should be increased.
The main contribution of the paper is the architecture and implementation of a new system. It is a database query engine that works over the HDF5 file format. The system used before the tool was introduced was PostgreSQL. It is a bit surprising that the query engine over HDF5 is row-based. The HDF5 format is array-based and the queries run by scientist are analytical so either an array-based or even a column-based systems would fit better in this case. When you compare results of benchmarks of OLAP-like queries for PostgreSQL and MonetDB, the performance difference is stunning, with MonetDB being an order of magnitude faster.
The paper targets a very specific use case - scientific data analysis. It seems to be one of the best places where the NoDB idea https://cacm.acm.org/magazines/2015/12/194619-nodb/fulltext can be applied. Regarding the implementation details, SDS/Q system implements the positional maps, which were proposed in NoDB. Clearly, the outcome is not as expected - because the positional maps perform poorly in this case. Why? The authors mention the inherent cost of performing random point lookups over HDF5 data. It seems to be more about at least 3 things: the queries run (workload), the underlying file format, and the experiments themselves to approve/disapprove a given technique. Let me comment on the two former differences. The queries run in the NoDB paper are aggregates that scan the whole input file. Moreover, the tables in NoDB have hundreds of columns. It can be the case that when you do such a scan, you can just jump over the file but still preserving the forward pass through the file and, overall, a sequential access to disk. On the other hand, SDS/Q indicates random accesses. The data storage from HPC (High Performance Computing) environment is able to support massively parallel I/O where many processes/threads access data from the storage simultaneously, but in case of singe program accessing data randomly, the cost of such access is more expensive than just a sequential one.
Mistakes: a claim in section 4.2 that the checkpointing frequency was increased to speed-up the data loading process to PostgreSQL is incorrect. Actually, a reverse statement is correct: the checkpointing should be less frequent and the intervals as well as the amount of data modified (threshold) to trigger a checkpoint should be increased.
Tuesday, 28 March 2017
Suggestion for Supper
Pancakes with Greek yogurt and cherry jam, apples with cinnamon and oatmeal cookies with almond butter. Bon Appétit :)
Monday, 27 February 2017
Snake bites
The programming language that bites me most terribly & keenly is ... no doubts ... Python. This time it was a global variable eps (epsilon) and I did not add the "self." prefix to the one that I really wanted to use in a method of a class. The nightmares of C programming and its common best practices come back! All in all, avoid global variables also in Python, or these snake bites can be deadly at the end of the day.
Monday, 20 February 2017
Bug in pthread_cond_timedwait or we need an improvement?
pthread_cond_timedwait
returns ETIMEDOUT instead of e.g. EINVAL when provided with "timespec
*restrict abstime" whose tv_nsec part exceeds 999999999 (basically, it's
more than 1 second). Furthermore, IMHO pthread_cond_timedwait should
return ETIME instead of ETIMEDOUT (if we follow comments in:
http://bit.ly/2kgHEhj). Anyway, if you want to avoid a few hours of
debugging then make sure that your tv_nsec is correct in each timespec
struct!
Location:
Chicago, IL, USA
Friday, 3 February 2017
"sudo checkinstall" instead of "sudo make install"
The pain of removing packages installed from source has reached its ultimate peak and it's the highest time to move to checkinstall. This gives us a very handy ability to remove a package from the system using the system packaging tools: e.g.
dpkg -r custom-protobuf
So current flow of commands for any installation from source is:
dpkg -r custom-protobuf
So current flow of commands for any installation from source is:
./configure make
sudo checkinstall
Wednesday, 21 December 2016
Laws in Physics vs. in Computer Science
The laws of physics and nature are unchanged and we just have to discover them. It requires a lot of imagination and thorough study to fully explain and prove a law. A beautiful and rewarding effect is that later on we can predict certain phenomenon or simply what will happen next based on the laws. An example is the Fermat law that says that light always traverses the path that gives it the lowest running time. You can, for example, infer that because the atmosphere is denser than the vacuum, the light that comes to your eye from the Sun is curved and in reality when you watch a sunset, the Sun is already below the horizon, even though it is still visible.
On the other hand, there are no true and unchanged laws in computer science. The design of systems changes and the way it does can be surprising as every designer/human being has different preferences and can even change a commonly accepted "good design choices". An example is a mismatch between OS page size and DBMS page size, 4 KB and 8 KB respectively. The database can fetch 8 KB pages randomly, for example, because of the index-based scan. On the other hand, the OS notices that the application (DBMS in this case) starts from fetching 2 pages in a row (2x OS page of 4 KB - gives the 8 KB page fetched by the DBMS) and OS assumes that it must be a sequential scan of pages, so it additionally prefetches another 2x 4 KB pages (16 KB in total), the second 8 KBs in vain. The other 2 pages won't be read subsequently. Afterwards, DBMS goes to a totally different location to fetch another 8KB page.
The systems could have a built-in level of adjustment (probably built-in Machine Learning components) that could simulate the nature and automatically improve as the time progresses, for example changing the number of pages to 3 in a row to trigger sequential scan assumption in the OS. The computer environment should imitate better the natural environment.
On the other hand, there are no true and unchanged laws in computer science. The design of systems changes and the way it does can be surprising as every designer/human being has different preferences and can even change a commonly accepted "good design choices". An example is a mismatch between OS page size and DBMS page size, 4 KB and 8 KB respectively. The database can fetch 8 KB pages randomly, for example, because of the index-based scan. On the other hand, the OS notices that the application (DBMS in this case) starts from fetching 2 pages in a row (2x OS page of 4 KB - gives the 8 KB page fetched by the DBMS) and OS assumes that it must be a sequential scan of pages, so it additionally prefetches another 2x 4 KB pages (16 KB in total), the second 8 KBs in vain. The other 2 pages won't be read subsequently. Afterwards, DBMS goes to a totally different location to fetch another 8KB page.
The systems could have a built-in level of adjustment (probably built-in Machine Learning components) that could simulate the nature and automatically improve as the time progresses, for example changing the number of pages to 3 in a row to trigger sequential scan assumption in the OS. The computer environment should imitate better the natural environment.
Thursday, 27 October 2016
$ fortune
$ fortune
Real software engineers work from 9 to 5, because that is the way the job is
described in the formal spec. Working late would feel like using an
undocumented external procedure.
Real software engineers work from 9 to 5, because that is the way the job is
described in the formal spec. Working late would feel like using an
undocumented external procedure.
Monday, 10 October 2016
Thouhgt of the day from Quora
"Get a
good education, find someone you love, do something you're good at and
don't stop until you're the greatest at it. That way, you don't care
what people think of your life or your pictures, you can just live your
life the way you've always dreamt." http://bit.ly/2d7irxs Feynman: "What do you care what other people think?"
Thursday, 22 September 2016
PhD student has to write blog posts regularly, here you go.
"PhD is a career like running your own business". I swung by an event for new incoming students to UChicago and herd such a sentence. I set my heart on learning a couple more things from my fellow students on how I should live my PhD life. I read a couple of pages in a book on how to write academic papers and one advice was that you should call your supervisor: advisor. It was repeated in the talk. It seems to me that in this matter the nomenclature is really of importance. It's not only your advisor who can teach you new aspects but also other students around you, of course. The only requirement is that the other people should be interested in a similar topic like you. The database group at UChicago is growing rapidly and we hope that our new chair will be willing to help with this endeavor. It would be too cumbersome to create a story from the thoughts that I heard today so let me just enumerate them and comment a little bit on each of them.
- You get what people think you should get. This is very true. We have to master the skill of communication, especially about what we work on, what is our research about and what is in for you. Giving a talk is always a challenge for me, but I love it. I'm always thrilled and sometimes even a little bit nervous, however, once I am there on the stage, know that my material is well-prepared and start communicating with the audience, then there is no better time in my life, seriously.
- Don't do something off truck. So, communicate with your advisor frequently and make sure that you both agree on the next steps. I don't want to make my advisor being frustrated, sure thing. This is more about how you want to run your business, what your vision is for an excellent new approach/technique/method/algorithm/theory/experiments. Just make sure that your supervisor agreed with you and remember to calibrate your research trajectory.
- Spend some time improving yourself. I know that I must work more on math & English. This is math that helps me to keep sane in this unstructured world of words/thoughts/opinions and get on the right truck with my own thinking. At the same time, you mush speak/read/write in English and do it perfectly, otherwise you loose a lot being in the US or other English speaking countries.
- Write a technical blog. I'll write more technical stuff, I promise. It'll be on compression, Spark, parquet (and other data formats), data migration, some other databases (MonetDB), and I will comment on some papers.
- This blog has to be keyword search-able, I'm glad it is.
- Revise your blog posts from time to time.
- Endurance and self-motivation.
- Take ownership of your life and your research.
- Manage yourself as you were a superstar.
- Act thoughtfully.
- Act intelligently.
- Act as a leader.
Friday, 8 July 2016
San Francisco from another perspective
If you are going to San Francisco, take some smile with you. This city just requires you to admire the beautiful and sunny days. This vibrant place let you experience an amazing mixture of tastes from posh Financial District to sad places brim with homeless people. You can do a traditional city-oriented sight-seeing or go to special places, such as, California Academy of Sciences or the Young Museum in the Golden Gate Park. The crucial point is this, it's all about people. Ask them what the best place to visit is and you'll get a basket of tips and tricks :)
![]() |
| Transamerica Pyramid - tall, landmark building shaped like a narrow pyramid (view from Hyatt Regency in the Financial District). |
![]() |
| The Sun penetrating the Financial District. |
![]() |
| Railways of the cable car and steep hill in the background. |
![]() |
| Manually operated cable car (the icon of the city and the last such relic in the world). |
![]() |
| This is not the Golden Gate bridge but the San Francisco - Oakland Bay bridge. It also looks marvelous. |
![]() |
| A homeless person at one of the Bart stations. |
![]() |
| Gorgeous butterfly in the Golden Gate Park (California Academy of Sciences). |
Labels:
San Francisco California
Location:
San Francisco, CA, USA
Check your paper for IEEE compliance through the IEEE PDF eXpress site
I found that the easiest way to make your pdf compliant with the IEEE requirements is to just print your pdf to another pdf! This works like a charm. I had a few problems, which are enumerated in the table below. I tried removing the urls, I even tried these hacks: http://mohamednabeel.blogspot.com/2009/10/fixing-font-not-embedded-issue-to-pass.html. However, the only thing that you have to do is to grab the document generated by latex, go to File->Print...->Print to file (choose another location/name) and voila, it works! :)
|
If
the report says: |
Possible
cause(s) |
Solution |
|
|---|---|---|---|
|
(1) |
Bookmarks found in document |
(1)
User inserted bookmarks into the PDF. |
Click |
|
(2) |
Document
contains security |
(2a)
User applied security to some or all elements of the
PDF |
Click |
|
(2b)
If source is Microsoft Word— PDFMaker is
set to apply security to all PDFs |
Click |
||
|
(3) |
Font
### is not embedded |
(3a)
The font file does not exist on the system that created
the PDF |
Click |
|
(3b)
The font is not being found by Distiller |
Click |
||
|
(3c)
The font is not embeddable |
Click |
||
|
(3d)
Using Office 2003 or 2007 |
Click |
||
|
(4) |
Font
### is not subsetted |
(4a)
PDF conversion options are not set correctly |
Click |
|
(4b)
Headers/footers were added using Acrobat 6 function
(or other application) |
Click |
||
|
(4c)
Using Office 2003 or 2007 |
Click |
||
|
(5) |
Document contains link annotations |
(5)
User has applied a link to text in the document. |
Click |
|
(6) |
Document contains form fields
|
(6)
User has used form fields in the document. |
Click |
Location:
United States
Thursday, 7 April 2016
Thought of the day
"If you want to build a ship, don’t drum up the men
to gather wood, divide the work, and give orders. Instead, teach them
to yearn for the vast and endless sea." Antoine de Saint-Exupéry
Friday, 15 January 2016
Another RUBY lesson
adam@gaia:~$ ruby hello.rb
hello.rb:2:in `<main>': undefined method `wait' for Thread:Class (NoMethodError)
adam@gaia:~$ ruby hello.rb
In another thread
adam@gaia:~$ ruby hello.rb
In thread 0In thread 5In thread 1In thread 9
In thread 4In thread 2In thread 8In thread 3
In thread 7In thread 6
adam@gaia:~$ ruby hello.rb
In thread 0
In thread 3
In thread 4
In thread 6
In thread 1
In thread 2
In thread 9
In thread 5
In thread 7
In thread 8
adam@gaia:~$ irb -r ./hello.rb
irb(main):001:0> pt_1
NameError: undefined local variable or method `pt_1' for main:Object
from (irb):1
from /usr/bin/irb:12:in `<main>'
irb(main):002:0> load('hello.rb')
=> true
irb(main):003:0> pt_1
NameError: undefined local variable or method `pt_1' for main:Object
from (irb):3
from /usr/bin/irb:12:in `<main>'
irb(main):004:0> class Point
irb(main):005:1> attr_accessor :x, :y
irb(main):006:1> end
=> nil
irb(main):007:0>
irb(main):008:0* class Line
irb(main):009:1> attr_accessor :pt_1, :pt_2
irb(main):010:1> end
=> nil
irb(main):011:0>
irb(main):012:0* pt_1 = Point.new
=> #<Point:0x000000014ea100>
irb(main):013:0> pt_1.x = 10
=> 10
irb(main):014:0> pt_1.y = 20
=> 20
irb(main):015:0>
irb(main):016:0* pt_2 = Point.new
=> #<Point:0x000000014a38e0>
irb(main):017:0> pt_2 = 50
=> 50
irb(main):018:0> pt_2 = 100
=> 100
irb(main):019:0>
irb(main):020:0* line = Line.new
=> #<Line:0x00000001496550>
irb(main):021:0> line.pt_1 = pt_1
=> #<Point:0x000000014ea100 @x=10, @y=20>
irb(main):022:0> line.pt_2 = pt_2
=> 100
irb(main):023:0> pt_1
=> #<Point:0x000000014ea100 @x=10, @y=20>
irb(main):024:0> line
=> #<Line:0x00000001496550 @pt_1=#<Point:0x000000014ea100 @x=10, @y=20>, @pt_2=100>
irb(main):025:0> line.pt_1
=> #<Point:0x000000014ea100 @x=10, @y=20>
irb(main):026:0> line.pt_1.x
=> 10
irb(main):027:0> line.pt_1.y
=> 20
irb(main):028:0> line.pt_2.c
NoMethodError: undefined method `c' for 100:Fixnum
from (irb):28
from /usr/bin/irb:12:in `<main>'
irb(main):029:0> line.pt_2.x
NoMethodError: undefined method `x' for 100:Fixnum
from (irb):29
from /usr/bin/irb:12:in `<main>'
irb(main):030:0> line.pt_1.y
=> 20
irb(main):031:0> class Point
irb(main):032:1> attr_accessor :x
irb(main):033:1>
irb(main):034:1* def y
irb(main):035:2> x + 10
irb(main):036:2> end
irb(main):037:1> end
=> nil
irb(main):038:0>
irb(main):039:0* class Line
irb(main):040:1> attr_accessor :pt_1, :pt_2
irb(main):041:1> end
=> nil
irb(main):042:0>
irb(main):043:0* pt_1 = Point.new
=> #<Point:0x0000000123e000>
irb(main):044:0> pt_1.x = 10
=> 10
irb(main):045:0> pt_1.y = 20
=> 20
irb(main):046:0>
irb(main):047:0* pt_2 = Point.new
=> #<Point:0x0000000122cee0>
irb(main):048:0> pt_2 = 50
=> 50
irb(main):049:0> pt_2 = 100
=> 100
irb(main):050:0>
irb(main):051:0* line = Line.new
=> #<Line:0x000000017189e0>
irb(main):052:0> line.pt_1 = pt_1
=> #<Point:0x0000000123e000 @x=10, @y=20>
irb(main):053:0> line.pt_2 = pt_2
=> 100
irb(main):054:0> line.pt_1.y
=> 20
irb(main):055:0>
adam@gaia:~$ irb -r ./hello.rb
irb(main):001:0> Point.new.x
ArgumentError: wrong number of arguments (0 for 2)
from /home/adam/hello.rb:2:in `initialize'
from (irb):1:in `new'
from (irb):1
from /usr/bin/irb:12:in `<main>'
irb(main):002:0> Point.new(10, 20).x
=> 10
irb(main):003:0> Point.new(10, 20).y
=> 20
irb(main):004:0> Point.new(10, 20).adam
Called adam but I only respond to [:method_missing, :x, :x=, :y, :y=]
=> nil
irb(main):005:0> load('hello.rb')
=> true
irb(main):006:0> Point.new(10, 20).x
=> 10
irb(main):007:0> Point.new(10, 20).y
=> 20
irb(main):008:0> Point.new(10, 20).adam
Called adam but I only respond to [:!, :!=, :!~, :<=>, :==, :===, :=~, :__id__, :__send__, :class, :clone, :define_singleton_method, :display, :dup, :enum_for, :eql?, :equal?, :extend, :freeze, :frozen?, :hash, :initialize_clone, :initialize_dup, :inspect, :instance_eval, :instance_exec, :instance_of?, :instance_variable_defined?, :instance_variable_get, :instance_variable_set, :instance_variables, :is_a?, :kind_of?, :method, :method_missing, :methods, :nil?, :object_id, :private_methods, :protected_methods, :public_method, :public_methods, :public_send, :respond_to?, :respond_to_missing?, :send, :singleton_class, :singleton_methods, :taint, :tainted?, :tap, :to_enum, :to_s, :trust, :untaint, :untrust, :untrusted?, :x, :x=, :y, :y=]
=> nil
irb(main):009:0> str = "Adam 6\nBrian 10\nCarol 13\nBrian 14\nAdam 23\nCarol 14"
=> "Adam 6\nBrian 10\nCarol 13\nBrian 14\nAdam 23\nCarol 14"
irb(main):010:0> puts str
Adam 6
Brian 10
Carol 13
Brian 14
Adam 23
Carol 14
=> nil
irb(main):011:0> str.lines
=> #<Enumerator: "Adam 6\nBrian 10\nCarol 13\nBrian 14\nAdam 23\nCarol 14":lines>
irb(main):012:0> str.lines.to_a
=> ["Adam 6\n", "Brian 10\n", "Carol 13\n", "Brian 14\n", "Adam 23\n", "Carol 14"]
irb(main):013:0> str.lines.map { |line| line.split }
=> [["Adam", "6"], ["Brian", "10"], ["Carol", "13"], ["Brian", "14"], ["Adam", "23"], ["Carol", "14"]]
irb(main):014:0> str.lines.map { |line| line.split }.map { |name, score| [name, score.to_i] }
=> [["Adam", 6], ["Brian", 10], ["Carol", 13], ["Brian", 14], ["Adam", 23], ["Carol", 14]]
irb(main):015:0> str.lines.map { |line| line.split }.map { |name, score| [name, score.to_i] }.group_by { |name, score| name }
=> {"Adam"=>[["Adam", 6], ["Adam", 23]], "Brian"=>[["Brian", 10], ["Brian", 14]], "Carol"=>[["Carol", 13], ["Carol", 14]]}
irb(main):016:0> str.lines.map { |line| line.split }.map { |name, score| [name, score.to_i] }.group_by { |name, score| score }
=> {6=>[["Adam", 6]], 10=>[["Brian", 10]], 13=>[["Carol", 13]], 14=>[["Brian", 14], ["Carol", 14]], 23=>[["Adam", 23]]}
irb(main):017:0> str.lines.map { |line| line.split }.map { |name, score| [name, score.to_i] }.group_by { |name, score| name[0] }
=> {"A"=>[["Adam", 6], ["Adam", 23]], "B"=>[["Brian", 10], ["Brian", 14]], "C"=>[["Carol", 13], ["Carol", 14]]}
irb(main):018:0> str.lines.map { |line| line.split }.map { |name, score| [name, score.to_i] }.group_by { |name, score| name }
=> {"Adam"=>[["Adam", 6], ["Adam", 23]], "Brian"=>[["Brian", 10], ["Brian", 14]], "Carol"=>[["Carol", 13], ["Carol", 14]]}
irb(main):019:0> str.lines.map { |line| line.split }.map { |name, score| [name, score.to_i] }.group_by { |name, score| name }.map { |name, name_and_scores| name_and_scores }
=> [[["Adam", 6], ["Adam", 23]], [["Brian", 10], ["Brian", 14]], [["Carol", 13], ["Carol", 14]]]
irb(main):020:0> str.lines.map { |line| line.split }.map { |name, score| [name, score.to_i] }.group_by { |name, score| name }.map { |name, name_and_scores| name_and_scores.map(&:last) }
=> [[6, 23], [10, 14], [13, 14]]
irb(main):021:0> str.lines.map(&:split).map { |name, score| [name, score.to_i] }.group_by(&:first).map { |name, name_and_scores| name_and_scores.map(&:last) }
=> [[6, 23], [10, 14], [13, 14]]
irb(main):022:0> str.lines.map(&:split).map { |name, score| [name, score.to_i] }.group_by(&:first).map { |name, name_and_scores| name_and_scores.map(&:last).reduce(:+) }
=> [29, 24, 27]
irb(main):023:0> str.lines.map(&:split).map { |name, score| [name, score.to_i] }.group_by(&:first).map { |name, name_and_scores| [name_and_scores.map(&:last).reduce(:+)] }
=> [[29], [24], [27]]
irb(main):024:0> str.lines.map(&:split).map { |name, score| [name, score.to_i] }.group_by(&:first).map { |name, name_and_scores| [name, name_and_scores.map(&:last).reduce(:+)] }
=> [["Adam", 29], ["Brian", 24], ["Carol", 27]]
irb(main):025:0> str.lines.map(&:split).map { |name, score| [name, score.to_i] }.group_by(&:first).map { |name, name_and_scores| [name, name_and_scores.map(&:last).reduce(:+)] }.to_h
NoMethodError: undefined method `to_h' for [["Adam", 29], ["Brian", 24], ["Carol", 27]]:Array
from (irb):25
from /usr/bin/irb:12:in `<main>'
irb(main):026:0> str.lines.map(&:split).map { |name, score| [name, score.to_i] }.group_by(&:first).map { |name, name_and_scores| [name, name_and_scores.map(&:last).reduce(:+)] }.to_hash
NoMethodError: undefined method `to_hash' for [["Adam", 29], ["Brian", 24], ["Carol", 27]]:Array
from (irb):26
from /usr/bin/irb:12:in `<main>'
irb(main):027:0> RUBY_VERSION
=> "1.9.3"
irb(main):028:0> Hash[str.lines.map(&:split).map { |name, score| [name, score.to_i] }.group_by(&:first).map { |name, name_and_scores| [name, name_and_scores.map(&:last).reduce(:+)] }]
=> {"Adam"=>29, "Brian"=>24, "Carol"=>27}
irb(main):029:0> str
=> "Adam 6\nBrian 10\nCarol 13\nBrian 14\nAdam 23\nCarol 14"
irb(main):030:0> str
=> "Adam 6\nBrian 10\nCarol 13\nBrian 14\nAdam 23\nCarol 14"
irb(main):031:0> Hash[str.lines.map(&:split).map { |name, score| [name, score.to_i] }.group_by(&:first).map { |name, name_and_scores| [name, name_and_scores.map(&:last).reduce(:+)] }]
=> {"Adam"=>29, "Brian"=>24, "Carol"=>27}
irb(main):032:0> Hash[str.lines.map(&:split).map { |name, score| [name, score.to_i] }.group_by(&:first).map { |name, name_and_scores| [name, name_and_scores.map(&:last).reduce(:+)] }].max_by(&:last)
\=> ["Adam", 29]
irb(main):033:0> Hash[str.lines.map(&:split).map { |name, score| [name, score.to_i] }.group_by(&:first).map { |name, name_and_scores| [name, name_and_scores.map(&:last).reduce(:+)] }.sort_by(&:last)]
=> {"Brian"=>24, "Carol"=>27, "Adam"=>29}
irb(main):034:0> Hash[str.lines.map(&:split).map { |name, score| [name, score.to_i] }.group_by(&:first).map { |name, name_and_scores| [name, name_and_scores.map(&:last).reduce(:+)] }.sort_by(&:last).reverse]
=> {"Adam"=>29, "Carol"=>27, "Brian"=>24}
irb(main):035:0> Hash[str.lines.map(&:split).map { |name, score| [name, score.to_i] }.group_by(&:first).map { |name, name_and_scores| [name, name_and_scores.map(&:last).reduce(:+)] }.sort_by(&:last).reverse.lazy]
NoMethodError: undefined method `lazy' for [["Adam", 29], ["Carol", 27], ["Brian", 24]]:Array
from (irb):35
from /usr/bin/irb:12:in `<main>'
irb(main):036:0> Hash[str.lines.map(&:split).map { |name, score| [name, score.to_i] }.group_by(&:first).map { |name, name_and_scores| [name, name_and_scores.map(&:last).reduce(:+)] }.sort_by(&:last).reverse]
=> {"Adam"=>29, "Carol"=>27, "Brian"=>24}
irb(main):037:0>
hello.rb:2:in `<main>': undefined method `wait' for Thread:Class (NoMethodError)
adam@gaia:~$ ruby hello.rb
In another thread
adam@gaia:~$ ruby hello.rb
In thread 0In thread 5In thread 1In thread 9
In thread 4In thread 2In thread 8In thread 3
In thread 7In thread 6
adam@gaia:~$ ruby hello.rb
In thread 0
In thread 3
In thread 4
In thread 6
In thread 1
In thread 2
In thread 9
In thread 5
In thread 7
In thread 8
adam@gaia:~$ irb -r ./hello.rb
irb(main):001:0> pt_1
NameError: undefined local variable or method `pt_1' for main:Object
from (irb):1
from /usr/bin/irb:12:in `<main>'
irb(main):002:0> load('hello.rb')
=> true
irb(main):003:0> pt_1
NameError: undefined local variable or method `pt_1' for main:Object
from (irb):3
from /usr/bin/irb:12:in `<main>'
irb(main):004:0> class Point
irb(main):005:1> attr_accessor :x, :y
irb(main):006:1> end
=> nil
irb(main):007:0>
irb(main):008:0* class Line
irb(main):009:1> attr_accessor :pt_1, :pt_2
irb(main):010:1> end
=> nil
irb(main):011:0>
irb(main):012:0* pt_1 = Point.new
=> #<Point:0x000000014ea100>
irb(main):013:0> pt_1.x = 10
=> 10
irb(main):014:0> pt_1.y = 20
=> 20
irb(main):015:0>
irb(main):016:0* pt_2 = Point.new
=> #<Point:0x000000014a38e0>
irb(main):017:0> pt_2 = 50
=> 50
irb(main):018:0> pt_2 = 100
=> 100
irb(main):019:0>
irb(main):020:0* line = Line.new
=> #<Line:0x00000001496550>
irb(main):021:0> line.pt_1 = pt_1
=> #<Point:0x000000014ea100 @x=10, @y=20>
irb(main):022:0> line.pt_2 = pt_2
=> 100
irb(main):023:0> pt_1
=> #<Point:0x000000014ea100 @x=10, @y=20>
irb(main):024:0> line
=> #<Line:0x00000001496550 @pt_1=#<Point:0x000000014ea100 @x=10, @y=20>, @pt_2=100>
irb(main):025:0> line.pt_1
=> #<Point:0x000000014ea100 @x=10, @y=20>
irb(main):026:0> line.pt_1.x
=> 10
irb(main):027:0> line.pt_1.y
=> 20
irb(main):028:0> line.pt_2.c
NoMethodError: undefined method `c' for 100:Fixnum
from (irb):28
from /usr/bin/irb:12:in `<main>'
irb(main):029:0> line.pt_2.x
NoMethodError: undefined method `x' for 100:Fixnum
from (irb):29
from /usr/bin/irb:12:in `<main>'
irb(main):030:0> line.pt_1.y
=> 20
irb(main):031:0> class Point
irb(main):032:1> attr_accessor :x
irb(main):033:1>
irb(main):034:1* def y
irb(main):035:2> x + 10
irb(main):036:2> end
irb(main):037:1> end
=> nil
irb(main):038:0>
irb(main):039:0* class Line
irb(main):040:1> attr_accessor :pt_1, :pt_2
irb(main):041:1> end
=> nil
irb(main):042:0>
irb(main):043:0* pt_1 = Point.new
=> #<Point:0x0000000123e000>
irb(main):044:0> pt_1.x = 10
=> 10
irb(main):045:0> pt_1.y = 20
=> 20
irb(main):046:0>
irb(main):047:0* pt_2 = Point.new
=> #<Point:0x0000000122cee0>
irb(main):048:0> pt_2 = 50
=> 50
irb(main):049:0> pt_2 = 100
=> 100
irb(main):050:0>
irb(main):051:0* line = Line.new
=> #<Line:0x000000017189e0>
irb(main):052:0> line.pt_1 = pt_1
=> #<Point:0x0000000123e000 @x=10, @y=20>
irb(main):053:0> line.pt_2 = pt_2
=> 100
irb(main):054:0> line.pt_1.y
=> 20
irb(main):055:0>
adam@gaia:~$ irb -r ./hello.rb
irb(main):001:0> Point.new.x
ArgumentError: wrong number of arguments (0 for 2)
from /home/adam/hello.rb:2:in `initialize'
from (irb):1:in `new'
from (irb):1
from /usr/bin/irb:12:in `<main>'
irb(main):002:0> Point.new(10, 20).x
=> 10
irb(main):003:0> Point.new(10, 20).y
=> 20
irb(main):004:0> Point.new(10, 20).adam
Called adam but I only respond to [:method_missing, :x, :x=, :y, :y=]
=> nil
irb(main):005:0> load('hello.rb')
=> true
irb(main):006:0> Point.new(10, 20).x
=> 10
irb(main):007:0> Point.new(10, 20).y
=> 20
irb(main):008:0> Point.new(10, 20).adam
Called adam but I only respond to [:!, :!=, :!~, :<=>, :==, :===, :=~, :__id__, :__send__, :class, :clone, :define_singleton_method, :display, :dup, :enum_for, :eql?, :equal?, :extend, :freeze, :frozen?, :hash, :initialize_clone, :initialize_dup, :inspect, :instance_eval, :instance_exec, :instance_of?, :instance_variable_defined?, :instance_variable_get, :instance_variable_set, :instance_variables, :is_a?, :kind_of?, :method, :method_missing, :methods, :nil?, :object_id, :private_methods, :protected_methods, :public_method, :public_methods, :public_send, :respond_to?, :respond_to_missing?, :send, :singleton_class, :singleton_methods, :taint, :tainted?, :tap, :to_enum, :to_s, :trust, :untaint, :untrust, :untrusted?, :x, :x=, :y, :y=]
=> nil
irb(main):009:0> str = "Adam 6\nBrian 10\nCarol 13\nBrian 14\nAdam 23\nCarol 14"
=> "Adam 6\nBrian 10\nCarol 13\nBrian 14\nAdam 23\nCarol 14"
irb(main):010:0> puts str
Adam 6
Brian 10
Carol 13
Brian 14
Adam 23
Carol 14
=> nil
irb(main):011:0> str.lines
=> #<Enumerator: "Adam 6\nBrian 10\nCarol 13\nBrian 14\nAdam 23\nCarol 14":lines>
irb(main):012:0> str.lines.to_a
=> ["Adam 6\n", "Brian 10\n", "Carol 13\n", "Brian 14\n", "Adam 23\n", "Carol 14"]
irb(main):013:0> str.lines.map { |line| line.split }
=> [["Adam", "6"], ["Brian", "10"], ["Carol", "13"], ["Brian", "14"], ["Adam", "23"], ["Carol", "14"]]
irb(main):014:0> str.lines.map { |line| line.split }.map { |name, score| [name, score.to_i] }
=> [["Adam", 6], ["Brian", 10], ["Carol", 13], ["Brian", 14], ["Adam", 23], ["Carol", 14]]
irb(main):015:0> str.lines.map { |line| line.split }.map { |name, score| [name, score.to_i] }.group_by { |name, score| name }
=> {"Adam"=>[["Adam", 6], ["Adam", 23]], "Brian"=>[["Brian", 10], ["Brian", 14]], "Carol"=>[["Carol", 13], ["Carol", 14]]}
irb(main):016:0> str.lines.map { |line| line.split }.map { |name, score| [name, score.to_i] }.group_by { |name, score| score }
=> {6=>[["Adam", 6]], 10=>[["Brian", 10]], 13=>[["Carol", 13]], 14=>[["Brian", 14], ["Carol", 14]], 23=>[["Adam", 23]]}
irb(main):017:0> str.lines.map { |line| line.split }.map { |name, score| [name, score.to_i] }.group_by { |name, score| name[0] }
=> {"A"=>[["Adam", 6], ["Adam", 23]], "B"=>[["Brian", 10], ["Brian", 14]], "C"=>[["Carol", 13], ["Carol", 14]]}
irb(main):018:0> str.lines.map { |line| line.split }.map { |name, score| [name, score.to_i] }.group_by { |name, score| name }
=> {"Adam"=>[["Adam", 6], ["Adam", 23]], "Brian"=>[["Brian", 10], ["Brian", 14]], "Carol"=>[["Carol", 13], ["Carol", 14]]}
irb(main):019:0> str.lines.map { |line| line.split }.map { |name, score| [name, score.to_i] }.group_by { |name, score| name }.map { |name, name_and_scores| name_and_scores }
=> [[["Adam", 6], ["Adam", 23]], [["Brian", 10], ["Brian", 14]], [["Carol", 13], ["Carol", 14]]]
irb(main):020:0> str.lines.map { |line| line.split }.map { |name, score| [name, score.to_i] }.group_by { |name, score| name }.map { |name, name_and_scores| name_and_scores.map(&:last) }
=> [[6, 23], [10, 14], [13, 14]]
irb(main):021:0> str.lines.map(&:split).map { |name, score| [name, score.to_i] }.group_by(&:first).map { |name, name_and_scores| name_and_scores.map(&:last) }
=> [[6, 23], [10, 14], [13, 14]]
irb(main):022:0> str.lines.map(&:split).map { |name, score| [name, score.to_i] }.group_by(&:first).map { |name, name_and_scores| name_and_scores.map(&:last).reduce(:+) }
=> [29, 24, 27]
irb(main):023:0> str.lines.map(&:split).map { |name, score| [name, score.to_i] }.group_by(&:first).map { |name, name_and_scores| [name_and_scores.map(&:last).reduce(:+)] }
=> [[29], [24], [27]]
irb(main):024:0> str.lines.map(&:split).map { |name, score| [name, score.to_i] }.group_by(&:first).map { |name, name_and_scores| [name, name_and_scores.map(&:last).reduce(:+)] }
=> [["Adam", 29], ["Brian", 24], ["Carol", 27]]
irb(main):025:0> str.lines.map(&:split).map { |name, score| [name, score.to_i] }.group_by(&:first).map { |name, name_and_scores| [name, name_and_scores.map(&:last).reduce(:+)] }.to_h
NoMethodError: undefined method `to_h' for [["Adam", 29], ["Brian", 24], ["Carol", 27]]:Array
from (irb):25
from /usr/bin/irb:12:in `<main>'
irb(main):026:0> str.lines.map(&:split).map { |name, score| [name, score.to_i] }.group_by(&:first).map { |name, name_and_scores| [name, name_and_scores.map(&:last).reduce(:+)] }.to_hash
NoMethodError: undefined method `to_hash' for [["Adam", 29], ["Brian", 24], ["Carol", 27]]:Array
from (irb):26
from /usr/bin/irb:12:in `<main>'
irb(main):027:0> RUBY_VERSION
=> "1.9.3"
irb(main):028:0> Hash[str.lines.map(&:split).map { |name, score| [name, score.to_i] }.group_by(&:first).map { |name, name_and_scores| [name, name_and_scores.map(&:last).reduce(:+)] }]
=> {"Adam"=>29, "Brian"=>24, "Carol"=>27}
irb(main):029:0> str
=> "Adam 6\nBrian 10\nCarol 13\nBrian 14\nAdam 23\nCarol 14"
irb(main):030:0> str
=> "Adam 6\nBrian 10\nCarol 13\nBrian 14\nAdam 23\nCarol 14"
irb(main):031:0> Hash[str.lines.map(&:split).map { |name, score| [name, score.to_i] }.group_by(&:first).map { |name, name_and_scores| [name, name_and_scores.map(&:last).reduce(:+)] }]
=> {"Adam"=>29, "Brian"=>24, "Carol"=>27}
irb(main):032:0> Hash[str.lines.map(&:split).map { |name, score| [name, score.to_i] }.group_by(&:first).map { |name, name_and_scores| [name, name_and_scores.map(&:last).reduce(:+)] }].max_by(&:last)
\=> ["Adam", 29]
irb(main):033:0> Hash[str.lines.map(&:split).map { |name, score| [name, score.to_i] }.group_by(&:first).map { |name, name_and_scores| [name, name_and_scores.map(&:last).reduce(:+)] }.sort_by(&:last)]
=> {"Brian"=>24, "Carol"=>27, "Adam"=>29}
irb(main):034:0> Hash[str.lines.map(&:split).map { |name, score| [name, score.to_i] }.group_by(&:first).map { |name, name_and_scores| [name, name_and_scores.map(&:last).reduce(:+)] }.sort_by(&:last).reverse]
=> {"Adam"=>29, "Carol"=>27, "Brian"=>24}
irb(main):035:0> Hash[str.lines.map(&:split).map { |name, score| [name, score.to_i] }.group_by(&:first).map { |name, name_and_scores| [name, name_and_scores.map(&:last).reduce(:+)] }.sort_by(&:last).reverse.lazy]
NoMethodError: undefined method `lazy' for [["Adam", 29], ["Carol", 27], ["Brian", 24]]:Array
from (irb):35
from /usr/bin/irb:12:in `<main>'
irb(main):036:0> Hash[str.lines.map(&:split).map { |name, score| [name, score.to_i] }.group_by(&:first).map { |name, name_and_scores| [name, name_and_scores.map(&:last).reduce(:+)] }.sort_by(&:last).reverse]
=> {"Adam"=>29, "Carol"=>27, "Brian"=>24}
irb(main):037:0>
Wednesday, 18 November 2015
RAID
I always forget what each RAID looks like. Here, I don't want to repeat the standard information but give some comparison and consequences of using each RAID. RAID 2 and 3 are not used any more, I suppose that the same holds for RAID 4. RAID 5 is a suitable solution for databases.
The main difference between RAID 4 and RAID 5 is that in RAID 4 you can have many reads at a time (if you don't check the parity for every read), but you cannot have many writes at a time because each write have to update the parity disk. The RAID 5 supports both many reads and many writes at the same time (providing the writes do not want to update the parity on the same disk). All the reads and writes for RAID 2 and RAID 3 are sequential (only one at a time) because all disks are involved in a single I/O.
You can use RAID 0 but once one of your disks fails, then you loose some data and it's difficult to recover.
The RAID can have a spare disk (not used for a time being) that can replace a disk which failed automatically, which means that we don't have to wait for a technician to replace the failed disk manually. It can speed up the recovery time. The only drawback of RAID is its price, RAID 5 for a dozen of disks costs about $6000 which is still a high price.
Many big companies have the same philosophy as RAID. In RAID we use many commodity disks to provide fast and reliable storage, which is still keenly priced when compared to one huge disk (even taking into account the RAID price). The huge IT companies use many commodity machines instead of beefy servers.
The main difference between RAID 4 and RAID 5 is that in RAID 4 you can have many reads at a time (if you don't check the parity for every read), but you cannot have many writes at a time because each write have to update the parity disk. The RAID 5 supports both many reads and many writes at the same time (providing the writes do not want to update the parity on the same disk). All the reads and writes for RAID 2 and RAID 3 are sequential (only one at a time) because all disks are involved in a single I/O.
You can use RAID 0 but once one of your disks fails, then you loose some data and it's difficult to recover.
The RAID can have a spare disk (not used for a time being) that can replace a disk which failed automatically, which means that we don't have to wait for a technician to replace the failed disk manually. It can speed up the recovery time. The only drawback of RAID is its price, RAID 5 for a dozen of disks costs about $6000 which is still a high price.
Many big companies have the same philosophy as RAID. In RAID we use many commodity disks to provide fast and reliable storage, which is still keenly priced when compared to one huge disk (even taking into account the RAID price). The huge IT companies use many commodity machines instead of beefy servers.
Labels:
RAID databases storage
Location:
Chicago, IL, USA
Subscribe to:
Posts (Atom)









