Posts

Showing posts from July, 2015

c - How does open() have two definitions, as shown in the man-page? -

the man page of open() shows open has 2 definitions. #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> int open(const char *pathname, int flags); int open(const char *pathname, int flags, mode_t mode); i trying make wrap around open add backtrace debugging. definition in fnctl.h shows variable argument function int open(const char *path, int oflag, ... ); but how can know whether mode present or not? the mode argument not needed open flags. example, if opening existing file reading, there's no need set file mode flags. on other hand, when creating file, need include mode. see the documentation open (or local manual page) see if need include argument or not.

how to make particular column editable for copy in datagridview of devexpress in c#? -

i have devexpress datagridview have 10 columns first column name non-editable user should able copy cell content(name). private void gridviewbatches_showingeditor(object sender, system.componentmodel.canceleventargs e) { gridview view = sender gridview; if (view.focusedcolumn.fieldname == "batch no") //editable true { e.cancel = false; } else //other column editble false { e.cancel = true; } }

java - Find out value that returns true from if statement -algorithm -

another class going pass in random numbers method(x,y,z) . want know boolean returns true last if() statement, can operations on it. have explained logic in comments. i still new this, logic may wrong. public static string finddate(int x, int y, int z) { boolean istrue1 =(x >= 1 && x <= 31); boolean istrue2 =(y >= 1 && y <= 31); boolean istrue3 =(z >= 1 && z <= 31); if(istrue1 ^ istrue2){ if(istrue1^istrue3){ if(istrue2^istrue3){//now knowing no values same, can find true value. if(istrue1||istrue2||istrue3){ // want store/use/print/know bool(istrue) evaluated true, know if //x,y,z went through algorithm successfully. } } else{return "ambiguous";} }else{return "ambiguous";} }else{return "ambiguous";} return "true"; //i end returning value went through a...

javascript - Unable to remove scroll in kendowindow -

Image
everyone have popup opened when click button popup. when popup open has scroll bar don't expect appear. var win = $("#q-exp-add-edit-window").kendowindow({ draggable: false, visible: false, modal: true, //position: { // top: 5, // left: 8 //}, resizable: false, }).data("kendowindow"); //set window title win.title("entry notes"); //set window width & height $("#q-exp-add-edit-window").css("width", "870"); $("#q-exp-add-edit-window").css("height", "460"); $("#q-exp-add-edit-window").html(""); win.refresh({ url: expenseseditgrid.urladdeditnote + params, iframe: true }); //center & open window win.center(); win.open(); here image: many . decrease inner table height , width, so inner table fit , scrolls inside model. check model height , width (or try assign) and change following lines, less models si...

How to convert query string in hash in perl -

i have query string this: id=60087888;jid=16471827;from=advance;action=apply or can : id=60087888&jid=16471827&from=advance&action=apply now want create hash have key id , value i have done this my %in; $buffer = 'resid=60087888;jobid=16471827;from=advance;action=apply'; @pairs = split(/=/, $buffer); foreach $pair (@pairs){ ($name, $value) = split(/=/, $pair); $in{$name} = $value; } print %in; but issue in query string can semin colon or & how can please me check answer: my %in; $buffer = 'resid=60087888;jobid=16471827;from=advance;action=apply'; @pairs = split(/[&,;]/, $buffer); foreach $pair (@pairs){ ($name, $value) = split(/=/, $pair); $in{$name} = $value; } delete $in{resid}; print keys %in;

unix - Practical difference between .pls and .sql file in oracle -

what practical difference between .pls , .sql file in oracle. restrictions on different types of statements in both? i given project in unix(korn script) uses both .sql , .pls files in different places. trying figure out should used where. file suffixes large extent matter of convention. can use them provide useful metadata other developers. so .pls indicates (we hope) file pl/sql script, creating pl/sql package or stored procedure. in other shops might see .pks , .pkb indicate package spec script , package body script respectively. file .tab or .tbl extension indicates ddl create table. because convention requires discipline (or code reviews) make sure remain consistent. the 1 difference .sql . although convention represents sql (a query, or perhaps dml or ddl) has special property in sql*plus. if have script called whatever.sql can call in sql*plus... sql> @whatever ... whereas if script has other extension must include extension in call... ...

numpy - Find minimum cosine distance between two matrices -

Image
i have 2 2d np.arrays let's call them a , b , both having shape. every vector in 2d array a need find vector in matrix b , have minimum cosine distance. have double loop inside of try find minimum value. following: from scipy.spatial.distance import cosine l, res = a.shape[0], [] in xrange(l): minimum = min((cosine(a[i], b[j]), j) j in xrange(l)) res.append(minimum[1]) in code above 1 of loop hidden behind comprehension. works fine, double loop makes slow (i tried rewrite double comprehension, made things little bit faster, still slow). i believe there numpy function can achieve following faster (using linear-algebra). so there way achieve want faster? from cosine docs have following info - scipy.spatial.distance.cosine(u, v) : computes cosine distance between 1-d arrays. the cosine distance between u , v , defined as where u⋅v dot product of u , v . using above formula, have 1 vectorized solution using `numpy's broadcasting capabi...

c - getting at pointers in an array of struct passed as a void* -

i have function signature qsort : const char* get_str(int i, const void *base, size_t nmemb, size_t size); i passed arrays of pointers const char* , or arrays of structs first field pointer const char* . what casts need extract pointer in array element i ? i have tried casting base array of char itself, can advance right element: return *(const char**)(((const char*)base)[i * size]); but compiler complaining: warning: cast pointer integer of different size [-wint-to-pointer-cast] it looks want implement type or identification sytem structs so: #include <stdlib.h> #include <stdio.h> struct { const char *id; int x; }; struct b { const char *id; double d; }; union { struct a; struct b b; }; int main() { struct a[] = {{"one", 1}, {"two", 2}, {"three", 3}}; struct b b[] = {{"pi", 3.1415}, {"e", 2.71}}; union any[3]; any[0].a = a[0]; any[1].b = b[0]; ...

winbugs - JAGS - hierarchical model comparison not jumping between models even with pseudopriors -

i'm using hierarchical modelling framework described kruschke set comparison between 2 models in jags. idea in framework run , compare multiple versions of model, specifying each version 1 level of categorical variable. posterior distribution of categorical variable can interpreted relative probability of various models. in code below, i'm comparing 2 models. models identical in form. each has single parameter needs estimated, me . can seen, models differ in priors. both priors distributed beta distributions have mode of 0.5. however, prior distribution model 2 more concentrated. note i've used pseudo priors had hoped keep chains getting stuck on 1 of models. model seems stuck anyway. here model: model { m ~ dcat( mpriorprob[] ) mpriorprob[1] <- .5 mpriorprob[2] <- .5 omegam1[1] <- 0.5 #true prior omegam1[2] <- 0.5 #psuedo prior kappam1[1] <- 3 #true prior model 1 kappam1[2] <- 5 #puedo prior model 1 ...

php - Use MSSQL GROUP BY with too many columns -

how can use group by location column on query having think aggregate things? select a.[plateno] ,a.[trxdate] dates ,a.[location] ,a.[account] ,a.[trxtime] ,a.[msg] ,b.company [mark_fast].[dbo].[alarm] inner join [mark_fast].[dbo].[account] b on a.[account] = b.senderno or a.[account] = b.sim1 a.trxdate between '09/10/2015' , '09/10/2015' , msg '%geo%' , (a.plateno = 'bcy536') order location desc the sample output is: plateno dates location account trxtime msg company 123 9/9/1999 loc 1 321 02:39:00 geozone exit alert! transpartner trucking services 123 9/9/1999 loc 1 321 02:39:00 geozone exit alert! transpartner trucking services 123 9/9/1999 loc 1 321 02:31:00 geozone entry alert! transpartner trucking services 123 9/9/1999 loc 3 321 02:32:00 geozone exit alert! transpartner trucking services 123 9/9/1999 loc 3 321 0...

python - Cython: std::sort on C++ vector -

i'm having trouble compiling using libcpp.algorithm.sort ( std::sort ) on libcpp.vector . short code below: from libcpp.algorithm cimport sort stdsort libcpp.vector cimport vector cdef sort_something(mylist): myvec = vector[int]() num in mylist: myvec.push_back(num) stdsort(myvec.begin(), myvec.end()) this using standard syntax using std::sort on c++ vector . angry compiler messages. reference, setup.py file: from distutils.core import setup cython.build import cythonize setup( ext_modules=cythonize("*.pyx", language="c++") ) this compiler output. (warning: it's long, , can't comprehend it.) python setup.py build_ext --inplace running build_ext building 'sample' extension cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -os -pipe -fno-common -fno-strict-aliasing -fwrapv -denable_dtrace -dmacosx -dndebug -wall -wstrict-prototypes -wshorten-64-to-32 -dndebug -g -fwrapv -os -wall -wstrict-pro...

Error while passing array as function parameter in bash -

this code dealing with: function execute { task="$1" servername="$2" "$task" "${servername[@]}" } function someotherthing { val=$1 echo "$val" } function makenecessarydirectory { arr=("$@") echo "${arr[@]}" } dem=(1 2 3 4 5) execute someotherthing 1 execute makenecessarydirectory "${dem[@]}" output: 1 1 expected output: 1 1 2 3 4 5 how achieve this? found no error logically. side question : is safe receive 2nd parameter array inside execute can deal both of dependent functions, or should have explicit check inside execute ? as explained in comment you passing array individual args execute , passing first 1 makenecessarydirectory , $@ single argument passed 1. i way, have added comments parts have changed. minor changes should work you. #!/bin/bash function execute { task="$1" servername="$2" ...

mysql - Access: How to structure input vs read only forms -

Image
ive got peoples db , after development recordset main form not updatable because of subqueries etc etc.. all because redesigned db resemble real life more, meaning added tables track things. made relations little more complex , im left db cant add new records or edit hahaha , thats pretty useless so i'm left thinking can't me there either simple solution can't see or have designed forms totally wrong. whats praxis in design/structure when have/get form based on recordset that's not updatable in "regular" peoples db , want add or edit details in it? (think hr managment db) (reason recordset being un-updatable: recordset based on query gets records 3 related tables , max function on date field recent record on 2 of tables) now have mainform , 3 subforms on it. can edit/add info in subforms of course mainform displaying names , other personal details not updatable... the mainforms query querying tblperson, tblinmate, tblclassificationhistory , ...

java - How to make a delay in repainting components -

i'm making "dice game". i'm adding jlabels panel random dice images. want them not appear @ same time, delay. found thread.sleep() job. problem when put sleep() inside for-loop, loop loops , of labels repainted in same time (after set sleep-amount). goal show first label, sleep amount of time, show next, sleep , on. help! public void paintlabels(player[] players, die[] dice, string[][] images) throws interruptedexception { pnldice.removeall(); // remove play-area pnldice.setlayout(new java.awt.gridlayout(players.length,6)); // sets new layout based on number of players jlabel[] image = new jlabel[dice.length]; // declares array of labels based on number of dice (int i=0; i<players.length;i++) { (int j=0; j<dice.length; j++) { image[j] = new jlabel(); image[j].seticon(new imageicon(images[i][j])); // set image of label pnldice.add(image[j]); // add label panel ...

org.apache.http jar class not found in android studio projects -

Image
i include following jars see below image. i want integrate json web service import below jars apache-mim44j-0.-6.jar gson-2.1.jar httpmime-4.0.1.jar json_simple-1.1.jar build.gradle file apply plugin: 'com.android.application' android { compilesdkversion 23 buildtoolsversion '22.0.1' defaultconfig { applicationid "pkg.android.myapp" minsdkversion 15 targetsdkversion 23 versioncode 1 versionname "1.0" } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile filetree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:23.0.1' } when set above structure jar file not getting in class file idea how can solve problem?your suggestions appreciable. edit apply plugin: 'com.android.application' androi...

c# - Combobox binding breaks when dropped down -

i have combobox bound dependencyproperty on form. can add items property through button click , add them combobox . however, drop down combobox binding breaks. can still add items property, combobox never updates show them. for example click button 3 times drop combobox down - have 3 items click button 3 times drop combobox down - still have 3 items starting application again and: click button 6 times drop combobox down - have 6 items xaml <grid x:name="layoutroot" background="white"> <combobox name="combtest" itemssource="{binding users}" width="50" height="50" horizontalalignment="left" /> <button click="buttonbase_onclick" width="50" height="50" horizontalalignment="right" /> </grid> code behind public mainp...

sql - How i create a table from a list of values? -

i have hard work , don't know how implement in t-sql (sql server). i have table (temp_table) this: ------------------------------------------------------------- measure column_name column_type tabletobecreated ------------------------------------------------------------- me_aa d_product [decimal](19,6) stagin_meaa me_aa d_store [decimal](19,6) stagin_meaa me_aa1 d_product [decimal](19,6) stagin_meaa me_aa1 d_store [decimal](19,6) stagin_meaa me_bb d_product [decimal](19,6) stagin_mebb me_bb d_store [decimal](19,6) stagin_mebb me_bb d_time [decimal](19,6) stagin_mebb me_bb1 d_product [decimal](19,6) stagin_mebb me_bb1 d_store [decimal](19,6) stagin_mebb me_bb1 d_time [decimal](19,6) stagin_mebb . .. ... ----------------------------------------------------------------- then, table, want create table called column tabletobecreated temp_table th...

Cannot load HTTP links in UIWebView in iOS 9 -

Image
i trying load http links within uiwebview. links website reliable. have searched internet , found solution here: how can add nsapptransportsecurity info.plist file? after following solution info.plist looks this.: even after making changes cannot load http links within uiwebview. following error: app transport security has blocked cleartext http (http://) resource load since insecure is there doing wrong? update: after making changes suggested ramshad in comments still not work. see image below: it should done this, need add in plist following records apple documentation nsapptransportsecurity <- type dictionary nsallowsarbitraryloads <- type boolean value yes

objective c - Counting push notifications on iOS (deal with cancel from notif center) -

i'm trying understand on how deal particular use case push notifications. let's suppose have 4 push notifications in notification center waiting interaction, server keeps track of badge number. user picks one, in -application:didreceiveremotenotification: decrement badge , communicate server notification make decrements "badge" number , mark notification read.everything works fine. i'm not able deal case. let's user deletes notification center 1 notification , opens app tapping on another, have incorrect badge number on both server , app, since deleting notification doesn't seem affect badge number. there way understand remote notification has been removed? seem more fine grained control better use mix of silent push , remote notification.

jaxb - JXB How to use different strategies of code generation -

usually, jaxb used generate code xsd, generates java classes xsd complextype annotations convert xml , vice-versa. i trying achieve different. want, generate data mapper class each such xsd element. mapper map each field of generated class values datatype (say database, or other stream) so need to: every user-defined datatype in xsd, add method in datamapper class map-<xsd-complexdatatype-class>() , generate method body. to achieve this, think not possible generate class in plugin extending com.sun.tools.internal.xjc.plugin in run method, wont able create new jdefinedclass is there way add hook method before model invokes plugins ? thanks, there few things can do. in my other answer specificaly meant these: in plugin can write , set own com.sun.tools.xjc.generator.bean.field.fieldrendererfactory . field renderers generate fieldoutline s cpropertyinfo s. step between model , outline. if want different code generated out of model, consider implemen...

Java generics: Bound mismatch.Looking for the valid substitute -

i have couple of generic classes: public interface data<e> {} public interface clonable<e extends clonable<e>> {} public interface naturalnumberinterface extends data<naturalnumberinterface> {} public class naturalnumber implements naturalnumberinterface {} public interface setinterface<e extends data<e>> extends clonable<setinterface<e>> {} public class set<e extends data<e>> implements setinterface<e> {} when i'm trying create new instance of set set<naturalnumber> s=new set<naturalnumber>(); compiler says: naturalnumber not valid substitute type parameter <e extends data<e>> of type set<e> maybe can me find mistake, cause spent long time , didn't find solution. i assume setinterface defined in same way listinterface , data interface data<t> . the generic argument of setinterface f-bounded : e extends data<e> . in current code naturalnu...

C++ Constructor with delegation -

this question has answer here: what weird colon-member (“ : ”) syntax in constructor? 12 answers code below: #include <iostream> #include <cstdio> using namespace std; typedef char byte; #define buf_size 30 class { public: a(); ~a(){} inline const byte* getbuffer() const { return m_pbuf; } int pop(void); private: const byte* m_pbuf; }; a::a():m_pbuf() //<---line 19 { byte* pbuf = new byte[buf_size]; if (pbuf == null) return; (int i=0; i<buf_size; i++) { pbuf[i] = i; } m_pbuf = pbuf; } int main() { a; const byte* pb = a.getbuffer(); if (null != pb) { (int = 0; i<buf_size;i++) printf("%u", pb[i++]); } return 0; } i trying figure out how many kind of initialization list of c++ constructor provided. , find special 1 above.can ...

java - Hibernate Criteria Query with Vararg Method -

the objective entities specific ids. want create vararg method take entity ids , return entity list according ids: @override public list<entity> getentities(long... ids) { session s = sessionfactory.getcurrentsession(); s.begintransaction(); criteria criteria = s.createcriteria(entity.class); (long id : ids) { // id want create restriction // restriction goes // criteria.add(restrictions.or(restrictions.eq("id", id),restrictions.eq("id", id))); } s.gettransaction().commit(); return null; } usage be: list<entity> list = getentities(453,282,781,784); how create such criteria query? a variable number of or id = ? clause in clause. done using restrictions.in method: criteria.add(restrictions.in("id", ids));

SQL Server 2008 - ROWNUMBER OVER - filtering the result -

i have following sql works , returns products duplicate names , rownum column count of how many times name appears. adding where rownum > 1 @ end gives me duplicates only. select * (select id, productname, row_number() on (partition productname order productname) rownum products group id, productname) result requirement i need produce list of products if rownum column has value greater one, want see rows pertaining product grouped name column. if rownum value product 1 only, , no value greater 1 (so no duplicate) don't want see row. so example if "blue umbrella" appears 3 times, want see result product as: id name rownum 35 blue umbrella 1 41 blue umbrella 2 90 blue umbrella 3 how go achieving please? change row_number on count(1) over , select count greater 1 , remove group by select * (select id,productname, count(1) over(partition productnam...

javascript - jQuery DataTables - Sorting doesn't work when column is clicked -

the tabs/search bar/page entries appear @ top of table expected. not sorted when clicked. it's looks @ first row. <script> $(document).ready( function () { $('#aeotable').datatable(); } ); </script> echo ' <table id="aeotable" class="display"> <thead> <tr> <th>company name</th> <th>expiry insurance certificate</th> <th>comments</th> <th>file name</th> <th>&nbsp;</th> </tr> </thead>'; // print each file while($row = $result->fetch_assoc()) { echo " <tbody> <tr> <td>{$row['cop']}</td> <td>{$row['expo']}</td> <td...

c++ - Adding QFrame A to layout of QGroupBox B when QFrame is instantiated outside QGroupBox -

Image
i encountered unwanted behavior when adding qframe in qvboxlayout of qgroupbox. i have custom qframe class : class customframe : public qframe { } i have class customgb inherits qgroupbox method addframe supposed add type frame groupbox's layout class customgb: public qgroupbox { q_object public: customgb(); ~customgb(); void addcustomframe(customframe* aframe); private: qvboxlayout * _timelayout; } customgb::customgb() { _timelayout=new qvboxlayout; setlayout(_timelayout); } customgb::addcustomframe(customframe * aframe) { _timelayout->addwidget(aframe); } i want add new frame in groupbox. i naturally call code (1st algo) : customframe * aframe = new customframe (); cutomgbinstance.addcustomframe(aframe ); this results in frame not being added correctly in group box. it's added in top left corner. , calling code several times note add frames below each other every frame in ex...

jquery - Last DIV scrollable only -

i have following scenario need make div scrollable. whats happening me when try different solutions make scrollable entire div set becomes scrollable. want here make last div scrollable. <div class="container">first</div> <div class="container">second</div> <div class="container"> <div id="notsolong">don't scroll this!!!!</div> <div id="long">lorem ipsum dolor sit amet, consectetur adipiscing elit. maecenas ut placerat ipsum. integer mollis magna sapien, nec fermentum justo volutpat dapibus. in eget pretium enim. scroll this!!!</div> </div> .container { width:100%; height:auto; min-height:100px; } #long { width:200%; overflow-x:auto; } you should add overflow:auto; .container . alternatively, if want only .long scroll, should wrap element , set overflow:auto

java - How to replace getDate() from the type Date which is deprecated? -

i have existing program have correct . contains these lines : date startdate = new date(); int day = startdate.getdate() - 1; but getdate() type date deprecated have change using calender . tried : calendar startdate = calendar.getinstance(); startdate.add(calendar.date, -1); int day= startdate.gettime(); but results following error : type mismatch: cannot convert date int if want day in month use this: int day= startdate.get(calendar.day_of_month); if want day in week use this: int day= startdate.get(calendar.day_of_week); also careful day of week, because day 0 sunday not monday. field number , set indicating day of week. field takes values sunday, monday, tuesday, wednesday, thursday, friday, , saturday.

jquery - Uncaught ReferenceError: Main is not defined javascript -

i having bit of trouble calling function 1 javascript file another. the call search.js file using main.userroleteam({ teamdropdown: $("#team"), teamroledropdown: $("#teamrole"), memoryload: true, load: function (options) { } }); the other file main.js function userroleteam(options) { ... } in dev, works in test, not. the folder \ file structure same , have checked this. i have used diff tool @ solution \ folder \ file differences , there nothing. in aspx page files being called so. <script src="../static/search.js" type="text/javascript"></script> <script src="../static/main.js"type="text/javascript"></script> i have check other answers on here, , tried various solutions, of state order of calling files should above. ================================================ edit 1 looking @ page source, values should expecting in sourcecode, <div class=...

Return filtered array in javascript -

i though going straightforward. have dataset containing (foreach country) name, imfcode, lat,lon. want pass code function filter dataset returning info correspond code passed it. if pass 512 should information relating afganistan. here function, mind telling me i'm doing wring function loadtrade(imfcode) { console.log ("country code= ",imfcode) var sourcecountry=dataset.filter function(el){ return el.imfcode===imfcode } console.log ("source country= ",sourcecountry) } i keep getting unexpected token , can't see it. many thanks you missed parenthesis after dataset.filter change : function loadtrade(imfcode) { console.log ("country code= ",imfcode) var sourcecountry=dataset.filter(function(el){ return el.imfcode===imfcode; }); console.log ("source country= ",sourcecountry); }

Repository pattern (Laravel) switching beetwen models -

i'm writing app in laravel using repository pattern. main idea write 1 repository handle 2 models based on route parameters. so routes.php looks this: routes.php <?php $api = app('dingo\api\routing\router'); $api->version('v1', function ($api) { $api->post('create/{type}', ['uses' => 'beyondi\account\http\controllers\accountcontroller@insert']); }); accountcontroller.php class accountcontroller extends controller { /** * generate json web token. */ protected $account; public function __construct(typerepositoryinterface $user) { $this->account = $user; } public function insert(accountrequest $request) { if($this->account->create($request->input())) { return $this->response->array("user inserted")->setstatuscode(200); }else { return $this->response->array("error,...

javascript - Trying to change id for multiple rows -

i'm trying change id multiple lines in order activate , deactivate link, works first line. there way make work on entire page? i want change paragraphs @ same time function changediv() { if (document.getelementbyid("enabled")) { document.getelementbyid("enabled").id = "disabled"; } else { document.getelementbyid("disabled").id = "enabled"; } } <button type="button" onclick="changediv()">display</button> <br><br> <a href="http://www.google.com" id="disabled">this paragraph.</a><br> <a href="http://www.google.com" id="disabled">this paragraph.</a><br> <a href="http://www.google.com" id="disabled">this paragraph.</a> as said, id attribute of element must unique in document the id should unique throughout scope of current docu...

Using Crosswalk in an Android Cordova Project with Embedded WebView -

i have existing android cordova project uses embedded webview. means activity not extend cordovaactivity, instead embeds systemwebview , initializes within oncreate. the following how being done: within layout xml file <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > .... other layout elements not related cordova.... <org.apache.cordova.engine.systemwebview android:id="@+id/cdvwebview" android:layout_width="fill_parent" android:layout_height="fill_parent" /> </relativelayout> within activity's oncreate: systemwebview systemwebview = (systemwebview) findviewbyid(r.id.cdvwebview); cordovawebview cdvwebview = new cordovawebviewimpl(new systemwebviewengine(systemwebview)); configxmlparser pars...

python multithreading data race -

Image
i`m making multithread system on python 2.7. basically, has 3 thread , 1 singleton-class shared data. red arrow - invoke ; blue arrow - access every thread separate class in file. file main.py import working , communication files, , shared data. main thread invoke working class in 1 thread , communication in 1 thread. herewith shared data, 1 instance of singleton, passed in constructors of working class , communication class. file main.py import communication import worker import data app_data = data.instance() #........... srv = communication.server(app_data) srv.setdaemon(true) srv.start() #........... while true #........... # must locker.acquire() if condition1: if condition2: job = worker(app_data, srv.taskresultsendtoslaves, app_data.ip_table[app_data.cfg.my_ip]['tasks'].pop()) job.setdaemon(true) job.start() # must locker.release() file communication.py class server(threading.thread): #...

How to zip multiple zip files in Javascript? -

problem i want generate zip file contains multiples other zip files in javascript. use jszip don't manage add zip files 1 zip file. example i have multiple text files : player 1 - file 1.txt player 1 - file 2.txt player 2 - file 1.txt player 2 - file 2.txt i want generate zip file : example.zip player 1.zip player 1 - file 1.txt player 1 - file 2.txt player 2.zip player 2 - file 1.txt player 2 - file 2.txt thank help. fiddle: https://mikethedj4.github.io/kodeweave/editor/#ca2d1692722e8f6c321c322cd33ed246 after many hours , failed attempts got work jszip ! note : i'm using jszip v2.6.0 outdated , not work current version 3.0 time of posting. javascript : // set sample url document.getelementbyid("zipurl").value = "https://mikethedj4.github.io/kodeweave/editor/zips/font-awesome.zip"; $(".loadzipurl").on("click", function() { if ( (!document.getelementbyid("zipurl").value...

apache poi - Using POI4XPages SVE control and browser window closed before completing download -

if browser window/tab closes before download of export finishes, http service appears locked up. application running poi4xpages process in. idea how prevent this? can imagine users doing , restart of http service every time not optimal solution. i've not seen threads locked - though i'm not admin. can locked believe if users clicks "download" button more once. think there's couple solutions typically have button open new page/tab calls xagent triggers download.

My flash player not autoplaying in Chrome version 45 -

with chrome version 45, "chrome automatically pauses flash content isn’t ‘central’ web page". how chrome determine 'central' content? on web page there 1 player on top left. flash based. business requirement auto play content whenever page loads seems chrome latest version not allow autoplay content , instead displays play icon on it. how chrome determines central content? tried put focus on player still not autoplay. is there way can overwrite chrome setting through ui "run plugin content" under content settings? there other alternative can try. inputs appreciated. thank you! regards, hakim ok, got solution issue. chrome requires minimum height, width, aspect ratio consider player central/important content of page. in case height of player 267px , chrome min needed 298 (see below link). changed 298px , worked :) please see below link/code if need more details: https://code.google.com/p/chromium/codesearch/#chromium/src/content/rende...

c# - Steamkit2 Message to specific user -

once adds bot in friendlist, bot accepting request , send message new "friend", want send message steamid well, reason isn't working it accept , send message new friend, not send me message, static void onfriendslist(steamfriends.friendslistcallback callback) { thread.sleep(2500); foreach(var friend in callback.friendlist) { if (friend.relationship == efriendrelationship.requestrecipient) { steamfriends.addfriend(friend.steamid); thread.sleep(500); steamfriends.sendchatmessage(friend.steamid, echatentrytype.chatmsg, "hello bot"); steamfriends.sendchatmessage(new steamid { value = "76561198145164176" }, echatentrytype.chatmsg, "a friend had added me!"); //this ain't working } } } also getting syntax error @ value, severity code descr...