Hatena2010-03-23
code:hatena
<body>
*1269317264* Java-en Onsen 2 Summary
I went to Java-ja spa 2. This time, 1: I got the work done rather well and got the new service to closed beta. 2: I played a lot of Dominion. 3: I invented a new way to play my own game. So it's been pretty fulfilling.
Compiled before Twit is swept away.
** Before joining the 1st day
>
Dr. Guguru told me to take the Kodama, so I scurried around and asked the station attendant if I wanted to go to Atami, and he said it was the 11th line. Should I take the Rapid Acotee? Come to think of it, someone said something like that.
<<
>
@/takano32 will be found drowned and naked in the bathroom. All the rest have alibis! Drinking and going to hot springs is dangerous. RT @/hyoshiok: @/nishio Atami Murder Case. It's a masterpiece by @TsukaKohei.
<<
Read Drucker on rapid accotee.
>
I'm not sure what the difference is between an imaginative imitation strategy and a judo strategy. I guess a Judo strategy is like a large, top company that gets its feet paid off and falls down.
<<
>
Atami Now. The footbath is very crowded. →The footbath is lukewarm. I think it used to be too warm to stay in it for a long time, but maybe it cooled down because it is winter.
<<
>
Nau who met up with @/hirokinko. I wonder who else will be in the cab.
<<
By the way, I thought I heard that a cab was about 2,000 yen, but it was actually 1,000 yen.
** Day 1
>
Would it be easier to see #JavaJaSpa2 without hashtagging if I made a list of participants? I thought so, but it's a hassle! I wonder if anyone has made a batch registration script for the list or something. <<
In a case like a development camp where we stay together for a few days, I would like to list the Twit of everyone there.
>
A student next to me in the footbath said "Zushi no historijitsu" (Zuju no fumi...right?) and I had a hard time holding back my tsk tsk tsk. I had a hard time holding back my tsukkomi. Zuryu, Zuryu, Zuryu...
<<
>
<<
>
Now looking into how to do template inheritance in Jinja. But maybe I can do it like Django. → I'm working on it. Next time, I'll use page transitions to show if the answer is correct or not when the user selects an answer. I'll do it later.
<<
>
<<
>
noisy conversation
<<
>
Perhaps multitasking skills must be developed by performing tasks with a large amount of conversational interaction.
<<
>
Tokyo Disney Disaster RT @/igrep TDD - Tokyo Disney D... I wonder what it is.
<<
>
For now, when I press the correct answer button, I get a nice "Good! :)". Well, I'll do the design later.
<<
>
There's no end to how nice it is to meet you!" (Mr. Taichi)
<<
I think this stance is amazing. Everyone is a friend from the first meeting.
>
I was woken up saying I didn't know about the url_for tag, so I looked at the Jinja reference → haha, I wonder if url_for is not Jinja → I'm doing something like <a href="{{ url_for('auth/request_reset_password ') }}"> or something like that, so it shouldn't be unusable. I guess I need to write something in the SETTINGS.
<<
>
Nau making a screen to display the percentage of correct answers → I'm getting into unnecessary areas such as trying to make a bar chart → I wonder what the quickest way to make a 1x1 PNG would be.
<<
>
Gee, jinja's format has such an argument order. http://jinja.pocoo.org/2/documentation/templates#format → What do I do when I want to format x|y in jinja. format("...") Can't do |(x|y) → I misunderstood the syntax. ..." I can just use ||format(x|y) → No, I was too absorbed in making a bar chart. That is not the essence. <<
<img src="http://gyazo.com/ff1e0108f39e3e810a7cc5779875e86f.png" alt="Is this the tea you bought out?" 'y' "No, it's the one you ordered...I see...strictly distinguished. What I wanted to know was whether I could drink it... private tea or public tea... Oh, I should have asked 'is this public? I should have asked, 'Can I drink it?'" > >
RT @/inuro: I'm using date schema because it's annoying to have requests fly, but I wasn't sure I could make PNGs correctly by hand RT @/inuro: Would it be faster to write 1x1 transparent GIFs for dummies as data in base64? RT @/nishio: The quickest way to make 1x1 PNG is to use
<<
I realized later that this would be better to do expiration: 300d.
>
Individual pages for each problem have been created. For now, I'll put the link from the top page. I would like to have a link to "next problem" on the screen after solving a problem, considering user behavior. Oh, I see, there is published_on, so I can just take one item after that.
<<
>
There are two theories about the dinner at 1830 and 1930, but there is no sign of preparation yet, so I'm sure it will be 1930. I'm going to take a bath.
<<
** After dinner on Day 1
>
<<
>
<<
>
Yes, I've heard that AspectJ can do more than logging, but there is something called WhiteDog that gives you network synchronization. If you write "synchronize this", the synchronization code will be woven in. http://code.google.com/p/whitedog/ <<
>
I play a 9X9 board game with @/cactusman. I was white and komi was 6.5 → I lost by 2.5 → My 9X9 board game with @/cuctasman was 2-1. However, the two times I won, I was the first to catch and kill the cactusman's strike, so it is possible that we are both just not good at playing the latter.
<<
>
Let's see, Guest if there is no ID in the cookie, Create User if there is no ID when you answer the question, TempUser if there is an ID in the cookie but no name for the user connected to it, and TempUser if it makes you enter a password when you register your name and become a regular User. I think I got it right. → The more mistakes I make, the less likely I am to get the question right. Blessed. Now what's the next step? → Now that we have questions, answers, and totals, all we need to do is add more questions and create navigation between them.
<<
Users were first created for the purpose of tallying grades per user.
>
Doing weird things with CSS is a puzzle, and I find myself spending a lot of time on it. I should make an account registration screen instead of making bar graphs. It's a pain in the ass. → I've been working on the login form, checking if the password matches, hashing, etc., and then I realized that the framework already has auth. No good, I guess I'm tired.
<<
>
I got "Hi, nishio" correctly! In the end, I decided to throw away all the auth I had made in Oreo and use kay.auth. Whew. If you don't mind the design of the login screen, you can now log in, log out, autosignup, and signup for now. Now I just need to make the navigation between questions and put in about 50 questions and I'll be good to go.
<<
>
It's already 3 o'clock. Now that I've settled down, I'm going to take a bath.
<<
Of course, it means 27:00.
>
I was not happy with the fact that if I put the user's login information in the content page, it would be unnecessarily dynamic and the content part would not be cacheable, so I decided to use an iframe, but adjusting the size is a pain. So I decided to use an iframe because I didn't want to put user login information in a page that would be unnecessarily dynamic, and I didn't want the content part to be cached. Well, make the navigation first.
<<
>
Oh, I don't feel so good. Hungry? → Have I been writing code with my head for almost 8 hours since I ate dinner at 8:00? Did my blood sugar drop too low because I wrote without eating a snack? I feel nauseous.
<<
I didn't eat too many treats this time because I was worried about mouth ulcers and obesity.
>
I was kidnapped by a bad monster and had to play Race of the Galaxies.
<<
By the way, it is 28:00.
Race of the Galaxies is San Juan with complicated rules. Dominion also does.
** After breakfast on Day 2
(He's in the futon.)
** After lunch on Day 2
>
I ended up playing games until 8:00, eating breakfast, and then going to bed.
<<
>
I thought I could navigate, but it doesn't show up because there's only one question on WW. And no, the Japanese is wrong. He wrote something like, "It should have been done, so the question quiz is."
<<
I can code, but not Japanese. It seems that only my Japanese brain was still asleep.
>
PyString default encoding and shell encoding story now sys.stdout = codecs.getwriter('utf-8')(sys.stdout)
<<
>
Is there such a thing as Skype4py?
<<
Play until dinner. I don't remember what we did...
** After dinner on the 2nd day
>
My previous statement on Twitter was 5 hours ago, so that means I spent 5 hours playing games and eating dinner! I'm aiming to put in about 50 questions by the end of the day and sneak them out to the public via Skype!
<<
>
As for whether or not you can program in Python using only symbols, you can create an arbitrary list of numbers using only symbols for now, since ~([]! =[]) to create -1, so for now I can make a list of arbitrary numbers using only symbols. The problem is that I can't think of a way to turn it into a string or print it.
<<
|python|
~([]!=[])
||<
>
Use an extended for statement for an array of length 1 to eliminate assignments in Java (who gets it?)
<<
>
10/03/21 23:19:11 Nishio Yasukazu (nishio.hirokazu): http://a.*.com/ I was wondering if it would work at least. I'm still in closed beta only in this chat room. I'm not sure if the difficulty level of the problems is too high, since it is not adjusted yet. I forgot to do Analytics, I'll do it tomorrow.
When I press Older Question, it jumps to the oldest question. lol Oh, I get it, the OLDER is getting the one older than me, but I don't have ORDER attached, so it's taking the first one that's older than me.
<<
>
bulk upload bug and navigation bug removed
<<
Do Battle of the Spaghetti Monsters.
>
Battle of the Spaghetti Monsters has an island, and when the peasants are placed and the sorcerer goes around in order and performs the rituals of the land, the island can move. Reversal of currents, revolution. Blessings and curses. Life, death and drifting. The sinking of an island. Prayer and sacrifice. A game like that.
<<
Sleeps around 28:00.
** After breakfast on the 3rd day
On the last day, I was sleepy because I could not use my hands to sleep after breakfast. I only drank miso soup while dozing off. After taking a bath, I was rather awake.
After paying the bill and seeing everyone off, I ate udon alone at the Raiku Shrine at the bottom of the hill.
>
Sakuraebi Udon at Raikyu Shrine
<<
>
I bought a green seat because the train to Tokyo was not likely to seat me, but the next train was the first one to Atami.
<<
I'm going home to sleep. Thank you for your hard work.
*1269324128*How to specify output encoding when redirecting print results in Python
I asked @whosaysni because we were just talking about encoding at the Java-ja spa. when you try to output a unicode object with a print statement, it is converted to a byte string in the destination shell's encoding before being output.
||
tmp$ cat > tmp.py
print u'\u307b\u3052'
tmp$ python tmp.py
foobar-style name for a dummy variable
||<
However, when redirection is done on the shell side, unlike the shell, the encoding of the file cannot be easily obtained, so the user may think, "I don't know the encoding, so I don't know what to use. If the file is in ascii, I can submit it as it is.
||
tmp$ python tmp.py > tmp.txt
Traceback (most recent call last):
File "tmp.py", line 1, in <module>
print u'\u307b\u3052'
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128)
||<
And the solution, if we can assume that the encoding of the file to be redirected from that script and written out is utf-8:.
|python|
import sys, codecs
sys.stdout = codecs.getwriter('utf-8')(sys.stdout)
||<
That's OK, let's give it a try.
||
tmp$ cat > tmp.py
import sys, codecs
sys.stdout = codecs.getwriter('utf-8')(sys.stdout)
print u'\u307b\u3052'
tmp$ python tmp.py > tmp.txt
tmp$ cat tmp.txt
foobar-style name for a dummy variable
||<
I'm happy and satisfied. Also, @tokibito told me about a library called chardet that can determine the encoding. I will not use it in this case, but I will keep it in mind as I may need it.
</body>
---
This page is auto-translated from /nishio/Hatena2010-03-23. If you looks something interesting but the auto-translated English is not good enough to understand it, feel free to let me know at @nishio_en. I'm very happy to spread my thought to non-Japanese readers.