Posts

Showing posts from January, 2013

angularjs - Camera plugin + cordova social sharing -

i'm using camera plugin take photo, , want share photo cordova social sharing plugin, don't know how... the camera works fine, , shows me photo i'd taken ionicapp.controller("functions", function($scope, $rootscope, $cordovacamera) { $rootscope.takepicture = function() { var options = { quality : 75, destinationtype : camera.destinationtype.data_url, sourcetype : camera.picturesourcetype.camera, allowedit : true, encodingtype: camera.encodingtype.jpeg, targetwidth: 300, targetheight: 300, popoveroptions: camerapopoveroptions, savetophotoalbum: false }; $cordovacamera.getpicture(options).then(function(imagedata) { var image = document.getelementbyid('myimage'); $rootscope.imguri = "data:image/jpeg;base64," + imagedata; }, function(err) { // error occured. show message user }); } }); ionicapp.controller("share&q

Excel lookup to return formula -

Image
i have two-column lookup table like: col1 col2 tran1 =qty/1000 tran2 =qty/2000 tran3 =price+10 qty , price named ranges. i want use vlookup (or whatever else may work) populate cell formula in column 2, rather value. let's suppose a1 contains tran1 , b1 = 2500. b1 named range qty . want lookup formula in col2 of lookup table , insert formula cell c1, cell c1 displays 2.5. using excel 2010. i'm struggling find way this. say have lookup table in columns g , h like: we want enter word in cell a1 , appropriate formula appear in cell b1 . enter following event macro in worksheet code area: private sub worksheet_change(byval target range) dim r range if intersect(range("a1"), target) nothing exit sub set r = range("g1:g4").find(what:=target.value) if r nothing exit sub application.enableevents = false target.offset(0, 1).formula = r.offset(0, 1).formula appli

string - C# Replace Cyrillic chars failed -

i need replace cyrillic chars transliterated latin chars. unfortunately solution return -1 when search char position. what's wrong that? stringbuilder sb = new stringbuilder(); var domain = configurationmanager.appsettings["domain"]; catname = catname.tolower(); var englishchars = new string[] { "a", "b", "v", "g", "d", "e", "yo", "zh", "z", "i", "y", "k", "l", "m", "n", "o", "p", "r", "s", "t", "u", "f", "kh", "c", "ch", "sh", "shch", "i", "e", "yu", "ya", "_" }; var slavicchars = new string[] { "a", "б", "в", "г", "д", "е", "ё

vb.net - Back button closing app instead of going back on Windows Phone 8.1 -

i've created simple windows phone 8.1 app in visual studio 2013 , added 2 basic pages, along code navigate second screen when button on first screen clicked. going second screen works fine, when hardware button pressed, app closes. want app go first page when button pressed. i have followed instructions in navigationhelper.vb , added sub new() initialization commands, button still not work. how can pressing work correctly? in advance. here code: basicpage1.xaml.vb : imports app1.common public notinheritable class basicpage1 inherits page private withevents _navigationhelper new navigationhelper(me) private readonly _defaultviewmodel new observabledictionary() public readonly property navigationhelper navigationhelper return _navigationhelper end end property sub new() initializecomponent() me._navigationhelper = new common.navigationhelper(me) addhandler me._navigationhelper.loadstate, a

javascript - Nodejs TypeError: undefined is not a function -

i'm following treehouse nodejs tutorial , ran error. server response in router unable find view method in renderer. router.js:10 response.view("header", {}, response); ^ typeerror: undefined not function renderer.js var fs = require("fs"); function view(templatename, values, response) { //read template files var filecontents = fs.readfilesync('./views/' + templatename + '.html'); //insert values in content //write out contents response response.write(filecontents); } module.exports.view = view; router.js var profile = require("./profile.js"); var renderer = require("./renderer.js"); //handle http route / , post / i.e. home function home(request, response) { //if url == "/" && if(request.url === "/") { //show search response.writehead(200, {'content-type': 'text/plain'}); response.view("header", {}, response); response.write(&q

javascript - Save DIV Data In Database Using Ajax To MySQL (using PHP Mysqli) -

have database below fetching data based on studentregid , studcourse , studentsection (are droupdown table) want send fetched data database using ajax , php on submit button click data radio button selected value , associated student name , 3 selected drop down values. databse1 schoolid studentregid studentfirstname studcourse studentsection ft001 12kqc31085 abc bcom ft001 12kqc31086 def bcom ft001 12kqc31087 ghi bcom ft001 12kqc31088 jkl bcom data data base <div id="myspan4"> </div> php: $mysqli=mysqli_connect('localhost','root','root','db'); $standard1 = mysqli_real_escape_string($mysqli,trim($_post["tclass"])); $section1 = mysqli_real_escape_string($mysqli,trim($_post["tsection"])); $schoolid1 = mysqli_re

Amazon S3 CORS works with HTTP but not HTTPS -

i can amazon s3 pass cors headers http, not https. how work both? if we're using akamai cdn? here's bucket configuration: <?xml version="1.0" encoding="utf-8"?> <corsconfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <corsrule> <allowedorigin>https://*</allowedorigin> <allowedorigin>http://*</allowedorigin> <allowedmethod>get</allowedmethod> <maxageseconds>3000</maxageseconds> <allowedheader>*</allowedheader> </corsrule> </corsconfiguration> here's test. difference between these 1 uses http, other uses https. both resources load fine in browser, use them in cors setting https. pnore@mbp> curl -i -h "origin: http://example.com" -h "access-control-request-method: get" -h 'pragma: no-cache' --verbose http://my.custom.domain/path/to/file/in/bucket | head -n

php - Access a remote Laravel 5 web app using ajax through a Hybrid App -

i'm developing hybrid app use ajax requests connect remote database. database accessed through laravel(5) framework . when send requests remote laravel web app, following case. error message, no access control allow origin header present. to solve problem added access control headers index.php @ public/ directory. above error no longer occurs(yes, know can same using middleware , recommended way). internal server error occurs saying csrf token mismatch exception . know if web appilication, have added csrf_token. since hybrid app, cant set token since can't run php here , can't obtain token ajax request. up now, have read every thread related in laravel forums. there no feasible answer. have idea how solve issue? thanks in advance!

magento CE1.7.0.2 gives error while installing live site backup on local workstation -

i facing below errors while installing live site backup on local workstation. imported database backup in mysql. renamed "local.xml.sample" "local.xml". renamed cache folder. yet gives below error. 1. warning: include_once(mage/core/functions.php): failed open stream: no such file or directory in c:\wamp\www\app\mage.php on line 50 2. warning: include_once(): failed opening 'mage/core/functions.php' inclusion (include_path='c:\wamp\www\app\code\local;c:\wamp\www\app\code\community;c:\wamp\www\app\code\core;c:\wamp\www\lib;.;c:\php\pear') in c:\wamp\www\app\mage.php on line 50 3. warning: include(mage\core\model\app.php): failed open stream: no such file or directory in c:\wamp\www\lib\varien\autoload.php on line 93 4. warning: include(): failed opening 'mage\core\model\app.php' inclusion (include_path='c:\wamp\www\app\code\local;c:\wamp\www\app\code\community;c:\wamp\www\app\code\core;c:\wamp\www\lib;.;c:\php\pear') i

javascript - Scroll function make left contraction -

i'm using following script fixed menu when scroll page. var num = 5; $(window).bind('scroll', function () { if ($(window).scrolltop() > num) { $('.scroll').css({'position':'fixed', 'top':'0px'}); } else { $('.scroll').css({'position':'', 'top':''}); } }); i'm using script table. see jsfiddle . when scroll down, title going contraction left left side. why it's happening , how can fix? should support major browsers(not ie). when set position: fixed left prop seems set 0. hence, headers moving left corner. may have play display , width props you're after. note adding/removing class better setting inline styles via .css() . @ following demo , adapt code accordingly suit needs. var num = 5; $(document).bind('scroll', function () { if ($(document).scrolltop() > num) { $('.scroll').addclass("scrolled

c# - Web api with mvc 6 get element based on string -

i creating web api using mvc 6. trying element db. key in table string (email address). not have access database cant change key of table. now when creating demo webapi able create controller extract items based on key int. when trying element string program crashes. [route("api/[controller]")] public class todocontroller : controller { [httpget("{id:string}", name = "getbyidroute")] public iactionresult getbyid (string id) { var item = _items.firstordefault(x => x.id == id); if (item == null) { return httpnotfound(); } return new objectresult(item); } } when trying access path (example.com/api/todo/key) key being string exception in startup.cs the exception in browser reads: system.invalidoperationexception constraint entry 'id' - 'string' on route 'api/todo/{id:string}' not resolved

arrays - How to use malloc in a c function? -

i want make c function fir filter, has 2 input arrays , 1 output array. both input arrays constant numbers, want use them computation of output of filter,and after computation delete them , store output array of function code not work #include <stdlib.h> float * filter(float *patientsignal,float *filtercoef, int lengthofpatient , int lengthoffilter ){ static float firout[8000]; int i,j; float temp=0; float* signal; float* coef; signal = malloc(lengthofpatient *sizeof(float)); coef = malloc(lengthoffilter*sizeof(float)); } (j = 0; j <= lengthofpatient; j++){ temp = signal[j] * coef[0]; (i = 1; <= lengthoffilter; i++){ if ((j - i) >= 0){ temp += signal[j - i] * coef[i]; } firout[j] = temp; } } free(signal); free(coef); free(patientsignal); return firout; } there several problems in code, unnecessary } after line coef = ma

Cron Job On local Host Windows Xampp php -

i have been following tutorial: run cron job on php script, on localhost in windows the first answer set on wamp... can tell me settings should run on xampp, windows 8. ps: when manualy click on "run" in task scheduler... runs te desired code (inserting data db) not happeneing automatically.

Update or remove value Vertica -

i have next sql structure table: id | account_id | app_id | setting | value example data: 1 | 8fb38bac-6896-49e8-ac92-4cf6300ccd6f | 1 | recipients | taras@gmail.com 2 | 8fb38bac-6896-49e8-ac92-4cf6300ccd6f | 1 | day | monday 3 | 8fb38bac-6896-49e8-ac92-4cf6300ccd6f | 1 | count | 1234 and need update data if send new value or remove if don't exist in request db. if sending ( recipients, day, count ) new value update existing data, if send ( recipients, day ) update data , remove count . i try use next code: update settings set setting='count', value='1' account_id='8fb38bac-6896-49e8-ac92-4cf6300ccd6f' , app_id='1'; but script update field in table. how fix it? from input , looks lots of values in table have same value account_id , app_id , hence when running script, updating values. if want update rows count in settings, - update settings set value='1' account_id

android - How to detect end call event in skype call -

i have integrated skype call in android application. wanted - catch call end event. know skype doesn't provide api calling uri calling using calling. how can detect call end because when press end call button skype activity.i want go application activity. is there workaround achieve that?because don't think of any.

Moodle Duplicate Course without archiving old course -

a teacher delivering same course 2 separate classes, wants create course once , copy different name. please guide how duplicate course without users, ensuring both courses active, not archived , function independently. thanks. moodle 2.8.5 please help very simple. backup , restore. there backup link on course menu. https://docs.moodle.org/28/en/backup_and_restore_faq

how to set bootstrap button to active on click using javascript -

<div class="row"> <div class="col-md-8"> <h3 > <button type=submit class="btn btn-primary btn-lg btn-block" .button><a href = "mrequest.php">make request</button> </h3> </div> </div> <div class="row"> <div class="col-md-8"> <h3> <button type=submit class="btn btn-primary btn-lg btn-block" .button><a href = "mviewreq.php">view requests</button> </h3> </div> </div> <div class="row"> <div class="col-md-8"> <h3> <button type=submit class="btn btn-primary btn-active btn-lg btn-block" .button><a href = "mviewstaff.php">quotation requests</button> </h3> </div> how can change button active when particular button clicked , , want

swift json type data parsing after get data -

i'm developing function receiving json after calling nsurlrequest in swift. having issues accessing different data values subscript after have parsed result. the following retrieved json: {"retcode":100,"retmsg":"success","retdata":{"usn":92,"id":"clipsys@gmail.com","nickname":"ppigimi","profile_image":"..\/upload\/profile\/20150528172839.jpeg","language":"jp","join_channel_nm":"korfolk","cert_key":"696d6fb453dc141e5295e9d8e37b8dd0f1afc8e34ce30b74551ed74a447ac564","cert_flag":"y","join_date":"20150518155650","token":"3ea0a5fec1b55a5a23b5f1dc5c14b040dcd71eea"}} the following code. don't know how values usn , token inside of retdata . let task = nsurlsession.sharedsession().datataskwithrequest(request) { data, response, error in

php - Double slashes on Wordpress Admin URL redirects to wp-login -

i can access dashboard through www.example.com/wp-login.php links inside dashboard have double slashes before wp-admin .. " www.example.com//wp-admin/ ..." , when access url, server redirects me wp-login again... my .htaccess file wp default # begin wordpress <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] </ifmodule> # end wordpress any clue it? thanks

ios - Deleted CloudKit records Reappear -

i'm building ios application using cloudkit. it should allow user add, edit , delete products in cloud. user can organize these in folders. these folders other record types in cloudkit. there no limit levels of folder user can use, folder can hold ckreference it's parent folder. cloudkit communication in app happens in dedicated cloudkitcontroller class this works, stops working after while no clear reason. when test app, don't user folders multiple levels deep. however, after using while (up week), deleted records seem reappear on cloudkit. couple of notes on this: when reset cloudkit dashboard , start on again, works perfect. no code changes made. obviously, i'm editing code app in development. however, don't edit data types in code stored in cloudkit. when do, issue not arise straigt afterwards changes in cloudkit dashboard (e.g. adding data types) not cause issue am not storing records locally, in core data. sit in singleton long use them when

Awk one-liner to replace text of first matching regex occurence only -

i need awk command replace ss:width="252" in first xml tag in text ss:width="140" , leave rest of tags alone: cat <<- eof > text <ss:column ss:autofitwidth="1" ss:width="252"/> <ss:column ss:autofitwidth="1" ss:width="126"/> <ss:column ss:autofitwidth="1" ss:width="126"/> <ss:column ss:autofitwidth="1" ss:width="126"/> <ss:column ss:autofitwidth="1" ss:width="126"/> <ss:column ss:autofitwidth="1" ss:width="252"/> <ss:column ss:autofitwidth="1" ss:width="126"/> <ss:column ss:autofitwidth="1" ss:width="126"/> <ss:column ss:autofitwidth="1" ss:width="189"/> <ss:column ss:autofitwidth="1" ss:width="189"/> <ss:column ss:autofitwidth="1" ss:width

c# - Error 0x800A03EC when creating an excel data sheet -

iam trying create excel file info within datagridview db. following error exception hresult: 0x800a03ec" (system.runtime.interopservices.comexception)... error seems in line ** the code within button click microsoft.office.interop.excel.application excel1 = new microsoft.office.interop.excel.application { }; workbook work1 = excel1.workbooks.add(xlsheettype.xlworksheet); worksheet ws1 = (worksheet)excel1.activesheet; excel1.visible = true; ws1.cells[1,1] = "id"; ws1.cells[1,2]= "name"; ** ws1.cells[1,1]= datagridview1[1,1]; ws1.cells[1, 2] = datagridview1[1,2]; there references available, example see: com exception diagnosing: https://msdn.microsoft.com/en-us/library/af1y26ew(v=vs.80).aspx depending upon operating system using, old excel file access bug: https://social.msdn.microsoft.com/forums/vstudio/en-us/4d6c383a-94eb-4898-9d22-aa4bb69be25b/excel-interop-sy

HTML5 form upload file with php getting errors over a certain MB filesize -

i've spent 10 hours trying make large video uploads work: i've made form submits sql database uploading file folder on server. works except files on 110mb or so, need @ 300m. form looks like <input type="hidden" name="max_file_size" value="800024288"> <input type="file" name="video_upload" required> and php.ini has following values, confirmed phpinfo() upload_max_filesize = 300m post_max_size = 300m memory_limit = 2048m max_execution_time = 1200 max_input_time = 1200 is there i'm forgetting? i've turned these limits high try make work. first programming project i'm not yet advanced enough use more sophisticated techniques. possible there's apache configuration timeout error or going wrong? time edit i'm getting 'this webpage not available' (err_connection_aborted) php code <?php // not working - error_reporting(e-all); //defining db access info constants d

amazon web services - Keep config file secure using github and Elastic Beanstalk? -

i using github (public) keep track of web app , deploy elastic beanstalk. there way keep config file secure has rds username/password? have add file git in order push elastic beanstalk make password visible on github...? suggestions? thanks! your intuition correct! keep keys/passwords/credentials out of committed codebase. elastic beanstalk provides environment variables in control panel purpose. official documentation can found here: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options.html#command-options-ruby these environment variables can edited through elastic beanstalk ui. you can reference these variables in .yml config files, e.g. password: <%= env['param1'] %> .

android - NFC based authorisation -

i`m working on university project implementing 2-step nfc based authorisation. got couple of questions. i`m using android hce feature pass login data nfc reader. nfc reader driven chrome extension. is there possibility launch chrome extension website in iframe example or in background?(chrome app uses usb feature, need launch in chrome , explicitly launch application, in other way can`t use nfc feature) way solve stuck url_handlers, seems not elegant. also if first fails - able pass nfc data validation server, fetch answer, set cookie, close app , redirect user main page? update: website , extension opened on pc in chrome browser, android used hce emulating app it's unclear environment trying on. mention android, if on device see google chrome faq does chrome android support apps , extensions? chrome apps , extensions not supported on chrome android. have no plans announce @ time. if on chrome browser desktop , on page chrome loads content scri

javascript - Having multiple datepicker and linking them all together -

i'm using https://github.com/eternicode/bootstrap-datepicker datepicker. have problem on how link multiple datepickers making them same. 1 header , 1 main page. if click datepicker on the header , change date should same in main page same goes when change date on main page header must change well. making them linked together. initialize , works 1 on header. on reload datepicker on header shows date today , date tomorrow. when change date arrival departure change date tomorrow. works on header doesn't work on mainpage, not show date today , date tomorrow when reload shows on header. when click date arrival on main page date departure not change still gets date on header. please help. my code. header <input type="text" name="datearrival" class="datepicker arrivaldate"> <input type="text" name="datedeparture"class="datepicker departuredate"> mainpage <input type="text" name

java - Openshift port-forwarding -

after many hours , many attempts, remains help. im trying port-forwarding access db in openshift on neatbeans . i've done lots of tutorials, upgrade , downgrade versions of net-ssh , uninstall rhc , on. have read lot git solutions ( ssh_options[] ...) , doesn't understand damn thing. when i'm trying port-forwarding this: `c:\users\andre>rhc port-forward -a leixinhos checking available ports ... not parse pkey: no start line usage: rhc port-forward <application> pass '--help' see full list of options c:\users\andre>` leixinhos app name have right except detail prevents me access db on neatbeans. in console output see following error: could not parse pkey: no start line i see running rhc on windows machine. what version of ruby have installed? getting same error message when trying use rhc latest version of ruby on windows machine. in order rhc commands work correctly in windows had uninstall rhc, uninstall latest version of

mysql - php filectime returns an error -

i trying make site in display digital movies own. working on page scan movies directory , read each movie in there , extract name , insert mysql database. i need pull creation date file , insert well. yet when searched here on os tried examples find , errors of them , cannot figure out error coming from. need format creation date way fits format in mysql database. i working on windows based machine. code: include("config.php"); echo '<ul>'; if ($handle = opendir('m:/movies/')) { while (false !== ($entry = readdir($handle))) { if ($entry != '$recycle.bin' && $entry != 'system volume information' && $entry != '.' && $entry != '..') { $replace = array(".avi",".mkv",".mp4"); $title = str_replace($replace, "", $entry); $exists = mysql_query('select * `mdw_movies` `title` "'.$title.'%"'); $exists1 = mysql_n

eclipse - LWJGL Java App Only Launches By Terminal (Linux, potentially OS X) -

i have application i've created using lwjgl 2 main components: game , editor. when running jar eclipse or using java -jar <jarname>.jar , application runs lwjgl components fine. however, whenever double click .jar run it, lwjgl components not run in application, show no errors, literally nothing. i have libraries linked, before lwjgl componenents called, make sure set library path proper natives depending on os. as how app structured, have 1 jar file runs sort of mini launcher, allowing user select either game or engine. when game selected, button depressed few seconds , game's window never pops up. again, running via command line produces no such issues. my directory structure follows app.jar |-lib |----jars |----natives |-----------windows |-----------macosx |-----------linux |-res |-save in natives/windows or natives/macosx or natives/linux folders proper natives. in jars folder lwjgl jars such lwjgl-util.jar , lwjgl.jar, eclipse compiles th

javascript - x-axis <g> tag transform not transitioning -

i have 2 x-axes on horizontal bar chart, , when created both given transform translates them vertically ( .attr('transform', 'translate(0,' + (height - 5) + ')'); ). when data point removed, chart shrinks, changes height variable, changes transform. if try add transition, nothing happens. doesn't not animate, doesn't set transform. without animation @ least sets transform (just way early, looks weird else shrinking). here's relevant code: chart.select('.x-axis.top').transition().duration(1500) .attr('transform', 'translate(0,' + (height - 5) + ')'); again, if remove .transition().duration(1500) , transform @ least still changes. update while modifying lars kotthoff's jsfiddle match code i've been working on, figured out problem was. this: svg.select('.x-axis') .transition().duration(1500).attr("transform", "translate(0,100)"); svg.select('.x-axis')

php - Yii shell_exec yiic command run not working -

i trying send large number of email notifications using yiic , run cconsolecommand . command okay. there no php errors. can't run linux command using shell_exec . here part of code if ($post->save()) { chdir(yii::app()->basepath); shell_exec('yiic makemasspost ' . $post->id . ' ' . $id . ' > log.txt & echo $!'); } there no point in going linux yii run command runs yii application again. you can try running directly yii yii::import('application.commands.*'); $command = new mycommand("test", "test"); $command->run(null);

dictionary - How to combine two NSDictionary in Swift -

i beginner in swift , trying apprehend notion of dictionaries. i have 2 nsdictionary both contain same keys, follow: var currencyname: nsdictionary = [ "cny": "chinese yuan", "pln": "polish zloty" ] var rawrates nsdictionary = [ "cny": "1.34", "pln": "1.456" ] i trying combine them 1 dictionary such as: ["cny": "chinese yuan","1.34"] ["pln": "polish zloty","1.456"] i guess first question sort of variable should put output in ? can use nsdictionary ? reading documentation understanding nsdictionaries work pairs of key/values. possible put 2 values inside dictionary ? my second question how should go combining 2 dictionaries, have tried use code below without success for (currency, rawrate) in rawrates { (currencyid, name) in currencyname{ if curren

ios - UICollectionVIew zoom of a single UIImageView in a cell -

how zoom uiimageview takes fullscreen cell in uicollectionview image? since uicollectionview subclass of uiscrollview should simple.. i tried set minimumzoomscale, maximumzoomscale , viewforzoominginscrollview: result mess. in viewforzoominginscrollview returned uiimageview, not work. now i'm trying return visualized cell, on zooming image changes first cell. it zooms messes collection view. func viewforzoominginscrollview(scrollview: uiscrollview) -> uiview? { if let selectedindex = self.collectionview.indexpathsforvisibleitems().last as? nsindexpath { let cell = self.collectionview.cellforitematindexpath(selectedindex) return cell } return nil } so, need zoom image (cell) on screen? moreover pagingenabled goes off automatically (that's panning zoomed image, not scrolling collection) you need put new uiscrollview inside uicollectionview since should not mess zooming of collectionview itself.

graph algorithm - Error in java: Exception in thread "main" -

i trying apply dijkstra algorithm in java. input text file contains 3 columns first 1 start node , third end node , second 1 relation name not need right use first , last column. text file is: 12 ecrel 15 15 ecrel 18 11 ecrel 12 12 ecrel 14 11 ecrel 14 11 ecrel 18 14 maplink 17 12 maplink 17 14 maplink 10 18 maplink 10 14 maplink 16 15 maplink 19 18 maplink 19 12 maplink 19 can 1 please take code , me find problem in code cause error. code bellow: package shortestpath; import java.util.scanner; import java.io.*; import java.util.*; public class dijkstra { public static int count; //public static graph.edge[] graph = new graph.edge[count] ; public static void countlines(string file) throws ioexception { linenumberreader lnr = new linenumberreader(new filereader(new file(file))); lnr.skip(long.max_value); dijkstra.count=lnr.getlinenumber() + 1; //add 1 because line index starts @ 0 // finally, linenumberreader object

uninitialized data segment of program memory -

in uninitialized data segment, kernel initialize uninitialized variable 0. but if directly use uninitialized variable (for eg. int sum; , not int sum=0; ) , use in program sum=sum+n(n number), sum take garbage value. so why sum take garbage value if has been initialized 0 kernel? you seem asking difference between compile-time initialization , run-time initialization. in following c code: int i; int main() { int j; return + j; } i globally scoped variable , default initialized zero, achieved including in data segment of program. either written block of initial values binary or describe loader size of block , loader flood-fill zeros when executable starts. j , however, local variable live in registers or on stack. c , c++ choose not default initialize these values, , if access them without initializing them, see value happens in register/stack location.

java - LibGDX on Netbeans - android.os does not exist -

there many answers how fix problem on eclipse, none netbeans. libgdx desktop project runs great, android project says "package android.os not exist". furthermore, when try create new android project in netbeans (not in libgdx, creating new android project), works fine. there seems problem libgdx/android-sdk communication, after searching answers online, can't seem figure out! i can post code if needed. edit: must have changed something, error different now. instead of "android.os not exist", says "cannot find class bundle in android.os". here things i've tried: creating simple android application using file-->new project works fine , emulated correctly. creating new libgdx project basic structure still results in error in android project. when build original android project, no errors found. when run original android project without avd running, says "error: device not found", build failed. when run original android

c++ - SQLITE_MISUSE in prepared statement -

i'm getting sqlite_misuse error on following code, , wondering if might caused having table name bound parameter? different causes of sqlite_misue? const char sqlneuralstateinsert[] = "insert ?1(layer_id, neuron_id, input_id, value)" "values(?2, ?3, ?4, ?5);"; sqlite3_stmt* stmt1; rc = sqlite3_prepare_v2(db, sqlneuralstateinsert, -1, &stmt1, null); if(rc){ //!< failed prepare insert statement } sqlite3_bind_text(stmt1, 1, this->getnname().c_str(), -1, sqlite_static); for(uint32_t = 0; < m_nlayers; i++){ sqlite3_bind_int(stmt1, 2, i); // layer id for(uint32_t j = 0; j < m_layers[i]->getneuroncount(); j++){ std::vector<double> weights = m_layers[i]->getweights(j); sqlite3_bind_int(stmt1, 3, j); // neuron id for(uint32_t k = 0; k < weights.size(); k++){ sqlite3_bind_int(stmt1, 4, k); sqlite3_bind_double(stmt1, 5, weights[k]); rc = sqlite3_step(stmt1

How to add credentials for sbt-launcher to access custom repository for bootstrap -

i'm overriding repository in sbt.boot.properties file bootstrap loads file company repository. here fragment in file: [repositories] local typesafe-ivy-releases: https://artifactory.mycompay.com/artifactory/simple/typesafe2-ivy/, [organisation]/[module]/[revision]/[type]s/[artifact].[ext], bootonly how should provide credentials boot time load?

javascript - Browser crashes while downloading large size files -

i have web api reads file azure , downloads byte array. client receives byte array , downloads pdf. not work large files. not able figure out how can send bytes in chunks web api client. below web api code returns byte array client: cloudblockblob blockblob = container.getblockblobreference(filename); blockblob.fetchattributes(); byte[] data = new byte[blockblob.properties.length]; blockblob.downloadtobytearray(data, 0); return report; client side code gets data when ajax request completes, creates hyperlink , set download attribute downloads file: var = document.createelement("a"); a.href = 'data:application/pdf;base64,' + data.$value;; a.setattribute("download", filename); the error occurred file of 1.86 mb. the browser displays message: went wrong while displaying web page.to continue, reload webpage. the issue server running out of memory on these large files. don't load entire file var

python - Variable set to call a function -

i hope question doesn't seem naive or silly, definite answer confirmation. is possible set variable call function? i.e def func(): print "test" var = [something magical + func] then if had typed/used var output test ? in other words, there alternate way calling function without use of parenthesis if never requires (or accepts) arguments [in python]? i assuming isn't possible required use"()" call function, curious if there might exceptions? in general, no . exception of properties mentioned in comments, need apply parameter list (even if it's empty () ) call function. otherwise, you're not calling function, referencing function value . you can reproduce on python's command line interpreter: >>> def func(): ... return "foo" ... >>> func() # call function; statement returns function's return value 'foo' >>> func # reference function value; statement returns