Posts

Showing posts from July, 2012

simulator - Android app installation issue? -

guys working in android apps , it's working problem when going run via simulator shows message : qemu-system-i386.exe: -drive if=none,index=1,id=cache,file=c:\users\user\.android\avd\nexus_s_api_24_1.avd/cache.img: not open disk image c:\users\user\.android\avd\nexus_s_api_24_1.avd/cache.img: not open 'c:\users\user\.android\avd\nexus_s_api_24_1.avd/cache.img': invalid argument simulator runs app not install :( using intellij ide

python - Django - Multiple <pk> in urls.py with DetailViews -

i'm trying build script using django generic display views . my urls.py url(r'^page/(?p<pk>[0-9]+)/$', pagedetails.as_view(), name='page-details'), my views.py class pagedetails(detailview): model = pages def get_context_data(self, **kwargs): context = super(pagedetails, self).get_context_data(**kwargs) return context the problem how can set multi <pk> in urls this? url(r'^page/(?p<pk>[0-9]+)/subpage/(?p<pk>[0-9]+)$', pagedetails.as_view(), name='page-details'), in views need take data first , second <pk> . change second pk argument in url else, example pk_alt : ^page/(?p<pk>[0-9]+)/subpage/(?p<pk_alt>[0-9]+)$ the url parameter pk_alt available in views function part of self.kwargs dictionary, can access using: self.kwargs.get('pk_alt', '') you update views following: class pagedetails(detailview): model = pages def ge

Tables vs databases performance in RethinkDB -

i've been reading rethinkdb documentation i'm confused how design database perfomance. i need store data date there's no relation between data in different dates. need table each date linked many tables (very upserted). it's better create table each date in same database or directly create different database each date? databases in rethinkdb merely group tables similar namespace. database table in doesn't impact performance @ all, how access table. so whether put 1 database or split multiple databases matter of taste in end. additionally there few operations can apply (more easily) tables in given database. example can run r.db("db name").reconfigure({replicas: 3, shards: 2}) shard tables in db name database on 2 shards, , replicate data 3 times. can use databases mean configure groups of tables rather each table individually.

asp.net - C# allowing one thread to run the method at a time after multiple requests triggerred to application server -

i building asp.net web.api service. there api needs more 2 minutes retrieve desired data, implemented cache mechanism, , every request sent api server, server return cached data , meanwhile start new thread load new data cache, issue if submitted lot of requests, lot of thread running , crashed server, want implement mechanism control thread @ time, know asp.net web.api inherently multi threads, how tell other request wait, because there 1 thread retrieving new set of data ? [dependency] public icachemanager<orderarray> orderarraycache { get; set; } private readorderservice service = new readorderservice(); private const string _ckey = "all"; public dynamic get() { try { orderarray cache = orderarraycache.get(_ckey); if(cache == null || cache.orders.length == 0) { orderarray data = service.getallorders(); orderarraycache.add(_ckey, data); return

Passing a 2D array of unknown size into a function in C++ -

i'm trying input 2d array function. don't know number of rows or columns array , loaded c++ via cimg. have: // main function: int main() { int rows, columns; float summation; cimg<unsigned char> prettypicture("prettypicture.pgm"); rows = prettypicture.height(); columns = prettypicture.width(); summation = sum(prettypicture[][], rows, columns); } // summation function: float sum(int **picture, int rows, int column) { ... // there code here don think important. } i pass array summation function , i'm aware should using pointers in way, i'm not sure how this. appreciated. thank you (sorry being noob) try this: summation = sum(prettypicture.data(), rows, columns); and make sum function this: float sum(char* picture, int rows, int column) ... you need pass in data (if want pointer data) because that's cimg provides. it's pointer character because that's kind of cimg have; , it's char* ,

java - xmpp openfire push notification and logging -

i building java backend app (android & ios) has messenger function integrated. i playing around openfire , ejabberd last days , wondering how can solve problem - want catch messages , server log messages custom history file send push notifications android & ios client when offline. has implemented yet? have read xmpp proxy doing work dont know how start. thanks in advance. - bob 1: log messages custom history file: openfire, can write custom plugin packet interceptor , can log information per business needs. can find opensource plugins this, per experience, have done custom work log specific information. 2: send push notifications android & ios client when offline: again experience custom solution per business needs. custom code can injected in openfire code , can send http request push server (or can send push directly gcm or apple determining platform of recipient). custom code provides ability send information require. like, can send actual chat

security - Converting plain text into the mysql database using php and getting it back when required as plain text -

i designing web app require take credentials users access few websites (equfax etc.. ) i know saving these credentials in plain text bad idea. need end team password business process. how can retrieve hashed password , display plain text ? if doesn't work, guess can use pdf form details , save file blob in mysql , download when required. but, still know risk if database stolen. let me know, if have solution this. thank reading this. yes indeed need encrypt these passwords if store them anywhere on server (database, text file, ram... anywhere). now, tricky part if app can decrypt these passwords itself, breaks server able same reverse-engineering code. the way prevent use encryption key made of 2 separate components: - server key, stored in app's code - , user key back-end team input in app (upon login example). eg: $encryption_key = $server_key . $user_key; $encrypted_password = your_encryption_function($key, $value_to_encrypt); $decrypted_pass

angularjs - Creating single custom directive for ng-click to perform multiple controller function -

i have following code: <div>... <div class="glyphicon glyphicon-filter ng-click="vm.add()" tabindex="1"> <a href='' tabindex="2"><img id="touch" ng-click="vm.multiply(xyz)" src="/ui/assets/images/xxx.png"/></a> <div class="glyphicon glyphicon-filter"ng-click="vm.showid()" tabindex="1" title="filter"> </div> ..</div> i want create custom single ng-click directive recommended div ( ng-click used buttons). want know if there way can create single directive 3 ng-click , call 3 different functions in link @ $apply ? here go: http://jsfiddle.net/psevypcs/2/ html <div clicky="test()">test</div> <div clicky="test2()">test2</div> angularjs-controller $scope.test = function(){ alert('hy'); }; $scope.test2 =

c# - Using [Serializable] with mscorlib (Unity) -

i'm building ios game using unity , in docs optimisation, says: don’t use lives in system.dll or system.xml.dll in code. these libraries not compatible micro mscorlib. here's link page . in code, save game data have class so: [serializable] class generalgamedata { public bool mutemusic; public bool mutesoundfx; public bool mutevibration; public int highestscoreachieved; } which requires: using system; when run game, seems ok mscorlib use nasty crash, crash kills unity every , again , game @ random points. suspect might this. can point me in right direction how save serialized data micro mscorlib? cheers. you can have @ mono compatibility reference see elements not available in micro mscorlib. you'll notice serializableattribute (namespace system, assembly mscorlib) available in .net 2.0, 2.0 subset, web player , micro. use of [serializable] should not @ fault here. however, actual serialization code may indirectly rel

C: How to access different types of anonymous or unnamed nested structs -

i noticed there few ways define structs inside other structs in c: struct s { int abc; struct { int a; }; struct { int b; } intern; struct { int c; }; struct i2 { int d; } intern2; struct i3 { int e; }; struct i3 intern3; }; this struct compiles fine using gcc or g++, assume parameters accessible in way. tried this: int main(int argc, char const *argv[]) { struct s mystruct; mystruct.abc = 0; mystruct.a = 1; mystruct.intern.b = 2; mystruct.c = 3; // <-- not compile mystruct.intern2.d = 4; mystruct.intern3.e = 5; return 0; } apart access mystruct.c , compiles (compile error message ‘struct s’ has no member named ‘c’ ). accessing struct parameters in correct way? there alternatives? how access c parameter? in code, struct { int c; }; there no member variable of type struct i neither qualifies anonymous structure note . i

configuration - Setting Cassandra on server IP -

Image
i'm trying switch cassandra localhost server ip cassandra has been installed. in cassandras config file: cassandra.yaml , changed listen_address ip, on seed , on rps_address. beyond on picture can see have changed name of cluster first cluster but when start cqlsh got: where doing wrong? if comes post , still don't know fu** not working, here answer. listen address in cassandra must stay on localhost always. how change address than? go in cassandra.yaml ,and change: rpc_address = your_server_ip ( it's on localhost) rpc_start = true ( on false) when trying access cassandra in shell type this: sh ~cassandra/bin/cqlsh your_server_ip_which_you_set_as_rpc_addr something like: sh ~cassandra/bin/cqlsh 10.12.123.123

Sass multiple styles with same attributes -

is there quicker way write same style result in sass.? e.g without sass: bottom: auto; left: auto; right: auto; top: auto; with sass bottom, left, right, top { auto; } i'm not if fit exact needs, might case mixin. with scss syntax be: @mixin position($position) { bottom: $position; top: $position; left: $position; right: $position; } you can use mixin div { @include position(auto); } which equivalent div each of positioning properties set "auto" sass syntax, completion sake =position($position) { bottom: $position; top: $position; left: $position; right: $position; } and usage div +position(auto)

sql server - SQL command to map data from one column to another -

suppose table looks this [ name, number, firstname] [foo:bar, 123, ] [bar:foo, 456, ] i want split name field @ ':' , use first part 'firstname' column. furthermore, want permanent, rather result set. how that? i'm using sql server 2008. i'm aware variants of question have been asked before, seem deal merely selecting data, , mean update it. you create view use view future selects. create view split name select substring(name, 1, charindex(':', name, 1) - 1) firstname, rtrim(substring(name, charindex(':', name, 1)+1,100)) surname, number mytable alternatively, update mytable set firstname = substring(name, 1, charindex(':', name, 1) - 1) mytable

visual c++ - How to get decoded barcode height from camera images in c++ zxing library -

Image
how determind or find barcode height camera image or image file.here using zxing c++ library decode barcode. if you're using zxing c++ port, don't need find (startx, starty) or (endx, endy). can use leptonica lib. think faster firstly, using pixread() read input image, save pix* format. then, convert pix* binarybimap , use decode() method class reader of zxing directly! if still have problem or don't know, can send detail code

Ansible unarchive module does not changed when the filename not changed -

my ansiable task looks this: - name: roll out new pkg when: pkg_version defined unarchive: src=/var/jenkins_home/pkg/{{ project }}/{{ project }}.{{ pkg_version }}.tar.bz2 dest={{ path }} owner=root group=root i deploy bz2 file no filename change(the content changed), status ok. when delete 1 of files, status changed. task [roll out new pkg] **************************** ok: [10.0.0.6] changed: [10.0.0.8] so want know why happen?

css - Google bar chart data labels positioning -

how change google bar chart data labels position ? have data labels (2003,2004,...) between bars - not straight below them now. enter image description here function drawvisualization() { // create , populate data table. var data = google.visualization.arraytodatatable([ ['year', 'austria', 'bulgaria', 'denmark', 'greece'], ['2003', 1336060, 400361, 1001582, 997974], ['2004', 1538156, 366849, 1119450, 941795], ['2005', 1576579, 440514, 993360, 930593], ['2006', 1600652, 434552, 1004163, 897127], ['2007', 1968113, 393032, 979198, 1080887], ['2008', 1901067, 517206, 916965, 1056036] ]); // create , draw visualization. new google.visualization.columnchart(document.getelementbyid('chart')). draw(data, {title:"yearly coffee consumption country", width:600, h

knockout.js - Knockout mapping.fromJS does not map all properties -

Image
i'm trying mapping viewmodel every time call ajax function mapping.fromjs not mapping properties of object. i thought maybe problem property not declared, found solution here , i'm creating empty viewmodel templating server using viewbag. here happening: the data object has property "entregapai" id , viewmodel has value undefined, , after mapping: the "entregapai" property still undefined rather others mapped well. [edit] here code: // seleção de linha da lista - ajustar dados self.selectrow = function (row, event) { self.canrefreshsubtipopais = false; $.ajax({ url: template.urlget, method: 'get', contenttype: "application/json; charset=utf-8", data: { entregaid: row.entregaid() }, cache: false, success: function (data) {

php - CODEIGNITER call to a member function num rows on boolean -

please have issue codeigniter. when try log here result: fatal error: call member function num_rows() on boolean in d:\xampp\htdocs\procurementsys\application\models\login_model.php on line 19 below tho code of relative file: <?php class login_model extends ci_model { //this function checks whether username , password in database or not public function check_login($username, $password){ $this->db->select('username, password, status'); $array = array('username' => $username, 'password' => sha1($password),'status' => 'active'); $this->db->where($array); $query = $this->db->get('user'); if($query->num_rows() == 1) // if affected number of rows 1 { return true; } else { return false; } } //this function returns status of user used in authentication public function user_login_data($username, $password){ $this->db->select(

asp.net - can I pass an aspx page class to a subroutine? -

here's i'd do: let's have page named "foo.aspx". class called "foo". on page checkbox named "bar". want subroutine update checkbox. so want write like: in foo.aspx.vb: partial class foo ... whatever ... dim util new myutility util.update_checkbox(me) in myutility public sub update_checkbox(foo1 foo) foo1.bar.checked=true end sub but doesn't work, visual studio doesn't accept "foo" class name. why not? there magic namespace on it, or else have identify class besides "foo"? (and yes, realize in trivial example, pass in checkbox, or move 1 line of code aspx.vb, etc. real problem involves setting number of controls on form, , want able in class has subtypes, can create instance of proper subtype, call 1 function , set controls differently depending on subtype.) update ndj's answer works. else dropping here, let me add able little more flexible suggestion. able create property returns control i

python 3.x - Coverting strings to decimal with a radix -

i'm getting empire of code , i've come across problem don't understand @ all. eli5 this? i'm not sure start making function. problem: you given positive number string along radix it. function should convert decimal form. radix less 37 , greater 1. task uses digits , letters a-z strings. watch out cases when number cannot converted. example: "1a" cannot converted radix 9. these cases function should return -1. input: 2 arguments. number string , radix integer. output: converted number integer. example: convert("af", 16) == 175 convert("101", 2) == 5 convert("101", 5) == 26 convert("z", 36) == 35 convert("ab", 10) == -1 what asking? don't know enough number bases have slightest grip on this. our number system base 10. there 10 possible digits can use represent numbers, 0-9. once 9, need digit represent larger number (10). other systems are, of course, possible. famous ones: bas

java - Unchecked assignment when initializing a list -

this question has answer here: java raw type , generics interaction 2 answers what difference between list<string> list = new arraylist(); and list<string> list = new arraylist<>(); ? in first case, ide highlights , says "unchecked assignment", seem behave same. no difference, java compiler figure out type, better add inferred type argument: list<string> list = new arraylist<string>();

python - Syntax error importing pandasql -

i installed pandasql , keep getting error importing specified in usage guide. seem bit lost. installed package sudo since getting permission denied on python folder. appreciate wisdom: in [1]: import pandas pd in [2]: pandasql import sqldf file "/usr/local/lib/python2.7/dist-packages/pandasql/sqldf.py", line 98 return {**outer_frame.frame.f_globals, ^ syntaxerror: invalid syntax****

Scheduled powershell script requires keystroke input -

powershell script wont complete when running scheduled task. can run manually when scheduled task never completes, file isn't generated final move doesn't happen. suspect because keystrokes aren't being received can see exe process running in background , final keys strokes should exit app. the exe runs not have arguments running silently need inject keystrokes. $syncexe = "consoleserversync.exe" $syncfile = "sync_out.xml" $servdir = "c:\server\" $exportdir = "c:\export" if (test-path $servdir$syncfile) { remove-item $servdir$syncfile} if (test-path $exportdir$syncfile) { remove-item $exportdir$syncfile} start-process -filepath $servdir$syncexe start-sleep -s 10 add-type -assemblyname system.windows.forms [system.windows.forms.sendkeys]::sendwait("`r") [system.windows.forms.sendkeys]::sendwait("yes`r") [system.windows.forms.sendkeys]::sendwait("q`r") start-sleep -s 30 move-item $servdir

php - What is the best way to install Laravel on HTML website that already use GIT? -

i have complete html website folders css, js & images , use version control git. what best way install laravel 5 on website keep git track diversion html laravel framework smoothly. the steps convert current html website laravel easy unless if have js backend: install laravel move css,js,images laravel public folder move html files resource/views , rename them name.blade.php or name.php. fix reference links of css, js , images. the big part!!! navigation go through routes , backend logic in controllers. e.g. wanna go page! have rule in route redirect function in controller , function call view (html page currently) , optionally pass information view. these simple ways transfer website, once can learn many features of laravel can optimize site.

Why are these two different representations (dec vs. hex) of integers different in Java? -

say have 2 integers, 1 in decimal other in hexadecimal: int myint01 = 0xc7d23020; int myint02 = 3352440864; the both same number, when try assign decimal integer variable in java, error: error: integer number large: 3352440864 but when assign hexadecimal integer variable in java, works should. why way? that's because 0xc7d23020 interpreted -942526432 valid int value, while 3352440864 wrong int value because it's higher limit 2147483647 ;

c# - Add Animated Gif to Clipboard in UWP -

how can go adding animated gif clipboard universal windows 10 app can pasted in app? it's possible. you can read article copy image windows store app clipboard still valid uwp apps. http://www.c-sharpcorner.com/uploadfile/99bb20/clipboard-operations-in-windows-store-apps-using-c-sharp/ please mark answer if it's useful you! thank update: i tried scenario seems gif images not supported. there not documentation issue

Run time error 91 - Object variable or With block variable not set- updating XML from Excel -

i getting run time error 91 - object variable or block variable not set when trying update , xml using excel vbscript sub updatexml() call fnupdatexmlbytags end sub function fnupdatexmlbytags() set xmldoc = createobject("microsoft.xmldom") xmldoc.load "f:\xml\xml1.xml" omsgid = "15544216089s01f15544100002396000002" set nmsgid = xmldoc.selectsinglenode("//acctswtchbtch/grphdr/msgid") nmsgid.text = omsgid strresult = xmldoc.save("f:\xml\xml1.xml") end function a function must return something. example: function fileexists(filepath string, filename string) boolean dim currentdir string currentdir = curdir ' used set curdir if filepath <> "" chdir filepath if dir(filename) <> "" fileexists = true else fileexists = false end if chdir currentdir end function i suggest changing function sub.

php - Group arrays by key value -

i have problem approaching issue have, need group arrays key value i have 3 foreach functions foreach ($report_phonecall $key=>$value) { $phonecalls[$value['datum']] = $value['broj']; }; foreach ($report_meeting $key=>$value) { $meetings[$value['datum']] = $value['broj']; } foreach ($report_notes $key=>$value) { $notes[$value['datum']] = $value['broj']; } that give me array $phonecall = array ( [2016-07-13] => 2 [2016-07-14] => 1 [2016-07-19] =>1 ) $meetings = array ( [2016-07-13] => 1 [2016-07-14] => 1 ) $notes = array ( [2016-07-19] => 1 ) i need merge them 1 array foreach date this array(2016-07-13 => array([phonecalls]=>2, [meetings]=>1, [notes]=>0)) 2016-07-14 => array([phonecalls]=>1, [meetings]=> 1, [notes]=>0).... etc i want group/sort them key value. going $group_reports[$value[key]] = $val

c# - Difference between (long)value and Convert.ToInt64(value) -

i've procedure gets value database dataset , copy local long typed variable. contains long value . this how i'm copying value dataset variable. areaid = dstable.searchedtable[i].isareaidnull() ? 0 : (long)dstable.searchedtable[i]["areaid"]; sometimes works fine gives me error specific cast not valid then have change these kind of conversion format areaid = dstable.searchedtable[i].isareaidnull() ? 0 : convert.toint64(dstable.searchedtable[i]["areaid"]); i'm confused what's wrong (long) when has same value both methods , 65 . i'm missing on here??

cq5 - Script tags in RTE AEM 6.1 -

i trying create editor component take inline javascript. understand can use clientlibs folder loading js, of video cdn folks require put embed tags javascript in editor, , think of used rapid development. state of rte, cannot put script <script/> tag after extending it, strips out , takes html tags. please provide insight if doable in aem 6.1 here's have tried: i looked @ several post didn't got clue extended rte using adobe's documentation, see script button, takes html tags. looked hacks tell me part of code tripping out </script> tags or not execute js. looked components out there that, found nothing far.

Connect to different Oracle database and transfer table through Stored Procedure -

i have 2 oracle databases on different servers: oracle 1 oracle 2 i want run stored procedure execute in oracle 1 , following: a) connect oracle 2 b) create db link in oracle 2 connect oracle 1 or use existing 1 if created c) copy table 1 oracle 1 oracle 2 i able using: create public database link mylink connect source_user identified source_password using source_entry_in_tnsnames'; copy data: insert mytable select * mytable@mylink; i wrote stored procedure , included these not able connect oracle 2. how can connect oracle database stored procedure? it rights issue. database link on target oracle db has procedure want call. must have execute rights package / proc. also, have found must call target procs schema name. such schema.package.procedure@dblink(parms). if did not have schema on proc call package not compile. side note... if calling procedure on link has refcursor returned not work. (at least on oracle 10 , 11). in cases had return table.

javascript - JSON request returning undefined, not an error -

function searchgames(query) { // send off query $.ajax({ url: gamessearchurl, type : "get", data: { query : query, resources: "game", format: "jsonp", crossdomain: true, limit: 16, field_list : "description,name,image", json_callback : "returngames", sort : "original_release_date:desc" }, datatype: "jsonp" }); }; /* reference: http://stackoverflow.com/questions/22918573/giantbomb-api-work */ /* reference: http://www.giantbomb.com/forums/api-developers-3017/api-request-with-jsonp-uncaught-syntaxerror-1492639/ */ // callback when results function returngames(data) { $('div#display').append('found ' + data.total + ' results ' + data.query); var games = data.game; $.each(games, function(index, game) { $('div#display

install - CS50 library in C -

i new ubuntu , new c programming. watching cs50 videos understand better c , cs together. tried install using these guidelines: debian, ubuntu first become root, with: sudo su - then install cs50 library follows: apt-get install gcc wget http://mirror.cs50.net/library50/c/library50-c-5.zip unzip library50-c-5.zip rm -f library50-c-5.zip cd library50-c-5 gcc -c -ggdb -std=c99 cs50.c -o cs50.o ar rcs libcs50.a cs50.o chmod 0644 cs50.h libcs50.a mkdir -p /usr/local/include chmod 0755 /usr/local/include mv -f cs50.h /usr/local/include mkdir -p /usr/local/lib chmod 0755 /usr/local/lib mv -f libcs50.a /usr/local/lib cd .. rm -rf library50-c-5 i used it, , think went planned, try run gcc demo.c fatal error message: adder.c:2:18: fatal error: cs50.h: no such file or directory #include <cs50.h> so seems somewhere went wrong , don't know how fix it. guide me little bit how fix or how reinstall c automatically include library? check in /usr/local/include d

Rails Devise Omniauth Facebook Client Token -

i'm having issues getting saving facebook login database. i'm getting error in browser. could not authenticate facebook because "invalid credentials". and error in terminal. ideas? i've been browsing 2 days , it's possible facebook api has changed. lead app isn't using client token @ all. and don't know how debug user nil or not. appreciated. thanks. started "/users/auth/facebook/callback code=aqcdbzac0nk6ys9_ynebsvnzrc9tqwwqbgolxpu2ztnsxjp9nzecvkdgfqe71gxttv86_ uc5mhktzb4fbzinldead0ffakdu3h-v7ymmyy_kctrjxqtpucd-gnblaiozdyq3klhnxe3nzwbcrsxwf_effc4kguu8ww9sgds906-w6lfppl4e78iudefs9d-lhxgp_qa3_oubfcg2feiiykmgyioqig_-9pwhgdrh_wt8qfyemn1qtkbuwe173ui-eodfrfgbtzvbbjm-u8n4rqefx6gqgynldmma9gzxrvpuz7cbec1okzuqtgtaagz-kmmw0rnxgp81nwcvgqspsx1o&state=c8957c4caba73271f3ed9a083412aa995afebf1ba2e63f50" 127.0.0.1 @ 2016-02-27 22:11:16 -0800 i, [2016-02-27t22:11:16.190167 #9991] info -- omniauth: (facebook) callback phase initiated. e, [2016

javascript - How to set values for datepicker in jquery -

i have list of datepickers need set value based on selection of first date picker, if select value in first date picker same value should passed other date pickers <input name="start" id='from' class="date-pick form-control" data-date-format="dd/mm/yyyy" type="text" /> <input name="start" id='to' class="date-pick form-control" data-date-format="dd/mm/yyyy" type="text" /> <input name="start" id='return' class="date-pick form-control" data-date-format="dd/mm/yyyy" type="text" /> <input name="start" id='depart' class="date-pick form-control" data-date-format="dd/mm/yyyy" type="text" /> here jquery $('input.date-pick, .input-daterange input[name="start"]').datepicker().on('changedate', function (ev) { var date2 = $('.date-pick'

caching - Docker Error: CSS File in Mapped Volume Fails to Update -

system setup: docker version 1.9.1, build a34a1d5 oracle virtualbox 4.3.34r104062 image: https://hub.docker.com/r/rc42/flaskserver/ when edit css file in flask server <link rel="stylesheet" href="{{ url_for('static', filename='styles/bootstrap.css') }}"> , following things seem happen: the changes not show when reload localhost test page. the changes not show when remove/rerun container. the changes not show when stop/restart container. at first, thought might web browser cache problem, not. have tested problem against hard reload, different browsers , manner of browser cache clearing. on top of this, when enter container , examine file, none of changes show in 'cat' or 'grep' call. but, examinations of file on own system show changes have indeed occurred on file. the way can seem these changes propagate if refactor file name name have not used css file. <link rel="stylesheet" href=&

r - function works perfectly fine outside ddply but throws an error inside ddply -

i trying row-wise operation (by group) on data frame. when run function 1 group, runs fine. however, when put function inside ddply run groups, throws error - argument of length zero. the function when run separately on data frame 'test': for (i in 1:(nrow(test) - 5)) { if (i <= 5) { test[i, "mppalert"] <- 0 } firstmpp <- test[i, "tagmppsearchcount"] lastmpp <- test[i+5, "tagmppsearchcount"] if ((lastmpp - firstmpp) >= 10) { test[i+5, "mppalert"] <- 1 } else { test[i+5, "mppalert"] <- 0 } } the above function inside ddply throws error: error in if (lastmpp - firstmpp >= 10) { : argument of length 0 below ddply code: mpp_fn <- function(x) { (i in 1:(nrow(x) - 5)) { if (i <= 5) { x[i, "mppalert"] <- 0 } firstmpp <- x[i, "tagmppsearchcount"] lastmpp <- x[i+5, "tagmppsearchcount&q

c# - Saving an integer value after string is found in text file -

i've got program reads .hrm files , i'm wanting search through text file , retrieve integer value after whatever states. have reading text file other things, can't figure 1 out. below example: if (line.contains("version=")) { //get integer after 'version=' } i not sure how integer value , store it. the hrm file reads below: [params] version=106 monitor=34 smode=111111100 date=20130205 starttime=15:46:20.0 length=01:06:18.9 interval=1 upper1=0 lower1=0 upper2=0 lower2=0 upper3=180 lower3=170 timer1=00:00:00.0 timer2=00:00:00.0 after find line contains version= var number = int.parse(line.split('=')[1]);

javascript - AmCharts - Line Chart Overflowing graph container -

Image
i trying line graph display correctly on site, reason wants overflow graph container. have tried reset box-sizing initial, setting overflow hidden on child elements of graph , nothing seems working. have no idea why happening , wondering if had come across issue before themselves? i've added image below of getting , underneath that, object being used set line graph. { "type": "serial", "theme": "light", "marginright": 80, "automarginoffset": 20, "margintop": 7, "dataprovider": querydata.data.result, "valueaxes": [{ "axisalpha": 0.2, "dashlength": 1, "position": "left" }], "mousewheelzoomenabled": true, "graphs": [{ "id": "g1", "balloontext": "[[value]]", "bullet": "round", "bulletborderalpha": 1, "bulletcolor": &qu

I need to acces second time to tcp server in Python -

this server code. need connect 2 times must same time. maybe thread wrong. don't know need help. import threading import socket import random soket=socket.socket(socket.af_inet,socket.sock_stream) num=random.choice(range(101)) host="0.0.0.0" port=7972 soket.bind((host,port)) print ("%s : %d server balşatıldı" % (host,port)) soket.listen(5) print "kullanıcı bekleniyor" conn,adres=soket.accept() print "bağlantı kuruldu." def dinle(): print num data=conn.recv(1024) print data conn.sendall("hoşgeldiniz\nbir sayı tuuttum bakalım bulabilecekmisin?" ) while true: tahmin=int(conn.recv(1024)) if tahmin==num: conn.sendall("tebrikler") break else: conn.sendall("bulamadın") in range(10): t1=threading.thread(target=dinle) t1.start() t1.join() soket.close() this easy number guessing game. can solve please.

c# - “error isam instalable cant be found” -

i'm trying connect windows form app embedded database (.dbf) , keep getting message no matter connection string: error isam instalable cant found here code i'm using test whole thing: private void bguardar_click(object sender, eventargs e) { try { string cadena = "provider = microsoft.jet.oledb.4.0; data source =d:\\; extended properties = dbase iv; userid =; password =;"; oledbconnection con = new oledbconnection(); con.connectionstring = cadena; con.open(); messagebox.show("conected"); con.close(); } catch (oledbexception exp) { messagebox.show("error: " + exp.message); } } i think problem in connection string.

jquery - call javascript page function inside ajaxed html -

i have page use jquery load content div element <div id="contents-box-in"></div> jquery code in page $(document).ready(function() { $("#contents-box-in").load("new-01.php", function() { $('#contents-box-in').fadein(120); }); var updateboxdata = function(data) { $('#contents-box-in').fadeout(100, function() { $('#contents-box-in').html(data).fadein(130); }); } }); the content load form needs load new page sending collected data form $('#form-buttons-next').click(function(e) { var formdata = new formdata($(this)[0]); var forms = $.ajax({ url : 'new-02.php', type : 'post', data : formdata, async :

ruby on rails - TypeError: can't dump MatchData -

i've inherited app developer , have added error notification service, , have received 1,408 occurrences of error having trouble getting bottom of... the error simply: typeerror: can't dump matchdata with non-project frames in stack trace.... i can see error occurring in activesupport gem message_verifier.rb file, assume there's error in application or configuration causing originally, , not sure best approach how trace point of origin on our end. strikes me kind of thing may @ , see recognize it. , advice appreciated.... this stack trace: file "xxx/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.22.2/lib/active_support/message_verifier.rb" line 53 in dump file "xxx/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.22.2/lib/active_support/message_verifier.rb" line 53 in generate file "xxx/shared/bundle/ruby/1.9.1/gems/actionpack-3.2.22.2/lib/action_dispatch/middleware/cookies.rb" line 300 in []= file "xxx/shared/bundle/rub

excel - Populating columns read from a pivot table using VBA or macro -

Image
suppose have employee id on left , hours worked on right. of course, 1 row of rather large pivot table. can take id, match existing id in excel spreadsheet, , populate hour column in sheet hour in pivot table, using vba macro? the pivot table data looks this: i have spreadsheet, automatically generated. however, hour column empty: is there way can have click macro or on pivot table sheet, , have employees hours populated pivot table? purpose make things easier else populating these excel spreadsheets save lot of time.

php - Authenticate with the Silex Security examples -

having hard time in getting `symfony/security/ work silex 2.0, i'm trying create complete implementation of basic snippets http://silex.sensiolabs.org/doc/master/providers/security.html . it works without errors, /admin route alway shows login link , never logout one. there 3 possible causes: authentication not work, not stored in session, or template not see it. the full code on github ( https://github.com/aoloe/php-silex-demo-security-path ). below can find relevant files. web/index.php : <?php error_reporting(e_all); ini_set('display_errors', 1); define('app_basedir', dirname(__dir__)); include_once(app_basedir.'/vendor/autoload.php'); $app = new aoloe\demo\application(); use symfony\component\httpfoundation\request; $app->get('/admin', function(request $request) use ($app) { return $app['twig']->render('admin.twig', [ // 'content' => ($app['security.authorization_checker&#

java - Architecture Microservices Jhipster -

i want start architecture microservices of jhipster have doubts. have 4 pieces. "hr" <- front , backend application "selection" <- front , backend application validation <- 1 database front customers <- shared between "hr" , "select" in front in microservice , "hr" , "select". both applications must validated against same database (jwt). both applications must share microservicio "customer" have backend, front in each of 2 applications. 1 - "hr" gateway? 2 - "selection" gateway? 3 - how implement security both against same database (jwt) validated 4 - "customer" microservicio? sorry english. your needs fit using jhipster in conjunction jhipster uaa. general design your first part model bounded contextes, such "hr", "selection" or "customer". microservice backend. every single item in model, "customer",

java - Best way to communicate between an Android App and a JavaFX Application -

Image
i working on javafx music player can communicate android app via tcp sockets, displaying data music player (e.g.: playlist). android app loads list of available music players database. in list there the current ip , current public_port of music player. android app can connect player on tcp socket , public_port. after music player returns "private_port" android app (so app can communicate on private_port player), , starts listening new clients connect. public void connecttoserver() { boolean end = false; for(int = 0; end == false; i++) { try { if(i > 100) { end = true; } socket = new java.net.socket(serveraddress,port); end = true; port = integer.parseint(getportfromserver()); log.d("", "connected engine on port" + port); socket.close(); socket = new java.net.socket(serveraddress,port); readplaylist()

java - Why does Synth keeps throwing NullPointerExceptions when trying to apply a style? -

whenever try apply style jmenu or jmenuitem (via synth) lot of nullpointerexceptions whenever hover or click jmenuitems or jmenu itself, stack trace isn't giving me useful information , doesn't point anywhere @ of source files. i loading file correctly , does display styles (apart background colors that's aside) problem lot of exceptions while working fine, program doesn't crash. this synth lookandfeel.xml file: <?xml version="1.0" encoding="utf-8"?> <synth> <style id="menubarstyle"> <state> <color value="gray" type="background"/> </state> </style> <bind style="menubarstyle" type="region" key="menubar"/> <style id="menustyle"> <insets top="5" bottom="3" right="10" left="10"/> <state> <color

Call a Function Handler after Owin Token Authorization in C# -

i use owin on serverside access token. afterwards, send token client server authenticated. want know, how can run function after authorization completed? (i've tried accesstokenprovider -> onreceiveasync didn't not worked properly). i found answer. it's enough using onreceive instead of onreceiveasync in app start or initiate oauth object, below: oauthoptions = new oauthauthorizationserveroptions { tokenendpointpath = new pathstring("/getauthtoken", provider = new applicationoauthprovider(publicclientid, usermanagerfactory), authorizeendpointpath = new pathstring("/api/account/externallogin", accesstokenexpiretimespan = timespan.fromdays(10), allowinsecurehttp = true, accesstokenprovider = new authenticationtokenprovider() { onreceive = context => { context.deserializeticket(context.token);

css - calc() in less doesn't work -

this question has answer here: less aggressive compilation css3 calc 3 answers i want div has right margin depending of screen width. wrote following css rule: ...{ right: calc(100% - 960px); } but see in following result in firebug: right: calc(-860%) !important; how can fix it? my problem using less instead of css. resolved doing right: calc(~"100% - 960px");

javascript - getting already posted post fields and updating them using jquery -

i'm working on laravel, want edit post having multiple fields edit. i've done post's body field , want achieve other two. related controller code: $post->body=$data['body']; $post->state = $data['state']; $post->problem_domain = $data['problem_domain']; $post->update(); return response()->json(['new_body'=>$post->body],500); blade earlier data needs fetched: <article class="post" data-postid="{{ $post->id }}"> <p> {{ $post->body }} </p> <p> <b> region: </b> {{ $post->state }} &nbsp <b> problem domain: </b> {{ $post->problem_domain}}</p> <div class="info"> posted <b>{{ $post->user->name }}</b> on <b>{{ $post->created_at }}</b> </div> <div class="interaction"> <a href="#" class="like"

java - Version number in jar file name - how to set classpath in manifest file properly? -

i have set of jars deployed ear websphere. when each of these jars built, manifest file gets class-path entry jars dependencies. later, when ear deployed, these entries used websphere determine visibility. up now, used jar names without versions, want introduce jar names versions in (like foo-1.0.0.jar). problem following: when build jar file, might depend on foo-1.0.0.jar, jar goes manifest file. later, when ear file built, foo-1.0.5.jar included because stable version. manifest file contains reference file not included in ear. can it? or did miss important?

Magento RWD theme: Making search bar permanent -

i'm using rwd theme , trying make search bar permanent (rather clicking search icon , having appear). i'm still newbie , poking through template files looking javascript make happen, looking through scss see if can find acting on id or class (seems either #header-search or .skip-links), can't seem find anything. any hints on go next? in case else looking this, ended finding javascript file (app.js) in rwd theme that's responsible hiding search bar. adds , removes 'skip-active' class show or hide search bar, added script header template of theme , achieved desired effect: <script type="text/javascript"> jquery(function($){ $('#header-search').addclass('skip-active'); }); </script>

c# mysql unable to output query to a textbox -

here code: private void searchindatabase() { mysqlconnection c = new mysqlconnection("datasource=localhost; username=root; password=123456; port=3306"); mysqlcommand mcd; mysqldatareader mdr; string query; try { c.open(); query = "select * test.classmates first_name ='"+searchname.text+"'"; mcd = new mysqlcommand(query, c); mdr = mcd.executereader(); if(mdr.read()) { firstname.text = mdr.getstring("first_name"); middlename.text = mdr.getstring("middle_name"); lastname.text = mdr.getstring("last_name"); age.text = mdr.getstring("age"); } else { messagebox.show("result not found"); } } catch(exception error) { messagebox.show("error: "+error.message); } { c.close(); } } i ask i