2010-05-31

Another Demo movie of "Muroto for iPad"

Hi, it is NISHIO Hirokazu. I posted Hacker's Cafe Blog: MUROTO: tangible figure as a controller for iPad apps, however it said difficult to see that Muroto can get the information of position and direction. So I made another demo program and movie again!

In the movie, it is more clear:

2010-05-27

FIX: ImportError: cannot import name ImmutableList

Hi, it is NISHIO Hirokazu. I'm moving my Django app into Google App Engine with Django-nonrel. I encountered the error and it took a lot of time from me. Google search didn't know anything about the problem.

The version of Django in Google App Engine is 1.0. Thus that of Django-nonrel(djangoappengine) is 1.2. It is the root of the problem.

Of cource, some code to avoid such a versioning problem was wrote in Django-nonrel. See djangoappengine/main/main.py


parent_dir = os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
f parent_dir not in sys.path:
sys.path.insert(0, parent_dir)

# Remove the standard version of Django
if 'django' in sys.modules and sys.modules['django'].VERSION < (1, 2):
for k in [k for k in sys.modules
if k.startswith('django\.') or k == 'django']:
del sys.modules[k]


If sys.path doesn't have the path to Django in Django-nonrel, it add the path. If already old Django was imported, it remove that. But unfortunately, in my case, sys.path has the path, and the path to Django in Google App Engine preceded, but it's not imported yet.

It's mystery. I can't tell why it happened. But it actually happened.

I wrote a workaround for the problem. It bring the path to correct Django always on top.


parent_dir = os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
if parent_dir in sys.path:
sys.path.remove(parent_dir)
sys.path.insert(0, parent_dir)

FIX: DatabaseError: Non-nullable field id can't be None!

Hi, it is NISHIO Hirokazu. I'm moving my Django app into Google App Engine with Django-nonrel. I encountered the error and it took a lot of time from me. Google search didn't know anything about the problem.

Keep in mind: DON'T INHERIT DJANGO MODELS!

I want to add "oldid" field to keep relation information between models. Unfortunately "User" models are not mine, just be imported from django.auth, so I inherit it to add the field. It was the root of evil.

I hope it helps you :)

2010-05-26

MUROTO: tangible figure as a controller for iPad apps

Hi, it is NISHIO Hirokazu. I and KUCHII Jun made a system to control iPhone/iPad apps with tangible figure for "Make: Tokyo Meeting 05" on the last Sunday. We called it "MUROTO". Using MUROTO you can know the type of figure you put on iPhone, the direction and also position(not shown in movie)
So you can use tangible figures as a controller! We are making demo apps for iPad now. Don't miss it! See also: PONG-like game played on iPad with tangible controller

2010-05-22

home-less

Hi, this is takano32.

R0025618

Today's topic is "home-less", this is Japanese English and it means "Homelessness".

Ueno is one of the most famous home-less city in Japan.
And many other cities are having many home-less near by railway station.

The photo in this article is taken at Shibuya in Japan.
But Shibuya is famous by having many teenagers.

Here in Shibuya have many teenagers and also having many home-lesses.
It's very interesting Japanese city has many faces on each aspects.

2010-05-17

ruin(破滅) lounge @ Shibuya

Ruin Lounge is a new style of gallery.

I'm a Ruin Lounge member.
http://chaosxlounge.com/artist.html

There are many computers.

Geeks are making visual processing software every day,

So that the visual effects will become more and more cool.





2010-05-13

13 chars in [4,+,-,*,/] can make all number in range(60)

Hi, it is Dr. NISHIO Hirokazu. Today I wonder how much characters required to make fixed-width one-digit-only digital clock. Which digit is the most suitable?

When I allow to use bitwise calculation, 5 is the most suitable digit. It requires only 8 characters.

0 555/5555
1 ~~-5+-~5
2 -~-5+-~5
3 555&5*55
...

Surprisingly in the hardest restriction it requires only 13 characters.

  • no bitwise operation. allow only the 4 arithmetical operations.
  • no minus-minus connection. 4--4 = 4 - -4 is not allowed
  • negate operation should not be aside of the other operation. 4+-4, 4*-4, 4/-4 are also omitted
  • true division. 4 / 44 is not 0, it is 1 / 11.


Here is the result. I think 37 == 4444/44-4*4*4 is very cute!! I love it!


0 4444*4-4*4444
1 44-44+444/444
2 4/4+4444/4444
3 44/44+4/4+4/4
4 4-4/4+444/444
5 4-4-4+4+4+4/4
6 4-4/4+4-44/44
7 -4-44+44+44/4
8 4-4*44+44*4+4
9 4-4+4+4+44/44
10 444/4-4444/44
11 -4+4-4+4+44/4
12 4-4-4-4+4*4+4
13 4-4-4+4*4+4/4
14 4-4/44+444/44
15 4-4+4*4-44/44
16 -4-4-4-4*4+44
17 4*4+4444/4444
18 4+4*4-4/4-4/4
19 -44+4*4*4-4/4
20 4-4/4+4*4+4/4
21 4-4+4+4*4+4/4
22 4-4+44/4+44/4
23 4+4+4*4-44/44
24 4-44+44+4*4+4
25 -4-4*4+44+4/4
26 -4/4+4*4+44/4
27 -4+4*4+4+44/4
28 4*4-4-4+4*4+4
29 4-4-4-44/4+44
30 4+4+44/4+44/4
31 4*4+4*4-44/44
32 44-44/4-44/44
33 44/44+4*4+4*4
34 44+44/44-44/4
35 -44/44-4-4+44
36 -44-4-4+44+44
37 4444/44-4*4*4
38 4-44/4+44+4/4
39 -4-4+4-4/4+44
40 -4*4-4+4*4+44
41 -4+44+444/444
42 -4+44+4/4+4/4
43 -4+44+4-44/44
44 -4*44+44*4+44
45 -44+44+44+4/4
46 -4/4-4/4+4+44
47 -4-4/4+4+44+4
48 -4-4-4+4*4+44
49 -44/4-4+4*4*4
50 44-4-4/4+44/4
51 4+44+44/4-4-4
52 -44+4+44+44+4
53 44+4+4*4-44/4
54 44+44/4-44/44
55 44-44+44+44/4
56 4-4-4-4+4*4*4
57 4/4-4-4+4*4*4
58 4-4/4+44+44/4
59 44+4-4+4+44/4


see also The list of all numbers which can generate from nine 4s and arithmetics operations.