Posts

windows - Set proper paths for VS Command Line Compiler -

i installed vs15 - preview (stripped down version of visual studio 2015). able compile c/c++ sources inside ide, not able compile command line interface cl.exe. can't find c stdlib headers. tried use vcvars32.bat set proper reg values seemingly cant find "common tools folder". "error: cannot determine location of vs common tools folder." the script uses env. variable "%vs150comntools%". if try run "cd %vs150comntools%" cmd line, can't find path, seems main problem. how can manually set %vs150comntools% right path? how can set cmd linker settings manually (without telling cl.exe every time call it)? okay, solved adding path include directories , lib directories env. variables "include", "lib". works now, whyever script not able set values properly. not fluent in reading .bat let away writing in, assume directory structure, different vs15 preview when compared full version, had not been adapted yet. ...

javascript - How to click and have x/y position written at that position? -

this question has answer here: how x&y corrdinates image input? 3 answers i have image on page. want able click on image , @ point of click output x/y position (coordinates), each click. how can that? note: know how x/y coordinate. question centers around how write x/y coordinates screen @ exact coordinates? i suppose on click of image dynamically write inline div text coordinates in it. have no idea how implement that. thanks! here working snippet. idea bind click event img element , on click create dynamic span tag , set top , left css property event.offsety , event.offsetx respectively. make sure span places click happened. $('img').on('click',function(e){ var span = "<span style='position:absolute;top:"+e.pagey+"px;left:"+e.pagex+"px'>"+e.offsetx +","+ e.offsety+...

sorting - python sort objects by difference in attributes/weights -

is there way sort function in python? the array holds objects each 1 has weight value. i'd appreciate javascript sort . i tried doing cmp run error: typeerror: comparison function must return int, not float use python's built in sorted function lambda , , cast result integer. sorted_list = sorted(unsorted_iterable, lambda x, y: int(x.weight - y.weight))

javascript - Data of type undefined has no value? -

in javascript, type "undefined" supposed have 1 value "undefined". however, in example below, undeclared xxx has type "undefined" apparently has no value of kind. not make difference js throws exception because of no value in xxx. consistent js should throw exception on typeof xxx. otherwise, have big hole in logic here. <!doctype html> <html> <body> <script> document.write("type=" + typeof xxx); document.write(", value="); document.write(xxx); </script> </body> </html> you need first at: data types typeof in example never declare xxx variable, therefore when document.write(xxx) variable xxx doesn't exist. var xxx; document.write("type=" + typeof xxx); document.write(", value="); document.write(xxx); declaring var xxx; no value instantiate , since has no value assigned, default assignment undefined stated in data types .

How do I use string manipulation on a .txt file with multiple lines -

what i'm aiming assign strings,each different line(from txt file),to each own variable. example of txt: 1 2 3 i tried doing assigning type output of txt file on variable command for /f "delims=" %%i in ('type "textfile.txt"') set testingvariable=%%i %testingvariable% being variable,i tried string manipulation this set newvariable=%testingvariable:~3,1% hoping come out 2 , results had either 0 on 3 numbers or nothing. is there simple simple solution this? (and if possible try explain as can still of beginner) you want every line seperate variable? need counter: setlocal enabledelayedexpansion set c=0 /f "delims=" %%i in ('type "textfile.txt"') ( set /a c+=1 set testingvariable[!c!]=%%i ) set testingvariable[ ... , need delayed expansion note: emty lines skipped

php - Categorized gallery -

i'm trying make categorized gallery blog. far i've created datebase tables: photos (photos_id, photos_gal_id, photos_link), galeries (galeries_id, galeries_title, galeries_description), , there other tables, not related problem (such users, posts etc). i've established connection db through init file: <?php class init { protected $db, $result; private $rows; public function __construct(){ $this->db = new mysqli('localhost','root','hhpass','europa'); } public function query ($sql){ $this->result = $this->db->query($sql); } public function rows(){ for($x =1; $x<= $this->db->affected_rows; $x++){ $this->rows[] = $this->result->fetch_assoc(); } return $this->rows; } }?> then data db through: class galeries extends init { public function fetchgaleries(){ //query db $this->query("select photos_id, photos.photos_ga...

php - Laravel 5 Session not available for the second page -

i new in laravel, , using laravel 5 storing values in session this this in controller function abc session::put('check_in', $check_in); session::put('check_out', $check_out); session::put('no_of_rooms', $no_of_rooms); session::put('adult', $adult); session::put('child', $child); return view('room'); i getting values of these sessions in rooms view, problem when going other link or on other page room view , using session as echo session::get('check_in')."<br>"; echo session::get('check_out')."<br>"; echo session::get('no_of_rooms')."<br><br>"; echo session::get('adult')."<br>"; echo session::get('child')."<br>"; i not able of these sessions value. i using sessions has on pages till session flashed or browser gets closed, not retrieving of session values.. ...