Posts

python: running a loop over indexes of a sub list -

for items in things: while inputfloat != 0: thingsback[][1]=inputfloat//things[] inputfloat=inputfloat-(things[]*thingsback[][1]) things list of n elements, while thingsback list n sub-lists. want both things , thingsback start @ 0th element , loop through recursion. calculation inputfloat//things[] changes 1 index of j-th sublist in thingsback. know [] invalid syntax, used illustrative purposes. it seems there obvious solution, not seeing it. taking guess, think looking index of current item in loop? for index, items in enumerate(things): # stuff using index check out: accessing index in python 'for' loops

r - Error using DEXSeqDataSetFromHTSeq -

currently trying understand dexseq package. have design tsv file , 7 files contains counts. run following command library("dexseq"); design=read.table("dexseq_design.tsv", header=true, row.names=1); ecs = dexseqdatasetfromhtseq(countfiles=c("m0.txt", "m1.txt", "m2.txt", "m3.txt", "m4.txt", "m5.txt", "m6.txt", "m7.txt"), design=design, flattenedfile="genome.chr.gff"); the last command gives , error error in class(sampledata) %in% c("data.frame") : error in evaluating argument 'x' in selecting method function '%in%': error: argument "sampledata" missing, no default what error means , how fix it? while loading package dexseq there warning warning message: replacing previous import ‘ggplot2::position’ when loading ‘deseq2’

excel - Converting column into rows -

i have column of dates , numbers this: 24/01/2016 1 0.123 24/01/2016 2 0.121 24/01/2016 3 0.104 24/01/2016 4 0.116 24/01/2016 5 0.091 ... how can transform column in excel appears in three columns such: 24/01/2016 1 0.123 24/01/2016 2 0.121 24/01/2016 3 0.104 24/01/2016 4 0.116 24/01/2016 5 0.091 ... you can find answer here . in short, 1 of answers use following formula: =indirect(address((row($a1)-1)*3+column(a1),1))

PDFBox not returning the correct size of an image -

i new pdfbox , stuck @ finding height of image in inches. after couple of searches, piece of code working with: pdresources resources = apdpage.findresources(); graphicsstate = new pdgraphicsstate(apdpage.findcropbox()); pagewidth = apdpage.findcropbox().getwidth() / 72; pageheight = apdpage.findcropbox().getheight() / 72; @suppresswarnings("deprecation") map<string, pdxobjectimage> imageobjects = resources.getimages(); if (null == imageobjects || imageobjects.isempty()) return; (map.entry<string, pdxobjectimage> entryxobjects : imageobjects.entryset()) { pdxobjectimage image = entryxobjects.getvalue(); // system.out.println("bits per component: " + image.getbitspercomponent()); matrix ctmnew = graphicsstate.getcurrenttransformationmatrix(); float imagexscale = ctmnew.getxscale(); float imageyscale = ctmnew.getyscale(); ...

go - Golang- invalid array bound -

when run code below error: school_mark.go:8: invalid array bound s my code: package main import "fmt" func main(){ var subj float64 fmt.println("enter how have subjects inn school: ") fmt.scanf("%f", &subj) s := subj var mark [s]float64 var float64 = 0; a<s; a++{ fmt.scanf("%f", &mark) } var total float64 var float64 i= 0; i<subj; i++{ total += mark[i] } fmt.println(total/subj) } what problem? spec: array types: the length part of array's type; must evaluate non-negative constant representable value of type int . your length in [s]float64 not constant. use slice instead of array type, , know have use integer type length, e.g.: var mark []float64 = make([]float64, int(s)) or short: mark := make([]float64, int(s)) going forward, use integer types (e.g. int ) indices. can declare in for like: for := 0; < len(mark); i++ { ...

css - Video background on a wordpress website not showing up properly on IE9 -

using jw player, trying embed video website background. using wordpress cms website. home page works on chrome , firefox, not show on ie 9. having hard time trying figure wrong. url website: demo website first of all, video doesn't cover whole background on resolution set width , height of video element to: video_wrapper{ width: 100%; height: 100%; } considering ie9 can explain wrong or provide screenshot?

How do C programs pass whitespace arguments to the libc system(3) calls? -

when c program calls system() run unix command, know it's possible pass arguments command, , according stackoverflow answer (from high-rep user), the system() call uses shell execute command . it surprised me see system("ls -lh >/dev/null 2>&1"); example system() call c program, since looks using same whitespace delimited "words" shell uses interactively. from standpoint sysadmin, i'd understand provisos , pitfalls when system() call going executed within c program on files or commands on system. passing whitespace-containing filenames shell script very issue-prone ; there similar issues when c program calling command? or make point blunter (though less exact): c program written novice break on whitespace-containing filenames shell script? there nothing in c source here, string pass system() run in shell context. shell parse string, c program doesn't. if @ system() function prototype : #include <stdlib.h> ...