Communicate, communicate, communicate – and the new email friendly layout

February 4th, 2013
hejdig.Long time no see.This is the same email with a new layout.
To make a long story short; the positive feedback I have gotten on this email has been on the contents, the bad on the format.  Depending on email client it has been mangled enough to be rendered ugly.
So through a detour around Ruby land I have finally gotten something that is readable again.For getting this layout to work I have started using Mailchimp.  I am totally new to this tools so if you find any dead links or anything else not working – please let me know.
Your email address is still as private as before.So what do you think?To celebrate the new layout I link to possibly the funniest jump.  Evar.

And as always – the good stuff is at the end of the letter.

/OF

—-8<—-

Code and development

Create a menu in CSS3 (web)

The article below is nice. The code probably ok. But. As always with CSS it requires a certain width, 960 in this case.I will continue my holy war against pixel width in the web.- http://www.webdesignerdepot.com/2012/08/create-a-stunning-menu-in-css3/

Aspnetmvc, Webapi, Jquery, Knockout and Signlr all together (web)

Aspnetmvc, Webapi, Jquery, Knockout and Signlr all together.
In an hour or less.
Awesome.
Continue with googling with bing for “webstack of love” for more of his presentations.BTW: NDC (Norwegian Developer Conference) has most (all?) of its presentations online.  There are many good ones.- http://vimeo.com/m/43603472

Javascript frameworks to aid Model/DOM-manipuation on the client (web)

Using MV frameworks on the client is pure goodness until one stumbles upon a situation where it doesn’t work and instead trips you.
Don’t let that stop you – I have tried Knockout and really like it.Angular isn’t MVVM but MVW, whatever that stands for, and has another model for sending data between DOM elements.  Sort of MVVM without the Model.  It looks like it’s a Google product.Backbone has a Model.  When it is updated the DOM updates.  When the DOM updates so does the Model. It is more MVC than MVVM. It relies on underscore, another helper lib which might be good to have in the toolbox.Ember is a tool that targets bigger solutions.  It has MV and templating like the others.  Recently out with a new beta.  They call it 1.0pre.  Which is a beta AFAIK.Knockout is a MVVM framework that just happens to be the one blessed by Aspnet.  I have tried it.  I like it.Then there I Knockback to mix the Knockout and Backbone worlds.

– http://angularjs.org/
– http://backbonejs.org/
– http://emberjs.com/
– http://knockoutjs.com/
– http://kmalakoff.github.com/knockback/

– http://stackoverflow.com/questions/5112899/knockout-js-vs-backbone-js-vs <-comparision and discussion

JSHint, A JavaScript Code Quality Tool (web)

Text copied from the about screen explains it best.
“JSHint is a community-driven tool to detect errors and potential problems in JavaScript code and to enforce your team’s coding conventions. It is very flexible so you can easily adjust it to your particular coding guidelines and the environment you expect your code to execute in.”There is a big text box on the site.  Just paste your code and feel ashamed of yourself for writing sub par javascript.  Just as I do.- http://www.jshint.com/

List and poll and summary of HTML5 development tools (web)

Below is linked a survey, a listing and some summaries about HTML5 development tools. Most programs I (you) already know of but browsing such lists once in a while can be worth its while.-http://www.infoq.com/research/valuable-tech-html5-development

Monkeycoder

Multi platform game development.The program translates the Monkeycoder language to several others which can then be compiled in respective environment. And sold. And profited.-http://www.monkeycoder.co.nz/

Tipthanks DanielG

GTD with Evernote

The secret weapon is the name for a project? solution? idea? community? that has put GTD (getting things done) together with Evernote.GTD is in short:
If you can do it in less than 5 minutes – do it now.
The rest – put on a list and prioritise.
When the <5minutes tasks are done: review list.
GOTO 10-http://www.thesecretweapon.org/

Hammer.js – javascript touch lib (web,mobile)

If you are just starting your utterly responsive HTML javascript project you should be aware that the browser on Ios has a 300ms delay between tap and click.There are totally valid reasons for this but outside the scope of this article.
300ms is noticeable. I foresee it will decrease in the future when we get screens with more sensors and intelligence in them. Also outside the scope of this article.Never the less, if you are writing a HTML5 game this might be a show stopper so you are into writing your own handlers for down, up and click/tap/press. And there goes your initial estimates for a demo because down-up-click is a framework on its own, especially combined with doubleclick, swipe, pinch and drag.Talking of frameworks, the link below tries to solve just that.-http://eightmedia.github.com/hammer.js/

DYI – a 3D touchless tracking device (arduino)

You need a computer, an Arduino, some wires and electronics components, time and patience.
Of course it is a little course. Of course it takes a few hours to put together. Of course it isn’t compatible with your latest games.The documentation puts some weight on everything sharing the same ground. In Sweden laptops are often not grounded but that could be remedied by yet another wire acting as ground.-http://makeprojects.com/Project/A-Touchless-3D-Tracking-Interface/2233/1

Great jQuery plugins for fresh websites (web)

There are many Jquery plugins.  Below are various curated.- http://www.webdesignerdepot.com/2012/08/great-jquery-plugins-for-fresh-websites/

Git-ts: Git integrated with TFS (win)

Should one choose Git or Tfs?There doesn’t necessarily have to be one SCM to rule them all since one cannot integrate with Git-Tfs directly from Microsoft.- http://blogs.msdn.com/b/bharry/archive/2012/08/13/announcing-git-integration-with-tfs.aspx

Common infrastructure libraries for .NET (dotnet)

Have you ever had to choose between log4net (how much is it developed today?), nlog (newer and fresher but better?) and enterprise framework (can do everything but how?) and decided to postpone decision or even roll your own?Have you ever been in a project where some run log4net and others nlog and someone used ef some years ago?Enter Netcommon.  It presents a common interface for everything logging.  The plans are for supporting more infrastructure stuff in the future but right now only logging is ready.
So you can write logging through Netcommon and don’t care what people use down the road.  A nice idea.  I have to go down the corridor to talk to a guy who has used it.  Be right back!- http://netcommon.sourceforge.net/Yupp.  He was satisfied.

Jquery 1.9 release (web)

Smaller.  Faster.  Modularised.
Modularisation means one can use Grunt to strip out unnecessary stuff.  Still not as good a jquery-ui where there is a GUI for what you want to use and not and create a script with just what you need.Then 2.0 is released as beta.  It doesn’t support old IE browsers.- http://blog.jquery.com/2013/01/15/jquery-1-9-final-jquery-2-0-beta-migrate-final-released/

Mousetrap – keyboard shortcuts in javascript (web)

The Web interface is very mouse pointer oriented which sucks big time since I am born with just two hands and they are on my keyboard. Mouse works fine for browsing but input? No.
Fat client programs have keyboard shortcuts which is still The reason to use them instead of Web applications.
But look at gmail for instance; press ? and a help screen pops up. C for composing a new letter, GI for getting back to the inbox and so forth. Implementing this on your own is a great pain, unless you use a lib of course; then it is only Less of a pain.Mousetrap, the lib linked below, contains tools for ctrl-a, ctrl-shift-a and the like, “hormal” shortcuts if you prefer.  It also contains gmail-style which are ?, C, GI etc.  To top it up it contains whay they call Konami style.  An example of that would be: up up up down up up left right lef right down a x.  There are live examples right on their site.- http://craig.is/killing/mice

Unit testing and SMTP (dotnet)

Doing automatic testing with email is a hassle.  Below is linked a link to a fake SMTP server and a trick with it to drop the emails in a folder.- http://www.thinqlinq.com/Post.aspx/Title/Unit-testing-and-SMTP

How do I become a hacker?

The head line is the one most used questions at a certain kind of forum.  The answer is the same as with learning to play an instrument.
Practice.But where does one start?
I really don’t know but hackerhighschool seems as good as any.And remember – Hack everything but harm none.  Really.  As a 10 years old one hasn’t developed ethics, as a 20 one is still new at the game and as a 40 years old one is still learning.
Print it out “Hack everything but harm none.”  Put it on the wall behind the monitor. Read it.  Embrace it.  Hack.- http://www.google.com/ <- best place to start learning hacking
– http://www.hackerhighschool.org/lessons.html

Gratis device emulators for testing

Having recently delivered a project running on both Android and IOS tablets and phones I can testify it is cumbersome to test.  And debug.
Ok, with Ios6 one can finally connect remotely to Safari but we had to support Ios5 too.  And what about debugging Chrome on Ipad?  Phew.
Does Opera run on Ipad?  Opera mobile has solved remote debugging already today you know.With 90% of the functionality we can move it to the desktop and the horse powers we have there.  Below is linked 6 such tools.- http://www.webdesignerdepot.com/2012/11/6-free-mobile-device-emulators-for-testing-your-site/

Colour scheme designer with colour blindness visualisation (web)

Colours is a science of its own.How does one choose the right colours for a site or application or when drawing or doodling?  One has only 3 choices: chance, feel or math.  Due to lack of time and a slight colour blindness I go for the latter.Below is a site that does the hard work for you.  It has several hidden features like export to different formats, manipulations like pastel and contrast and visualisation of how the colours look for different types of colour blindness.

When you have decided for a colour scheme you can store the URL and get back to where you were.

– http://colorschemedesigner.com

What happens the first few milliseconds of a HTTPS call? (web)

As the headline says. Written in a easy to understand manner, if possible is.- http://www.moserware.com/2009/06/first-few-milliseconds-of-https.html

Chart of what takes time, code vs network calls

Absolutely not comprehensive but instead readable to give a rough value of if it is with to trim code or network calls.- http://www.eecs.berkeley.edu/~rcs/research/interactive_latency.html

Razor engine tips and tricks (win)

The Razor template engine is awesome.  It’s like “how would I like to code?” and then just write like it and let Razor figure out what you mean.
There are certain caveats but they can be remedied with for instance @: and @helpers.  You haven’t heard about them?  Me neither.  Hence my linking below.If you do AspnetMVC with the Razor engine; read below.  These 2 minutes of you time are a good investment.- http://odetocode.com/blogs/scott/archive/2013/01/09/ten-tricks-for-razor-views.aspx

Projects and leadersip

About Google’s one day a week

Google is famous for letting their developers do other stuff 20% of the time. That is quite a lot of time. But it seems to work!- http://www.codinghorror.com/blog/2012/08/today-is-goof-off-at-work-day.html

Your Path through Agile Fluency

How does a team move from being Waterfall dependant to being fluent in Agile?MFowler, of course, has some insights to share.- http://martinfowler.com/articles/agileFluency.html

Deliver 50 times a day

Latest project I was in came with the usual birth labour.  Deliver.  Bugs found.  Correction.  Deliver.  Repeat.
I find this good.  I believe in continuous delivery and repeated my mantra “a delivery every 20 minutes” for anyone who’d listen.  (reality:to anyone having the bad luck to be close enough)
Then during one of these delivery iterations we felt a disturbance in the force; and checked online; and was Live!It wasn’t a 20 minutes delivery and it wasn’t 50 times a day but it was a first step.Below is linked a way bigger and more complex site than ours that deliver continuously.  50.  Times.  A day.- http://timothyfitz.com/2009/02/10/continuous-deployment-at-imvu-doing-the-impossible-fifty-times-a-day/

T4 for visual studio 2012 (win)

T4 is the templating language used by Microsoft and Visual studio.  If you for instance are doing Entity Framework you are using T4.Now this language and these template can be further developed or made totally from scratch.  I have invested some time in ST4bby which creates POCOs with a single click of a button.T4 has been updated and adapted for the new Visual studio.  If you are using it, or thinking thereof, zip through the link below for some new stuff.

– http://www.olegsych.com/2012/12/t4-toolbox-for-visual-studio-2012/
– http://johnnycode.com/ST4bby/ <- create pocos by the touch of a button

Getting kids into programming

I have many times written about languages appropriate for programming. I have later realised that it is possibly not the language that is the threshold but the will. *Why* should a kid chose to program?The simple answer is “games”. The more comprehensive answer is longer.   Below its linked a blog article with various links.- http://blog.pamelafox.org/2013/01/getting-kids-into-programming.html

Products and releases

Raspberry pi + Xbmc + Airplay (linux)

Raspberry pi is a small and cheap (<30€) computer that doesn’t draw lots of energy (<5W). It also doesn’t have a fan or any other moving parts; this makes it fitting for a living room.Now the moment we all have been waiting for has arrived – Xbmc works on Raspberry pi. And not only that – also Airplay works.(Airplay is an Apple construct to share screen content between devices. Typically you can play youtube on your ipad and watch it on the tv.) (Google is working on an open competitor to Airplay.)

A konkullega has tried it and it was no problem he said.  Also 1080 works if the file is not too heavy.  A 30 gig file stuttered.  He got airplay audio to work but no video.

– http://www.hanselman.com/blog/AddingAirPlayToAReceiverWithoutAnAppleTVRaspbmcAndTheRaspberryPi.aspx
– http://www.hanselman.com/blog/Top10RaspberryPiMythsAndTruths.aspx<- more about what raspberrypi can do
– http://apc.io/<- higher price, more horse power and less press coverage
– http://www.fxitech.com/fxi-demonstrates-any-screen-connected-computing/ <- memory stick sized, usb powered android computer using existing hdmi monitors as screen

Ouya preorderable (android)

It’s an open game console with an Android engine.
One of the shiny parts is that is was funded through Kickstarter.- http://www.ouya.tv/

Textmate 2 going F/OSS (mac)

Contrary to Windows there is just a handful of free and gratis text editors on the Mac.  Textmate is one of them and it is now going open source.  Not only that, it is going GPLv3 which means than no fork of it can be sold in the app store.<trying>
<to>
<resist>
</resist>
</to>
</trying>
<fail/>I’ll throw a log in the fire and write that the editors on the mac are lacking in usability.
The litmus test is to edit a file without using the mouse.- http://blog.macromates.com/2012/textmate-2-at-github/

Whiteboard on the web (web)

Need to scribble and doodle with someone out of arms’ reach?
Go online!http://webwhiteboard.com/

The Ipad and Android has icons in tabular format so you, dear reader, know how bad it is (win)

There must be a better solution.
Windowsphone7 has tiles which is slightly interactive icons but in a vertical order. Very like but also very different.
The start menu of Windows>=95 is hierarchical.
Spotlight and the start menu of Windows>=7 does a quick text search and happens to be my preferred way of starting applications.
Late Osx versions use pinch to show a, yet again, tabular screen with icons.I don’t know how to use Circledock but I know in the back of my head there is a good use for it.-http://circledock.wikidot.com/

Upverter

Online collaboration for hardware electronics.Gratis for open source projects.- http://upverter.com/

Android Mini PC RK3066 (android)

Raspberrypi is getting all the lime light right now but one shouldn’t forget neither Fxitech nor Rk3066.  Read more about the latter below.
– http://www.engadget.com/2013/01/12/the-rk3066-android-4-1-mini-pc-hands-on/

Papercut – mimic a mail server (win)

If you are writing an application that sends email you also have to set up SMTP server or SMTP relaying; and do it securely.  It is not difficult but it takes some time.Papercut is instead a desktop application that does this work for you without configuration – anything you send pops up in the GUI.  F/OSS.- http://papercut.codeplex.com

Privacy, security and rights

The patent war between Samsung and Apple described as a flower

Apple created an icon with a blue sky, green leaves and a yellow sunflower for the gallery.  Samsung created an icon with a yellow flower and a couple of green leavers.  The original article sees this as a rip off.I see imitation as the highest form of flattery.  Plus; I don’t see a flower and blue sky as so unique for a GUI that a company should be able to own it.  Or if it is so wonderful a solution – then maybe a company shouldn’t be able to own it but instead the whole world.But we freedom fighting heroes are not without flaw.  Open source initiative, one of the good guys, is fighting with Open source hardware, another good guy, about an icon and another icon.
Personally I see no reason they shouldn’t be able to live together.  Now the Open source initiative logo is darn ugly but that is beside the case.- http://thenextweb.com/apple/2012/08/08/apples-argument-that-samsung-copied-its-software-designs-summed-up-by-a-single-yellow-flower/
– http://www.networkworld.com/news/2012/080812-open-source-movements-butt-heads-over-261484.html

Watching Netflix or Hulu from outside USA or Canada is not impossible (web)

Watching Netflix or Hulu from outside USA or Canada is not impossible, it just requires a few tweeks.
Below is linked info for a newbie.- http://www.networkworld.com/community/node/81175
– http://www.engadget.com/2012/08/15/netflix-watch-instantly-streaming-scandinavia/

No more Flash updates on the Android platform (android)

What does this mean?
Well… when the next vulnerability is found on Flash running on Android all Flash has to go on your Android devices.
Read that again if you have an Android device and didn’t get it. It might be important.-http://www.engadget.com/2012/08/14/psa-adobe-halts-new-installs-of-flash-on-android-as-of-tomorrow/

Use Google to search for patents

Google has for a long time has a service for searching for patents. Both regular patents and the sick, mis formed, abused, innovation halting and humanity unfriendly software patents. It is now extended to try to search for prior art.Which leads me to my own site, Selfelected ideas, where I drop ideas I have just to make sure that no one believe they are alone with inventing such a obvious idea.-http://www.engadget.com/2012/08/15/google-patents-gets-prior-art-and-european-patent-search/
– http://ideas.selfelected.com/

Logo for DRM free files

DRM, aka copy protection, is a way of the past even though not everyone has understood. Ok ok, to be honest I know of some places where it is a good fit but for, say, music or moving pictures it is more of a wart than real limb.Someone has created a logo for this. My trained artist eye says the logo is hideous.-http://www.defectivebydesign.org/node/2243

Site for helping you with those pesky Terms-of-service

Have you ever read one Terms of service?  I doubt I have.
Have you ever written a Terms of service?  I have not.  My personal terms of service are either Works on my machine or I don’t owe you and you don’t owe me.Now there is a site to grade and discuss Terms of service.  It also has a wonderful feature – a diff feature.  Every time you get a new Flash patch you have some ks of words of Terms of service but what is new?  A diff is exactly that – tells you what is new, changed and gone.One thing to look for that I haven’t noticed earlier is the right to leave the service.  According to Steam or Skype you cannot.  It’s like a Cockroach hotel.Duckduckgo gets full grades but it is also a very simple service.  Github is one grade down.  Facebook is not graded yet but we know which end of the scale it ends up on.  I guess Google, despite trying hard, is going towards that same end.Below is also linked to an aid for creating your own privacy policies.- http://tos-dr.info/
– http://termsfeed.com/free/privacy-policy-generator

Free classical music

Modern music is owned by someone.
Older music might be free.
Some people has collected old music for our convenience. Free.
Not as in Free beer but as in Free speach.- http://musopen.org/music/by/performer/Musopen-Symphony-Orchestra

US government (or military) eaves drop your private Facebook postings

In the name of the holy war against terrorism and people with different opinions your facebook private files might be read by the U.S. national security details.In the defense of the Holy warriors in the holy war against terrorism and different opinionated, the guy arrested was putting out some real threats.  Personally I’d prefer to have him under surveillance and treatment too.
But the fact remains that Facebook isn’t private.  Not even the private parts are private.Which leads me to Microsoft skydrive where one is not allowed to store nude pictures or warez.  This means that there is constant surveillance of what you store.  I have lost the link though.Equally lost is the link to the guy at Google, a contractor, that had as job to sift through juicy pictures; the real juicy, like goatse-juicy ones.  He had to go to therapy afterwards.- http://yro.slashdot.org/story/12/08/20/2345253/ex-marine-detained-for-facebook-posts-deemed-terrorist-in-natureI guess I get bumped with Echelon for this.

Miscellaneous

Mactuts+ – mac tutorials

If the Mac isn’t as easy to use as you expected.- http://mac.tutsplus.com/

Toys – war toys of yesterday

If you ever wondered where USA got their love for weapons look no further.  Below is linked old commercials with gay (used in the old tense as happy, glad) boys blasting away at their enemies.
No gun is too big.
Every boy wants one.
And girls too.
Mattel – big guns for boys, eating disorder dolls for girls.
Batteries not needed – remember, this was back in the black&white days.- http://www.webdesignerdepot.com/2012/08/retro-commercials-old-toys-your-parents-loved/

How differential gears work

I know how differential gears (differentialväxel) work.  And You know how differential gears work.  But trying to explain how it works is another issue.So below is linked a flick from the times when the moving pictures where black and white but mostly grey and people smoked in their homes and women were secretaries and wore skirts but above all the Car was teh Future and gasoline was neither scarce, expensive nor polluting the earth.
Strangely enough it does a good job of explaining how differential gears work.  You can wind 1:30 or 3:15 into the movie to avoid some of the fluff.- http://www.youtube.com/watch?v=K4JhruinbWcTipthanks MaTh

Nice presentation

Nice presentationA presentation for presentation’s sake. Nice one too.-http://www.ted.com/talks/marco_tempest_the_electric_rise_and_fall_of_nikola_tesla.html

Tipthanks FredrikH

Watch in CSS (web)

Watch in CSS (web)Nice animation of a watch. Almost only done in CSS.-http://codepen.io/TheSisb/pen/eAHyJ

Home made prosthetic arm

One should not fish with dynamite. It is bad for the fish. It can also be bad for the hands.
So this guy does some dynamite fishing and blows of his hands.
Without hands he still manages to create two prosthetic hands.
How’s that for dexterity?-http://www.huffingtonpost.com/2012/08/15/sun-jifa-prosthetic-hands_n_1777168.html

DIY aircraft

Now, when we are about to get 3D printers and affordable CNC machines in every household why not make an aircraft? Open source!-http://makerplane.org/

Physical 1st person shooter

Playing FPS is probably the most fun thing you can do with your clothes on.
What it lacks though is sweat and pain.We have all dreamt about the 2D tread mill so we can walk and run in any direction instead of slouching in the couch.  And we have all dreamt about the surround graphics filling our view field with intense graphics.  Now this is done.And to add…
…paint ball markers to give sensory input when you get fragged!Sensoring is done through a Kinect so you can do it naked too.Reality is coming closer as we speak.- http://www.youtube.com/watch?v=eg8Bh5iI2WY

Tipthanks Fx

Nice looking props helmet

Below is linked some nice instructions on how to build a 3D props helmet out of paper.
First use a computer program to model the helmet in.  Then use another program to get the model translated to paper and lines to cut.  Then cut and glue and cut and glue.  And cut and glue some more.  Then apply bonding, polyester and other stuff every other time and sand every other.  Repeat and repeat.  Then apply layers and layers of paint.  The result below is quite nice looking.- http://protagonist4hire.blogspot.se/2012/01/prop-building-101-part-1-building.html

Scariest prank. Ever.

It is like the Ring of pranks.- https://www.youtube.com/watch?v=7N5OhNplEd4

Lego rubber band tank

Not bad.
Considering the creator i 9 years and have 20 hours of stamina – not bad at all!- http://www.youtube.com/watch?v=DP0TosvzoBITipthanks MaTh

Solar powered Raspberry pi FTP server

The title says it all.
Now, why limit oneself to FTP?  It could just as well be a web server or media server.  The thing here is that solar power is enough to power it.  Just add water proofing and you have a server for your summer house.- http://blog.makezine.com/2012/12/11/how-to-solar-powered-raspberry-pi-ftp-server/

Bumbloods – zombie web series

Stupid people doing stupid things. A proven recipe since Friends and long before that. Bumbloods isn’t as good as Bite me but can be watch worth.- http://www.dailymotion.com/Bumbloods

Putting scale to things

How big is the sun?  If you take the distance from Earth to Moon it is very roughly a fifth of the diameter of Sun.  So Sun isn’t that big, cosmology wise.
Jupiter on the other hand is big.  The biggest (known) planet TrES-4 isn’t even double the diameter of Jupiter.Okok, you can put all planets in our solar system on a plane and still have Sun surround them; so I guess it is kind of big.  Disregaring Betelgeuse that is so big that when I placed Sun beside it, Sun was but a speck.  Now Betelgeuse isn’t the biggest star, not by far.  But it is old; old enough to die within the next 10000 years.Now.  How small is an atom?
Don’t get me started.  Find out for yourself.Play around with the link below.
Almost as addictive as google maps and heroin.- http://scaleofuniverse.comTipthanks Lasse

How Git works – explained in pictures

It might be fun if you don’t know Git.
It *is* fun if you know Git.- http://wheningit.tumblr.com

List the size of tables and stuff in a Sqlserver

February 4th, 2013

A simple solution copied from here is

1
sp_msforeachtable "sp_spaceused '?'"

an almost as simple is the one below copied from here:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
SET NOCOUNT ON

CREATE TABLE #TBLSize
(Tblname VARCHAR(80),
TblRows INT,
TblReserved VARCHAR(80),
TblData VARCHAR(80),
TblIndex_Size VARCHAR(80),
TblUnused VARCHAR(80))

DECLARE @DBname VARCHAR(80)
DECLARE @tablename VARCHAR(80)

SELECT @DBname = DB_NAME(DB_ID())
PRINT 'User Table size Report for (Server / Database): ' + @@ServerName + ' / ' + @DBName
PRINT ''
PRINT 'By Size Descending'
DECLARE TblName_cursor CURSOR FOR
SELECT NAME
FROM sysobjects
WHERE xType = 'U'

OPEN TblName_cursor

FETCH NEXT FROM TblName_cursor
INTO @tablename

WHILE @@FETCH_STATUS = 0
BEGIN
INSERT INTO #tblSize(Tblname, TblRows, TblReserved, TblData, TblIndex_Size, TblUnused)
EXEC Sp_SpaceUsed @tablename

-- Get the next author.
FETCH NEXT FROM TblName_cursor
INTO @tablename
END

CLOSE TblName_cursor
DEALLOCATE TblName_cursor

SELECT CAST(Tblname AS VARCHAR(30)) 'Table',
CAST(TblRows AS VARCHAR(14)) 'Row Count',
CAST(LEFT(TblReserved, CHARINDEX(' KB', TblReserved)) AS INT) 'Total Space (KB)',
CAST(TblData AS VARCHAR(14)) 'Data Space',
CAST(TblIndex_Size AS VARCHAR(14)) 'Index Space',
CAST(TblUnused AS VARCHAR(14)) 'Unused Space'
FROM #tblSize
ORDER BY 'Total Space (KB)' DESC

PRINT ''
PRINT 'By Table Name Alphabetical'

SELECT CAST(Tblname AS VARCHAR(30)) 'Table',
CAST(TblRows AS VARCHAR(14)) 'Row Count',
CAST(LEFT(TblReserved, CHARINDEX(' KB', TblReserved)) AS INT) 'Total Space (KB)',
CAST(TblData AS VARCHAR(14)) 'Data Space',
CAST(TblIndex_Size AS VARCHAR(14)) 'Index Space',
CAST(TblUnused AS VARCHAR(14)) 'Unused Space'
FROM #tblSize
ORDER BY 'Table'

DROP TABLE #TblSize

Encrypt Android and restore a bricked Google nexus 7

January 28th, 2013

Encrypt android

With the later (exact version unknown) it is possible to encrypt the whole Android device. This should mean that anyone getting hands on your machine can’t get to its data. I don’t know the encryption method nor do I know if there are any holes to exploit that makes the encryption moot.

Just go look in the Settings and there is a Security and from there you’ll find your way.
The memory card can be encrypted too.

For encrypting a device one must start using a pass code to start the machine.
For security one should also have a pass code to open it. Now this can be tedious, pressing in 4 characters or more every time you want to do a small check.
Try out Llama. It can react on the cell masts/IDs and in a beta to WLANs. For instance have the device not being locked while being at home (close to a mast or within your home’s WLAN range).

Restore a Google nexus 7

First hits when googling google nexus restore are various kinds of holding down power button and up/down volume.

If this does’t work there is a hidden while doing System restore I found here.

If you are so out of luck this doesn’t work go here to do a full OS replacement.

Convert data like you do in Excel – but with a tool that is created for it

January 25th, 2013

SHORT

If you convert table like data, think Excel and manipulation, before being able to use it:
There is a tool called Openrefine for this and it is free.

TL;DR

Sometimes one gets a file from the customer to import into a system. The received data is almost correct.
So one opens a spread sheet, pastes/imports and start converting. After a while deed is done and case is closed. Then one gets a new file and redoes everything.

In my above, real life, example a spreadsheet program like Excel or Openoffice-Calc is used. But that is not what it is created for, or best at, or even good at.

I have wished for a program created for importing and converting data. And it has existed since many years, albeit seldom mentioned.

http://openrefine.org/

Using the same URL disregarding the protocol (http/https)

January 25th, 2013

If you are running your development on HTTP but testing, QA and production on HTTPS you might have stumbled on

Do you want to view only the web page content that was delivered securely?

Do you want to view only the webpage content that was delivered securely

“Do you want to view only the webpage content that was delivered securely” dialogue.

The culprit might be your site loading stuff through HTTP while the site is run through HTTPS; the browser doesn’t like that.

Solution:

Instead of rewriting everything to HTTPS or create a deploy transformation to have different versions in dev, test and the rest just abandon the protocol.

E.g. use:

1
<script type="text/javascript" src="//www.otherexamplesite.com/cdn/jquery.js"></script>

instead of

1
<script type="text/javascript" src="https://www.otherexamplesite.com/cdn/jquery.js"></script>

Happy hacking!

Variable names, their types and choice of language – a 5 day experiment

January 13th, 2013

 

TL;DR

  • You have to have knowledge of your types, either through tools or through syntax.
  • Have different naming conventions for different languages.
  • A strongly typed compiled language can have any naming convention but a weekly typed should have the types integrated in the variable names.

LONGER

Should one use Hungarian notation (sName, oCustomer), type suffixing (nameString, customerObject) or leave out the type (name, customer).  The Rulez have come full circle and we are now back at keeping it simple so name and customer is what we write in coding standards nowadays.  I am a die hard fan of compiled and strongly typed languages and I really don’t care.  My compiler, my IDE and my plugin take care of finding misspellings and type mismatches.

But…

In my head I couldn’t get the simplest, and as I see it most modern naming convention (name, customer), to work together with the weekly typed javascript language.  Keeping track of types in javascript is a problem and if one doesn’t get any help from the variable names – how does one do?

So I set out on a 5 day experiment.

I wrote some real production code with Aspnet Webforms, Knockout, Underscore, Jquery, Ajax and Web services returning Json.
I chose to name variables and methods in their simplest form.

1
updateCustomers( customers )

which iterates and calls

1
updateCustomer( customer )

and returns a bool if everything worked as expected.

My conclusion is that this is a bad idea.
I spent way too much time debugging and tracing the-object-property-having an-array-of-another-object-type and whether the final property had a plural “s” or not.  The example is not contrived; I had a view model object containing an object which contained a list of Customers which contained properties, or a property which was a list.
To add insult to injury – Knockout was involved so I had to trace through method calls which made the debugging even more tedious.  (don’t get me wrong – Knockout still does it’s work properly – it is my own objects and their relations and above all naming that trips me)

After this real world experiment I now have a case for having the type in the identifier names.

1
bUpdateCustomers( aCustomer )

which iterates the the parameter and calls

1
bUpdateCustomer( oCustomer )

I am not saying hungarian notation is better than suffixing the type but it makes for shorter names.  Which makes for less possibility to mistype.

[ before gong berserk on Hungarian notation – please check into the difference between System and Apps. ]

Visual Studio 2012 and Blend – the designer only shows XAML and the remedy

December 17th, 2012

With VS2010; Blend was shipped as a stand alone product. With VS2012; Blend was bundled. Almost.

The Blend that comes with VS2012 only does Win8 ModernUI apps.

But there is a remedy: download Blend preview from here: http://bit.ly/U3Opxh.  Login might be required.

IE debugger – it has existed since a long time back

November 28th, 2012

Every so often (but more seldom) I hear that IE doesn’t have a debugger.
“What?” I say.  “I have been using a debugger in IE for many years.”

It is (was?) hard to find though.  One way was to install Visual studio.  Another to install MSOffice. The third was (is) to follow this forgotten, seldom mentioned but still working link to download.  I have recently used it for debugging an unpatched IE7 on WinXP.

Today the debugger is one F12 press away.

<rant>The IE debugger has shortcuts which is a must for debugging.  Mousing is doable but not for serious work. (YMMV)  Chrome, Opera and Firefox have shortcuts too but they mix with the debugee – try setting the focus on the debugee form and then press a shortcut; nothing happens.  By the time you, dear reader, read this the problem might have been solved but for now I am right. <mad-professor-laughter/></rant>

“Windows update” on windows 8

November 26th, 2012

The as-far-as-I-have-discovered fastest way to get to “Windows update” in Win8 is command/windows button -> type “update” (or possibly “upd”) -> down arrow (to get to Settings) -> return -> return.
( Then tab&enter to see more info about what is about to get installed, esc to close the dialogue, tab to set focus on the Ok button and then return to shoot. )

PC settings (in Norwegian bokmål)

I have been playing with language settings – hence What PC settings looks like in Norwegian (bokmål).

[ Lots of GUI stuff is new in Windows 8 and not all for the good; getting rid of Search programs and files is not one of the wise choices. ]

tags: | categories: Miscellaneous | no comments »

Mac OSX, Parallels, Windows 8, Visual studio 2012 and VS drops all keyboard events

November 22nd, 2012

For my fellow googlewithbingers out there:

If you run a setup like mine with Win8 running on OSX through Parallels and your VS2012 sometimes stops responding to key presses; activate another application, then press the windows/command button for getting the start screen and then choose VS2012.  Your already running VS gets focus and the keyboard is restored.

Don’t know why this works.  There are certainly better workarounds.  The problem with probably go away in the future.  But for now it saves me.