Tag Archives: cool

Compare 2 source files and add difference to 3rd

Beyond Compare 3-way merge

Sometimes when you patch or update your current version of software there is a need to apply the same changes to a previous version. Ordinary it’s a pain – you need to painstakingly determine which changes from the current source should go to previous version (because current source has changed a lot, new features added etc).

Enter Beyond Compare – coolest tool to do all kind of compassion. One of the best features – “3 way merge”. It allows you to compare 2 files and apply the difference to 3rd.

In our case here is what it can do:

  • Select new patched version of source file and compare it to old unpatched version
  • In menu select “Session –> Merge Files” – a middle pane appears that allows you to select 3rd file
  • In the middle tab select new unpatched version

That’s it! Beyond Compare will compare new patched and new unpatched version. If there’s a difference – those lines will be applied to old unpatched version. Otherwise if both new versions are the same – old version keeps it lines, even though they’re different from new version.

It’s all performed automatically all you have to do in the bottom pane (where merge result appear) select the filename to save to and hit “Save”

How to search for Pebble app/watchface on the web

Pebble smartwatch has a pretty good appstore that is accessible from the official app on your phone. But sometimes I want just to search for the app on the Web (big browser, keyboard/mouse – you know). Fortunately it is possible:

Pebble Google Search

Just enter “site:apps.getpebble.com” in your google search in addition to search terms and you will be able to get direct links to Pebble apps/watchfaces in the app store.

Pebble direct appstore link

Of course this has limited use at the moment – you can scroll thru app screenshots, read the description and that’s about it. Ideally this would behave same way as Google Play store does – allow me to install the app from the web directly to registered device.

Your move, Pebble.

Flipping pebbles

Big Flip Clock

As far as smartwatches go – Pebble is a lot of fun. But after playing around with Watchface Generator, Canvas for Pebble and numerous other apps I wanted something more, something that only Pebble SDK could provide. A coder in me wanted to code.

Enter CloudPebble – an amazing online development environment that runs in your browser, has a full-blown C compiler and connects to your watch to run/debug compiled apps. Plus your projects are stored on the cloud and available anywhere you can get online.

Yes you program Pebble in classic C – and it’s a lot of fun. And my first real attempt at custom watchface (pictured above) is old-style flip clock, you can get it here. It is based on amazing pebble bitmap library by Gregoire Sage

How to receive Stack Overflow notifications on your phone and smartwatch (v 2.0)

StackOveflow Pebble UpdateA while back I described how you can receive Stack Overflow notifications on your phone and smartwatch by reading RSS feed provided by StackOvedlow API (v1) and connecting it to PushOver push notification service (and their Android app and ultimately Pebble Smartwatch via awesome IFTTT.

Since then Stack Exchange retired version 1 of their API (and besides it didn’t provided all the information needed, e.g. total reputation points) so I was looking for an alternative. Fortunately StackOverflow API v2 provides very extensive set of functions. One call I was looking for is

api.stackexchange.com/2.2/users/[userid]?site=[site]

Where [userid] is your Stack Exchange User ID and [site] is the Stack Exchange site you’re interested in. For example for me call to

https://api.stackexchange.com/2.2/users/961695?site=stackoverflow

provides a nice JSON output: Continue reading →

Canvas for Pebble: How to hide time in all-day events

If you wish to create a custom watchface for Pebble Smartwatch but want it to have some more advanced features than very cool Watchface Generator offers then amazing Android app Canvas for Pebble is definitely for you.

Using it you can have your Pebble watchface to display weather, location, temperature, of course date and time, etc. etc. in highly customizable formats.

One cool thing it allows you to show – next calendar events from your Google calendar. As with everything else it’s a highly customizable entry. For example three (out of much more) options are:

%a – abbreviated day of the week
%R – start time of the event in 24-hour-format
%ET – event title

So if you format the calendar field as "%a %R: %ET" your Pebble will display something like "Mon 12:30: Visit from Elvis". Unfortunately if calendar event is an all-day event (e.g. national holiday) – start time of the event (%R) always displays as “00:00” making your event look like "Tue 00:00: Day of the Tentacle". It would be really nice if we could hide the time for all-day events.

Fortunately one of the things Canvas allows you to do is conditional formatting. It does this in a form of {text1#condition#text2} where if condition is true – text1 is displayed, otherwise text2 is displayed (which is optional and can be omitted).

I noticed that for all-day events, event duration (represented in Canvas as %ED) is always 24 hours (duh). So I replaced the above format for calendar event with this one: %a{ %R#%ED<24}: %ET. The code in braces means “if event duration is less than 24 hours – show event start time, otherwise don’t show anything”. And the result is in images above.

Pebble Steel: DIY (some assembly required)

Pebble Steel: DIY

Pebble Steel is a new flagship smartwatch of a widely successful kickstarter Pebble. It’s the latest craze and everybody wants one. Unfortunately the demand far outweighs the supply – it’s a well known problem. Pebble can’t manufacture enough new Steels in time, there’re many backorders, missed deadlines, a lot of frustrated, complaining customers.

But Pebble is not called genius for nothing. They found a brilliant solution, one they borrowed directly from the Apple, when the company was at its very humble beginning and was struggling as well. If you recall – original Apple 1 computer was sold as an electronic kit, that users had to put together themselves. This approach solved many problems for Apple back then and it will be very helpful for Pebble today.

Enter “Pebble Steel: Do it yourself” kit. The new Steel will ship as a collection of parts with detailed instructions on how to put them together. Since Pebble Steel doesn’t have to come fully assembled – that will seriously cut down manufacturing time and the product will ship to users much sooner. Cost saved on assembly labor will also be passed directly to customers – expect to see cheaper Steels soon. And since majority of Pebble users are computer/electronics geeks anyway, crowd that loves tinkering with their gadgets – assembling your very own Pebble Steel will come as an interesting and a welcome challenge and will make a proud owner even more proud.

How to receive Stack Overflow notifications on your phone and smartwatch

If this then that

As you may have gathered I am a frequent participant of Stack Overflow Q&A board for coders. On that site everytime somebody responds to your question or comments – a notification is displayed in the status bar. Ditto when your reputation points change.

I became curious whether I could receive these modifications on my phone. Stack Exchange released their own application on Google Play store that does send push notifications when a reply is received, but no notifications on reputation changes. Also it’s still a little rough around the edges and besides I realized I didn’t want a full blown Stack Overflow application (when I do use SO for questions/answers I prefer the full site on my laptop). There should be another way. Continue reading →

Have you tried DotNet Fiddle?

You might be familiar with JS fiddle – an awesome tool that allows you to interactively test and share your JavaScript code along with gazillion of libraries and CSS classes.

You may even know non less awesome SQL Fiddle using which you can build custom schemas, tables, views and run and share your SQL queries in various RDBMS.

But have you heard about .NET Fiddle? This is a great interactive compiler, using IDE familiar to other fiddlers users it allows you to run and share your .NET code in both C# and VB.NET.

From the developers of .NET Fiddle:

We are a group of .NET developers who are sick and tired of starting Visual Studio, creating a new project and running it, just to test simple code or try out samples from other developers.

Give it try!

Infragistics WebSplitter: Set SplitterBar’s CSS class in clinet-side JavaScript

Hello there. Haven’t written in a while, been busy participating in Stack Overflow community, but this little bit I found interesting.

Infragistics has a cool versatile Web Splitter control in their ASP.NET suite, but recently I encountered a shortcoming – there’s no way to set a CSS class for splitter bar on client-side via JavaScript. On server-side you can do something like

xMySplitter.SplitterBar.CssClass = "hiddenElement";

On client-side – you can get the CSS class via

var sCss = $find('xMySplitter').get_splitterBarCss()

but there’s no counterpart set_splitterBarCss() method. Continue reading →

Locket: Get paid just for unlocking your screen

Get Locket

This is actually very cool, the company called Locket had a very novel idea: What do million of Android users do most often with their phones? Play games? Browse the Web? No! Unlock the phone.

That Lock screen is a prime real estate and they decided – why not display beautiful ads there? And the ads are very good indeed, a lot better than most wallpapers I’ve seen. And for every unlock swipe you get 1 cent. You’re doing it dozens times a day anyway – why not get paid for it?

Locket is an Android app that replaces your lock screen.

From the site:

Here’s How Locket Works:

Open your phone, and you’ll see an ad.

Swipe Left
to engage with an ad, claim a deal or watch a trailer.

or

Swipe Right
to go straight to your phone like you always do.

Either way, you get paid. Because the lock screen is the most valuable space in advertising. And you own it.

Join the club! Get Locket.