AbstractPath | AbstractPath http://www.abstractpath.com thoughts from @tumtumtum Sun, 12 Jan 2014 02:27:36 +0000 en-US hourly 1 http://wordpress.org/?v=3.8.2 Updating OpenSSL to Install Postgres 9.x on CentOS 6.xhttp://www.abstractpath.com/2014/updating-openssl-to-install-postgres-9-x-on-centos-6-x/?utm_source=rss&utm_medium=rss&utm_campaign=updating-openssl-to-install-postgres-9-x-on-centos-6-x http://www.abstractpath.com/2014/updating-openssl-to-install-postgres-9-x-on-centos-6-x/#comments Sun, 12 Jan 2014 01:10:43 +0000 http://www.abstractpath.com/?p=937 The instructions provided here for installing Postgres on CentOS via yum don’t work for Postgres 9.x (Postgres 9.3 being the latest) if you’re stuck running CentOS 6.4 or lower. CentOS 6.4 and lower do not ship with OpenSSL 1.0.1 which is required by Postgres 9.x — they ship with OpenSSL 1.0.0 or lower.

You will most likely get the following errors:

 Error: Package: postgresql93-Server-9.3.2-1PGDG.rhel6.x86_64 (pgdg93) Requires: libssl.so.10 (libssl.so.10) (64bit)</p>
<p>Error: Package: postgresql93 -libs-9.3.2-1PGDG.rhel6.x86_64 (pgdg93) Requires: libssl.so.10 (libssl.so.10) (64bit)</p>
<p>Error: Package: postgresql93-9.3.2-1PGDG.rhel6.x86_64 (pgdg93) requires: libssl.so.10 (libssl.so.10) (64bit)</p>
<p>Error: Package: postgresql93-libs-9.3.2-1PGDG.rhel6.x86_64 (pgdg93) Requires: libcrypto.so.10 (libcrypto.so.10 ) (64bit)</p>
<p>Error: Package: postgresql93-Server-9.3.2-1PGDG.rhel6.x86_64 (pgdg93) Requires: libcrypto.so.10 (libcrypto.so.10) (64bit)

Follow the instructions here to build and install an RPM package for OpenSSL 1.0.1. Once that’s done, follow the instructions for installing Postgres again and it should work.


An even simpler approach

Install the ius repo:

 rpm -ivh http://dl.iuscommunity.org/pub/ius/stable/Redhat/6/x86_64/ius-release-1.0-11.ius.el6.noarch.rpm

Enable the ius-archive repo:

Edit /etc/yum.repos.d/ius-archive.repo and enable the ius-archive repo by changing enabled=0 to enabled=1.

Install the yum replace plugin:

yum install yum-plugin-replace

Replace the existing openssl package with openssl10:

yum replace openssl --replace-with openssl10

http://www.abstractpath.com/2014/updating-openssl-to-install-postgres-9-x-on-centos-6-x/feed/ 0
C# LINQ and Sum, Min, Max, Average behaviourhttp://www.abstractpath.com/2014/c-linq-and-sum-min-max-average-behaviour/?utm_source=rss&utm_medium=rss&utm_campaign=c-linq-and-sum-min-max-average-behaviour http://www.abstractpath.com/2014/c-linq-and-sum-min-max-average-behaviour/#comments Fri, 03 Jan 2014 22:38:01 +0000 http://www.abstractpath.com/?p=888 I’ve recently been improving support for aggregates in Shaolinq in order to make Shaolinq queries match LINQ to objects as closely as possible. The LINQ Enumerable<T>.Sum, Enumerable<T>.Min, Enumerable<T>.Max and Enumerable<T>.Average extension methods map to the SQL aggregate functions SUM, MIN, MAX and AVG respectively. In SQL, all these functions will return a null if there are no rows returned. In .NET, the behaviour when the enumerable is empty depends on whether the type T is nullable or not.

The .NET aggregate methods Min, Max and Average will throw an exception if the enumerable is empty and type T is not nullable (int vs int? etc). If type T is nullable then Min, Max, Average will return null. The exception to all this is Sum which will always return 0 regardless of the nullability of type T.

When performing a SQL aggregate query such as SELECT SUM(age) FROM PERSON, SQL will return a single row even if there are no PERSON rows and the SUM column value set to null.  This null value is used to detect empty result sets which can be mapped to the appropriate exception or null result depending on the nullability of the .NET required type. To match the behaviour of always returning 0 for Enumerable<T>.Sum regardless of whether the resultset is empty or not, Shaolinq wraps SUM aggregate calls in a SQL COALESCE. This is handled by the SumAggregatesDefaultValueCoalescer class along with SqlQueryProvider and ObjectProjector.


http://www.abstractpath.com/2014/c-linq-and-sum-min-max-average-behaviour/feed/ 0
Art Tech AT-6 Texan Replacement Retractshttp://www.abstractpath.com/2013/art-tech-at-6-texan-replacement-retracts/?utm_source=rss&utm_medium=rss&utm_campaign=art-tech-at-6-texan-replacement-retracts http://www.abstractpath.com/2013/art-tech-at-6-texan-replacement-retracts/#comments Fri, 27 Sep 2013 14:52:43 +0000 http://www.abstractpath.com/?p=879 I have a Art Tech AT-6 Texan RC plane. The one big problem I’ve had with this plane is that the electronic retracts that come with it are prone to overloading, hanging and overheating. If you switch the retracts on/off too fast it causes a current surge which overloads the control transistor causing the retract to hang until it’s unplugged. Sometimes the “brake” switch at either end of the retract’s extents stop working causing the retract motor to continuously push, damaging the “brake” switch even further and causing the whole unit to massively overheat.

A set of replacement retracts for the AT-6 cost £35 but you can get the exact same retract system (sans the wheel and strut which you can move over from the broken set) for £5 each from HobbyKing. They have UK stock as well….

Art Tech AT-6 Texan RC Plane Replacement Retract Replacement retracts with original wheel and strut attached


http://www.abstractpath.com/2013/art-tech-at-6-texan-replacement-retracts/feed/ 0
iPhone exchange setup connection to server failed errorhttp://www.abstractpath.com/2013/iphone-exchange-setup-connection-to-server-failed-error/?utm_source=rss&utm_medium=rss&utm_campaign=iphone-exchange-setup-connection-to-server-failed-error http://www.abstractpath.com/2013/iphone-exchange-setup-connection-to-server-failed-error/#comments Wed, 26 Jun 2013 12:03:00 +0000 http://www.abstractpath.com/?p=865 I got a replacement iPhone 5 today and tried to setup my exchange account. It failed and all I got was a cryptic ‘connection to server failed’ error alert box. This error could mean a lot of things and I had no luck finding anything of substance in the Exchange 2010 or IIS logs.  

After a few hours of frustration an searching, I discovered that my problem was caused by having too many mobile devices attached to my exchange account (apparently I’ve owned 10 unique iPhone/iPads over the last 5 years). You can check this by using the exchange web mail interface. Log into web mail -> Options -> All Options then you’ll see a tab on the left named “Phone”. From there you will see a list of devices that have ever synced with your exchange account. Remove the old ones. You may have to delete and then recreate the exchange account on your iPhone for things to start working again.

Exchange Mobile Devices

http://www.abstractpath.com/2013/iphone-exchange-setup-connection-to-server-failed-error/feed/ 0
Tips for running a tech startuphttp://www.abstractpath.com/2013/tips-for-running-a-running-a-tech-startup/?utm_source=rss&utm_medium=rss&utm_campaign=tips-for-running-a-running-a-tech-startup http://www.abstractpath.com/2013/tips-for-running-a-running-a-tech-startup/#comments Sat, 18 May 2013 21:39:24 +0000 http://www.abstractpath.com/?p=824
  • Do not forget that your most important task is to focus on creating a great product. No amount of marketing spend will make up for a crap product that no one really wants to use. 
  • Make what you know — not what you think will make money. Running focus groups to “discover what is needed” is something best left to large corporations with money to burn and little or no vision or decision making capabilities remaining. Your chances of success  are greatly increased if you create your startup to answer a need that you yourself have. In doing this this, you will not have to constantly ask if what you are doing is right. You also guarantee that you will have at least one user: yourself.
  • Choose one or two things you want to do really well and then set out to do them really well. Do not allow yourself or those who work for you to lose to lose identity and focus. Do not create a homer.
  • Do not forget to create a strong company culture.  Do not expect it to create it itself — especially if you are the founyder. Think about what your company’s goals are and then think about the people you will require to accomplish those goals. For example, if your product is a software product then do not deny that you are a technology company. If you’re a technology company then create a culture that will attract technology people. Engineers like casual dress, free coffee, free soda, free snacks, fast computers, big monitors, comfy chairs and a quiet working environment. Providing these things will be one of your most cost effective spends and your investors will thank you for it.
  • Do not forget to create a strong brand. The brand projects your company’s culture and values. Like your company culture, the brand will not create itself. The brand needs to be lucid and unified. Don’t forget that the brand is for everyone; most especially your employees. A strong brand will reduce conflict in decision making. (Think of the question: “Is this constitutional?”).
  • Do not focus on small problems whilst ignoring the large problems. For example, do not stress over the cost of a coffee machine for your developers whilst ignoring overrunning third-party consultancy costs (such as SEO consultants).
  • Do not hire SEO consultants.
  • Do not outsource your core competency. If you’re a game company, you can outsource your web design but don’t outsource your game design and development!
  • Avoid anyone who regularly uses the terms viral or game changing as if it’s a solution.
  • Avoid anyone who thinks that the key to success is the silver bullet of the week (for example: changing the color of your buy button from grey to blue is not creative thinking nor will it magically double your user count).
  • Look for the best engineers and pay them accordingly. Simple.
  • Except for sensitive financial information, do not create a cloak and dagger culture. If you’re a tech startup, your employees will (if you’re doing your job properly) be above average intelligence. Respect that.
  • If you’re an engineer yourself, you probably can’t wait to get your hands dirty in the code.  Encourage rather than discourage your team to code. Managers at Google and Facebook are encouraged to code. Software engineers like to follow managers who can code just like soldiers like following orders of generals who can fire a gun.
  • Software scales very well economically. Do not skimp on the initial development costs. Invest upfront to create a great product because the cost of distributing a great product to 10 million users is going to cost about the same as distributing it to 10 users. If you don’t create a great product, you won’t have 10 million users. Someone else will.
  • In the physical world, a premium product has to have a premium price tag to cover the costs of materials and production. In the software world, a premium product does NOT necessarily have to have a premium price tag. If you try to compete purely on price (rather than on quality or execution) then someone else will get your users.
  • Limit your product functionality for up-sell if required but don’t think that deliberately creating a poor user experience in the hopes that people will upgrade is a good strategy. What is most likely to happen is that the user will not pay at all and use an competing product instead. A good example is coffee shops. I once heard it argued that coffee shops should have uncomfortable chairs to encourage faster throughput of paying customers. This sounds reasonable but it does not take into account competition. You may be able to get away with this if you are the only coffee shop in town but in reality your customers will quickly find better, more comfortable places to drink and socialise. You may get customers once but they won’t come back. People don’t put up with bad user experiences unless they have to. If you’re building software, think about creating the equivalent of comfy chairs for your users. As mentioned in the previous point, the amortised cost is minimal.
  • Have fun :-)
  • ]]>
    http://www.abstractpath.com/2013/tips-for-running-a-running-a-tech-startup/feed/ 0
    Platform.VirtualFileSystemhttp://www.abstractpath.com/2013/platform-virtualfilesystem/?utm_source=rss&utm_medium=rss&utm_campaign=platform-virtualfilesystem http://www.abstractpath.com/2013/platform-virtualfilesystem/#comments Fri, 03 May 2013 17:17:21 +0000 http://www.abstractpath.com/?p=802 I’ve just open sourced my Virtual File System library for C#. It provides a uniform interface to any type of file system providing interfaces for navigating, reading, writing, hashing and network access. It’s useful on both client and server side. The best feature is support for creating (sub)views of file systems — similar to chroot on unix. You should never try to access file systems directly again.

    You read more about it from the GitHub project page :-)

    http://www.abstractpath.com/2013/platform-virtualfilesystem/feed/ 0
    The ridiculousness of Microsoft .NET JSON dateshttp://www.abstractpath.com/2013/the-ridiculousness-of-microsoft-net-json-dates/?utm_source=rss&utm_medium=rss&utm_campaign=the-ridiculousness-of-microsoft-net-json-dates http://www.abstractpath.com/2013/the-ridiculousness-of-microsoft-net-json-dates/#comments Tue, 30 Apr 2013 15:49:16 +0000 http://www.abstractpath.com/?p=789 If you’ve seen JSON date times as formatted by WCF you’ll notice that they’re formatted like this:


    The first number represents the number of seconds since 1/1/1970. The second number represents the time offset from UTC (presumably from the location where the date was created).  I’ve seen a whole lot of confusion on the internet about what to do with the second number on deserialization. Many people try to adjust the time they got from the first number with the second number. Do not do this. The reason the second part exists is ridiculous and relates to a change Microsoft made to .NET between version 1.0 and 2.0.

    When Microsoft released .NET 2.0, they introduced a new property DateTime.Kind which affects the behaviour of the ToUniversalTime and ToLocalTime methods. If you have a DateTime representing a kind of “Local” then converting ToUniversalTime would return a DateTime with a different value however if the kind of the DateTime was already Utc then calling ToUniversalTime would return a DateTime with the same value. Presumably the Kind property could be queried by UI controls in order to determine whether conversion is necessary before display.  I would argue that internally you should always store DateTime as UTC and then always convert to Local (or whatever timezone you need) on display. There is a highly questionable performance advantage to internally storing dates as local time.

    The only information you need to reconstruct a valid time is the first number. The Microsoft JSON deserializer will ignore the + or – as well as the second number and only uses their presence to indicate the DateTime.Kind of the deserialized DateTime structure. This Kind will only affect whether the internal value of the DateTime is stored relative to 1/1/1970 local time or 1/1/1970 UTC but will not affect the actual time stored. If you were to call ToUniversalTime on the deserialized DateTime it should come out to the same value regardless of whether the second number was +0500 or -0700.

    Generally it’s good practise to convert a DateTime ToLocalTime before displaying to the user so the need to set DateTime.Kind is completely unnecessary and confuses the serialisation format. This confusing method of serialising DateTimes may have performance advantages in very edge case systems. In my opinion, most well designed systems would only ever work with DateTimes in UTC format, converting only at the time of display.

    http://www.abstractpath.com/2013/the-ridiculousness-of-microsoft-net-json-dates/feed/ 1
    London startup tips from a tech guyhttp://www.abstractpath.com/2013/london-startup-tips-from-a-tech-guy/?utm_source=rss&utm_medium=rss&utm_campaign=london-startup-tips-from-a-tech-guy http://www.abstractpath.com/2013/london-startup-tips-from-a-tech-guy/#comments Fri, 29 Mar 2013 19:12:14 +0000 http://www.abstractpath.com/?p=756 Here’s some startup tips from a tech guy who’s been working in a London startup for the last few years.

    • Start your company with like-minded people who share your vision.
    • When hiring, intelligence and experience are both important but intelligence is more important.
    • It’s hard to not stress this enough. The best marketing is a great product. Pushing pixels and marketing gimmicks will only get you so far.
    • Creating and marketing a new brand is very different from maintaining and marketing an established brand. Someone who’s able to sell ads for Sports Illustrated or cigarettes for Rothmans may have marketing skills applicable to a startup but it’s hard to know because the brand sells itself. It’s quite possible that they don’t have marketing skills at all.
    • A good idea is important. Very important. But it is only 1% of what’s important. The other 99% is execution.
    • Do not be afraid to go back to the drawing board. Bad product ideas can’t always be patched up.
    • A technology startup should be staffed by people who love technology at all levels, not just engineering.
    • Attract creative people. Flexible hours, casual dress, natural light, plants, artwork, fresh fruit are all relatively inexpensive.
    • If you’re an engineer, don’t let people tell you to stop coding. There’s a reason why companies like Google insist that their technical managers spend at least 20% of their time coding. For engineers, coding is our own form of meditation.  You’ll be a more effective manager because engineers prefer to be led from the front.
    • Admit you’re wrong when you’re wrong so you can move on and be right. Gently help others to do the same.
    • You will encounter a lot of bullshit artists a long the way.  SEO specialists and management consultants are a complete distraction.  What they peddle is mostly common sense and what they charge for it is insane. Put your money and resources into product development.
    • You may need to work with people who don’t know what they’re doing. Manage them if possible but don’t waste your time doing anything you don’t believe in or anything for anyone you don’t believe in. Life’s too short and you’re never trapped.
    • Don’t outsource your engineering projects; even to other London agencies. Keep everything “in the family” because you’ll get much better results. Bad code can be much worse than no code.
    • Do not ignore the fact that the most successful technology companies are started and run by engineers.  Engineers understand the importance of the product. Do not let investors or management sideline your engineers. Successful startups aren’t the ones that ignore their most important human capital.
    • Do not let people who don’t love or understand technology try to tell you you’re wrong about technology.  These people are known as bozos. Follow your gut.
    • Do not let people tell you you’re wrong simply because you’re younger. They could be right but they could also be very very wrong. Age should not be a factor. Again, follow your gut.
    • It’s better to miss out on hiring good people than to hire bad people. One bad apple in your team can totally ruin it. Skills must go hand-in-hand with humility.  Having one but not the other is not good enough.
    • Your science training is gold. Scientific thinking and methodology can and should be applied to product, design and management. It’s amazing how many business people don’t actually think.
    • The best products are created by people with the need themselves. It’s incredible difficult to create a great product from scratch if you don’t have the need yourself.  Focus groups etc are unnecessary when you know what you want.  Often focus groups are used by people too afraid to make their own decisions and/or people who manipulate the results to further their own personal agendas. These people are also known as bozos.
    • Focus on doing a few things and a few things well.  If you’re developing something you need yourself you will know what the most important features will be.
    • Much of your time may be spent protecting your designers and developers from reactionary feature creep. This is an important responsibility, a fact of life, and must not be ignored.
    • Be a perfectionist in everything you do but remember that you will need to ship. This means you’ll need to compromise on features. It’s better to have 5 features that are perfect than 20 that are below average.
    • Make extensive use continuous integration (I have a soft spot for TeamCity). Compiling, testing and deploying should all be one click.  Stop everything you’re doing and spend an entire day setting this up if you need to.  You’ll be thanking yourself every day after.
    • Make decision quickly and then re-make them if necessary.  Indecision (especially if it comes from the top) is very bad for productivity and morale.
    • Find people who can earn your trust and then trust them. These may be business people, investors, designers and engineers. Don’t waste time with people you can’t trust.
    • Work with other companies. Google & Facebook are two large tech companies with a significant presence in London and they both love working with startups.
    http://www.abstractpath.com/2013/london-startup-tips-from-a-tech-guy/feed/ 0
    IIS Output Caching and Accept Headerhttp://www.abstractpath.com/2013/iis-output-caching-and-accept-header/?utm_source=rss&utm_medium=rss&utm_campaign=iis-output-caching-and-accept-header http://www.abstractpath.com/2013/iis-output-caching-and-accept-header/#comments Sat, 02 Mar 2013 19:13:53 +0000 http://www.abstractpath.com/?p=752 After a bit of testing I found out today that IIS Output Caching will not work unless the Accept request header includes */*;  Most browsers include this by default but if you make HTTP calls yourself (for example, using CFNetwork from iOS), you’ll need to include it.  For example:

     Accept: application/json,*/*;

    http://www.abstractpath.com/2013/iis-output-caching-and-accept-header/feed/ 0
    A simple pattern for cancelling GCD blockshttp://www.abstractpath.com/2013/a-simple-pattern-for-cancelling-gcd-blocks/?utm_source=rss&utm_medium=rss&utm_campaign=a-simple-pattern-for-cancelling-gcd-blocks http://www.abstractpath.com/2013/a-simple-pattern-for-cancelling-gcd-blocks/#comments Fri, 08 Feb 2013 12:31:11 +0000 http://www.abstractpath.com/?p=747 Sometimes when using GCD, it’s useful to cancel a block that’s already been placed on a queue to be processed. You could have a field named “isCancelled” that the block can check for but if you have lots of blocks you’d have to have a field for each block (or a dictionary etc). It’s useful to just define the flag as a captured variable so that each block gets its own unique flag. Changing the cancel flag is done by providing the flag value as an argument to the block.

    @interface FooClass()

    @implementation FooClass

    -(void) foo
       BOOL isCancelled = NO;

       block = (BOOL cancel)
           if (cancel || isCancelled)
               isCancelled = YES;


    http://www.abstractpath.com/2013/a-simple-pattern-for-cancelling-gcd-blocks/feed/ 0