Posts

File does not open in C -

file not show when enter want doesn't give me error. the file is: account name balance 100 jones 24.98 200 doe 345.67 300 white 0.00 400 stone -42.16 500 rich 224.62 int main(void) { int account; char name[30]; float balance; int request; char singleline[150]; file * fpointer; fpointer = fopen("acc.txt","r"); while (!feof(fpointer)) { fgets(singleline, 150, fpointer); } if ((fpointer= fopen("acc.txt", "r"))==null) printf("file not opened\n"); else { printf("enter request\n" "1 - list accounts 0 balances\n" "2 - list accounts credit balances\n" "3 - list accounts debit balances\n" "4 - endof run\n"); scanf("%d", &request); while (request !=4) { fscanf(fpointer,"%d%s...

printing - How to repair whitespace in a Python script? -

so i'm new python , guess i've deleted spaces @ beginning of script don't know where. print("hey, i'm chatmaster! what's full name?") x = input() print(x,"died several years ago.. how did die?") y = input () print (y, "... wow.. that's terrible... how here? soul haunting mainframe??") z = input() if z == "yes": print ("*demon voice* i'll have delete you.") print ("*session has ended. terminated in 5 seconds. type cancel cancel") v = input () if v == "cancel": print ("chatmaster- nice try. you've been overriden.") print ("5") print ("4") print ("3") print ("2") print ("1") if z == "no": print (" don't believe *system shuts down.*") best guess (ps whitespace important): print("hey, i'm chatmaster! what's full name?") x = input() print(x,"died several years a...

html - Dynamic element height to match background cover dimensions -

i'm using following css set cover background image on element: .bg { background: url(images/kitteh1.jpg) no-repeat; background-size: cover; background-position: center; height: 200px; } what right, css-only, way of having element size match of background image, such image first takes 100% width, , takes height necessary fit original aspect ratio? here's playground: http://jsfiddle.net/e5ek812c/ as far know, css never aware of image size. can do, however, set padding-top or padding-bottom image's ratio (height is 56.25% of width here). explanation padding-top , when set percentage, uses element's width reference ( 100% ). unlike height . .a { background-color: #ddd; } .bg { background: url(https://prinzhorn.github.io/skrollr/examples/images/kitteh1.jpg) no-repeat; background-size: cover; background-position: center; padding-top: 56.25%; } .c { background-color: #aaa; } <div class="a"...

Filtering Inner Collection in Entity Framework -

i have teams , each team holding products collection , products holding branches collection. each of above entity having field say: isactive want retrieve teams, products, branches active ( isactive=true). system.data.entity.infrastructure.dbquery<team> query = dbcontext.teams.asnotracking(); query = query.include("products"); query = query.include("products.branches"); //filtering active teams querymod = querymod.where(b => b.isactive == active.value); //filtering active products querymod = querymod.where(b => b.products.where(c => c.isactive == active.value).all(d=>d.isactive==active.value)); //filtering active branches querymod = querymod.where(b => b.products.all(c => c.branches.all(d=>d.isactive == active.value) && c.isactive == active.value)); but looks not working expected. correct form of using statement filter inner groups direction or appreciated!. thanks

amazon s3 - Bash cron job doesn't execute like it does on command line -

i've written bash script executes python script write file directory, sends file amazon s3. when execute script command line executes perfectly, when run cron, file writes directory, never gets sent s3. must doing wrong cron. here bash script: #!/bin/bash #python script exports file home directory python some_script.py #export file created python s3 s3cmd put /home/bitnami/myfile.csv s3://location/to/put/file/myfile.csv like said before, manually executing works fine using ./bash_script.sh . when set cron job, file writes directory, never gets sent s3. my cron job is: 18 * * * * /home/bitnami/bash_script.sh am using cron incorrectly? please help. cron looks ok, path .py file not found. you have add path or home like: location=/home/bitnami/ python $location/some_script.py also s3cmd needs located correctly: /bin/s3cmd alternative might need load user environment first before executing script find username/password/ssh key s3cmd

Can't Install Cordova -

hello can't install cordova npm can me please thank you. 0 info worked if ends ok 1 verbose cli [ 'c:\\program files\\nodejs\\\\node.exe', 1 verbose cli 'c:\\program files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js', 1 verbose cli 'install', 1 verbose cli '-g', 1 verbose cli 'cordova' ] 2 info using npm@2.5.1 3 info using node@v0.12.0 4 verbose node symlink c:\program files\nodejs\\node.exe 5 silly cache add args [ 'cordova', null ] 6 verbose cache add spec cordova 7 silly cache add parsed spec { raw: 'cordova', 7 silly cache add scope: null, 7 silly cache add name: null, 7 silly cache add rawspec: 'cordova', 7 silly cache add spec: 'c:\\users\\sarahprat\\cordova', 7 silly cache add type: 'local' } 8 silly addlocaltarball shasum (computed) da39a3ee5e6b4b0d3255bfef95601890afd80709 9 verbose addtmptarball c:\users\sarahprat\cordova not in flight; adding 10 verbose addtmptarball va...

templates - Mustache section values are overridden -

how output: <h1>colors</h1> <li><strong>red</strong></li> <li><a href="#green">green</a></li> <li><a href="#blue">blue</a></li> from template: <h1>{{header}}</h1> {{#bug}} {{/bug}} {{#items}} {{#first}} <li><strong>{{name}}</strong></li> {{/first}} {{#link}} <li><a href="{{url}}">{{name}}</a></li> {{/link}} {{/items}} {{#empty}} <p>the list empty.</p> {{/empty}} this data: { "header": "colors", "first": true, "items": [ {"name": "red", "first": true, "url": "#red"}, {"name": "green", "link": true, "url": "#green"}, {"name": "blue", "link": true, "url": "#blue"...