Wednesday, March 5, 2014

Fast access to ssh public key

I took it from github page. It's nice to have shortcut:)
xclip -sel clip < ~/.ssh/id_rsa.pub

Wednesday, February 26, 2014

SQL Case with only nulls problem

Last time client reported some strange SQL error.

None of the result expressions in a CASE specification can be NULL

It is caused by following statement

UPDATE MY_TABLE SET MY_COLUMN = CASE ID  WHEN 99 THEN null WHEN 100 THEN null  END

It looks for me ok, but the problem is with nulls. When CASE expression returns only nulls, then MSSQL interpreter do not know result type. I can think abount many workarounds for this problem but the best is to add "ELSE MY_COLUMN" expression. Corrected, stable form of statement is now

UPDATE MY_TABLE SET MY_COLUMN = CASE ID  WHEN 99 THEN null WHEN 100 THEN null  ELSE MY_COLUMN END

Now interpreter knowns result type and it works.

Tuesday, February 25, 2014

Scala interview questions

Comming soon

Git merge specific file from another branch

No more workarounds! I finally know how to merge changes from only one file from given branch to current branch.

Just do the following:

git checkout <some-branch> <path-to-specific-file>

Friday, April 26, 2013

[Solved] R SVM test data does not match model

Hi,

Here is my solution to error "test data does not match model !". It occurs, when you try to predict testdata with SVM model from e1071 like bellow
predict(mySVMmodel, type="class", testset)
I found some hint here http://r.789695.n4.nabble.com/Levels-in-new-data-fed-to-SVM-td4654969.html , but in wasn't exactly my case. I lost few hours but I have solution now.

 You have to set factor levels of ALL your columns to be exactly the same as in training data, not only class column...
So you can use sth. like:
(edition: thx to Ting Chi) 

testset$foocolname <- factor(
    testset$foocolname,levels = levels(trainset$foocolname)
)
testset$goocol <- factor(
    testset$goocol,levels = levels(trainset$goocol)
)
etc...
 If it helps, let me know:)

Edit: some tips
  • Error "length of 'center' must equal the number of columns of 'x'" might be somehow connected with factor levels problem. I don't know why, but by using tips from the post i solved that error too.
  • When you assign some factor levels you might get error "number of levels differs". It means, that left side column contains more factor levels than right side column and your idea is probably wrong.


Thursday, March 28, 2013

Scrum Open Assesment

Below i present three too hard for me questions from Scrum Open Assesment. There are also correct answers taken from Open Assesment Feedback.

Question 1:

The Development Team should not be interrupted during the Sprint. The work it selects for the Sprint should not be changed. The Sprint Goal should remain intact. All of these attributes of a Sprint foster creativity, quality and productivity. Based on this, which of the following is false?

A) The Product Owner can help clarify or optimize the Sprint when asked by the Development Team
B) The Sprint Backlog and its contents are fully formulated in the Sprint Planning meeting and do not change durring the Sprint.
C) As a decomposition of the selected Product Backlog Items, the Sprint Backlog changes and may grow as the work emerges.
The Development Team may work with the Product Owner to remove or add work if it finds it has more or less capacity than it expected.

Question 2:

Which statement best describes the Sprint Review?

A) It is a review of the team's activities during the Sprint.
B) It is when the Scrum Team and stakeholders inspect to outcome of the Sprint and figure out what to do in the upcomming Sprint.
C) It is a demo at the end of the Sprint for everyone in the organization to provide feedback on the work done.
D) It is used to congratulate the Development Team if it did what it committed to doing, or to punish the Development Team if it failed to meet its commitments.

Feedback:
Every event in Scrum, besides the Sprint which is a container for the other events, is an opportunity to Inspect AND Adapt.

Question 3:

Which two (2) things does the Development Team not do during the first Sprint?
A) Deliver an increment of potentially shippable functionality.
B) Nail down the complete architecture and infrastrunture.
C) Develop and deliver at least one piece of functionality.
D) Develop a plan for the rest of the project.

Hope it may help you also during (preparation to) real test. Blog is open for discusion about that questions.

Saturday, February 16, 2013

Songsterr free premium account


Hi,

this post isn't really conntected with programming but with free music tabs. Today (16th febuary) I registered free account. Then I came here https://www.songsterr.com/a/wa/plus and I spotted image
So after I clicked that image I got my own reflink

Then i pasted it into my browser, clicked "enter" and now I have premium for two weeks, so I can for example print tabs:)

Let your friends know!