Interesting Links for 18-04-2012
Apr. 18th, 2012 12:00 pm- Scotland's wind expertise is paying off - now selling turbines to the USA.
- Scotland's wind expertise is paying off - now selling turbines to the USA.
- Moore's Law hits cinema cameras - a 2.5K Cinema Camera with 12bit RAW for $3000
- A message to application programmers (these things piss me off too)
- 10 films that were rumoured to be ghost-directed
- Boston, 1967: When marathons were just for men
- At last, a use for homeopathy!
- An explanation of tech terms through the medium of breakfast cereal
- The 501 Developer Manifesto - valuing life over your job
- Wind Turbine Makes 1,000 Liters of Clean Water a Day in the Desert
- The BP oil spill, two years later: Natural recovery far greater than expected
- Twitter Vows To Sue For 'Defensive' Patent Purposes Only. Fantastic. Can we see a trend please?
- Talking to yourself has cognitive benefits
- Half-siblings of autistic children have 50% the chance of having autism as full-siblings
- Neil Gaiman Interviews Stephen King
- What Happened to the Iceberg That Sank the Titanic? (I'm looking forward to The Berg Strikes Back!)
- Now that consumer IP is non-rivalrous and non-excludable, what does that tell us about its price?
- Further evidence found of disturbed immune system in autism
- Operators think Nokia would sell better with Android - Windows smartphones still not selling
A shame, as I'd love there to be more competitors in the phone space, to keep everyone on their toes. I'd actually be tempted by a Windows phone, if they weren't locked to the MS app store.
- We Don't Need Game Publishers, Hardware Makers or Retailers
Interesting Links for 07-04-2012
Apr. 7th, 2012 12:00 pm- Some of the problems Google Glasses is going to have to solve are pretty big...
- The Beer Game -or- Why China Has Such A Massive Manufacturing Advantage
- Internet use promotes democracy best in countries that are already partially free
- 'Hello, world': Programming languages quiz. 15/20 for me. How about you?
- Britain is now officially a dystopia
- A remarkably accurate global temperature projection from 1981
- Atheism Rising, But God Is Not Dead Yet: 10 Ways Religion Is Changing Around the World
- How to put yourself off ever wanting a Cadbury's Creme Egg
- A hermit crab in a glass shell. Somehow even more alien than crustaceans usually are
Interesting Links for 04-04-2012
Apr. 4th, 2012 12:00 pm- Hermit crab moves into Lego shell
- Autonomous System Numbers: The _other_ unique numbers on the internet undergoing a shortage
- Why DRM isn't in publishers' interests.
- Best 404 ever
- In praise of. text files and protocols
- An illuminating (and occasionally funny) piece on Unicode. I feel much better educated than I did.
- Education, Skills & Slavery... and why we're probably screwed.
- How to recognise the moods of Game of Thrones’ Jon Snow
- Totally inept losers confident they can lock down the internet
- Four and Half Years On - Stephen Fry gives a brief history of the smartphone
- The wheels are coming off the online monitoring bandwagon
- Good news on civil liberties from the Daily Mail
- Is it time to outlaw soap operas?
- Arizona doesn't believe in freedom of speech
- Anti-Choice Senator: No Talking about Abortion on the Internet
- C. S. Lewis' five rules of writing
- Clegg proposes way to end big money political donations
- Lib Dems will not support proposals for secret courts
- Carrier bag charges in Wales cut usage by up to 90%
- Are we slim yet - a graph of how Firefox's memory is going down.
- On the impact of choice and competition on the NHS
- Walking: it’s time to take action on this major terrorist threat
Interesting Links for 21-03-2012
Mar. 21st, 2012 11:00 am- Why is this program erroneously rejected by three C++ compilers? (I laughed)
- Boris hijacks official Mayor Twitter account
- Why we're finding less and less miracle drugs
- Cheaper, quieter and fuel-efficient biplanes could put supersonic travel on the horizon
- How many hours would you have to work to rent a one-bedroom flat (for different areas of England)
- Change to Sunday trading laws would force us into shops against our will, warn Christians
I hadn't realised that England still had Sunday trading laws. WTF England?
- A Doctor speaks up on Transvaginal Ultrasounds
- Why some taxpayers effectively pay a 60 per cent marginal rate on income tax.
OF course, even including employer's NI the total tax rate is nowhere near that high.
- Excerpt of Let’s Pretend This Never Happened: True Stories from the dark side of HR
- An explanation for Roger Penrose
Interesting Links for 02-03-2012
Mar. 2nd, 2012 11:00 am- Apple censoring books because they contain URLs to a competitor
- You cannot use two genes to predict voter behaviour
- If you're doing anything on a .com domain that is illegal _if you were doing it in the US_ then it can be taken away.
- Coding tricks of game developers - anecdotes and examples of things you should hope you never have to do
- A generator that uses waste water for power - and desalinates it at the same time.
- How Not To Sell Software
Interesting Links for 24-02-2012
Feb. 24th, 2012 12:00 pm- Butter makes you smarter
- The original announcement of the creation of the web
- A neat way of folding a piece of paper
- Presenting NUKEMAP - overlaying the effects of nuclear bombs on Google Maps.
- Construction firm aims to build a space elevator by 2050
- A history of multi-touch interfaces
- Richard Dawkins and Will Hutton discuss secularism and atheism
- If buses drove themselves, how many more could we afford to put on the roads?
- Things Real Dreamwidth Programmers Do (I have done versions of most of these)
- All Dead Mormons Are Now Gay
- What happens if you dump ten tons of sodium into a lake?
Privacy
- The Gendered Advertising Remixer
- Offbeatr - it's Kickstarter for porn!
- Frequently asked questions about political polling
Interesting Links for 27-01-2012
Jan. 27th, 2012 11:00 am- Depression makes it more likely you'll do overtime
- Cars Kill Cities
- Android and iPhone neck and neck in the US smartphone market
- Apple still dominates the tablet market, but Android narrows the gap
- Pressure is being applied to raise the tax threshold for low earners further and faster
- Do the weather forecasters used by the Daily Mail actually exist?
- This is how I feel about people on minimum wage paying tax
- Why McDonald's second biggest market is...France
- Neil Gaiman on Lewis, Tolkien and Chesterton
- Tetris Furniture
- Douglas Adam's letter to the studio exec responsible for getting Hitchiker's to the screen.
- US government covering up an epidemic.
- I laughed a lot at this video of programming language strangeness. If you're a geek you might do too.
- Mail Online overtakes NY Times as top online newspaper. Now that's terrifying.
- Graphene can now distill alcohol. Is there anything it can't do?
Of course, I'm still waiting for anything graphene related to make it into the shops.
Interesting Links for 30-11-2011
Nov. 30th, 2011 11:00 am- Welsh paralympic great Tanni Grey-Thompson criticises absence of women on BBC Sports Personality Of The Year list
- The Rise and Fall of Bitcoin (I find it fascinating. Sticking to pounds for now though.)
- Good Lord, Windows phones seem to be selling. (Always in favour of more competition)
- Top Five Regrets of the Dying
- And an interesting piece on those deathbed regrets.
- EU: Copyright Doesn't Cover Functionality, Programming Language or APIs
- Should public racism be cause for arrest?
- 17 cultural reasons why this European never wants to live in America
- One of Europe's largest companies wants to abandon email. Bwahahahaha
- So, who else is looking forward to the forthcoming war with Iran?
- This is pretty much how I feel about respecting other people's beliefs
- Women who play online games have more sex
- Subtitling educational pictures. I declare myself "amused"
- US judge goes crazy, orders hundreds of sites "de-indexed" from Google, Facebook
- Scooby-Doo and Secular Humanism
- Apple's Siri Is (currently) Pro-Life (one hopes they update this)
- Cheer up: The economy could be much worse (soon, I suspect).
- Egypt imports 21 tons of tear gas from the US, port staff refuse to sign for it
- The Apologies of Zuckerberg: A Restrospective
- Quote of the Day - Isaac Asimov on Ignorance in America
- If you want to be the best in the world at something then you cannot be normal.
Interesting Links for 1-11-2011
Nov. 1st, 2011 11:00 am- Richard Feynman on the disease which computer programmers are infected with.
- Met police using surveillance system to monitor mobile phones
- A Sister’s Eulogy for Steve Jobs - beautiful and touching.
- Hobbiton set report spoiler analysis. I HAVE BEEN EARWORMED BY THE HOBBIT MUSIC AND IT WILL! NOT! STOP!
- Coronation Street to be the first UK show to feature paid product placement
- Vincent Tabak porn decision was correct - common sense from everyone!
- Scottish government reintroduces alcohol pricing bill
- Technical aptitude: Do women score lower because they just aren't interested?
- Only 3% of traffic on the Three mobile network is phone calls.
- If growth's the problem, are more ARMs the answer?
Fun and games with reflection
Nov. 5th, 2006 10:07 amI originally wrote this for the c# discussion forum at work, and if you don't use c# you'll be wanting to press the page-down button any second now...
Let's say you want to check whether a control is set to ReadOnly. The simple way is to say :
if(control.ReadOnly) {}
But, I hear you say, not all controls have a ReadOnly property. In fact, only TextBoxBase (and its descendants) have a ReadOnly property. Which is entirely true, most of the time. Not at all true, however, if the control has been subclassed and a ReadOnly property has been added. In which case what would be handy is a way of checking whether a control has a boolean ReadOnly property, and if it does returning it.
Which is where reflection comes in:
You can call it to retrieve the Text property like so:
string title = CheckProperty(myForm, "Text");
or as a replacement for the original if statement at the top:
if(CheckProperty(control, "ReadOnly")) {}
And I wouldn't advise you to use it all the time (there being an overhead for reflection, and it being less clear than straightforward property checking), but it can be very handy on occasion.
Let's say you want to check whether a control is set to ReadOnly. The simple way is to say :
if(control.ReadOnly) {}
But, I hear you say, not all controls have a ReadOnly property. In fact, only TextBoxBase (and its descendants) have a ReadOnly property. Which is entirely true, most of the time. Not at all true, however, if the control has been subclassed and a ReadOnly property has been added. In which case what would be handy is a way of checking whether a control has a boolean ReadOnly property, and if it does returning it.
Which is where reflection comes in:
private PropertyType GetPropertywhich may look complex, but all it's doing is getting the Type Information for your object, checking to see if it has a property with the correct name and checking to see if it matches the correct return type. If it does then you get the information back, if not you get a default value (null for objects, zero for numbers, false for booleans).(Object myObject, string propertyName) { Type typeInfo = myObject.GetType(); PropertyInfo propertyInfo = typeInfo.GetProperty(propertyName); if (propertyInfo != null) { object property = propertyInfo.GetValue(myObject, null); if (property is PropertyType) return (PropertyType)property; } return default(PropertyType); }
You can call it to retrieve the Text property like so:
string title = CheckProperty
or as a replacement for the original if statement at the top:
if(CheckProperty
And I wouldn't advise you to use it all the time (there being an overhead for reflection, and it being less clear than straightforward property checking), but it can be very handy on occasion.