Skip to main content

Posts

Showing posts with the label problem and solution

Reverse engineering Pubvn apps for fun and... larger-screen-fun

It's Friday night and the wife TM wanted to watch Games of Thrones on the TV (via Chromecast). Should be easy right? We have lots of apps installed for exactly this purpose: Netflix, HBO Now, Flix , etc. None of them worked though... Netflix just doesn't have HBO contents like GoT. HBO Now works but it requires a US proxy to watch and there is no way to tell the Chromecast to go through a proxy. Flix, a promising local app, good with TV streaming but not series. So we had to settle to use HBO Now and Google Chrome's cast tab feature to have it on the big screen. A complicated setup, and slow. The casting was broken a few times during the episode, probably because of wifi interferences. This problem needs some engineering! Proxy Those Apps First order of business would be proxy their apps to catch all network requests. I used Charles  with their iOS app. At first I thought it would be tricky if they use https or certificate pinning but it turned out everything ...

The new UISplitViewController, Swift and iOS 7

I was playing around with Swift today and stumbled upon the new awesome UISplitViewController  in iOS 8. This enhanced version of the controller makes it work for all iOS devices (originally, it only works with iPads). With the introduction of the "phablet", Apple had to improved their SDK to make it easier for devs to build app that works across all screen sizes. That's a good thing, but a little too late IMHO. Anyway, back to UISplitViewController, the app created by the Xcode template only works with iOS 8 so I tried to dig in and see if it is possible to support iOS 7 with the same code, same storyboard and everything. It looked like it was possible. Many people tried that, particularly this blog post , but the best solution out there still doesn't have it working smoothly in iPad portrait mode where it should show a button to open the master view in a popup... After a few hours looking around, I finally found the solution and have a demo project available at g...

Trying HHVM

So I was trying HHVM on a VPS when I encountered the error "list sub-command REMOVE_AT requires list to be present". Having no idea of what it is, I tried a Google search and ended up with a page of results (5 or something with half of them in Chinese) and no pointer at all... The full stack is like this CMake Error at CMake/EXTFunctions.cmake:8 (list):   list sub-command REMOVE_AT requires list to be present. Call Stack (most recent call first):   hphp/runtime/ext/imagick/config.cmake:12 (HHVM_LINK_LIBRARIES)   hphp/runtime/ext/CMakeLists.txt:24 (include) So I went in... vi CMake/EXTFunctions.cmake Found some macro definitions and some function declarations. The two things that caused error are both macro so I change them to function and it works! See the edited file here . At least CMAKE worked and now I'm running MAKE. I will update this post when I got HHVM running. So HHVM has been compiled and ran smoothly on my box. I submitted a pull req...

Nghi vấn CHAOBUOISANG.NET; Hãy là người sử dụng Facebook thông thái

Cập nhật ngày 1/11/2013: Đã có hỗ trợ phát hiện các trang lừa đảo cho trình duyệt Google Chrome, Apple Safari và Mozilla Firefox. Xem ở cuối bài. Cập nhật ngày 30/11/2 013: Cảnh báo kẻ xấu lợi dụng Clickjacking extension để tạo "botnet" . Hôm nay đột nhiên thấy một số lượng lớn bạn của mình trong Facebook like một bài viết ở trang CHAOBUOISANG.NET, mà lại đúng một bài mình vừa đọc cách đây ít phút... Kiểm tra lại activity trong Facebook thì phát hiện ra chính tài khoản của mình cũng đã like bài viết đó. Có vẻ có nghi vấn nên đã mở Google Chrome Inspector và kiểm tra lại nhưng không có kết quả gì. Dự đoán là có đoạn mã nào đó tự bảo vệ chống bị phát hiện nên mình đã tạo Profile mới trong Google Chrome, đăng nhập vào một tài khoản Facebook khác để thử lại. Lần này thì phát hiện ra một iframe ẩn chạy theo con trỏ chuột đúng như dự đoán: Sau khi kiểm tra kĩ hơn thì đoạn mã sinh ra iframe này nằm trong file /js/common_load.js , ý tưởng cơ bản như sau: Tạo một thẻ div vớ...

When I said vibrate, you should do that

So I upgraded my old-ish P500 to ICS one or two weeks ago. Nothing complicated, step by step below Download the ROM here . The thread specifically mentioned "GEEK ONLY". At the time of this writing, the latest version is beta 4. It's quite solid. Good battery mileage. All fundamental modules are working with the exception of Camera. Reboot into recovery and flash it. Before trying ICS, I used CM7 + CMW so it should be easy. In case you are curious, I was using this ROM . I used version 6.6. Now it's a little out dated but when I tried it, it was the first and the only CM7 ROM for P500.  After the flash, not reading the instruction very carefully, I wiped basically everything and boot it up. OMG IT WORKED. Beautiful home screen and the new overall style. I was quite satisfied. Browsing around for a while then I tried to go to the Market only to realize I have no Google apps installed. This is a common thing so I wasn't surprised so much, just need to grab the...

UML Diagram - Here we go

Finally, we made it! The UML assignment now has 3 versions Standalone version which is packed as a .jar file and can run without any problem in Windows and Linux (of course, JVM is required). You can get in here (Google Code link). The features are Build UML class diagram From scratch: using menu, pop-up menu, drag and drop with a bunch of forms From existing source code: load your Java source file(s) and modify the diagram using the same techniques as above Export Java source file(s) from the diagram. All methods are empty (of course) Save as Image The whole diagram Or this a part of it Easy navigation: most of the cases, the diagram will be big and it will be hard to have a good view but you can... Zoom in and zoom out Moving around  Rearrange structures to make them more well-organized (if you mess them up, feel free to re-draw from the menu) Quickly find a structure in the diagram  A more focus view in a structure by display related structures only ...

Survival Simulator Game (a closer look)

As mentioned earlier ( in this post ), I have built several modules for a Survival Simulator Game. You can see it in action in the old post. And now, I have finished documenting the source files (my modules only) and you can get source file and document from MediaFire or BlueHost . You can also view document online here: http://geek.daohoangson.com/projects/java/creatures/doc/ . Using the TextUserInterface is very simple (code copied from Game.java, provided by the instructor): Using my GraphicalUserInterface is pretty the same way: There are 2 notes: I modified the Game class (Game.java) to make it run infinitely If you double click the gui.jar file, you won't be able to view debug messages. If you want to view them, you have to invoke from console using something like this: java -jar gui.jar

Lazy developer

Have you ever heard a joke about developers? Actually it's not a joke since I personally think it's true (at least to me) but it's always fun to hear: Developers are very lazy. (Oh yeah, I'm). They can't afford to finish a 15-minute job at all. (Oops). They will spend 3 hours coding to be able to finish that job in 1 minute. (Uh oh, that's 14-minute laziness. LOL) I have an example here: got an exercise in discrete mathematics which involve using the Dijkstra algorithm to find the shortest way between a vertex to another in a graph. There are enough vertex in the graph that made me lazy (5, LMAO). Oops, I have just opened up the source code and found out it's about Hamiltonian path , anyway, I was lazy and finally came up with this PHP script to solve the problem quickly (hundreds millisecond is considered quick, isn't it?) The script is intelligent enough to sort out all duplicated paths. Lazy meeee!

This is pretty cool

This is pretty awesome. Try it now: "Trương Thúy Ngân" , "Truong Thuy Ngan" and Trương Thúy Ngân . The links will be opened via anonymouse.org to prevent customized search results from Google. You may want to use Google Vietnam version: "Trương Thúy Ngân" , "Truong Thuy Ngan" and Trương Thúy Ngân . You invaded my life, didn't you?

UML Diagram - Very first steps

Well, this is our second assignment of Java: writing an application which allows user to create a UML diagram and generate the code (with empty methods, of course) in Java. Actually the assignment suggested another reversed approach: reading Java source code files and generate the UML diagram but our team decided to choose it. After some discussion, yesterday, mr Tran Viet Son has done the data structure for the application which is pretty interesting and I'm showing you now. The source code can be grab here . All the core classes are under a package called com.tranvietson.uml. The test code is something like this

vBulletin users list in AdminCP Options

I intended to write about this for a while but I haven't had time. This is pretty cool stuff. When ever you want to have a users list for your plugin? Let's say you want to give some members a special permission to use the plugin. What's the best way to do that? Well, adding a field into `users` table is not really good. Setting up a new bitfield permission is interesting but if some other coder use the same bitfield value, disaster! Hmm, the most secure thing will be a separate table to store authorized userid, really good but slow and costly (and stupid somehow), nobody implements a new table just to store those userids! Many coders will use vBulletin Core Options system, create a free type input box, ask the Administrator to input userids, seperated by comma, etc... That's a good approach I think since it's quick and easy, most Administrators have enough knowledge to get the correct userids. But well, if we can make it better, why not? That's why I came up wi...

Local Search Engine

Today I ran into a problem: I need Windows XP driver for the Colorvis Z1 webcam . As usual, I have my belief on Google and because I'm using Google Chrome , I typed into Chrome's Omnibox : "windows xp driver colorvis z1", I clicked a few links but nothing works! Most of the links are from search engines or software portal sites. They did their job pretty well and I believe mis-clicks from people like me generate quite much revenue for them despite the fact that their site is useless! I was going to give up but then I got an idea. I went directly to Google Vietnam and typed this query: "driver colorvis". Actually, a few suggestions came up and I selected "driver colorvis 6 mat" (in English: "driver colorvis 6 eyes") and I got this site in the second position. I downloaded the driver and it works! So, in conclusion: After ~100MB downloaded driver from international sources, my webcam is still useless but after the first try with 25MB ...