via App.net
We speak of three kinds of laziness. The first is simply to spend all your time eating and sleeping. The second is to tell yourself, “Someone like me will never manage to perfect themselves.” In the Buddhist context, such laziness makes you feel that it’s pointless even trying, you’ll never attain any spiritual realization. Discouragement makes you prefer not even to begin making any effort. And the third kind… is to waste your life on tasks of secondary importance, without ever getting down to what’s most essential. You spend all your time trying to resolve minor problems, one after another in an endless sequence, like ripples on the surface of a lake. You tell yourself that once you’ve finished this or that project you’ll start giving some meaning to your life.
Matthieu Ricard, in his book of conversations with his philosopher father, “The Monk and the Philosopher”
An excerpt from the post The Three Kinds of Laziness by Gary Tan.
Heart surgeon after 23-hour (successful) long heart transplantation. His assistant is sleeping in the corner
Life can be magnificent and overwhelming — that is the whole tragedy. Without beauty, love, or danger it would almost be easy to live.
THIS IS WATER - By David Foster Wallace
In 2005, author David Foster Wallace was asked to give the commencement address to the 2005 graduating class of Kenyon College. However, the resulting speech didn’t become widely known until 3 years later, after his tragic death. It is, without a doubt, some of the best life advice we’ve ever come across, and perhaps the most simple and elegant explanation of the real value of education.
We made this video, built around an abridged version of the original audio recording, with the hopes that the core message of the speech could reach a wider audience who might not have otherwise been interested.
Read the full speech here:
web.archive.org/web/20080213082423/http://www.marginalia.org/dfw_kenyon_commencement.html
-The Glossary
theglossary.com
Nem furcsa, hogy az élet csak a világegyetem mellékterméke az anyag oxidálódással szembeni küzdelmében? A nemesgázok kivételével minden anyag arra törekszik, hogy stabil lehessen, és ennek az egyik eredménye lett az ember… Szinte hihetetlen történet.
Aztán ez az átmenetileg stabil anyag alkotott magának teremtéselméletet, lett kultúrája, lett művészete: mindent elkövetett annak érdekében, hogy ne legyen múlandó. Az öregedés tulajdonképpen csak egy kromoszóma oxidálódásának a folyamata, egy molekula rövidül, és egyre gyatrább sejtek jönnek létre…
És ekkor kezd el a megmagyarázhatatlan tudat olyan gondolatokat fejtegetni, mint a lélekvándorlás vagy a halál utáni élet. A hit a túlvilágban vallássá terebélyesedik, de hogy a vallás ne őrület legyen, kell egy rend, kell egy vezető a túlvilágon is, és az ember megteremti az Istenképet.
Ez látszólag butaság, és mint a hit tagja, én is a buták csoportjába tartozom, mert sivár lenne úgy az anyagnak, ha tudná, hogy pár évtized után hamuvá lesz. Sok dolog van, amit az ember képtelen felfogni. Az egyik ilyen a helyünk és célunk a világmindenségben, a másik ilyen a világegyetem végtelensége. Hogy lehet valami végtelen? És ha végtelenül nagy, akkor nekem, az egyénnek mi keresnivalóm van itt, elvégre nélkülem is ugyanígy működne az egész? De van értelme egyáltalán az egésznek nélkülem?
Az anyag nem tud örökké stabil maradni, ezért biztosítja azt, hogy újra és újra stabil anyag jöjjön létre, így az élőlények megtanulták reprodukálni magukat. Az osztódás primitív módszere helyett a két egyedből létrejövő utód fejlődési lehetőséget rejtő változata győzedelmeskedett, így az eredmény, az utód jobb lesz, mint a két forrás. A tudat pedig megtanul engedelmeskedni annak, hogy az élete az öncélú jókedv helyett átértékelődik, és egy ponton már csak az utód számít. Így az anyag fennmarad a maga stabil állapotában, az elvesző élet helyett pedig új keletkezik újra és újra.
Az ember csak ritkán gondol bele a világegyetemnek ebbe a kegyetlen logikájába, és legtöbbször nem hiszi el, hogy ő is csak egyede a fajnak. Sokan cél nélkül vesznek ki a tömegből, a szerencsések hatással vannak sorstársaik életére, de az igazán nagy egyének jelentőségére csak haláluk után derül fény, amikor már nem élvezhetik a sikerüket és megbecsülésüket. Mindez persze a végtelen távlatában nem is fontos, de az embernek nevezett anyag érez, gondolkodik, szerelmes, udvarol, törődik és alkot. Mindeközben az anyagot éppen az pusztítja el, ami élteti: az oxigén.
The best way is always to stop when you are going good and when you know what will happen next. If you do that every day … you will never be stuck. Always stop while you are going good and don’t think about it or worry about it until you start to write the next day. That way your subconscious will work on it all the time. But if you think about it consciously or worry about it you will kill it and your brain will be tired before you start.
There is nothing to writing. All you do is sit down at a typewriter and bleed.
The secret of happiness, you see, is not found in seeking more, but in developing the capacity to enjoy less.
Vipassana ist ein Oberbegriff für ganz verschiedene Formen und Techniken der Erkenntnis-Meditation nach buddhistischer Tradition. “Vipassana” ist ein Wort aus der Pali-Sprache und bedeutet eigentlich “Einsicht”, das heisst Einsicht in die wahre Natur allen Daseins. Vipassana-Meditation und -Retreats beinhalten ein systematisches Training in der Achtsamkeit von Moment zu Moment sowie im Gewahrsein unserer gegenwärtigen Erfahrung. Mit Interesse, Ausdauer und Liebe wird ein direktes, kontinuierliches Erleben und Erforschen der Körperempfindungen und Gefühle, der Geisteszustände und Emotionen, der inneren Bilder und Gedanken sowie aller Sinneswahrnehmungen geübt. Ohne uns allzusehr um den Inhalt unserer Moment-Erfahrung zu kümmern, wird auf sehr direkte, intuitive Weise die wahre Natur unseres Körpers, Geistes und des ganzen Daseins erforscht. Erkenntnis und Freiheit, inneres Gleichgewicht, Wertschätzung und Liebe sind die Früchte solcher Übung.
Mooji: Relationships
“Many relationships fail because very often we have an idea of what we think is good for us.”
“When the focus on truth is there, everything else is satisfied automatically.”
As you walk and eat and travel, be where you are. Otherwise you will miss most of your life.
The best day of your life is the one on which you decide your life is your own. No apologies or excuses. No one to lean on, rely on, or blame. The gift is yours. It is an amazing journey, and you alone are responsible for the quality of it. This is the day your life really begins.
The most solid advice for a writer is this, I think: Try to learn to breathe deeply, really to taste food when you eat, and when you sleep really to sleep. Try as much as possible to be wholly alive with all your might, and when you laugh, laugh like hell. And when you get angry, get good and angry. Try to be alive. You will be dead soon enough.
As observing detail is clarity,
So maintaining flexibility is strength;
Use the light but shed no light,
So that you do yourself no harm,
But embrace clarity.
The Contrast Rebellion is an artsy, HTML5-errific site pleading
Don’t give your visitors a headache only because gray or any other low-contrast type looked better on the design comps than black.
Sites certainly can and do get too low-contrast to be readable at times (the site gives a few…
Vipassana ist ein Oberbegriff für ganz verschiedene Formen und Techniken der Erkenntnis-Meditation nach buddhistischer Tradition. “Vipassana” ist ein Wort aus der Pali-Sprache und bedeutet eigentlich “Einsicht”, das heisst Einsicht in die wahre Natur allen Daseins. Vipassana-Meditation und -Retreats beinhalten ein systematisches Training in der Achtsamkeit von Moment zu Moment sowie im Gewahrsein unserer gegenwärtigen Erfahrung. Mit Interesse, Ausdauer und Liebe wird ein direktes, kontinuierliches Erleben und Erforschen der Körperempfindungen und Gefühle, der Geisteszustände und Emotionen, der inneren Bilder und Gedanken sowie aller Sinneswahrnehmungen geübt. Ohne uns allzusehr um den Inhalt unserer Moment-Erfahrung zu kümmern, wird auf sehr direkte, intuitive Weise die wahre Natur unseres Körpers, Geistes und des ganzen Daseins erforscht. Erkenntnis und Freiheit, inneres Gleichgewicht, Wertschätzung und Liebe sind die Früchte solcher Übung.
Miközben megvan még bennem az őskíváncsiság, csökkennek az egyoldalúságaim, egyre nyitottabb, figyelmesebb, egyre szabadabb leszek.
The results of your actions have little to do with what you are actually doing and almost everything to do with your attitude.
Which is ironic because we spend most of our time creating lists and getting organized and listing resolutions about what we should be doing, forgetting that who we are being is much more important.
That’s why we’re called human beings. Not human doings.
Your life is full of things that you do.
Your business and family and community demand that you do certain things. Some things you are shamed into doing. Other things you do because it makes other people happy or it makes you feel fulfilled or you get paid to do them.
But doing can mask the hollowness of just going through the motions. Mindless repetition. Heartless action.
Which is why your attitude is so important.
If you believe that your best days are ahead of you, then you’ll find a creative solution to even the worst circumstance. If you believe that people aren’t intentionally trying to hurt you, then you’ll tend to give more second chances and receive them. If you believe that you are worth fighting for then you’ll find a way to keep going — no matter the effort required.
You can put on a happy face temporarily when you’re in front of the right people, but your attitude is what determines the decisions that no one else sees until it’s too late.
Your attitude is what ultimately determines if you achieve your goals or if you fall short. You can’t fake it. You can’t pretend like everything is okay. Your attitude colors the world around around you. It changes the sights and sounds. It makes you believe what you want to believe.
So if what you want to see and hear and feel is hate and fear and frustration then chances are you’ll find it all too easily. But if you want to find the brightest parts of the universe around you, then that is what you will find. Your attitude will lead you there.
You will be delighted in spite of troubling times and unfortunate circumstances. You’ll find hope and happiness while others mock and scorn.
It’s your attitude the determines if you make it or if you just ended up being a loser.
Be a better you.
Throughout life we are impacted with moments that are rich with meaning and significance. Regardless of the joy or sorrow that these moments create, it is our job to listen and respond. This summer I was given the gift of one of those profound moments.
On a warm August afternoon, my wife and I invited some close friends over for lunch to spend the day swimming in our pool. We were in the water playing with our kids, watching them one-up each other jumping in, and playing all the usual games.
One of the times my daughter climbed out to jump back in, she cried out in pain after stepping on a bee. As soon as I pulled out the stinger left behind in her foot, one by one more bees began to swarm. Thinking that the dead bee was attracting others, I picked it up and went inside to throw it away.
The moment I opened the trash in the kitchen I heard my wife scream outside. It wasn’t an ordinary scream. I look outside right at the moment she was diving into the water. Racing outside I was certain that she was being attacked by the aggressive bees.
I made it to the edge of the water right when she was coming up. My heart sank…
The Quick Brown Fox Jumps Over the Lazy Dog.I feel like I’ve been preparing for this image all my life.
The internet is over, everyone can go home
The internet is over, everyone can go home
THE INTERNET IS OVER, EVERYONE CAN GO HOME
A hétvégén megnéztem a Moonrise Kingdom című filmet. Micsoda csalódás volt! Pedig minden annyira jól néz ki: remek sztori, fantasztikus színészek, gyönyörű helyszín, csodaszép képek, kreatív látványvilág… Mégsem működik. Néha egész jó, de többnyire inkább csak ügyetlen, helyenként pedig egészen hamis. Nem elevenedik meg a történet, nem áll össze a sok fantasztikus darabka és kreatív ötlet. A színészek tehetsége nem tud kibontakozni, mert szerencsétleneket dróton rángatják, mint a bábúkat. Egy film azok közül, amelyek megnézése után az a keserű érzés tölt el, hogy bárcsak a könyvet olvastam volna inkább. Mintha a mesélő a saját elbeszélési módjával volna elfoglalva, ahelyett, hogy hagyná az életet szóhoz jutni.
Már évek óta az EPAM-nál dolgoztam, így kerültem ide, egy projektre. Annyira más az élethelyzetem, hogy tanácstalan vagyok, hogyan tudnék segíteni.
Nem vásárolok új iPhone-t, mert még mindig roppant elégedett vagyok az iPhone 4S készülékemmel. (A nejem cseréli le a 3GS-ét egy iPhone 5-re.)
Nincs rálátásom erre a “trendre”, hogy “régi iPhone-osok váltanak Androidra”. Az első iPhone 5, amelyet a kezembe fogtam, az éppen egy volt androidosé volt, aki most váltott. Ebben a témában érdemes talán elolvasni Farhad Manjoo cikkét az iPhone 5 bejelentése előtt: The iPhone Is Boring, illetve miután majdnem egy hónapig használta: The iPhone 5 Is a Miracle
Egyoldalú volna teljes egészében az Apple ördögi marketingsikerének tekinteni azt a gyerekes hozzáállást, ha valaki elvárja, hogy az elektronikai gyártó a termék minden egyes változatával “lenyűgözze”. Jobb lenne, ha mindenki azt a telefont venné, amit a maga számára legjobbnak talál, nem pedig a divatot vagy a hamis ábrándjait követné.
*
Nem konkrétan a kérdésre válaszolva még néhány dolog.
Én webes ember vagyok. Már csak ezért is örülök annak, ha mindenféle méretű és fajtájú készülékek léteznek, minél jobb böngészőkkel. És nincs panaszra okom, van bőven kínálat. Az kicsit aggaszt, hogy az androidos készüléket gyártók ennyire leszűkültek, és hogy a Windows Phone is ekkora bajban van, de drukkolok, hogy javuljon a helyzet, s ne csak egy-két nagy gyártó legyen.
Mint webes ember, tesztelnem kell mindenféle eszközön a webes alkalmazásaimat, ezért szép lassan igyekszem egy kisebb eszközparkot felépíteni. Egyelőre vannak iPhone-ok (eredeti, 3GS, 4S) és egy HTC Desire (Android 2.3.3), de már dolgozom rajta, hogy legyen egy BlackBerry, egy Windows Phone, meg egy 4.1-es androidos telefonom is, az androidos táblagépekről nem is beszélve (bár jelenleg túl drágának találom őket az olcsó iPad 2 mellett). Szerencsére vannak nyílt eszközparkok is (itt, Zürichben is), ahova el lehet menni, és végigtesztelni a munkád mindenfélével.
Szívem szerint ezeket a különféle telefonokat szeretném legalább egy hónapig elsődleges készülékként is használni, mert csak együtt lakva ismeri meg őket az ember igazán. (Sajnos a HTC Desire alkalmatlannak bizonyult erre az állandó memóriaproblémáival, egyszerűen elegem lett belőle.)
*
A saját androidos készülékem, meg a két közvetlen kollégám Galaxy S3 telefonjai révén nyugodtan mondhatom, hogy az Android egy jól működő, színes és izgalmas rendszer. És a széles kínálat miatt mindenki válaszhat kedvére valót. Nyilvánvaló, hogy nem ugyanakkora minden ember keze, és mindenkinek eltérő igényei lehetnek pl. a képernyőméretre.
Ami engem zavar az Androidban, az nem is annyira az akadozások, másodpercekre leállások, meg a szoftverfrissítések hiánya, meg hogy a memóriakezelés rám hárul, hanem az alkalmazások által elvárt, ijesztő mértékű hozzáférések. Én még csak-csak türelmesen végigolvasom, és felelősen döntök, de a szüleimnek vagy a gyerekeimnek nem mernék androidos készüléket venni. Sajnos nem valószínű, hogy a Google vagy a gyártók, mobilcégek fellépnének ez ellen, hiszen mindannyian jól járnak (legalábbis középtávon).
*
Ami engem illet, nem láttam még vonzóbb telefont az iPhone-nál. Nem valamilyen konkrét tulajdonsága miatt, inkább ahogy a sok apró részlet összeáll.
Élvezem egyrészt a fizikai kimunkáltságát. Ha már ez a legtöbbet velem lévő eszköz, akkor szeretném, hogy legyen jó minőségű anyagokból, legyen ellenálló és letisztult, elegáns megjelenésű. Mindig tok nélkül használtam az iPhone-jaimat, és jó érzés őket kézbe venni, használni, és jól is bírták a strapát. (Mindamellett, hogy az új iPhone előrelépés a strapabíróság terén, nekem még mindig hiányzik pl. a vízállóság.)
Ugyanez szoftveroldalon. Igényes és végiggondolt. Nem tökéletes ez sem, de szinte minden kis részletbre több odafigyelés jut, és a meglepetések inkább kellemesek, hogy “nahát, még erre is gondoltak”. És ami nekem fontos: több rálátásom és kontrollom van afelett, hogy az egyes alkalmazások mihez férnek hozzá.
Ezek apró dolgok a mindennapi használat során összeadódnak, és meghatározzák, hogy milyen élmény ezt a legtöbbet nálam lévő tárgyat használni. És ez valahol mélyen rezonál bennem, mert én is szeretnék ilyen minőségben alkotni, dolgozni.
Mivel nekem ezek a szempontjaim, és elegendő a képernyőmérete, nem láttam még telefont, amely jobban tetszett volna, mint az iPhone.
A probléma valós: van egy kollégám, aki vett iPadet, de nem használja ki az iPhone és a MacBook Air mellett.
Valószínűleg akkor érdemes iPadet venni, ha sokszor olvasnál/néznél/csinálnál olyat, amihez a telefonénál nagyobb képernyő volna jó, a laptopénál pedig nagyobb szabadság.
Please watch this short film. It’s a beautiful reminder that digital isn’t permanent.
Papírformában olvasok egy könyvet, mert nem kapható elektronikusan.
Ami tetszik:
Ami nem tetszik:
Mindent összevetve sokkal szívesebben használnám az elektronikus változatot.
Együtt tudok érezni veled ezzel a zsibbadással kapcsolatban. Amikor tavaly “elszállt” a derekam, és az orvos megmutatta a képernyőn a röntgenképet, akkor három dolgot javasolt nekem:
Egy jó szék biztos, hogy javít a helyzeten, de ahogy te is írod, önmagában kevés, hiába optimális rajta a tartásod, nem ellensúlyozza az egészségtelen egész napos ülést, még akkor sem, ha mindennap komoly edzést végez az ember.
Ezért azt javaslom, hogy — amellett, hogy veszel egy jó széket — fogadd el az orvosom fenti három tanácsát. Ezek az alapvető dolgok jutnak most eszembe:
Nem mondtam semmi meglepőt, ezeket nyilván eddig is tudtad. A kulcs inkább az, hogy komolyan kell venni, és folyamatosan gyakorolni.
(Ehhez kapcsolódva tudom ajánlani Lift nevű ügyes kis alkalmazást is, amely támogat jó szokásaink rendszeres gyakorlásában.)
Én nem tudok erre az állásra jelentkezni, de hátha valamelyik olvasó…
A Ruby ritka elegáns nyelv, és a Rails is nagyon tetszik, annak idején boldogan kísérleteztem vele.
Ma megrendeltem a szemüvegemet, jövő héten elkészül. Nagyon-nagyon várom.
Korábban mindig örömmel töltött el, hogy hiába ülök egész nap a számítógép előtt, a szemem még mindig jó, és nem kell vesződnöm egy újabb tárggyal, felrakni, levenni, vigyázni rá…
Sajnos egy ideje már nem mondhatom, hogy minden rendben lenne a szemeimmel. Úgy tűnik, hogy a korom miatt (42 leszek egy hónap múlva), a szemlencsám már nem elég rugalmas, ezért képtelen közelre fókuszálni. Az “autófókuszom” hiába rángatja az alsó tartományban, nem jön be az éles kép, a szemem meg csak elfárad, estére már alig tudom használni közelre.
Eleinte azt hittem, hogy egyszerűen elfárad a szemizom, de kiderült, hogy nem így van: lehetek akármilyen kipihent, a kartávolságon belüli fókusz már nem megy. Ez a gyakorlatban azt jelenti, hogy nehezen látom az apró betűket a telefonon, csomagoláson, meg hasonló helyeken. Az iPad szerencsére kényelmesen olvasható kartávolságon, akárcsak egy újság, valószínűleg ezért is kezdtem el jóval többet használni.
Tegnapelőtt végre rászántam magam, és elmentem a helyi optikushoz, hogy vegyek egy olvasószemüveget. De aztán Frau Benedek addig vizsgált, tesztelt, addig beszélt nekem, hogy egy igazi szemüveg ennyivel, meg annyival jobb, hogy végül beadtam a derekam. (Frau Benedek egy “ötvenhatos” férfi leánya, de nem tud magyarul, mert annak idején a mamája megrémült, amikor a gyerekek keverték a két nyelvet, úgyhogy a magyart letiltotta.)
Felpróbáltam egy ilyen szemüveget, alul fél dioptriás résszel, és döbbenetes élmény volt: újra tökéletesen tudtam közeli dolgokat olvasni! A telefon képernyője olyan tisztán jelent meg, ahogyan valószínűleg évek óta nem. Idióta vagyok, hogy csak most szántam rá magam. De a fokozatosság miatt az ember nem veszi észre időben.
Úgyhogy még utánaolvastam kicsit, mi ez az egész Essilor-féle Anti-Fatigue (szemfáradtság-elleni) technológia, amit el akar adni nekem Frau Benedek, és mivel a leírt szimptómák megegyeznek a saját rossz élményeimmel, gondoltam, megpróbálom. Ezért ma visszamentem végleg megrendelni és keretet választani. Egyszerű drótkereteset akartam, mint amilyet Gandhi, meg John Lennon hordtak, de persze kiderült, hogy az a legdrágább, mert titániumból van.
Amióta láttam, hogy ez a fél dioptria ott, alul milyen csodát művelt a szememmel, egyre csak azt várom, mikor hordhatom végre, mikor fogom a közeli dolgokat újra tökéletesen látni. Szemüveges akarok lenni!
Working on a future-friendly web, with attention to detail.
Designing and implementing user experience and interactions with handcrafted HTML5, CSS3 and JavaScript. Developing server logic on Google App Engine with Python.
Cultivating mindfulness and simplicity.
This is just an extension to Nick Johnson's excellent code to address the problems highlighted by Amir in the comments:
auto_now and/or auto_now_add flag.Here's the updated code:
def clone_entity(e, skip_auto_now=False, skip_auto_now_add=False, **extra_args):
"""Clones an entity, adding or overriding constructor attributes.
The cloned entity will have exactly the same property values as the original
entity, except where overridden. By default it will have no parent entity or
key name, unless supplied.
Args:
e: The entity to clone
skip_auto_now: If True then all DateTimeProperty propertes will be skipped which have the 'auto_now' flag set to True
skip_auto_now_add: If True then all DateTimeProperty propertes will be skipped which have the 'auto_now_add' flag set to True
extra_args: Keyword arguments to override from the cloned entity and pass
to the constructor.
Returns:
A cloned, possibly modified, copy of entity e.
"""
klass = e.__class__
props = {}
for k, v in klass.properties().iteritems():
if not (type(v) == db.DateTimeProperty and ((skip_auto_now and getattr(v, 'auto_now')) or (skip_auto_now_add and getattr(v, 'auto_now_add')))):
if type(v) == db.ReferenceProperty:
value = getattr(klass, k).get_value_for_datastore(e)
else:
value = v.__get__(e, klass)
props[k] = value
props.update(extra_args)
return klass(**props)
The first if expression is not very elegant so I appreciate if you can share a better way to write it.
You can find a similar question here: How can you programmatically tell an HTML SELECT to drop down (for example, due to mouseover)?
I don't think there is a single solution that would work in every browser.
I can confirm that using document.createEvent() and .dispatchEvent() (as explained at the above link) works great in WebKit browsers (Safari, Chrome) but not in Firefox, Opera and IE.
However, you can try combining the different solutions listed there.
As far as I understand you are looking for a way to generate short, unique, alphanumeric identifiers for you documents. The kind of thing URL shorteners do (see questions Making a short URL similar to TinyURL.com or What's the best way to create a short hash, similiar to what tiny Url does? or How to make unique short URL with Python?, etc.). My answer is based on this assumption.
The datastore generates unique auto-incremented IDs so you can rely on that. Multiple data centers are not a problem, your IDs will be unique, short (at least, initially) and there is no collision. This is probably how tinyurl and similar services accomplish it.
You can even request one or more unique IDs before you persist your new document in the datastore by using the DatastoreService.allocateIds(), for example:
KeyRange keyRange = dataService.allocateIds("MyDocumentModel", 1);
long uniqueId = keyRange.getStart().getId();
You can then "hash" this ID or you could get an even shorter alphanumeric ID by simply transcoding the integer ID to Base64 (or Base36 or some other base where you define your own characters, e.g., omitting vowels can help you avoid generating obvious swear words accidentally).
If predictability is an issue you can prefix/suffix this alphanumeric ID with some random characters.
According to the official docs you can map the __key__ pseudo-property to the appropriate CSV column in your bulkloader .yaml configuration file, e.g.:
transformers:
- kind: MyKind
...
property_map:
- property: __key__
external_name: MyKeyColumn
...
(If you want the datastore to automatically generate the key id for you, like before, then you have to remove this property from the .yaml file.)
Why don't you just make those rows explicit? Something like:
CSS
section > div { display: inline-block; background: green; }
section > div:nth-child(even) { background: blue; }
HTML
<section>
<div>Test</div>
<div>Test</div>
</section>
<section>
<div>Test</div>
<div>Test</div>
<div>Test</div>
<div>Test</div>
</section>
<section>
<div>Test</div>
<div>Test</div>
<div>Test</div>
<div>Test</div>
</section>
I am using inline-block here because it's much simpler but if the gap between elements is an issue, you can float them or fight the spaces.
I am learning Google App Engine / Python and I love it. Unfortunately I am not allowed to use my own computer in the office and not allowed to install anything on the corporate machine.
It would be so great to have an online IDE for Google App Engine where I could play with my Python code using any browser, including the one on my iPad.
Maybe http://www.devunity.com/ will be an online IDE for GAE some day. Do you know any existing way to program GAE in a browser?
I have a list with articles. The article is collapsed by default so that its title and content is shown as a preview in the available space. The article can be expanded or collapsed. I would like to keep an element from the footer of the article visible both in collapsed and expanded mode.
Here is a quick mockup: jsfiddle.net/vuByG/11/
My problem is that the floating element is pushed below the content in collapsed mode. Is it possible to put the button in line with the article so that the collapsed article with the additional element takes up only a single line? I could position the floating element above the content but it overlaps it and I cannot always predict the width of that element.
HTML:
<article class="collapsed">
<header>
<h1>Title</h1>
</header>
<div>
<p>Some text.</p>
<blockquote>Quote.</blockquote>
<ul>
<li>Anything.</li>
</ul>
</div>
<footer>
<time>yesterday</time>
</footer>
</article>
CSS:
time {
float: right;
font-style: italic;
}
article {
background-color: beige;
cursor: pointer;
}
footer:after {
content: "";
display: table;
clear: both;
}
.collapsed {
white-space: nowrap;
width: 13em;
overflow: hidden;
text-overflow: ellipsis;
}
.collapsed * {
display: inline;
margin: 0;
padding: 0;
}
I am learning the webapp2 framework with its powerful Route mechanism.
My application is supposed to accept URIs like these:
/poll/abc-123
/poll/abc-123/
/poll/abc-123/vote/ # post new vote
/poll/abc-123/vote/456 # view/update a vote
Polls may optionally be organized into categories, so all the above should work also like this:
/mycategory/poll/abc-123
/mycategory/poll/abc-123/
/mycategory/poll/abc-123/vote/
/mycategory/poll/abc-123/vote/456
My incorrect configuration:
app = webapp2.WSGIApplication([
webapp2.Route('/<category>/poll/<poll_id><:/?>', PollHandler),
webapp2.Route('/<category>/poll/<poll_id>/vote/<vote_id>', VoteHandler),
], debug=True)
Question: How could I fix my configuration?
If possible it should be optimized for GAE CPU-time/hosting fee. For example, it may be faster if I add two lines for each entry: one line with category and another one without category...
GoogleAppEngineLauncher can display the local log file of my app while it is running on my Mac during development. However, I can't change the font size there so I would like to use the tail command to watch the log file myself.
It's a shame but I can't find the log files. They are not under /var/log/, ~/Library/Logs or /Library/Logs. Do you know where they are?
(Maybe there are no physical files, just the stdout of the python development environment and so the log is only available in the launcher application.)
A new post today with title What's Next on MacroMates official blog states (bold emphasis by me):
There has been a lot of speculation and trepidation about the future of TextMate recently, mostly about whether there will be another major release. Work on 2.0 began and while we wish it could have been completed faster we are very pleased with how it is turning out. Development has reached a point finally where we can make an announcement:
There will be a public alpha release this year, before Christmas, for registered users.
webapp2.uri_for() assumes that you are in a web request context and it fails because it cannot find the request object.
Instead of working around this you could think of your application as a black box and call it using literal URIs, like '/' as you mention it. After all, you want to simulate a normal web request, and a web browser will also use URIs and not internal routing shortcuts.
Using webapp2 I create unit tests for a form where there are checkboxes for votes so multiple values can be posted for the vote field and they are retrieved via request.POST.getall('vote'):
<input type="checkbox" name="vote" value="Better">
<input type="checkbox" name="vote" value="Faster">
<input type="checkbox" name="vote" value="Stronger">
In the unit test I tried passing a list:
response = app.get_response('/vote',
POST={'vote': [u'Better', u'Faster', u'Stronger']},
headers=[('Content-Type', 'application/x-www-form-urlencoded; charset=utf-8')]
)
But looks like it's simply converted to a string:
votes = self.request.POST.getall('vote')
# => [u"[u'Better', u'Faster', u'Stronger']"]
How can I pass multiple values for vote that will be retrieved as a list via request.POST.getall()?
There is an old, unmaintained but working code that extends django.template.defaultfilters.slugify() by adding support for all characters you can imagine. If you need to support all kinds of languages then this may be a good solution. It's called slughifi.
I am a systems analyst focusing on interaction design and usability, normally working on web applications (using my Mac). However, currently I am in a project team working on a legacy application which has a Windows Forms-based front-end.
I try to simplify and clean up the interface but given my web background it's quite frustrating to work within the strict constraints of WinForms and DevExpress 8.3 controls. (WPF would be great but it is not an option: the company has lots of off-shore users logged in remotely to virtual machines. WPF was tested several times and it failed. Windows XP and IE6 are still on all workstations.)
It would be great to see some good examples for elegant UI design for complex forms with lots of input fields in different categories and groups, including read-only sections with meta-data. It should not be fancy, just simple, slick and clean. Do you happen to have some good examples?
I still couldn't find real good ones, only sporadically. The best WinForms examples I found are in Windows XP itself and in other Microsoft products, like IE, Office.
Looks like there's no real online solution at the moment. I still think that it would be great to share simple examples and test out bugs without having to register a new application yourself.
However, it turns out to be quite comfortable to access my home computer via my 3G iPad using the Screens VNC app through an SSH tunnel. I set the computer's screen resolution to 1024×768 and I can quite comfortably use it to try out things when I have some free time. Not perfect because full keyboard support is missing but very powerful and usable.
I would like to use a string that was input by the user in a web form as part of a key name:
user_input = self.request.POST.get('foo')
if user_input:
foo = db.get_or_insert(db.Key('Foo', user_input[:100], parent=my_parent))
Is this safe? Or should I do some inexpensive encoding or hash? If yes, which one?
It is possible to configure the individual handlers to require HTTPS in the app.yaml file in the WEB-INF folder as described here: Java Application Configuration Using app.yaml - Google App Engine.
You just have to add these words:
secure: always
Then if a user tries to access the URL with HTTP she will be automatically redirected to HTTPS. Pretty cool.
However, as Yuval writes, this works only if you use the *.appspot.com domain provided by Google.
I think I had the same question, and got an answer: Where does GoogleAppEngineLauncher keep the local log files? (It's a Mac, not Ubuntu, but otherwise the question seems to be similar.)
In short: it turns out that these logs are not saved to a physical file but you can modify the source code to get this result. Details are described at the above link.
Did you try this already?
{{ a.name_is_x('www') }}
What kind of device is it? On iOS devices, for example, there seems to be no way to force the displaying of scroll bars. You have to indicate it with something else or choose a different design solution.
Both of your solutions look good but you will probably need to modify the RSVP plugin to support those.
The generated hash must be also unique, of course. So a simple transcode to Base64 is probably a good idea.
The datastore is generating auto-incremented unique IDs for each model. This integer ID is guaranteed to be unique for that model for your application across all instances. So, if you always use the integer ID for this specific model (e.g., MyDocumentModel) then the entire key will be unique. I am using the same technique in my own application.
Corrected. Thanks and sorry!
Only works in WebKit browsers (Safari, Chrome). Doesn't work in Firefox, Opera and IE. I just tested it.
Sorry, here is the correct link: developers.google.com/appengine/docs/java/javadoc/com/google/…
E.g., AdminDatastoreService.allocateIds("MyKind", 5) gives you the next 5 unique keys generated by the datastore for the MyKind model. Inside these keys there are the unique integer IDs.
I am not sure about the forms framework that you are using but if you provide an integer then it will become key's ID part, and if you provide an alphanumeric string then it will become the "Key Name" part of the key. You use either an integer or a string.
My comment on explicit line-height wasn't right. Setting this attribute for an inline element has no effect. See this, for example: stackoverflow.com/questions/1742525/…
Alternatively, an explicit line-height value could be specified for the small element.
Yes, not bad but I am still hoping that there is a better way. BTW, it works in IE, even without the position: absolute
The very entity cities is missing as stated by the error message.
Thank you, I will look into it!
Thank you, that works indeed.
Defeat Distraction: Refocusing with Purpose http://zenhabits.net/refocus/
The secret of happiness, you see, is not found in seeking more, but in developing the capacity to enjoy less.
most people aren't qualified to be doing what they're doing. Instead they were presented with an opportunity, and rather than waiting to be told they were ready, they simply jumped at the chance and figured it out as they went.
PATH="/System/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}" export PATH