Announcing: Slashdot Deals - Explore geek apps, games, gadgets and more. (what is this?)

Thank you!

We are sorry to see you leave - Beta is different and we value the time you took to try it out. Before you decide to go, please take a look at some value-adds for Beta and learn more about it. Thank you for reading Slashdot, and for making the site better!



TypeScript: Microsoft's Replacement For JavaScript

QX-Mat I find this useful, ignore the FUD! (488 comments)

As a cocoa programmer tasked with implementing yet another embedded htmlfucking5 project thanks to Adobe Edge, I wish Javascript would die.

After looking at the myriad of patterns for my current project - a Javascript client REST API - I came to the swift conclusion that most of them are silly, namespace polluting, self initializing mindfucks. I gave up looking at patterns, found a preloader (lab.js - although require.js is looking good) and wrote my own module pattern objects to satisfy the clarity, structure and ease of maintenance requirements of a good API. Being verbose is not a sin in enterprise Javascript.

I have a lot of little helpers like this:

MyCompany.fetchSomething(function (things) { // actually gives you things

Plus some event handlers

MyCompany.addEventHandler('scope', function (data) { // handler

But by far the largest section of my code is the model fetching stuff - you know the really boring bits where copy by value doesn't cut it, I need functions and and objects.

My last trail by fire was a paginated e-book reader with support for embedded video and audio. That wasn't a lot of fun, but at least the CSS3 spec was helpful and the DOM readable. The Javascript in that project was limited to around 200 lines.

I recently discovered that REST libraries are pretty long winded - after 200 or so lines, Javascript becomes a horrible implementation specific mess of spaghettied anonymous function chains. I opted for the Module pattern and ran into lots of fun:

  1. I have to write all my getters and setters, as properties/getters/setters
  2. Variable lifting/elevating results in seriously ugly var blocks at the top of my functions and causes copy by value in some rather obvious block scopes
  3. Fast enumeration (for x in a) doesn't work
  4. Itterating through ordered keys is painful with associated hashes - you have to create a key enumerator (with pushes! ) each time you want order. jQuery doesn't particularly help.
  5. Everything runs on the same thread.
  6. Post increments don't work in for loops, for (i = 0; i
  7. Prototypical inheritance is pointless key bashing - it pollutes your vision with the use of 'self' everywhere god forbid you miss a one.
  8. Inheritance is a dirty word unless you've already written things in a special way (prototype extension is just a dirty hack!)
  9. Given a lack of compile stage, writing code is error prone and debugging a tiresome line by line experience
  10. Chained async callbacks are inflexible, hard to read and painful to edit. Expanding ajax piped promises to a colleague made him cry and take a week off sick.
  11. Everything has to be a fucking DOM element before jQuery/the DOM will play nice
  12. Preloading code, initializing it and handing off to that code is painful/ugly with self initializing modules.

So with MS actually targeting 5 or more of the annoying problems I face, I find this library really useful. But naturally I'll get modded down because, a) I develop Apple software and b) I don't pick sides, I program (I like Windows 7 as my desktop, XCode as my IDE, and Slackware on my shell - go fish!).

Oh well, I can only dream of this being adopted!

more than 2 years ago

Why America's School "Lag" Has Never Mattered

QX-Mat The medium of wealth (361 comments)

An economist would say that, if you take away money, you don't become less wealthy. For a long time the wealth has been a measure of your ability to produce which essentially boils down to the amount of tapped (exploitable) man-power you (and your country) have

more than 2 years ago

Drinking Too Much? Blame Your Glass

QX-Mat Personally (115 comments)

Personally I find beer impairs my ability to pace myself. YMMV.

more than 2 years ago

Ask Slashdot: IT Contractors, How's Your Health Insurance?

QX-Mat Re:Best Preference (468 comments)

It would appear you've been modded 'Funny', despite it being the same unfunny statement I intended to make.

Now I've read a post about someone saying disorders like autism could lead to higher premiums prior to Obama... wtf America? It's as if the more I understand about the US, the less I actually know :( I used to think Ireland was living in the middle ages for charging €35 for a GP (general practitioner aka family doctor) visit, now I think they're more like the slightly racist grandmother than the bat-shit crazy cat-lady nextdoor US :/

more than 2 years ago

Ask Slashdot: How Many of You Actually Use Math?

QX-Mat I use a fair bit (1086 comments)

It depends on what you're trying to do. Not knowing what you're doing can be hurtful, for example, not knowing very basic algebra means you can't do simple things. Recently I noticed my colleague couldn't determine the row and column for given an index. Quite trivial stuff.

Fairly recently I've implemented a 3d cone curl for iBooks style page flipping and countless interpolation functions where an API doesn't give enough control. Being able to work with a continuous principle and derive a discrete function is very important in animation.

I guess it comes down to 3 things: how well you understand the subject, how well you can program and whether you can apply relevant maths in a way that won't obscure your code or make it more difficult to maintain. I don't want to tweak random values, and if you don't understand these random values and start exposing them, you're going to make spaggetti code.

Understand your chosen coordinate system and swap when you need to! Take an arrow with a head - you can place a static arrow head at the end of a line or you can derive the arrow head's position and and shape as a function of the line - the latter looks really nice if you understand the coordinate system. If you don't, you'll end up making a horrible mess.

But alas, your mileage may vary - if someone hadn't done the hard work for me, I wouldn't be able to implement many of the things I'm asked to as I'm merely an engineer (and yes, I have a few of those mid-level textbooks with titles like 'Maths for Engineers' or 'Somethingtotallypointlessbutitsyourjob Theory For Engineers'). Once you've solved a couple of matrices most of what you'll do in Unity is state orientated, so with the help of a good model you don't need to think, ie: in some model context, model->modelToWorldMatrix will transform model coords into wordspace, use modelToWorldMatrix.

Hope this helps!

more than 2 years ago

What's To Love About C?

QX-Mat A lot of C Programmers are missing Objective-C (793 comments)

Disclaimer: I'm an Objective C Programmer by day

The LLVM compiler suite is tremendously powerful with Apple's billions advancing many select features, but key to it's success from a users prospective the core use of reference counted object graphs (of type 'id') and reflection (RTTI - via 'isa' and 'Class'). Obviously this means the entire language is dynamically typed at runtime, but with express qualification in 99% of the code you'll use there's absolutely no performance hit despite the ubiquity of the core object.

I worry that many C programmers will remember RTTI was once considered an unportable disaster in C++ because of the the many differing implementations owing to a spec that left the implementation up to each compiler... Don't let this kind of talk scare you! Although objective, objc is contained to a well defined spec, single inheritance and nary a template in sight.

I consider my programming work to be relatively easy. 50% of my ease comes from the object system above. The other 50% from the fast messaging system used in place of raw ADTs: In the objc world a nil object doesn't fault when messaged (in a C world dereferencing a NULL pointer, common if a struct fetching function fails and then passes NULL on failure) leads to all manner of crashes, or as seen recently, kernel exploits. The messaging system can even push around primitive values, not just nasty objects.

If you program in C, you may have missed Automatic Reference Counting, if you have, low and behold, it's amazing: at *compile time* the compiler adds lifetime qualifiers to the IR that automatically inserts retain and release messages (retain is +1 on alloc, -1 on dealloc - release occurs at 0). In other words the lifetime of an object in objective-c is now exactly the period of acquisition to last use. Yes, last use. ARC's use of a new 'weak' reference means that dangling pointers are a thing of the past: a __weak object is automatically nil'ed after last use: in all local instances of that object (did I say nil objects don't fault on message?).

Admittedly most of what I've mentioned is thanks to the advances in LLVM's Clang compiler, in particular it's static analyser, therefore much objc analysis also benefits C (LLVM's IR is quite specular ).

I could go on: methods can be heap objects with cblocks, objc encourages abstract programming with delegates, you can method swizzle at runtime, extend existing classes and link to C/C++ code.

more than 2 years ago

Apple Sued By Belgian Consumer Association For Not Applying EU Warranty Laws

QX-Mat Re:Too long? (290 comments)

This is a prime example of the EU doing what it does well: being reasonable. Sadly it's rarely ever reasonable when you want it to be. Domestic legislation tends to be more 'pro'-active.

Here in the UK we have a domestic statute that goes further than the mandatory 2 year EU Directive because of differing language: goods must be of satisfactory quality for a 'reasonable time'. Because reasonable time isn't defined in the statue or common law, it's possible to bring action under the Sale of Goods act within the civil limitation period (6 years from the date of purchase/contract).

The EU Directive is supposed to harmonise the law across member states. For some it is a backwards step and doesn't address the problem of faulty and wasteful electronics. On the plus side I believe the burden of proof is lower under the EU directive, unlike in the UK where it switches from the producer to the consumer after the first year (ie: if it's borked you have to show it's not your fault - easy when it's electronic, not so easy with unreasonable wear and tear).

That said, I'm a little weary of how long the older, better built, technology is lasting - I'm 27 and my parents have held on to a microwave many years older than me. Like a true horror movie it looks, sounds and acts evil - I wish it would go away :(

about 2 years ago

Go Daddy Reverses Course On SOPA

QX-Mat Too late? (330 comments)

I've already transferred my domain and cancelled the auto renewal on another. Ha.

more than 2 years ago

Brits Rejecting Superfast Broadband

QX-Mat 27 minutes of 'fast' (247 comments)

I was a Virgin subscriber for less than 28 days the other month. Thankfully I took advantage of their 28 day moneyback guarentee... why? All of their plans, except the most expensive one, capped you from 10Mb+ to 2Mb after 2Gb during 'peak time' (where peak time is a series of 4 hour slots throughout the day).

2Gb? That's less than movie on X-Box Live, 30 minutes of HD iPlayer or a 2Gb game patch... Deus Ex and BF3 are both 8Gb on Steam/Origin. The 2Mb cap is supposed to last until the end of the current peak period, or not more than 4 hours (iirc), but this didn't happen. If you hit the cap during the day, you were capped until 3am or later. Trying to use youtube or iPlayer on 2Mb is a painful experience. 480p would buffer and buffer and buffer - you had to load in the background and pause it regularly.

27 minutes of fast internet access, a package sold by misdescription, is a joke. Being able to fundamentally alter your service (by 80% or more) within 27 minutes is a joke. And people wonder why the target audience aren't running to sign up.

(Virgins ADSL2 service drop you to 5Mb, and are much more forgiving. Sky don't cap me at all - amazing!)

more than 3 years ago

TOSAmend Automates Counteroffer Terms For Service Agreements

QX-Mat Re:Obviously No Strong Legal Standing (138 comments)

The OP is right... but it's interesting.

For ordinary agreements you need offer (contractee) and acceptance (contractor), in a ToS acceptance and assent to the terms is implied by some form of conduct. TOSAmend seeks to make a unilateral contract (one to the world) bilateral (between parties) with no real chance or form of agreement. I believe it can be construed as an unaccepted counter offer. In such cases the method of communicating acceptance/rejection is important. Merely the act of making a counter-offer rejects the original offer ('destroying' it).

Website ToS are unilateral agreements. Your acceptance is your participation on a website be it subscribing, visiting or checking a box that signs your soul away. The obvious basis is that you cannot accept an agreement you have not agreed, nor can someone accept an agreement you have not proposed - acceptance requires a positive act on behalf of the contractor. All in all this won't stand up in a real court... in a TOSAmend user's favour.

However, I find the interesting bit is what happens next. If you don't assent to the terms or the original unilateral contract, and it is clear from your conduct that you have not (striking out terms etc), and managed to propose and communicate a counter offer, is the contractee bound by any of the original terms?

In common law you have to assent to terms. Ambiguity and unfairness are often side with the consumer in litigation. Unfair unilateral contracts are the most unreasonable of them all. A website trying to enforce a unilateral contract where acceptance was clear through conduct might find themselves with another burden: proving the contract the end user saw and assented to was their unmodified copy. Post form, text input box, and server-side string match of the accepted contract and original would easily solve the problem. In the mean time... don't let the user interact with the website... at all.

Just thinkin'


more than 3 years ago

British CS Majors Doing Badly In the Jobs Market

QX-Mat Re:The problem for UK IT graduates (349 comments)

I'm thankfully employed having spent over a year on the dole. If you're worried about your job now, it doesn't change much. To succeed and change jobs interviewers expect the impossible despite experience (Q: You know about static assertions? A: Yes I use them to guard external APIs [and why]. Q: How are static assertions implemented in a cross platform manner? Q: Ugh I er use them. I've not written my own handlers. I've not had time to research that - I've got deliverables and I'm relied upon.).

Things aren't going to pick up - there are so many shit programmers and shit team players who interview well for a desperate employer. This makes the market guarded and hard to penetrate (Q: This error took one of our programmers several hours to solve. What's the problem and why does it output this? A: He used the wrong braces in that array declaration, and but don't know what the comma operator does in that context. I wouldn't use it as I like to write maintainable and obvious code).

It didn't help that the last person to interview me on C++ was a former lecturer. Most of the questions you'll get have specific answers - it's not a case of thats on the heap, thats on the stack, const this and that, overruns and they're the same etc. It's more along the lines of what a MSVC specific nonstandard keyword does. (Q: How is so and so implemented internally in STL, A: I eurgh, use STL - I don't have time to write my own containers - I'm applying for the high-level Cocoa role you know!)

I'm also fed up with the 'undefined spec' questions. I know some of them. I shouldn't know everything - I'm supposed to be programming not memorising the spec/parashift FAQ!


more than 3 years ago

FBI Wants You To Solve Encrypted Notes From Murder

QX-Mat It's not encrypted (466 comments)

it's Welsh!

more than 3 years ago

China's Influence Widens Nobel Peace Prize Boycott

QX-Mat Re:Consequences (360 comments)

News just in: Obama isn't G W Bush.

Obama's Nobel prize was a swipe in the face of the last 2 terms of US foreign policy. Obama's pledge to reduce the nuclear stock pile and kill Gitmo probably gave it some legitimacy.

about 4 years ago

Court Says First Sale Doctrine Doesn't Apply To Licensed Software

QX-Mat Legally good and bad (758 comments)

I've got to hand it to the supreme court, because they've managed to do two things that are both legally good and bad at the same time (from 'our' /. perspective). First of all they've upheld what they know, that is, the assignability (assignation?) of a contract or licence. Admittedly contracts and licences are not the same from a legal perspective (the phenomena of agreement has a few more formal common law hurdles to cross), but the goal is simple: protect a very real asset.

What asset? In law there are a few types of contract. The most obvious is a standard A <-> B agreement, the next is a less standard A <-> B (personally), and the one a lot of people gloss over is A <-> X (where X is anyone). The latter is unilateral, where the formers are standard contracts where the ability to assign differs depending on terms of the agreement. The assignment of a promise is so core to IP, Property and Contract law that without it, our world would crumble (they figure on corporate balance sheets). Take for example, the case of a landlord renting a spacious flat with several rooms to a vetted tenant. If that tenant was given the ability to assign his lease to another tenant of lesser stature, what kind of protection would the landlord have? The worst case scenario is a poor tenant who creates several illegal sublets and uses the property as a crack den. The best case is a more an affluent/big earner type who pays their bills on time and gets on with all the neighbours.

For as long as contract has existed the ability to protect the intent of the contract has reigned supreme, therefore that means protecting the interests of people who set the terms and those who agree to the terms. Allowing landlords to block assignment protects a landlord and their interests in *their* property (sublets are legally problematic - more layers of enforcement to get rent, no privity etc - and crack dens reduce the value of property). Hence the ability to restrict the assignability is an asset to a landlord but a balance sheet liability to tenant (a buyer of a commercial tenant will have to purchase the remaining liability of any leases out-right because no seller would sell a business any retain property liability unless they got a massive capital gain).

So... legally speaking protecting a licensor's interests in a licence agreement, specifically the ability to assign, is a big ideal. However, what is happening in software is not an A B licence, because A purchases B's software from C's shelf. This, but definition, is a carbolic smoke ball: it is unilateral A X licence, where X is anyone in possession (I am glossing over the agency/distribution perspective massively). Unilateral contracts don't gel with the ability to restrict a licensee because there is no requirement of individual assent in a unilateral agreement (in other words because B, where A is the author of some software, didn't have to sign anything, why should B be liable on a personal basis when A made the offer to the class of B - iow, any potential buyer). What I believe we have is a limited personal licence: A <-- licences --&gt B (personally). Any by personally I mean the first purchaser bares the burden of the licence, nobody else. When they sell the copyrighted protect, ie: the program/code, the initial purchaser does not reassign the licence. Therefore a purchaser of B's copy is not restricted by the same terms as B was - this is the principle behind first sale (US)/exhaustion of rights (EU).

(nb: i've drunk far too much tonight for this to make any sense tomorrow)


more than 4 years ago

Malicious Hardware Hacking May Be the Next Frontier

QX-Mat Re:Hardware is traceable, software is not (146 comments)

A good point, except when small businesses try to extract the best value for money in an expensive IT purchase, counterfeit products can be very tempting - whether you know you're buying fake goods or not is irrelevent when the price is cheap. Cheap counterfeits are [arguabley] not traceable enough. Check out the Reg article on a recent Cisco raid

I remember reading another article on the Chinese fakes, where it was said that the only outward difference was the type of screw used. Scary to think that a specially crafted packet (or more likely, sequence of) could destroy the internet :)

more than 4 years ago

EU Plans To Make Apple, Adobe and Others Open Up

QX-Mat Re:Free market (389 comments)


This is good news and it goes to the heart of the treaty of Rome - that competition is a fundamental part of the EU, and the EU will move mountains to promote it. I suspect this will be in the form of a very long winded piece of guidance regulation that sits in parallel with Art 81. As someone who has read, reread and read again EU competition regulations and their directives from an academic point of view and professional one, it is mightily refreshing to finally see the EU do what I was told it did well... fight concerted practice and actively promote competition where the market fails.

more than 4 years ago

A Close Look At Apple's A4 Chip

QX-Mat ARM and ImgTec (245 comments)

Surely people are missing the next step? Apple want's to bring the SoC design in-house. It's currently a very fragile all-in-one unit provider. You pay for nothing revolutionary in an Apple product, instead you pay for a unique design/interface and the Apple goodwill 'mark-up'. The latter of which is a license the print money. So really Apple need to hit the semi-conductor market to maintain market dominance through R&D. In-house developments don't run the risk of being licenced to your competitor, and give you a technology lead that is hard and expensive to beat.

But did we all forget about the possible purchase of ARM? I don't think it'll happen soon (ARM's stock is higher than 2002). I don't really want it to happen either. ARM licences to far too many companies, therefore there will be monopoly considerations and any deal will be scuppered by a race to it by anyone with £5bln cash: Nokia, Motorola... even IBM or MS. The loss of ARM will actually hurt the "open" fabrication platform they've developed (think of all the individual ARM fabers that are out there... no are licence, no work) and we use benefit from (ARM chip competition has driven down price).

And what about the PowerVR licensing from Imagination Technologies - Apple increased it's shareholding this. I predict that apple will buy ImgTec by the end of the year. Possibly over the summer. They've got an good back catalogue of products, and despite the fact they didn't hire me, I think they're a brilliant acquisition for Apple: real chip fabricating people. A lot of their new stuff is low power which apple lacks experience with. Relying on an ARM development time-table means competitors can get to market relatively quickly, with similar specs. ImgTec are a good fit.


more than 4 years ago

iPad Bait and Switch — No More Unlimited Data Plan

QX-Mat Re:Why the Tech industry sucks. (670 comments)

Clauses are a bitch eh?

The best trick is to word clauses so they're terms of the agreement. Word them backwards, in the double negative, refer to external documents, obscure precedents and maxims etc. In B2B transactions you can pretty much get away with adding whatever you want, and care about litigating to enforce it at a later date - with a little lucky unenforceable clauses might become enforceable through statute or precedent! This doesn't mean a cunning clause is any more enforceable thatn it sound, it just rewards ambiguity and makes it disproportionately expensive to assert or rebut clauses that are more powerful that you first imagined. Often the mere threat of litigation will make a party baulk. Many of these clauses find their way into consumer contracts... like this.

It goes without saying that reserving a right to change the fundamental terms of a contract without enumerating the basis of a change, and the range and frequency of such a change etc, falls foul of good consumer law. Remember that you have no agreement without consent, and there is no consent without the reasonable notification of the ability to obtain and review the conditions - therefore onerous changes require reincorporation by way of signature... the more onerous, the more attention should be made to the clause. Mere silence is not assent. But common law rarely prevails because it costs too much to enforce for such little gain. The end result is a plethora of heavily loaded consumer contracts, everywhere.

If consumer policy dictates, the most offensive types of clause and their effect can be made deliberately dangerous to the drafter if, by inclusion, an entire agreement void where the agreement contains or purports to contain a 'hardcore restriction' that consumers shouldn't burdened based on of their inherent inability to bargain (bargaining positions are never equal in a B2C transaction... ever. When was the last time you bartered for your shopping?). Contrast with individuality severable clauses which a court will strike out but not punish the drafter for including them. What kind of consumer protection legislation actually strikes out entire agreements or puts heavy fines on the evilly minded drafter? None. Absolutely none (to my knowledge). In Europe it's the preserve of the competition articles (ie Art81(3)) - they are the only ones that dare strike out an entire agreement because someone drafted in an evil clause. Imagine if you got a free iPhone simply because Apple drafted an unfair contract? That'd stop them!

So... because you can get away with it, people try. Now we need N bits of consumer protection for every K unfair clauses J number of lawyers contrive.

more than 4 years ago


QX-Mat hasn't submitted any stories.


QX-Mat has no journal entries.

Slashdot Login

Need an Account?

Forgot your password?