Wenying http://www.wenying.net My Weblog Thu, 04 Dec 2008 03:12:34 +0000 http://wordpress.org/?v=2.3.3 en Sin Chan - Kazama Menjaga Himawari http://www.wenying.net/sin-chan-kazama-menjaga-himawari http://www.wenying.net/sin-chan-kazama-menjaga-himawari#comments Thu, 04 Dec 2008 03:12:34 +0000 admin http://wenying.net/sin-chan-kazama-menjaga-himawari

http://www.youtube.com/watch?v=Fg5KhZ8DHQ4

Kazama watch over Himawaris (Sin Chan’s Sister)

Language: Malay

]]>
http://www.wenying.net/sin-chan-kazama-menjaga-himawari/feed
True Environmentalism vs Corporate Environmentalism http://www.wenying.net/true-environmentalism-vs-corporate-environmentalism http://www.wenying.net/true-environmentalism-vs-corporate-environmentalism#comments Tue, 02 Dec 2008 15:31:07 +0000 admin http://wenying.net/true-environmentalism-vs-corporate-environmentalism It would seem that numerous people can only change their environmental outlook at the behest of the state and multi-national propaganda. In recent years there has been an explosion in so-called environmental consumables and philosophy. When a person looks into environmentalism, it becomes evident that this new environmental frame of mind is very narrow and is in part only a marketing ploy of corporations who seek to annihilate justifiably benevolent companies such as Fair Trade and the numerous small environmental start-ups.As an individual who has attempted to be a blip on the environmental harm radar – I recycle as much as I can, I refuse to drive a car and buy next to no non-essential products – I find this new vogue of environmentalism sepulchral and extremley limited. I am observing increasingly more and more persons who are ‘going green’, which seems to be almost completely inspired by the media.

It is not just our energy demands that can be succseeded by affectual green alternatives, but our building materials and product packing can become environmentally sustainable today.

One of the racketeers of this new movement are the energy multi-national corporations who are seeking to sell a new green depiction of themselves by their research into secondary power, which they will sell us once natural resources are no longer existent. It is these same corporations that have smothered the rise of true alternative energy in our lifetime, not in 2025. To individuals who are responsive to inquire into such technologies, it will become clear that true alternatives to power needs have been to hand for over a century. You are able to power your mode of transport with water right now or you can take a trip to Brazil where the majority cars run on ethanol.

While suring the net I found a green home web site, which will give you an idea of some of the alternatives out there. The eb log is continually updated with new environmental items and news from the environmental scene. The posts probe numerous of subjects, such as green home designs and green home buildings.
]]> http://www.wenying.net/true-environmentalism-vs-corporate-environmentalism/feed A little silence never hurt anybody http://www.wenying.net/a-little-silence-never-hurt-anybody http://www.wenying.net/a-little-silence-never-hurt-anybody#comments Tue, 02 Dec 2008 03:12:14 +0000 admin http://wenying.net/a-little-silence-never-hurt-anybody So I thought I’d write a little post letting everyone know that I haven’t forgotten about them. I’ve been a little busy with working on a Rails blog that I was going to be creating, and have had a few web design projects I’ve been trying to get finished up. Hopefully I won’t be much longer! I have a few cool things for you to check out while I’m away. The first one is called Synergy. It’s a cool open source utility that I’ve been using at work to connect all my computers (6 in total) together with the ability to use 1 set of keyboard and mouse. The second is called iShowU. It’s a cool little screen recording utility that I just purchased to help with creating some screencasts on a Mac. It’s about 20 bucks and gives me a clean looking file that through the use of a few programs I can convert the MOV file to an AVI file so I can edit and produce in Camtasia Studio. Hopefully sometime in the near future Camtasia Studio will be for a Mac. But until then, iShowU will do the trick for me.

I hope to have a new screencast up soon that will show you Synergy (at least on each side, Mac and PC), and maybe one that shows you a few things about iShowU. I have a list of some ROR screencasts that I’d like to do, but I’m finding that I need to really just record and then splice together all sorts of pieces to get a screencast. Maybe I’ll have the option soon to create shorter ones with the use of Jing, iShowU, and Camtasia Studio. :)

]]>
http://www.wenying.net/a-little-silence-never-hurt-anybody/feed
Getting to know acts_as_versioned http://www.wenying.net/getting-to-know-acts_as_versioned http://www.wenying.net/getting-to-know-acts_as_versioned#comments Mon, 01 Dec 2008 10:12:06 +0000 admin http://wenying.net/getting-to-know-acts_as_versioned I’ve been using Rick Olson’s acts_as_versioned Rails plugin on a project and recently ran into some thngs that I thought might be worth sharing.

In general, acts_as_versioned behaves well and integration has gone smoothly. The object that we wanted to version is called SurveyContent. We created a database table called survey_content_versions with the same columns and data types as survey_contents, plus id (key) and survey_content_id (foreign key to the versioned object). After adding :acts_as_versioned to the class definition for SurveyContent, every save of a SurveyContent object that has changes results in a new survey_content_version entry in the database.

Making acts_as_versioned play nicely with acts_as_state_machine

acts_as_versioned provides methods for things like .revert_to, .latest, and .previous, which is really nice. But we ran into trouble on a few fronts, particularly since SurveyContent also uses acts_as_state_machine. Users can request changes to their associated survey content, but these changes are subject to administrative approval, so we basically care about two versions of a SurveyContent instance: the approved version, and the latest version. Since we have distinct states defined for acts_as_state_machine, we’re used to calling foo.approved? to see if an object is in the “approved” state. Unfortunately, these convenience methods are not available on our survey_content_version object.

We ended up adding the methods to our version by creating anonymous mix-ins in SurveyContent:

class SurveyContent 

No real magic here– the documentation for the plugin provided the tip– but hopefully this will be of use to someone else.

Cloning a version

There was another situation in which we needed to act on an actual instance of a different version of SurveyContent, while keeping the existing instance intact. In that case, we opted to clone:

def approved_version
  if @approved_version.nil? && self.survey_content
    _last_approved = self.survey_content.versions.reverse.detect{|v| v.status == "approved"}
    unless _last_approved.nil?
      @approved_survey_content = SurveyContent.new
      _temp = _last_approved.attributes
      _temp.delete('survey_content_id')
      @approved_survey_content.attributes = _temp
    end
  end
  @approved_survey_content
end

Maybe a little ham-fisted, but it got the job done. Note that we had to drop the survey_content_id from the attributes, as SurveyContent has no such field.

acts_as_versioned and serialized attributes

The last problem we ran into had to do with the fact that one of the attributes on our versioned object was serialized. Out of the box, acts_as_versioned ended up converting it to a string. Luckily, some Google mining later, we found the solution.

First, we added some code to acts_as_versioned.rb:

def acts_as_versioned(options = {}, &extension)
...
    # Preserve serialized attributes
    self.serialized_attributes().each do |key, value|
      versioned_class.serialize key, value
    end

  end

end

module ActMethods
...

Then, we added another method to our anonymous mix-in on SurveyContent:

class SurveyContent 

(Note that in the snippet above, data is the name of our attribute.)

One last problem with serialization that we ran into was that acts_as_versioned was not detecting changes when we did a merge operation on our serialized attribute. To ensure that a save took place, we had to call will_change!:

def survey_content_date=( survey_content_params )
  self.survey_content.data_will_change!
  ...

Again, substitute the name of your object’s parameter for data.

Go version something!

If you’re looking for the plugin, be sure to download acts_as_versioned from github and not Rick’s site– he’s moved from SVN to Git, and github has the latest version.

]]>
http://www.wenying.net/getting-to-know-acts_as_versioned/feed
A “Trip” To Kamakura http://www.wenying.net/a-trip-to-kamakura http://www.wenying.net/a-trip-to-kamakura#comments Sat, 29 Nov 2008 09:11:56 +0000 admin http://wenying.net/a-trip-to-kamakura What the Kamakura Buddha said to me and why I’ll never sample wild Japanese mushrooms again:

Talking Buddha

Note: Come visit the front page for more of life in Japan - sort of…

]]>
http://www.wenying.net/a-trip-to-kamakura/feed
Gintama 78 http://www.wenying.net/gintama-78 http://www.wenying.net/gintama-78#comments Sat, 29 Nov 2008 06:11:02 +0000 admin http://wenying.net/gintama-78

part1

part2

part 3

part 4

part 5

part6

part7

part8

Next Episode Preview:

Thoughts on the Episode:

  • I totally thought this was going to be some food eating competition between Kitaouji and Hijikata. But it turned out to be totally opposite. Instead it was action packed fighting, and they even had the flashback for Hijikata. I wasn’t expecting this at all, and it surprised me. Again Gintama can be just as cool as those serious shows when it wants to be.
  • Unfortunately with all of that talk about fighting and techniques, I really had a hard time understanding this episode. Comedy stuff is usually easier than this kind of technical talk about swordplay and such. So I’m gonna have a hard time with the summary >.<
  • The comedy part of this episode was all at the beginning, and the thing that Kagura did was hilarious. Kondo-san was like so mad, wondering who did this to Sougo. When I saw the broken ankle I knew it something funny was coming. Then they show Kagura’s picture on the cell phone. So funny :D Great way to end that whole situation from last episode.
  • Looks like next episode is gonna be the showdown. Toujou looks like he’s really strong, and we don’t know anything about the old grandpa.
]]>
http://www.wenying.net/gintama-78/feed
Canceling My Costco Membership http://www.wenying.net/canceling-my-costco-membership http://www.wenying.net/canceling-my-costco-membership#comments Sat, 29 Nov 2008 04:11:49 +0000 admin http://wenying.net/canceling-my-costco-membership Since Costco came into Japan, many stores have popped up offering almost as low prices for items of similar size and quality. Some stores even offer items made in America at low prices, but not many. Although they are not made by the same manufacturers, most items I frequently buy at Costco like sausages, meat, cereals, toiletries, wine, cheese, and frozen items, most not made in China, can be found at discount supermarkets throughout the Kansai area closer to home, which means I don’t have to pay the annual membership fee or spend money traveling by train or on the expressway, along with gas, to get there.

So as of August, my wife and I are doing a cost comparison for the next year shopping at local stores instead of at Costco. We have canceled our Costco account, actually just didn’t renew our membership we’ve had since Costco opened its doors in Amagasaki many years ago.

Of course, Costco won’t miss us. They only know our names when we write it down on when we’re returning something or when we’re checking out at the cash register. If they send us a renewal notice, I’ll be surprised.

Most people at Costco recognize our faces, but don’t know our names. Local store employees may not know our names either, but that doesn’t matter. For the next year, we’ll spend more time shopping and pass through the checkout line more often than once a month if the items we buy aren’t as large as the Costco brands. But on a more positive note, we’ll probably also see people we know that live closer to home, maybe even friends or neighbors, and who knows, maybe we’ll even put together a BBQ at a local park and spend time together, spend less money on gas and transportation and won’t have to pay the extra 3500 yen Costco annual fee.

NOTE: We’re also canceling our Japanese American Express card, an annual savings of 20,000 yen for membership before our 5000 yen arigato coupon they send us once a year!

]]>
http://www.wenying.net/canceling-my-costco-membership/feed
Little Lolicon Girls http://www.wenying.net/little-lolicon-girls http://www.wenying.net/little-lolicon-girls#comments Wed, 12 Nov 2008 02:11:24 +0000 admin http://wenying.net/little-lolicon-girls

Title: Little Lolicon Girls
Genre: Sexy
Credits: Kitty Media

Cover Description: In a crowded train, lolicon sex strangers often end up being too close for comfort. But for some people, being too close is a comfort. When a poor conductor witnesses the train sex phenomenon, he decides to turn it into a business. Every night after the midnight train finishes its route, hardcore lolicon he turns it into a rolling bordello. Climb aboard, because the train is leaving the station! lolicon vids
(more…)

]]>
http://www.wenying.net/little-lolicon-girls/feed
Google Web Toolkit http://www.wenying.net/google-web-toolkit http://www.wenying.net/google-web-toolkit#comments Sat, 08 Nov 2008 09:11:14 +0000 admin http://wenying.net/google-web-toolkit http://code.google.com/webtoolkit/

The Google Web Toolkit is an OpenSource Java software development framework. It allows developers to create applications natively in Java, the Toolkit then converts that code into JavaScript and HTML. The majority of the time spent on web applications today is spent on testing. Everything from CSS up to JavaScript framework configurations. This framework allows you to build applications and focus on logic, instead of the nuances of cross browser integration.

]]>
http://www.wenying.net/google-web-toolkit/feed
用Filter Function作簡單線性圖Drill-Down http://www.wenying.net/filter-functionon作drill-down http://www.wenying.net/filter-functionon作drill-down#comments Fri, 07 Nov 2008 02:11:34 +0000 admin http://wenying.net/filter-functionon作drill-down é¦–å…ˆï¼Œæƒ³åƒæœ‰ä¸€å¼µç·šæ€§åœ–(Line Chart)ï¼Œä¸Šé ­çš„ç·šæ˜¯ç”±è¨±å¤šè³‡æ–™é»æ‰€æ§‹æˆã€‚在Flex中,一旦å°è©²è³‡æ–™åŠå’Œä½œäº†éžæ¿¾çš„動作,圖表會é‡ç¹ªã€‚然後,Flex3的圖表都有支æ´selectedItems:Array的方法,以ç²å–你圈é¸çš„資料é»ï¼Œå› æ­¤ï¼Œæˆ‘們å¯ä»¥è—‰ç”±é¸å–的資料é»ï¼Œå¾—到一個範åœï¼Œåˆ©ç”¨ç¯„åœä¾†éžæ¿¾åžŸè³‡æ–™é›†åˆï¼Œå°±å¯ä»¥åšåˆ°é¡ä¼¼Drill-Down的功能了。

這是範例(線性圖的drill down)
這是垟始碼

Drill down into data in a line chart.

With Flex3 data visualization package, we are able to get the selectedItems by
ChartBase.selectionMode = "multiple";ChartBase.selectedItems
Therefore, it is handy to measure a range for filtering out our data. We have to know that every series in a chart contains a data provider. The data providers are ListCollectionView objects. So to filter out those objects will update the display of chart immediately. Those lines will be redrawn. You could see the line scaled just like drilling-down into it.

Here is a sample and source code.
Simple Drill Down into Line Chart
Source

]]>
http://www.wenying.net/filter-functionon作drill-down/feed