View Posts

  • NSInvocation's Equivalent in Java?

    |
    Updated at
    Looks like browsing a discussion on LinkedIn about differences between Java and Scala turned out something I never knew about: Method Handles. If you remember my post on how freaking useful NSInvocations are, well read it!

    Basically, let's say you want to execute a method on a function somewhere far far away without knowing what object you are talking to, you use a Method Handle in Java or a NSInvocation to encapsulate the method. My use case scenario was in the iPhone app I created during the summer. I used...
  • Transitioning from PHP to Java

    |
    Updated at
    [UPDATE 10/27/2012] Writing servlets isn't as hard as I thought. Everything is just baked in, though I'll have to obviously get more experience with J2EE classes and the other components before I can make a definitive decision on just using Java. My next big concern is whether there are any xss/string stripping methods or whether I'll outsource that task to a library.

    I think it is about that time I started looking at Java as legit language for the web. There are many companies that use it successfully witho...
  • Why sentiment analysis with the Naive Bayes Classifier makes sense

    |
    Updated at
    Let's think about it for a second. You have a labeled data set meaning you have bunch of sentences with some sentiment attached to it (good/bad). Assuming we chose the Naive Bayes Classifier (NBC), we work with something called the bag of words model, so we assume we are using uni-grams as our features of the data set. In essence, that means we use word count divided by how many times we've seen the word in all classes as our simple way of calculating the probability of the word for a specific class.

    So, giv...
  • My Enthusiasm for Windows 8

    |
    Updated at
    But, it is not in the Metro interface (oops, no more? oh well), but rather in the speed up of boot times, consolidation of products, rebranding, and more importantly A NEW OS that does a better job than its predecessor.

    My impression of the Start Screen is that it feels more like an addition than the main interface of the OS because I don't find myself returning to it on purpose. It feels sort of like a secondary UI compared to the desktop app. If we could take statistics on my usage of the desktop icons vs....
  • Looks like My Lenovo x201 has the same issue again...

    |
    Updated at
    Sigh the problem is basically the same as before in this post. How unfortunate given that I take my lappy to french class to look at the ebook. Random shutoff times... wtf. 270 days left on its warranty though! I'm taking the advice from my past self and calling customer service soon. I need to wait for the arrival of my next lappy though. The x220T! Woooooooooooo! I'm usually on a one-two year lag when it comes to laptops because that appears to be how long most of them last before they start having issues...
  • Windows Phone's viability

    |
    Updated at
    I think Windows Phone, in its current state, is flopping around trying to find it's niche. I mean, realistically, why should I buy it? Why should anyone buy it over an iPhone or Android? Ease of use isn't so much of a big deal. It can't rely solely on the ease of use factor because Android and iPhone are easy enough to use. Presentation? The fact that notifications can pop in almost whenever and wherever and being able to adjust icon sizes? I don't know about that either.

    The fact of the matter is that Micro...
  • iOS: Selectors vs NSInvocation vs Method To Func Pointers

    |
    Updated at
    Building one of the features of the iOS app for my internship has been enlightening. Whenever I'd like to invoke a selector from another object I'd usually use [object performSelector:@selector(yada:)] and that's that. Apparently, yada is one of those functions that doesn't return an object. In fact it doesn't return anything at all, so at some point performing that same selector will cause a EXC_BAD_ACCESS. It is quite baffling to get this problem especially when it works. Sometimes, it is completely rando...
  • iOS WebView with an Address Bar

    |
    Updated at
    I've started creating an iPhone application at my job and one of the things I immediately took advantage of is the UIWebView. One of the things it lacks is an address bar and a progress loading indicator (probably talk about this in another post). An address bar can be pretty useful for knowing where you are and especially if it acts like Safari's Address bar where it will scroll along with the content and slide off screen as well.

    I started using iOS's storyboarding feature where you can easily attach view ...
  • I'm warming up towards Log Files

    |
    Updated at
    I used to think that all logs should go into the MySQL DB or whatever you want, but since my internship I'm starting to think that log files are the way to go. My aversion to writing to log files come from wanting to write to a log file immediately, but you don't have to It is probably best to keep a buffer zone in memory where the log file is written to after a certain quota or time. Then you can grab something like Splunk or some other cool log analysis tool to grab these log files and aggregate them for...
  • Handling Android's rotation/orientation changes.

    |
    Updated at
    One thing I've encountered with Android since my internship was handling the orientation changes. Orientation changes are part of a wider thing called configuration changes which will kill your activity and start it over (personally I think is stupid, but it make sense). Killing your activity and making it restart will possibly change the layout according to your layout structure (layout-port, layout-land, etc etc etc). Read about it here.

    So at first, I assumed adding orientation|keyboardhidden to the activ...