Installing steam on fedora 22

I had some trouble once I’d installed steam. It would fail to find the swrast driver. After some searching I found that the following command pulled through the required libraries:

sudo dnf install xorg-x11-drv-nvidia-libs.i686

This didn’t work quite so well on Fedora 23 so try this…

sudo dnf install nvidia-driver-libs

or use yumex-dnf to install nvidia-driver-libs.

when akmod-nvidia doesn’t appear to work

After installing akmod-nividia package, you might run into a situation where you install a shiny new kernel but the akmod-nvidia package builds, but doesn’t install the drivers for the Kernel. To get it to install your built drivers do this:

    cd /var/cache/akmods/nvidia; ls
    sudo rpm -ivh kmod-nvidia-###########.rpm
    sudo shutdown -r now

Where ############ is the latest number that corresponds to your new kernel number and the driver version.
You might want to check out the fail log to see why it failed. When this happened to me akmod had tried to install, but rpm was locked.

Simple outlook inbox analysis using R

Emails from eBay members asking questions come through as randomstring@members.ebay.com which can make them hard to count as a group
The following R script re-codes them so they can be counted.

install.packages("plyr")
library(plyr)

setwd("/home/mike/Desktop")
dir()
inbox<-read.csv("inbox.TXT", sep="\t")
names(inbox)

inbox$EADD <- ifelse(grepl("members.ebay.co.uk",inbox$From...Address.), 
                      "members.ebay.co.uk" , 
                      c(as.character(inbox$From...Address.)))   

str(inbox)

f <- ddply(inbox,c("EADD"),summarize,N=length(EADD))
plot(f$N)
head(f[order(-f$N),])
str(f)

Once you've identified the biggest culprits, make a rule to move or delete them from your email.

c++ binary stuff

#include 
#include 
#include 
#include 

using namespace std;
int maxBinLen;
string binary( unsigned long n, int needlength );

int main()
{
    unsigned long n=33;
    unsigned long p=76;
    int binarymax = 20;
    int np  = n & p;
    int x   = n ^ p;
    int s   = n | p;
    int bitshift = n << 1;
    cout<<"--------------=======---------------"<>= 1); //right bitwise operator
    str=string(resultArray + index );
    int strlen=str.length();
    for(int i=0;i<=(needlength-strlen)-1;i++)
        {strBin=strBin+"0";}
        strBin=strBin+str;
  return strBin;  //is this format something to do with returning a string??
}

t-sql

Create a table that contains one one, two twos, three threes etc. upto a given maximum using t-SQl

DECLARE @max int
declare @val int
declare @inner int
set @val = 0
SET @max = 20

WHILE   @val<=@max BEGIN
	set @inner=0
		WHILE   @inner<@val BEGIN
				insert into @id(number) values (@val)
				set @inner= @inner+1
			END
		set @val = @val +1
	END

select * from @id
select count(*) from @id