Sunday, December 19, 2010

Yes, Riding on Linux

I received a free WiMAX USB dongle (called the Yes Go) last Tuesday, given how busy week days usually are, I only managed to really get it working on my Ubuntu now. In this blog, I am not going write about the Yes site usability, how interesting the speed can go (by the way, if you think 10Mb/s is impressive enough, that's the speed HSDPA can give. WiMAX can run up to 40Mb/s.); Instead, I speak about what I went through getting it to work on my Linux machine.

Yes Go doesn't have (publicly) a Linux driver (and its source), just like the Clearwire USB dongle and many others. Yes Go is manufactured by Infomark, IMW-U300, which uses GCT chip (GDM7205 most likely, with uClinux. It can push >30Mbps of download and 6Mbps of upload):

(Note: I'm not a Linux hacker, so all I could do is usb_modeswitch and some simple digging. I'm happy to learn how to grab the image and boot into it when I have the time.)
$ screen /dev/ttyUSB0
Model name: IMW-U300   
 Manufacturere: INFOMARK
%WIMAX MAC: ff:ff:ff:ff:ff:ff
/dev/usb0
3Parameter block: version 2 in NVRAM EEPROM

$ lsusb | grep 1076
Bus 001 Device 039: ID 1076:7f00 GCT Semiconductor, Inc.
Given that (and I-ANAL - I Am Not A Lawyer), GCT could have violated the GPL (see also this Taiwanese post).

After hours of research, I contacted @YesCare for the driver, the case has been escalated and am still pending for solution at the time I'm writing this blog. This left me with one ugly workaround to use Yes Go -- bridging from a virtual machine (I use Sun's/Oracle's VirtualBox) running Windows.

The basic steps (more discussions in this VirtualBox's forum thread):
  • Create an ad-hoc wireless network in NetworkManager.
  • Add a bridge adapter in VirtualBox, select your wireless LAN (e.g. wlan0).
  • Turn off usb_modeswitch before plugging in the USB dongle. See /etc/usb_modeswitch.conf.
  • Start VirtualBox with root (or configure fstab to allow current user to read/write the USB device nodes).
  • Setup Yes Go, once connected, bridge it with your adapter added earlier.

That ends a chapter.

Meanwhile, for preregistered users, today is the last day to activate your account in order to retain your reserved phone number.

To make myself to really know what I'm going to pay for, I wrote a JS-based calculator last night using mvc.js (before Yes updated their site with the new calculator this afternoon). Feel free to fork it with jsfiddle or github.

Friday, December 10, 2010

The Malaysian Java User Group can be more than just a mailing list

Is simply just a mailing list for years. Continue reading.

Recently, I received an email (with a few in the loop, not through the mailing list) from Loke to discuss about some aspects of MyJUG. I found it hard to respond to most posted questions (such as "Best Practices" and "Strengths and Opportunities" of this group), simply because - the cruelest fact - there's nothing much to describe.

I join the mailing list about 4 to 5 years ago, when I innocently thought getting to know more people there could get some new hires for my former employer. It doesn't work that way (or at least at the moment), so if you happen to have the same intention, you may want to readjust or quit.

Every now and then, I whine and whine to some people about the lack of substantive committee to move forward the group, the lack of activities, etc. Then, every now and then, we voted for topics and things go silent. Then, recur.

StackOverflowError not yet.

To run a successful technical/user group seems really hard in Malaysia. FOSS-SM used to have consistent monthly meetup when Aizat was active. Chee Seng runs the Flex UG (MyFlex) but the number of participants is really low (also given the fact that Flex is barely a killer). Umm, the PHP UG seems pretty successful though. Why?

I don't know.

The community can change it.

Wednesday, November 3, 2010

Yes?

YTL Communications, a subsidary of YTL Power (YTLPOWR), will be launching their WiMAX service on the 19th of this month.

I attended its pre-launch event just now and here're some stuff to highlight to fellow Linux users or Android lovers.

  • No, there's no official Linux software or drivers and I don't see why they shall release one. But things shall really work OOTB.
  • No, HTC lovers, you can't run Evo 4G on it, as Evo works only with 2.5GHz-2.7GHz WiMAX. In Malaysia, WiMAX is currently deployed with 2.3GHz spectrum; although MCMC recently has granted the 2.6GHz spectrum - we still gotta wait.
  • Yes, you have to buy the phones from YTL and given that WiMAX requires no SIM, I am not sure whether that'll encourage vendor locked down and monopoly. My question on this wasn't really answered.
    • They are Samsung lovers and the available handset now is Samsung Epic 4G. I don't use and never like a QWERTY phone.
    • I suppose they have customized their phones with their own software, but custom ROM shall work just fine with all the necessary apk.
  • Yes, Android is the only platform for now. iPhone 4 is not a 4G network phone, yet.

    IMO, within the next two to three years, we won't see 2.6GHz band and LTE being deployed. That also means, we don't get real 4G 'til that happens. What shall happen in between, it's too hard to tell now.

      Thursday, October 7, 2010

      Zend Debugger > XDebug makes PDT > Netbeans

      Displaying variable values - including breakdown values of their attributes - of current scope has been the most important thing to my debugging practice.

      AFAIK, Netbeans PHP IDE only supports XDebug. XDebug is known to be unstable with watches and balloons (and I have had too many crashes experience) and having this defect yields Netbeans useless IMO.

      I use PDT together with XDebug over the past 3 years of active PHP development and for the past few days (finally) I started using Zend Debugger. Then I realized that it has the "problem" of only displaying variables in scope (e.g. function scope), meaning, global variables and $this will not be shown, due to usability and performance concern.

      The fix is pretty simple (after reading this forum response), just place watches if you want to monitor out-of-scope variables.

      Saturday, September 11, 2010

      回张木钦道德论

      "你有没有感受到,当前我们的社会流行的“比道德更高价值”的东西,就是“反国阵”?道德虽然好,但是还有更好的,就是打倒国阵。打倒国阵是政治目的,不是道德,却是比道德更高的价值。"

      "我们是不是即将进入一个只有政治目标,没有道德价值的世界?"


      在一个道德已被滥用的社会,已被国阵扭曲和掩盖的社会,你可否有反问道德是否还存有其被等量齐观的价值?

      革命,看重的是议程,被应许的是人权与未来。若像你那一般高谈道德,美女间谍就永远派不上用场了。

      这个星期我看了《V煞》整一百遍,在一个人民被贬低,媒体,司法与立法被控制的国家,政权的倒台与改变需要人民的策划与响应(当权者和汉奸最怕)。

        艾维: You really think blowing up Parliament's
      going to make this country a better place?

        V: There's no certainty, only opportunity.

      暗杀与爆炸听来血腥,毫无道德,但爆响声中却带来了希望与未来。

      Monday, May 17, 2010

      Wee, Prove It

      “I didn't jump ship. I am on my own and now I have more time to concentrate on my constituents.

      “My constituents will see whether what I did was right. I am certain I will be forgiven by history and the next generation,” he added.

      It's too early still for me to say that you had done practically nothing for my district, yes, my freaking district.

      I still remember on a Wednesday rainy night, me, a very a young guy at that time attended your cerama in celebration of your move to PKR. Then, a meet-up once speaking about a portal for Wangsa Maju.

      I remember you claimed that in 30 days Wangsa Maju/Setapak will see a change. I saw a small protest on removal of protected trees due to road expansion. I saw you hitting on Yew for the Platinum condominium and land matters. Other than that, I am still awaiting the change.

      Prove it.

      Monday, February 22, 2010

      Some Groovy Class-Loading Notes

      Was trying to load a resource (*.properties) from the class-path and as you know, class loading can be a PITA at different enviroments (IDEs, build tools, tests, containers).

      Here's the snippet I used, ran with Maven and Eclipse IDE, target/test-classes is in the class-path.
      String name = "aflexi.itest.properties"
      
      // System CL
      println ClassLoader.getSystemClassLoader()
      // Uses system or bootstrap CL
      println ClassLoader.getSystemResource(name)
      
      // Caller CL
      println ClassLoader.getCallerClassLoader()
      println ClassLoader.getCallerClassLoader().getResource(name)
      
      // Class's class loader. Perfectly fine in both places
      println getClass().getClassLoader()
      println getClass().getClassLoader().getResource("aflexi.itest.properties")
      
      // Doesn't work anywhere, the CL is the one of previous, but the name will be resolved as "net/aflexi/cdn/test/itest/aflexi.itest.properties"
      println getClass().getClassLoader0()
      println getClass().getResource("aflexi.itest.properties")
      
      // Doesn't work either. Using Groovy's calling class.
      println ReflectionUtils.getCallingClass()
      println ReflectionUtils.getCallingClass().getResource("aflexi.itest.properties")
      

      And here's the result:

      Expression / Class LoaderTest 1: InstanceTest 2: InstanceTest 1: Found Resource?Test 2: Found Resource?
      ClassLoader.getSystemClassLoader().getResource()sun.misc.Launcher$AppClassLoader@19134f4sun.misc.Launcher$AppClassLoader@19134f410
      ClassLoader.getCallerClassLoader().getResource()sun.misc.Launcher$AppClassLoader@19134f4org.codehaus.groovy.tools.RootLoader@8965fb11
      getClass().getClassLoader().getResource()groovy.lang.GroovyClassLoader$InnerLoader@14177f3groovy.lang.GroovyClassLoader$InnerLoader@dc043511
      getClass().getResource()groovy.lang.GroovyClassLoader$InnerLoader@14177f3groovy.lang.GroovyClassLoader$InnerLoader@dc043500
      ReflectionUtils.getCallingClass().getResource()class cuke4duke.internal.groovy.GroovyLanguageclass groovy.ui.GroovyMain00

      Take note that, getClass().getResource() uses the same CL instance (otherwise system CL) with getClass().getClassLoader().getResource(). The reason why it failed is that, it resolves the name of the properties file with package name, i.e. aflexi.itest.properties to net/aflexi/cdn/test/itest/aflexi.itest.properties.

      Saturday, February 20, 2010

      POGO + Singleton + Mixin

      Something worth sharing (or probably you may suggest me with a better solution) about injection/Mixin on Groovy's object that is being a singleton.

      Let's start off with an example. I have a Users class with a private singleton, e.g.
      @Mixin(Whatever)
      class Users{
      
        private static Users instance = new Users()
      
        def doGetUserByEmail(){}
      
        static def getUserByEmail(){
          instance.doGetUserByEmail()
        }
      }
      

      Unfortunately, this is not working as Users.instance is constructed within the class before Groovy does more thing with its interpreter (at this point, I still have limited knowledge about Groovy, but that's the basic idea).

      So I let Groovy to handle the construction of the singleton for me, with @Singleton - resulted with the same effect.

      However, @Singleton(lazy = true) solves the problem, as the late/lazy instantiation happens on a "ready" POGO class.