Mirroring Git/GitHub to Hg/BitBucket

This seemed a lot longer when I planned it in my notebook at lunch.

GitHub user project (both sides) BitBucket user SCM Schedule
ocornut imgui g-pechorin None Periodic
  1. Install hg-git
    • You’ll have to do this on the Jenkins server
    • You’ll have to do it either for the Jenkins user or all
    • I’m using a OsX machine as my host, so I was able to use easy_install to install hg-git and dulwich
  2. setup a project on GitHub
  3. create a Jenkins Freestyle project which runs periodically
    • Polling the SCM was NOT an option since there’s no default branch on GitHub
      • … this is a quirk of hg-git … I think
      • … IIRC/YRMV - so sling me a tweet or whatever if I’m wrong
  4. program the job to pull from git, push to hg, and ignore results of 1
    • this was only elaborate because I needed it to not-fail when there were no changes
      if [ -d "imgui" ]; then
      echo "Re-Using ImGUI"
      cd imgui
      hg pull git+ssh://git@github.com:ocornut/imgui.git
      echo "Cloning ImGUI"
      hg clone git+ssh://git@github.com:ocornut/imgui.git
      cd imgui
      hg push -f ssh://hg@bitbucket.org/g-pechorin/imgui
      if [ $retcode -eq 0 ] || [ $retcode -eq 1 ]; then
      exit 0
      exit $retcode

Mercurial / Hg SubRepos

I’m still trying to catch up on stuff following Develop. I’ve decided to write a post about my experience(s) switching my work over to SubRepos.

I am unaware of the “reason” why they’re considered “bad.” Perhaps it’s a Unix thing? Maybe they don’t work as well as people feel that they should?


As an example, I have a (secret) project called “nite-nite/“ in which I use and develop some public-domain headers. I want this public-domain stuff to be … well … public-domain and external.

First step is/was to setup a repository to hold the thing on BitBucket.

Following the basic usage I cloned this into my existing working copy and set it up as directed;

C:\Users\peter\Desktop\nite-nite>hg clone ssh://hg@bitbucket.org/g-pechorin/pal-public-domain
C:\Users\peter\Desktop\nite-nite>echo pal-public-domain = pal-public-domain > .hgsub
C:\Users\peter\Desktop\nite-nite>hg add .hgsub
C:\Users\peter\Desktop\nite-nite>hg commit -m "added public domain stuff"

So far so good right? Well … not so much. The push command won’t work right since the setup we/I just used.

The fix is simple, the .hgsub file looks like this …

pal-public-domain = pal-public-domain

… and it needs to look like this …

pal-public-domain = ssh://hg@bitbucket.org/g-pechorin/pal-public-domain

So amend the previous commit and push

C:\Users\peter\Desktop\nite-nite>hg commit -m "added public domain stuff" --amend
C:\Users\peter\Desktop\nite-nite>hg push

Great, now I’ll get on with the actual work of moving those headers into the public-domain project.


I fixed a bug. I don’t have a video of this bug - just the fix


So - two more bugs to go before I can add features

Stop Motion

Mother told me to try something different

Stop Motion @ YouTube

I made a stop-motion video (mostly to see if I could) … also, I wanted to see if I could record “blocked out” storyboards since I’m a crap pose drawing person.

I spent £2 on some pipe cleaners and a dopey phone stand. I took the pictures on my phone. I used some bluetack to help posing, pyOpenCV3 to encode the jpegs at 3 FPS, and ffmpeg to reduce the file size so that I could upload it in < 40 minutes.

The writeup took about 40 minutes … so maybe I didn’t save much time

I think the fella could use some firmer limbs - (maybe pasta tubes?) to make animation easier. I went looking for used-GI-Joe toys to produce storyboards from. I wanted the articulated hips and joints to show things like dudes slouching. With firmer limbs - I’d probably get smoother results … maybe …

It also might be good to have a steadier hand when taking the pictures.

Dual Hetero Quadro on Heaven

Literally the punchiest title I could come up with. I’ve been told that heterogeneous GPU setups are ridiculously slower than a single-GPU. This is largely an anecdotal shrug of “hey - a second GPU doesn’t really slow my computer down in any meaningful manner at all!” I’m sure that I did this all wrong and that the GPU is capable of being tweaked into a setting where this all becomes conclusively - the legwork for that isn’t interesting to me so I haven’t done it.

TL:DR; A second GPU which doesn’t match up or SLI won’t give you cooties.


My workstation came with an NVidia PNY Quadro K600 GPU, which was replaced with a K620. I decided to put the K600 back into my computer as a secondary card and run UniGine Heaven benchmark to see just how slow a third wheel makes it. All tests were carried out at full-screen-exclusive resolution but were otherwise using the Heaven Benchmark’s default settings for their namesake. Stereoscopy was disabled for the non-stereo setting, and I used 3d Vision as UniGine’s the stereo method. For stereo settings the 3D OpenGL Stereo profile was used with Stereo= Enabled and Display Mode= Generic Active Stereo.


I really can’t see any reason that a consumer would use this setup - it just amused me.

Configuration Detail Setting Stereo Score Frames Per Second Minimum FPS Maximum FPS
K620 Extreme Yes 131 5.2 3.5 24.4
K620 Basic Yes 269 10.7 5.2 21.6
K620 Extreme No 281 11.2 7.3 22.5
K620 Basic No 592 23.5 15.0 42.2
K620 + K600 Extreme Yes 131 5.2 3.7 10.0
K620 + K600 Basic Yes 270 10.7 8.2 18.4
K620 + K600 Extreme No 280 11.1 7.2 22.0
K620 + K600 Basic No 591 23.5 14.8 40.5


The relation between the numbers suggests that;

  • the second GPU does kind of slow it down measurably
  • the second GPU doesn’t slow it down noticeably
  • the Dual-GPU is a teensy bit helpful with Stereo rendering, but not quite worth the cost
  • in a real-game, I could tell the second GPU to do PhysX work and maybe see some improvement?

I may have left some junk running on the desktop during the single-GPU tests, so the difference could be skewed a bit. Regardless; I’m confident that adding the second GPU to this desktop hasn’t sucked-up all my PCIe lanes or something silly.


  • how would this work in an AMD/NVidia mix? (Red/Green)
  • would a x86 OS work any good/evil with with x86 benchmark?
  • would something with PhysX really be that different good/evil?

Canadian Racing Geese

I have had several geese charge me - this is a poor approximation.

I was quite young and the geese were acclimated to humans, more importantly they knew how tasty the french fries and clam strips we carried were. I never had a chance, nor will I ever forget. Honking with an bestial hunger, the savage geese charged! Pursing me across the fried clam shop’s parking lot, my mother could only cackle as she scrambled for the camera.

To this day - I have not returned to that shop.

Bin Plugins / Python 3.5.1

I was playing with Python’s binary extension system and was impressed with the simplicity. I think that the usage of setup.py encourages a consistent ecosystem … as opposed to the more open conventions used by Java and CLR.

(I followed the generic instructions and they worked fine on Windows 8.1 - disregard the hype/hate!)

Example on GitHub

Samon 2

I wrote a whole post/blurb in one sitting!

Read it here

Also; Haoyi made a neat post about Build Tools (I mentioned his work at least once and wanted to be sure I had his deets and URL correct)

Switched Themes

I switched themes … because.

New theme seems to be better on mobile devices and easier to tweak

I wish it did previews of posts

Hungarian Notation

In which I pontificate on the subject of Hungarian Notation

Hungarian Notation is a contentious topic.

It boils down to an ambiguity for the word “type” within English / C++. MicroSfot’s modern style-guide says not to use “Abbreviations and Acronyms” or “Hungarian Notation” - originally Hungarian Notation was a style of abbreviation. I’m going to paraphrase a long blog post by Joel on Software and summarize my thoughts at the end.


C-family languages (C/C++, Java. C# JavaScript, Python, etc) have rather “weak” types, things like Haskell and Ada95 have strong types. If you define an integer in Ada95 (for example) you can give it a range of values (1 to 7) or even names (days of the week) to prevent confusion. So you’ll never be able to assign a day-of-the-month (1 to 31) value to a day-of-the-week (1 to 7) variable without a compiler error from Ada95.

I’m going to illustrate this with an example of storing the day number as an integer.

Charles Simonyi’s idea was that when you created an int day; to store the weekday variable you would use the name int wDay; to denote that the semantic type of this day integer was “week.” They were using “Abbreviations and Acronyms” as a sematic-type on their variables The IT managers who set policy didn’t understand the difference between semantic type (the meaning of the data) and storage type (the mechanical storage of the data) but knew Simonyi’s team was working better and the “type” as a prefix to their variables. So the convention became “thou musteth prefixth thine variable names with their types” for a long time.

I think that this was before IntelliSense and CodeCompletion was practical - error checking took a long time and this misinterpreted version of Hungarian Notation did help. My guess would be that IntelliSense and CodeCompletion came along and the practice became a redundant chore so it was abandoned mostly.

Peter’s Advice

To get the best of both worlds (and still look clever) name your int day; as dayOfWeek / dayOfMonth so that things like …

// day of month will be between 0 and 30 (or 1 and 31)
result->dayOfMonth = weekDay;
// "day of week" will be between 0 and 7
// "day of year" will be between 0 and 365 (or 1 and 366)
int dayOfWeek = (dayOfYear + 1) % 7;

… will look more-wrong and stick out when you’re debugging.

Certainly better than;

// What is this?
result->iDayWhichMightBeSomething = iDayWhichIsSomething;