Posts

jquery - (NodeJS + Express) Server isn't reading linked javascript file(s) from html -

i'm stuck, managed server on webhost working on aws + else in express.js have error: root@ip(censored):/home/ubuntu/(censored)# /home/ubuntu/(censored)/routes/index.js:15 $(document).ready(function() { ^ referenceerror: document not defined @ object.<anonymous> (/home/ubuntu/(censored)/routes/index.js:15:3) @ module._compile (module.js:570:32) @ object.module._extensions..js (module.js:579:10) @ module.load (module.js:487:32) @ trymoduleload (module.js:446:12) @ function.module._load (module.js:438:3) @ module.require (module.js:497:17) @ require (internal/module.js:20:19) @ object.<anonymous> (/home/ubuntu/forbiddenground/app.js:12:14) @ module._compile (module.js:570:32) @ object.module._extensions..js (module.js:579:10) @ module.load (module.js:487:32) @ trymoduleload (module.js:446:12) @ function.module._load (module.js:438:3) @ module.runmain (module.js:604:10) @ run (bootstrap_node.js:394:7) ...

How to pass <select> html data in bootstrap modal to jquery -

i'm trying figure out how pass selected value tag located in modal : <div class='row'> <div class='col-md-8'> <form class='form-inline'> <select class='form-control' name='sel1' id='sel1'> <option>1.00</option> <option>1.25</option> <option>1.50</option> <option>1.75</option> <option>2.00</option> <option>2.25</option> <option>2.50</option> <option>2.75</option> <option>3.00</option> <option>5.00</option> <option>inc</option> <option>drp</option> <option>wdrw</option> </select> </div> <div class='col-md-4' align='right'> <input style='display: block; width: 100%;' type='button' class='btn btn-success' value='e...

python - How to change sprite after certain amount of time? -

i'm making game , want change sprite punch image stand image after few frames can figure out. trying find solution last resort. in advance. import pygame import os import time pygame.init() # screen display_width = 1350 display_height = 700 screen = pygame.display.set_mode((display_width, display_height)) # colors white = (255, 255, 255) frame = 0 # constants clock = pygame.time.clock() # images img = pygame.image.load("stand.png") stand_img = pygame.image.load('stand.png') crouch_img = pygame.image.load('crouch.png') jump_img = pygame.image.load('jump.png') punch_img = pygame.image.load('punch.png') class fighter: def __init__(self, x_pos, y_pos, image, health): self.x_pos = x_pos self.y_pos = y_pos self.image = image self.health = health def draw(self): screen.blit(self.image, (self.x_pos, self.y_pos)) def move(self, accel_x, accel_y): self.x_pos += accel_x s...

ios - How to get a NSBatchDeleteRequest to delete and allow you to add back to an object again -

Image
i have following code. let workorderfetchrequest = nsfetchrequest<nsfetchrequestresult>(entityname: "workorders") let deleteworkorderrequest = nsbatchdeleterequest(fetchrequest: workorderfetchrequest) //deletes workorders //question delete references work orders correctly now? try context.execute(deleteworkorderrequest) //save work order objects (overwriting old ones same id if needed) { try context.save() print("saved context workorders") } catch let error nserror { print("could not save \(error), \(error.userinfo)") } catch { print("could not save, unknown error") } print("deleted references") a workorders looks this... import foundation import coredata extension workorders { @nonobjc p...

python 3.x - Py Elisticsearch query slow on laptop -

i running simple python elasticsearch query in script evaluates instantly on workstation, has ~3 second lag on laptop. i'm thinking memory usage thing i'm not sure best way adjust that. def searchdata(query): sdat = es.search(index="roasts", doc_type="roast", q=query) the indexed json files small. thinking instant. help!

windows - dotnet is not recognized as the name of a cmdlet -

we have downloaded , run dotnetcore.1.0.1-sdk.1.0.0.preview2-003133-x64.exe . after having closed , reopened our command prompt, running dotnet gives following output. the term 'dotnet' not recognized name of cmdlet, function, script file, or operable program. we have tried following: uninstall versions of visual studio. uninstall versions of .net core. repair c++ redistributable 2015 x86 & x64 restart computer. then reinstall .net core sdk. this contents of c:/program files/dotnet host fxr sdk 1.0.0-preview2-003133 shared microsoft.netcore.app swidtag microsoft .net core 1.0.1 - sdk 1.0.0 preview 2-003133 (x64).swidtag our path includes c:\program files\dotnet\ after again coming across problem, found answer here . open programs , features, choose microsoft visual c++ redistributable (x86), click uninstall , choose repair. after repairing (and x64 version if have it), reinstall or repair installation of .net core sdk 1.0.1. ...

java - Comparing two elements of a string array with .equals() -

i'm working on project , need compare 2 elements of same array private void checkimports() { //import tester for(int = 0; i<theclass.length;i++) { for(int j = 0; j<i; j++) { if(theclass[i].equals(theclass[j])) { system.out.println("there double import @ line " +i); adderror("double import @ line ",i) } } } } the array filled following strings: "import java.x;" //0 "import java.y;" //1 "import java.z;" //2 "import java.x;" //3 for reason when call equals() method never evaluates true when = 3 , j= 0. explanation why adderror method never called appreciated there 2 possible explanations (i mean, there many explanations, these 2 lend checking first, think): the comparison i==3 , j==0 never performed (even though think is). the values...