Core S2 Software Solutions

Verlet Integration: real-time cloth-like simulation

I’ve implemented a simple verlet-integration based 2D cloth simulation in Javascript here. This code is written in standard Javascript and uses the Three.js library for rendering through WebGL / Canvas through any modern browser. This was done as a quick debugging project as I couldn’t get an equivalent high-performance C++ implementation to work. As always, feel free to fork and modify the code to do whatever you want: license is free-for-all.

VerletClothIf you don’t want to Git-clone it on your computer, feel free to run it here online. (Not interactive; feel free to fork here!)

Posted in Programming | Leave a comment

Daily Programmer – Improving your real-world programming skills

DailyProgrammerSubreddit

Reddit’s r/DailyProgrammer subreddit is a brilliant community-organized group of programmers from around the world that do what many of us enjoy as a hobby & job: program! What’s nice is they do a range of programming challenge difficulties, from the “simple enough to have some fun with writing a crazy solution” to the complete brain-stumping challenges you sometimes hear in interviews.

I was made a moderator a few months back to help out with the community and help with new challenge submissions. I really enjoyed competitive programming events (as incredibly stressful as they were), so I was happy to learn about such a community and try and put up some of my own challenges. What I’ve learned in a few short months really reinforces what I’ve learned from professional programming experience  being crystal clear in documentation (i.e. challenge description) is of the upmost importance when it comes to programming. I’ve read tons of amazing solutions to corner-cases and special bugs that I couldn’t think of, having a blast learning new tricks as well to use for work!

To help out r/DailyProgrammer, I’ve written a web-crawler that does a bit of trickery to automate post submissions on my behalf. Usually we post three times a week, but consistency is hard when an actual human has to do it. Instead, this Python script takes unused submissions from a Google Docs spreadsheet (which is posted to through a spreadsheet form, keeping input very consistent), makes sure what it took fits the challenge difficulty expect for that day, and then posts it through my Reddit account. Nothing amazingly fancy, but it’s nice when tools and libraries “just work”.

Check out the source code here!

I’ve also added a fun peer-reviewed flair system. The basic idea is that comments get controlled through up/down-votes (as usual), but each active member gets a flair piece that has a gold medal and silver medal, with respective numbers on each circle. This shows how active and beneficial the given user has been to our community. Sure, people aren’t getting anything outside of digital flair, but it really does go a long way boosting up new programmer’s confidence saying “Hey, awesome solution! Really cool to see someone write it in that few lines of code!”, and then giving them a digital +1 gold medal.

Posted in News & Updates | Leave a comment

WindowSnaps!

Logo

Cheesy logo for an awesome desktop app!

I’ve loved the Window’s “window snapping” feature since they introduced it in Windows Vista. The feature is completely intuitive and incredibly helpful for programmers, where you constantly have to pull up documents, texts, images, and other resources, and have them be compared side-by-side. The feature basically is “drag any window by its top bar into the left or right screen edge for it to fill that half of the screen, or drag it to the top to fill the entire screen”. A simple drag and snap to get two windows in parallel without a single precious pixel lost is amazingly helpful when looking up documents; significantly more-so than just alt-tabbing.

OSX doesn’t have this built-in (I’m sure it’ll appear in some future update), and since I’ve yet programmed in Objective-C on OSX proper (the platform is so similar to iOS programming after all), I decided to write my own! Apple engineers did a great job keeping applications in a “sandbox”: there is no formal way, outside of writing a kernal extension, to “extend” the OS (more correctly, the “shell” people see). Thus, my application is truly just an app running in user-space, and gets its control of other windows and user events by using the OSX accessibility API. Though this requires the user to give permission, it is very flexible and pretty all-encompassing. At-times I found it frustrating to entangle C code and Objective-C code, but Apple does a good job of at least keeping the programming approach and designs extremely similar. All of the C code is crystal clear, and the memory-management system is the exact same as Obj-C, so nothing new has to be learned, nor do I have to heavily rely on managing my own memory.

Check out my app, titled “WindowSnaps” on Github here! I’ll be publishing the app for free on the Apple store shortly.

Posted in News & Updates | Leave a comment


Sites map