Posts

Showing posts from June, 2010

javascript - $scope element becomes "undefined" after being changed -

i have controller , object app.controller('maincontroller', function( $scope, $rootscope, $window, $state, $urlrouter, $http, content, flash, $modal, $stateparams ) { $scope.user = { username: '', password: '', email: 'default-value' } $scope.log = function ( message ) { console.log( message ) } ... and html this: <form class="form-inline form-waitlist" ng-show="showsignup"> <span class="form-group"> <input type="email" class="input-white form-control input-font-lg" ng-model="user.email" placeholder="email" /> <button class="btn btn-white btn-lg hidden-xs" ng-click="log( user.email )">sign {{ user.email }}</button> ... when load page field default-value , in object in controller. change typing in field, turns undefined. i'm in view, landing.splash ,

symfony - Symfony2 Doctrine API not returning dates as they are in the database (adding timezone) -

i have api built symfony2 , doctrine. dates stored in database without timezone modifiers (e.g. +0000 ). however, doctrine's ->findall() method returns dates timezone modifier attached. how ensure not happen? adding entity annotations? or maybe creating event listener modify data (seems might bit messy me though), or there way should done? thanks doctrine hydrates date , datetime columns standard php datetime objects. according http://php.net/manual/en/datetime.construct.php : if $timezone omitted, current timezone used. this means if doctrine doesn't set timezone when hydrating object system's default timezone used. standard php behavior , can't changed doctrine. solution: even if dates constructed a timezone, shouldn't bother much. using datetime 's format() method can display date in format want. example: display date in 2000-02-01 23:59:59 format can do: $entities = $repository->findall(); foreach($entities $e

How to correctly make the icon for Systemtray in C# -

using icon sizes of dimension systemtray doesn't overall. correct way of making icons windows system tray? screenshots: http://imgur.com/zsibwn9 icon: http://imgur.com/vsh4zo8

printing - How do I keep Python print from adding newlines or spaces? -

this question has answer here: how print without newline or space? 26 answers in python, if say print 'h' i letter h , newline. if print 'h', i letter h , no newline. if say print 'h', print 'm', i letter h, space, , letter m. how can prevent python printing space? the print statements different iterations of same loop can't use + operator. you can use: sys.stdout.write('h') sys.stdout.write('m')

mysql - Synonyms, Outer Joins, Single Row String Functions -

how return order id’s , total sum of quantities each order in order details table. label total value "total qtys" , return orders had total quantities > 250 , sort 1 on total quantities highest lowest? this mysql. assuming referring sum(qty) schema / load data test create table orders ( id int auto_increment primary key, custid int not null -- etc etc -- fk customer id ); create table orderdetails ( id int auto_increment primary key, orderid int not null, itemid int not null, qty int not null, -- etc etc -- fk items table not shown in example -- fk constraint orders table below: constraint fk_orddet_ords foreign key (orderid) references orders(id) ); insert orders (custid) values (1),(2),(3); insert orderdetails (orderid,itemid,qty) values (1,1,9),(2,1,190),(2,1,100),(3,1,255); -- below shows fk constraint fails faulty data (orderid 4 not exist) insert orderdetails (orderid,itemid,qty) values (4,1,9);

pivot table - Pivottable in Excel. How can I order value in a column in progressive more -

i have pivot table in excel column representing week number. if sort in alphabetical order 1, 10, 11, 12 ... 2, 20, 21 etc. this not making sense. how can 1,2,3,4... order? i looking creating "custom filter" no success. any help? thanks make sure source data column formatted general: go source data right-click on column select format cells select general click ok if green arrows in upper left corner of each cell, convert text numbers: click on first cell drag mouse down last cell (it won't work if use keyboard shortcuts shift+ctrl+down) click yellow diamond icon select "convert number" after have accomplished above, refresh pivot table , sort field.

ios - Objective C pointers to primitive types -

i came java background , i'm trying figure out if translating following piece of java code: public class someclass { private int[] somearray; //+....other instance variables public someclass(int arraysize) { this.somearray = new int[arraysize]; //some other initialization } } could safely translated objective c follows: @implementation someclass { int *_myarray; //some other private fields... } -(instancetype)initwitharraysize:(int)arraysize { if(self = [super init]) { int newarray[arraysize]; _myarray = newarray; //some other initializations } return self; } } i'm aware of nsarray , nsnumber boxing above code sounds cleaner , more efficient, specially app need @ cases hold thousands of references someclass. @ same time i'm not sure if primitive pointers safe use arc , whether cause leaks. i've tried following dummy test see if things work expected: @implementation someclasstes

mysql - Can't manage to return 100 results in Python -

so i'm trying 100 results mysql database via python. here's got far cursor = db.cursor() cursor.execute("select author, quote quotes order rand() limit 100") row in cursor.fetchall(): quote = row[1] author = row[0] return jsonify(quote=quote, author=author) when give run, 1 result, so { "author": "helen keller", "quote": "faith strength shattered world shall emerge light." } i'm trying return 100, not 1 quote. ideas? you returning on first pass through for loop. why 1 result. instead of loop, this: def testdb(): cursor = db.cursor() cursor.execute("select author, quote quotes order rand()") return jsonify(data=cursor.fetchall()) you remove for loop before return statement. if have fetchall() in there twice, without second query, second attempt produce empty list.

regex - How to split array of strings from two sides? -

i have array of strings (n=1000) in format: strings<-c("gsm1264936_2202_4866_28368_150cgy-gcsf6-m3_mouse430a+2.cel.gz", "gsm1264937_2202_4866_28369_150cgy-gcsf6-m4_mouse430a+2.cel.gz", "gsm1264938_2202_4866_28370_150cgy-gcsf6-m5_mouse430a+2.cel.gz") i'm wondering may easy way this: strings2<-c(2201_4866_28368_150cgy-gcsf6-m3_mouse430a+2.cel, 2202_4866_28369_150cgy-gcsf6-m4_mouse430a+2.cel, 2203_4866_28370_150cgy-gcsf6-m5_mouse430a+2.cel) which means trim off "gsm1234567" front , ".gz" end. just gsub solution matches strings starts ^ digits , alphabetical symbols, 0 or more times * , until _ encountered , (more precisely "or") pieces or strings have .gz @ end $ . gsub("^([[:alnum:]]*_)|(\\.gz)$", "", strings) [1] "2202_4866_28368_150cgy-gcsf6-m3_mouse430a+2.cel" [2] "2202_4866_28369_150cgy-gcsf6-m4_mouse430a+2

javascript - CKEditor divarea plugin doesn`t work correctly on iOs device with Safari 8 -

i use ckeditor (vers.4.5.1) divarea plugin , " minimalist " skin. necessary have ability change font size selected text. when open page in ipad ios 8 in safari, select text , click fontsize menu, appears , after click particular font size no text size updated, cursor caret returns position don`t use before. worthy of note can use chosen font size last step typing text after it. so, i not understand how can fix in order change font size of selected text, because not find same questions it. p.s. common issue impossible apply text formatting select boxes in ipad safari . open next page: http://ckeditor.com/demo#div in ipad safari browser , trying apply styles word in text.

c++ - How do I fix segfault error 4 in a shared library from Qt? -

so heres issue.... i have application1 start application2 through qprocess. application2 has dependencies on qt shared libraries, before start qprocess, set qprocess system environment current environment in application1, ld_library_path pointing qt shared libs in code below: void myclass::setenvironment() { qprocessenvironment env = qprocessenvironment::systemenvironment(); m_process->setprocessenvironment(env); qstringlist envlist = m_process->systemenvironment(); m_process->setworkingdirectory(m_project->path()); } after call qprocess::start, exitstatus returns qprocess::crashexit. i tried debugging application2 error before enters main. after looking kernel logs encountered error: jul 23 09:30:40 centos7-gui kernel: application2[23290]: segfault @ 38 ip 00002b4916d67969 sp 00007fff1b2e7c30 error 4 in libqt5core.so.5.3.1[2b4916c36000+510000] again, ive checked system environment after setting it, , ld_library_path needs be. also

selenium - EventFiringWebDriver does not register WebElement -

i testing frontend selenium using eventfiringwebdriver log webelement manipulation. findelement() calls work alright, if get webelement through javascriptexecutor, though, webdrivereventlistener's listeners don't called when interact (click, sendkeys, etc.) element. there way make listener work webelements come javascriptexecutor's executescript()? unfortunately since interacting javascript , not events on webpage events aren't considered fired far eventlistener concerned. you'll have manually manipulate elements though enduser listener notice.

ios - library not found for -lSystem -

when try compile version device has error ld: library not found -lsystem clang: error: linker command failed exit code 1 (use -v see invocation) i try remove frameworks , libraries , error still stay. open project settings , go buildsettings->other linker flags . need remove -lsystem string.

Stored procedure doesn't do anything in remote server when called with "Exec procedure" -

i'm puzzling stored procedure has different behavior when run withoout exec keyword. i have 2 servers, server 1: microsoft sql server 2008 r2 (rtm) - 10.50.1600.1 (x64) apr 2 2010 15:48:46 copyright (c) microsoft corporation standard edition (64-bit) on windows nt 6.0 (build 6002: service pack 2) (hypervisor) server 2: microsoft sql server 2008 (sp2) - 10.0.4000.0 (x64) sep 16 2010 19:43:16 copyright (c) 1988-2008 microsoft corporation standard edition (64-bit) on windows nt 6.1 (build 7601: service pack 1) (vm) a stored procedure (actualiza_mante_full) in server 1 deletes , inserts data table in server 2 tables in server 1. when run "exec actualiza_mante_full" process returns no errors destinatio table has no rows. when run "actualiza_mante_full" (without exec) process runs no errors , data inserted correctly. why difference?, i'm missing? edit: procedure pseudo code (sorry can't put actual code) create procedure miproc

excel - VBA: Filter table data based on drop down selection -

i filter table column c, based on drop down list selection. have more lines, can select country code form drop down list. i filter table based on country code selection. for example: first line: "54" country code selected second line "24" country code selected and on.... the table on other tab filtered selected country code "54","24". can please me how can manage it? thank :) sub filterrangecriteria() dim vcrit variant dim wsfiltered worksheet dim wsselection worksheet dim rngcrit range dim rngorders range dim lastrow integer 'you need more variables save range in array dim valarr variant dim cl range dim integer set wsfiltered = worksheets("s") ' want filter tab "centre information" selection set wsselection = worksheets("centre information") set rngorders = wsfiltered.range("b:b") 'i want filter column lastrow = worksheets("centre information").cells

ruby on rails - Make RoR nested representable into an array -

in using representable gem , looking nest object within array, array having 1 object. can't see figure out how accomplish this. ideas? reason due how google tag manager handles enhanced ecommerce tracking. nested 'products' property :name, getter: lambda{|*| name } property :id end will spit out: "products": { "name" : "nike swoosh", "id" : 8 } when want come out as: "products": [ { "name" : "nike swoosh", "id" : 8 } ] you can use collection in representable module. although have single object, since want wrap in array. technically become collection single object. define getter collection name in parent object. here example: require 'ostruct' require 'representable' require 'representable/json' class order < struct.new(:order, :product) def products [product] end end module orderrepresenter include representable::

csv - XSLT transformation of a XML file -

i have xml this, can have model region , tt , model tt: <brand id="1" desc="ih"> <type id="1" desc="tractors"> <product id="1" desc="tractors"> <series id="10496" desc="mxc"> <model id="10497" desc="mx100c" tscode="048"> <region id="4" name="apac" desc="asia pacific" /> <region id="1" name="na" desc="north america" /> <tt code="696033805" desc="-mx maxxum mfd " colcode="2" /> <tt code="696033808" desc="-mx maxxum 100c " colcode="2" /> <tt code="696044567" desc="-mx maxxum 300c " colcode="2" /> </model>

VBA on new Excel file -

i receive reports daily in spreadsheet form. have macro code take out portions of spreadsheet , put new spreadsheet. want know if there's way run macro without having manually copy paste each new file receive. sub copyitover() dim newbook workbook set newbook = workbooks.add thisworkbook.worksheets("sheet1").range("fe1:fh1").copy destination:=newbook.worksheets("sheet1").range("a1:d1") thisworkbook.worksheets("sheet1").range("iz1:ji1").copy destination:=newbook.worksheets("sheet1").range("e1") thisworkbook.worksheets("sheet1").range("jk1:jl1").copy destination:=newbook.worksheets("sheet1").range("o1") thisworkbook.worksheets("sheet1").range("ka1:kj1, kl1, kr1, kt1").copy destination:=newbook.worksheets("sheet1").range("q1") thisworkbook.worksheets("sheet1").range("fe328:fh328").copy de

Find the matching total Qty in SQL Server -

need here, below sample data need find matching request qty. let's request qty 90. in query can auto search possibility of matching total sum qty. for example, results can possible combination ids:- 2 + 10 = 90 3 + 8 = 90 5 + 6 = 90 4 + 7 = 90 6 + 7 + 8 = 90 . . . i understand combination formula can doing in sql server, n!/(n-r)!(r!). can slowdown query execution time if have thousand of rows need find qty matching. but want find first match qty enough instead of generate entire list of combination possibility. in case, have ideas or sample query can making query run faster on above scenario besides combination? +----+----------+-----+ | id | material | qty | +----+----------+-----+ | 1 | | 90 | | 2 | | 80 | | 3 | | 70 | | 4 | | 60 | | 5 | | 50 | | 6 | | 40 | | 7 | | 30 | | 8 | | 20 | | 9 | | 20 | | 10 | | 10 | +----+----------+-----+

MongoDB Math functions like $mod accept NumberLong in mongo shell but not through Java driver -

this sample record in collection "compliance": { "_id" : "fc750415-9425-413c-906d-0c15e1628b0d", "gcid" : "e9c5c788-a8df-4080-a94f-7949fc17bfa0", "audittime" : numberlong("1437316807198"), "auditmonth" : numberlong("1427826600000"), "checksum" : "30e4ae5aa93cfb17ad9876df6feea17149a0f347", "policyids" : [ "be0edaa7-6972-4397-8c0b-e8cceec5b929" ], "rectype" : "processed", "starttime" : numberlong("1437316807198"), "transid" : "-1", "transtime" : numberlong("1437316807198") } here mongodb query give me count of records "audittime" field boundaries of 100 milliseconds: db.compliance.aggregate([ {$project: { id: 1, rectype: 1,

ios - Turn off email notification - iTunes Connect -

Image
anyone know way disable email notification when app status changes? have 10+ internal testers , don't want them spammed email whenever app status changed. edit: users have no territories in options notification tab. this can done setting itunesconnect -> users , roles -> user name -> notifications -> app status reports "no territories" hope helps. kind regards, mukund

sql - Select No Rows If Any Row Meets A Condition? -

how can select no rows if row in result set meets condition? for instance: id|somecolumn|indicator 1 | test | y 1 | test1 | y 1 | test2 | x 2 | test1 | y 2 | test2 | y 3 | test1 | y say wanted select rows id = 1 unless there row indicator = x currently doing this select * sometable id = 1 , indicator = 'y' , id not in (select id indicator = 'x') but feels clunky , feel there better way doing this. there or being overly sensitive something ? select * sometable id = 1 , not exists (select 1 sometable indicator = 'x') or, if want x discriminate on same id: select * sometable t1 t1.id = 1 , not exists (select 1 sometable t2 t1.id = t1.id , indicator = 'x')

Bootstrap Why are my columns wider than the container -

i can't figure out why 4 columns put wider container in. can tell me how fix code group of column fits inside parent container? thanks. <div class="container"> <div class="row"> <div class="col-md-3"> <a href="#" class="btn">button</a> </div> <div class="col-md-3"> <a href="#" class="btn">button</a> </div> <div class="col-md-3"> <a href="#" class="btn">button</a> </div> <div class="col-md-3"> <a href="#" class="btn">button</a> </div> </div> </div> body{ margin:0; padding:0; } .container{ padding:0; margin: 0 auto; border:solid 1px blue; width:100%; } .col-md-3{ border:solid 1px red; padding:0; margin:0 auto; } .col-md-3 .btn{ display:block; border: 1

javascript - Is emulation mode in IE11 same as setting meta EmulateIE7 tag? -

for ie11 browser use see message on console : “html1122: internet explorer running in enterprise mode emulating ie8.” searching error code on https://msdn.microsoft.com/query/dev12.query?appid=dev12idef1&l=en-ie&k=k(vs.webclient.help.html1122) displays : “this mode configured management specific sites. if individual user needs turn off on webpage, uncheck enterprise mode option in tools menu. more management of enterprise mode, see documentation.” this fine want control setting meta tag. will adding <meta http-equiv="x-ua-compatible" content="ie=emulateie7"> head have same affect "running in enterprise mode emulating ie8" ? no. using content="ie=8" similar results not same. enterprise mode ie (emie) special mode designed provide greater compatibility ie8 possible using x-ua-compatible. ie8 standards mode introduced ie9 , organizations able use migrate legacy apps. other organizations struggled, however

mysql - PHP mySQLi prepare fails with duplicate column '?' -

i attempting prepare statement mysqli $stmt = $mysqli->prepare("insert high_priority `user` (`firstname`, `lastname`, `department`, `email`) select * (select ?,?,?,?) tmp not exists ( select `email` `user` `email` = ? ) limit 1;"); if (!$stmt) { printf('errno: %d, error: %s', $mysqli->errno, $mysqli->error); die; } $statementreturncode = $stmt->bind_param("sssss", $ssofirstname, $ssolastname, $ssodepartment, $ssoemail, $ssoemail); if (!$statementreturncode) { printf('errno: %d, error: %s', $stmt->errno, $stmt->error); } $stmt->execute(); $stmt->close(); when run receive following error: errno: 1060, error: duplicate column name '?' i've been able bind in fashion in past, i've never tried bind same column twice in different location in query (email). how can use same value email in 2 different locations, or different issue? to clarify being done query: this query run frequently. i

php - Disable session in Laravel -

i developing stateless resful api application, not need sessions @ all. i removed line \illuminate\session\middleware\startsession::class, protected $middleware = []; in \app\http\kernel.php have removed session_drive .env file. getting following error: runtimeexception in request.php line 756: session store not set on request. how can turn off sessions in laravel 5? remove illuminate\foundation\http\middleware\verifycsrftoken , illuminate\view\middleware\shareerrorsfromsession classes middleware too. these features require sessions. not required i'd suggest setting session driver array , if features using require sessions feature can @ least work without throwing errors. array driver, suggests, stores session data in standard php array erased request completed.

c# - Querying a list to find the count of an ID and merge the contents of two similar IDs -

i have generic c# list list<object> results has several fields several rows of data in follows list<object> results data: trdid date price seller buyer side 1000 7/23/2015 1 abc null 2 1000 7/23/2015 1 null xyz 1 1002 7/22/2015 1.5 null abc 1 1002 8/22/2015 1.5 null abc 1 1002 7/22/2015 1.5 xyz null 2 1002 8/22/2015 1.5 xyz null 2 1010 8/23/2015 2 acb null 2 1010 8/23/2015 2 null pqr 1 the above list has records ids repeated , want merge records ids repeated twice. , 2 records same ids have same values except seller , buyer seller null when side=1 , buyer null when side=2 , merge them single record replacing null values subsequent other side , resultant list follows expected results trdid date price seller buyer 1000 7/23/2015 1 abc xyz 1010 8/23/2015 2 acb pqr as can see above results i

How to remove unhashable duplicates from a list in Python? -

my data this: [{u'webpath': u'/etc/html', u'server_port': u'80'}, {u'webpath': [u'/www/web'], u'server_port': u'80'}, {u'webpath': [u'/www/web'], u'server_port': u'80'}, {u'webpath': [u'/www/shanghu'], u'server_port': u'80'}, {u'webpath': [u'/www/shanghu'], u'server_port': u'80'}, {u'webpath': [u'/www/www/html/falv'], u'server_port': u'80'}, {u'webpath': [u'/www/www/html/falv'], u'server_port': u'80'}, {u'webpath': [u'/www/www/html/falv'], u'server_port': u'80'}, {u'webpath': [u'/www/falvhezi'], u'server_port': u'80'}, {u'webpath': [u'/www/test10'], u'server_port': u'80'}, {u'webpath': u'/etc/html', u'server_port': u'80'}, {u'webp

css - How to make the items to overflow into columns? -

i have div place inside foreach loop records 1 one in column, this: aaa bbb ccc ddd eee the problem box has static height, , elements go outside of div, while want on overflow: aaa ddd bbb eee ccc how can this? you try flexbox , add align-content: flex-start; if need items positioned @ beginning of container. browser support tables, , vendor prefix details here . example div { display: flex; flex-flow: column wrap; border: 1px solid red; height: 60px; } <div> <span>aaa</span> <span>bbb</span> <span>ccc</span> <span>ddd</span> <span>eee</span> </div>

google maps - Cant get polygons to display in primefaces -

ok using primefaces gmap in order display multiple polygons retrieved database, cant display on page, know coordinates being passed in correctly , code code similar showcase on primefaces http://www.primefaces.org/showcase/ui/data/gmap/polygons.xhtml stumped. here backing bean code @postconstruct public void init() { try { class.forname("com.mysql.jdbc.driver"); dbconn = drivermanager.getconnection("jdbc:mysql://localhost:3306/demeter2.0", "root", "root"); } catch (sqlexception ex) { logger.getlogger(animal.class.getname()).log(level.severe, null, ex); } catch (classnotfoundexception ex) { logger.getlogger(animal.class.getname()).log(level.severe, null, ex); } preparedstatement ps = null; try { if (dbconn != null) { string sql = "select st_astext(markers) paddock idpaddock > 0"; ps = (preparedstatement) dbconn.preparestatement(sql);

nlp - Store large text corpus in Python -

i trying build large text corpus wikipedia dump . represent every article document object consisting of: the original text: string the preprocessed text: list of tuples, each tuple contains (stemmed) word , position of word in original text some additional information title , author i searching efficient way save these objects disk. following operations should possible: adding new document accessing documents via id iterate on documents it not necessary remove object once added. i imagine following methods: serializing each article separate file, example using pickle: downside here lots of operating system calls store documents single xml file or blocks of documents several xml files: storing list represents preprocessed document in xml format uses lot of overhead , think quite slow read list xml using existing package storing corpus: found corpora package, seems fast , efficient, supports storing strings plus header including metadata. putting preproce

installation - Visual Studio 2015 Setup Blocked -

Image
i @ setup blocked trying install vs 2015 on win 7 x64 i had ctp version installed, have uninstalled it, ran reg clean, manual search , removed key vs 2015 or version=14, stil error. :-( from log file: condition 'currentoperation = "install" , (communitycore_version14 < v14.0.23104.0) , (professionalcore_version14 > v0.0.0.0) , (professionalcore_version14 < v14.0.23104.0) , not(professionalcore_version14 = v14.0.23107.0) , (ultimatecore_version14 = v0.0.0.0)' evaluates true . any ideas ? i found , downloaded old ctp, installed again , uninstalled using /uninstall /force flags it solve problem.

internet explorer 8 - Merging media queries, using SASS and Breakpoint (Respond-To) -

using sass , respond-to (breakpoint) produces .css file multiple media queries, not merged. not big deal, in ie8, using css3-mediaqueries.js, cause ie8 crash. css3-mediaqueries.js add style tag every mediaqueries, , ie8 can't 32... how can merge media queries automatically? thanks generally, multiple media queries not big deal gzip being used compress css when passed server client. to enable media queries support in ie7 , 8, i've been succesfully using respond.js . see small guide how combine respond.js selectivizr: https://stackoverflow.com/a/16732064/901944

vba - Select cells in Excel based on cell content -

Image
i'm working excel trying write macro in vb applications , use help. my goal: export 1000s of records toad excel, , run macro place records on sheets based on cell content. example of data: (sorry, i'd post image inline, don't have enough reputation) explanation of data: privilege - different roles of users user_name - user name of each user sort_name - last_name, first_name of each user what i'd macro do: in privilege column, select records same priv , corresponding details, cut them, , paste them on new sheet. repeat privilege through end of data. example: select admin rows along user_name , sort_name. cut selected rows, paste on sheet2. select moderator rows along user_name , sort_name. cut selected rows, paste on sheet3. select generaluser rows along user_name , sort_name. cut selected rows, paste on sheet4. additional info: in actual data, there thousands of rows 60 different privileges. so, when run on real data, result in workboo

java - How to apply double line bottom border to a cell in iText -

i need in applying double line bottom border cell , remove other top, right , left borders. able implement dotted line cell borders using below code: class doublecell implements pdfpcellevent { public void celllayout(pdfpcell cell, rectangle position, pdfcontentbyte[] canvases) { pdfcontentbyte canvas = canvases[pdfptable.linecanvas]; canvas.setlinedash(5f, 5f); canvas.rectangle(position.getleft(), position.getbottom(), position.getwidth(), position.getheight()); canvas.stroke(); } } and pdf code is: paragraph tableparagraph = new paragraph(); tableparagraph.setalignment(element.align_center); pdfptable table = new pdfptable(2); table.getdefaultcell().setborder(pdfpcell.no_border); font total = new font(font.times_roman, 16); pdfpcell cel3a = new pdfpcell(new paragraph("total",total)); pdfpcell cel3b = new pdfpcell(new paragraph("cell 1",total)); cel3a.setborder(rectangle.no_border);

svn - git record-only merge / whitelist known breaks from interbranch diff report -

i have automatic report aimed @ catching missing commits between release branches based on output of tgt=$(git rev-parse --verify "origin/${target_branch}") ref=$(git rev-parse --verify "origin/${reference_branch}") git log --oneline --pretty=format:'%h\x1e%ad\x1e%s%d\x1e%an' --date=short --cherry-pick --right-only --no-merges "${tgt}...${ref}" which works nicely 99% cases. though, because of gentle human touch post-merge/post-cherry-pick there breaks. want "white list" post manual validation keep report in clean pass-good/fail-bad shape not requiring manual judgement. with subversion have done merge --record -c<commit-id> ... shut svn --show-revs eligible up. is there way in git (not storing meta-information outside git repository)?

multithreading - thread overwritten when new socket connects (Server/Client) multithread java -

i have cluedo game uni, have server class , clients connecting. each client connecting want start own serverthread socket of client connecting. thread listens incoming messages , tells server class send them client(s). problem: each time new client connects overwriting serverthread there 1 serverthread , have 1 each client. send json messages between clients , right receive message in serverthread reads last connected socket. how can solve this? added accept method in server guess mistake there anywhere. help! mauritius server public void accept() throws ioexception{ while(true){ socket socket = serversocket.accept(); runnable r = new serverthreadhandler(socket); thread t = new thread(r); t.start(); } } serverthreadhandler: public class serverthreadhandler implements runnable { static socket socket=null; protected user client; //private static int i; private static bufferedreader in;

hashtags for posted yammer messages using yammer REST API -

for existing yammer messages, there way create tag (i.e., hashtag) programmatically using yammer rest api. uri: https://www.yammer.com/api/v1/messages/about_topic/:topic_id.json accepts requests. you have include #yourhashtag in new reply.

javascript - how to display checked values in checkbox using angular array? -

i've accomplished selecting htc in home page , coming page. want display whether selected store value , severdata match (in case need show true). during on submit event, want pass selected values. have tried code below, not working me. $scope.selctedstores =window.localstorage.getitem("selectedservices"); console.log($scope.selctedstores); //console getting htc var serverdata = ["nokia", "htc", "samsung"]; $scope.items = []; (var = 0; < serverdata.length; i++) { var modal = { name: serverdata[i], selected: false }; $scope.items.push(modal); } $scope.check = function() { var checkeditems = []; (var = 0; < $scope.items.length; i++) { if ($scope.items[i].selected) { checkeditems.push($scope.items[i].name); } } console.log(checkeditems); } html <div ng-control

javascript - Load More Posts Ajax Button in Wordpress -

Image
i've had through old questions , tried many of different methods there seems to this. closest i've got working 1 here: how implement pagination on custom wp_query ajax i've tried , doesnt work. absolutely nothing changes on page. if inspect load more button , click it, jquery making load more button action changes <a id="more_posts">load more</a> <a id="more_posts" disables="disabled">load more</a> doesnt seem right me anyway. it's not adding posts, think i'm missing simple life of me can't work out. the code in template file is: <div id="ajax-posts" class="row"> <?php $postsperpage = 3; $args = [ 'post_type' => 'post', 'posts_per_page' => $postsperpage, 'cat' => 1 ]; $loop = new wp_query($args); while ($loop->have_posts()) : $loop->the_post(); ?> <div class

python - How to update a graph using matplotlib -

i'm using panda , matplotlib draw graphs in python. live updating gaph. here code: import matplotlib.pyplot plt import matplotlib.animation animation import time import numpy np import mysqldb import pandas def animate(): conn = mysqldb.connect(host="localhost", user="root", passwd="", db="sentiment_index", use_unicode=true, charset="utf8") c = conn.cursor() query = """ select t_date , score mytable t_date between date_sub(now(), interval 2 day) , now()""" c.execute(query) rows=c.fetchall() df = pandas.read_sql(query, conn, index_col=['t_date']) df.plot() plt.show() animate() i thought using funcanimation didn't right result. please? the documentation bit light on explanation of how use funcanimation. however, there examples in gallery , blog tutorials, such jake vanderplas's , sam dolan's pdf . this example jake vanderplas'

device - usb: why my f_uvc doesn't answer GET_DEF request? -

i need implement uvc1.5 spec in device, choose linux3.4 kernel, , want use drivers/usb/gadget/webcam.c function driver. doesn't function properly. according signals captured wireshark, when host sends get_def request device, device answer -enoent results in failure enumeration. i find out when composite.c receives kind of requests, forward them f->set_up continue. the main part of f->set_up is: uvc->event_setup_out = !(ctrl->brequesttype & usb_dir_in); uvc->event_length = le16_to_cpu(ctrl->wlength); memset(&v4l2_event, 0, sizeof(v4l2_event)); v4l2_event.type = uvc_event_setup; memcpy(&uvc_event->req, ctrl, sizeof(uvc_event->req)); v4l2_event_queue(&uvc->vdev, &v4l2_event); the call of v4l2_event_queue puzzles me: handle event? didn't see code doing such event related initialization work..... and question how handle event properly, can answer get_def request ? it

html - CSS - Flexbox - inline list when the text fits -

Image
i've got list of radio buttons structured this: and i'd use flexbox display them horizontally when there's enough space, follows: however, stands, i'm using min-width media query perform breaking, text overflow can occur: .radio-btn-label { width: 100%; height: 40px; } @media screen , (min-width: 900px) { .radio-btn-group { display: flex; } is there constraint can put on either individual flex children, or on container, prevent flex layout causing text overflow? at moment, html structure follows: <div> <label class="radio-btn-label"> <input type="radio"> <div class="label-text">foo</div> </label> </div> the .label-text class styled, , gives border , background list element. (this can use input[type='radio']:checked + .label-text selector style differently when it's button selected). css can't define if element overflow. combi

MongoDB server on Ubuntu, doesn't send acknowledgment on insert -

using ubuntu mongodb server (mongo version 3.0.4, ubuntu - 14). of inserts never return acknowledgment. reason that, , how can fixed? document written db collection. happens on ~1/10,000 documents. mongodb provides different levels of write concern better address specific needs of applications. clients may adjust write concern ensure important operations persist entire mongodb deployment. for other less critical operations, clients can adjust write concern ensure faster performance rather ensure persistence entire deployment. http://docs.mongodb.org/manual/reference/write-concern/ if want ensure receive acknowledgment on insert can put w param > 1 or " majority " (enough in cases). important: if set w number greater number of set members hold data, mongodb waits non-existent members become available, means mongodb blocks indefinitely.

c# - WPF MVVM async loading notify -

i have 2 views in window 1 of them load data asynchronously. how can notify second view data loaded , need update data in label? make singleton callback? mainwindow.xaml <grid> <grid> <grid.columndefinitions> <columndefinition></columndefinition> <columndefinition></columndefinition> </grid.columndefinitions> <views:firstview grid.column="0"></views:firstview> <views:secondview grid.column="1"></views:secondview> </grid> </grid> firstview.xaml <grid> <grid.columndefinitions> <columndefinition></columndefinition> <columndefinition></columndefinition> </grid.columndefinitions> <button grid.column="0" content="button" horizontalalignment="left" verticalalignment="top" width="75" command=

javascript - Login with google using google plus api on website for UserInfo and contacts using contact api -

i have implemented login google using google plus api. have achieved basic steps still have doubts can errors project in coming future or also. what have accomplished : got google user profile info. got email id got contacts of google logged in account. problems , doubts facing are: once logged in using google account on clicking button in website , logout website,then unable again login in website using google login button google login button doesnt perform event , not getting error on browser console. currently have used attribute approval: force ,till time on clicking login button if multiple gmail ids logged in ask through id want login.but here each time approval popup irritating user if he/she using same id login. so, want remove approval:force ,but if application reloads api gets automatically called,and start fetching information. need should still ask me account want login

javascript - AJAX POST Methods In HTML -

i trying update server database using ajax calls 2-dimensional array each time add more fields, ignores first fields updates last field. can please? in case phonework field being updated. function update_user(){ //get form data //there many ways data using jquery (you can use class or id also) $.ajax({ jsonp: 'jsoncallback', datatype: 'json', type: 'post', cache:false, beforesend: function() {$.mobile.loading('show')}, complete: function() {$.mobile.loading('hide')}, crossdomain: true, url: 'https://testing.vle.getsmarter.co.za/webservice/rest/server.php', data: { 'wstoken': '**************', 'moodlewsrestformat': 'json', 'wsfunction': 'core_user_update_users', 'users[0][id]': '2328', 'users[0][firstname]': document.getelementbyid('name').value, 'users[0][lastname]': document.getelementbyid(

Statistics for people's shoppings -

i building project (website) on people's shopping (stuff stored in refrigerator) . need generate automatic shopping cart based on people's shopping . example if person buys every week 1 bottle of milk , website offer person buy milk once week (if there no milk in refrigerator) . storing shopping history of each family. calculating shopping cart need generate statistics formula . have no clue how it. because there might scenarios (for example birthday) , when family buy more products needed, , make me false data statistics. want ignore such scenarios. has idea how , statistics should use? pseudocode assuming customer had account , database mysql every purchase must save customerid, product id/name ,date of purchase,comment(optional) table (e.g. purchased table) customer has own table includes @ least personal info(e.g. customer table) lets customer browses product (viewing website) • customer clicks product • system/server counts number of purchase i