Posts

Showing posts from February, 2010

SQL Server SSD vs HDD performance -

so i'm doing performance comparison between ssd , hdd sql server insert statements. i'm inserting 2,000 columns worth of data across 4 different tables. for each record insert 1 row in each table. i tested on 1 machine ssd main hard drive running sql server process , database file on secondary hdd drive. i tested on machine ssd drive has both sql server process , actual db file. i have expected machine database field on hdd slower machine on ssd. is behavior i'm seeing expected? if why?

How to use button through border in windows phone 8 -

this code block <grid> <button name="button" click="button_click"/> <border background="black" opacity="0.2"/> </grid> i want use button under border layer it's not possible because border has own tap event there way use button click event when border on top of it? just set ishittestvisible property of border false: <grid> <button name="button" click="button_click"/> <border background="black" opacity="0.2" ishittestvisible="false" /> </grid>

python - linking ipopt against openblas -

currently, trying build ipopt linking against openblas. downloaded openblas source , did make in parent directory. the configure script of ipopt has several options link against blas: i tried ./configure --with-blas="-l/home/moritz/build/coinipopt_test/thirdparty/openblas-0.2.14/libopenblas.so" but error checking whether user supplied blaslib="-l/home/moritz/build/coinipopt_test/thirdparty/openblas-0.2.14/libopenblas.so" works... no configure: error: user supplied blas library "-l/home/moritz/build/coinipopt_test/thirdparty/openblas-0.2.14/libopenblas.so" not work any tips how achieve want ? finally, make conda package. have installed openblas anaconda. same error message if link against installed libopenblas.so managed work. had install openblas directory of choice by make install prefix=/home/....../ aferwards compiled ipopt using ./configure --with-blas-incdir="-l/home/.../openblas/include/" --with-blas-lib=...

passing a variable string through a textfield for a digital clock in java fxml -

im building stop watch digital , analog clock having trouble printing digital clock value because im unsure how pass string fxml. why when try id="digitaltext" textfield in fxml program fails if write using text="00:00" work properly(just text 00:00 though no updating digital clock of course). have hoped giving id print value inside it. the controller package tds7xbstopwatchfxml; import java.awt.textfield; import java.net.url; import java.util.resourcebundle; import javafx.animation.animation; import javafx.animation.keyframe; import javafx.animation.timeline; import javafx.event.actionevent; import javafx.fxml.fxml; import javafx.fxml.initializable; import javafx.scene.image.image; import javafx.scene.image.imageview; import javafx.util.duration; public class fxmldocumentcontroller implements initializable { @fxml private imageview clockface; @fxml private imageview hand; @fxml private textfield digitaltext; string digital; double rotation...

asp.net mvc - JQuery UI datepicker not working in Chrome -

i using jquery ui date picker in asp.net mvc app. works fine in ie in chrome default date picker visible, when use jquery ui doesn't add date box. i have several options on here possible solutions nothing works. the viewmodel is: [required] [display(name = "date of birth")] [datatype(datatype.date)] [displayformat(dataformatstring = "{0:yyyy/mm/dd}", applyformatineditmode = true)] public datetime dateofbirth { get; set; } the view is: <div class="form-group"> <div class="row"> <div class="col-md-3 col-md-offset-1"> @html.labelfor(model => model.dateofbirth, htmlattributes: new { @class = "control-label" }) @html.editorfor(model => model.dateofbirth, new { htmlattributes = new { @class = "form-control", placeholder = "01/12/80" } }) ...

html - How can I make a div with a box-shadow overlay its h1 child element? -

i have div box-shadow , h1 inside, shadow doesn't cover h1 here code: h1 { position: absolute; top: 50%; left: 44%; -webkit-transform: translate(-44%, -50%); transform: translate(-44%, -50%); margin: 0; font-size: 120px; text-align: center; } #div{ width:100%; box-shadow:inset 0 0 0 1000px rgba(255,0,0,0.5); height:400px; } <div id="div"><h1>hi</h1></div> it appears question want div shadow cover h1 . to accomplish apply negative z-index h1 . h1 { z-index: -1; } demo: http://jsfiddle.net/rzhfqb5y/ the shadow covers h1 .

actionscript 3 - New as3 project framework (mvc)! Do you want to test it? -

i created actionscript3 framework myself. because hate code out of head. separated in different libs, can combined. whole code documented , docs including examples. the main usage mvc project framework , @ point, when can release it. still want work on extend , improve it. , point need little help. i'm pretty sure find issues in it. in understanding of it, way use or, in worst case, bug in code. so if to, here link: http://codeboxes.com/ and way: published under mit licence, can ever fun want it. ;) not open source! thank commenting , viewing question help. said has valid point. close , think opensource thingy.

python - Whats the correct list comprehension syntax for this -

if have 2 lists: e = [3,1,5,8] , w = [1,2,4] and want go in , check element of e evenly divisible every element of w, how do in list comprehension? using 2 lists, 8 should returned since 8 % each in w give zero. in terms of loop i'm thinking of like: for in e: j in w: if % j == 0: print but incorrect! [i in e if all(i % j == 0 j in w)]

sendmail not sending subject and message body -

i using send email. email being sent doesn't have subject , message in it. have tested ${mail_subject} , ${message} have correct values. echo "from: ${mail_from} \nto: ${mail_to} \nsubject: ${mail_subject} \n${message}" | /var/qmail/bin/sendmail -f ${mail_from} ${mail_to} can let me know how can fix issue? i'd call duplicate of https://unix.stackexchange.com/questions/168232/what-is-the-format-for-piping-a-message-into-sendmail , there seems mistake in line well. you may need use -e option echo , per link above. manpage: -e enable interpretation of backslash escapes note don't have problem on os x, , not apply bsd. doesn't hurt either. there needs 2 newlines between subject line , mail message. is, empty line. thus, following may work properly: echo -e "from: ${mail_from} \nto: ${mail_to} \nsubject:${mail_subject}"\ "\n\n${message}" | /var/qmail/bin/sendmail -f ${mail_from} ${mail_to}

python - Positions of substrings in string -

i need know positions of word in text - substring in string. solution far use regex, not sure if there not better, may builtin standard library strategies. ideas? import re text = "the quick brown fox jumps on lazy dog. fox. redfox." links = {'fox': [], 'dog': []} re_capture = u"(^|[^\w\-/])(%s)([^\w\-/]|$)" % "|".join(links.keys()) iterator = re.finditer(re_capture, text) if iterator: match in iterator: # fix position context # (' ', 'fox', ' ') m_groups = match.groups() start, end = match.span() start = start + len(m_groups[0]) end = end - len(m_groups[2]) key = m_groups[1] links[key].append((start, end)) print links {'fox': [(16, 19), (45, 48)], 'dog': [(40, 43)]} edit: partial words not allowed match - see fox of redfox not in links. thanks. if want match actual words , strings contain ascii: text...

How to get the file extension in grails? -

i started working on grails , want know how extension of file. ex: test.txt. want check extension(txt)? clue? here's way. using regular expression. def filename = 'something.ext' def matcher = (filename =~ /.*\.(.*)$/) if(matcher.matches()) { def extension = matcher[0][1] if(extension in ['jpg', 'jpeg', 'png']) { // go println 'ok' } else { println 'not ok' } } else { println 'no file extension found' }

c# - Change data from UI with data binding -

my understanding data binding in windows 10 programming gui can reflects data change , can manipulate data. wrong here? i have list of customized data defined in app. public static observablecollection<screen> screens; the structure of screen like public class screen : inotifypropertychanged { private string name; public string name { { return this.name; } set { if (this.name != value) { this.name = value; this.notifypropertychange("name") } } } public bool enabled { /* same name*/ } public event propertychangedeventhandler propertychanged; public void notifypropertychanged(string propname) { if (this.propertychanged != null) { this.propertychange(this, new propertychangeeventargs(propname)); } } } in 1 of page, let's page1, define listbox in xaml <listbox name="scree...

javascript - Make a hamburger ID work in two headers -

i creating clone of header , when scroll reach height, clone version display. works, want. problem trying “hamburger” action work in both headers. works in first section. need working in section 2 also. know have used id (“trigger-overlay”), should used 1 time , unique. is correct , reason why not working? guys know workaround fix problem? i need id because of more complex code in script, if it’s not possible keep in way. appreciate here. see jsfiddle html <section id="one"> <header class=""> <a id="trigger-overlay" class=""><span class="hamburger"></span></a> </header> </section> <section id="two"></section> css section { height:100vh; } #one{ background-color:#0097a7; } #two{ background-color:#00bcd4; } .hamburger, #trigger-overlay .hamburger:before, #trigger-overlay .hamburger:after { cursor: pointer; background-color...

Is Plone 5 multilingual? -

is version 5 of plone having official multilingual solution work? did try plone 4 no multilingual solution official or working properly. hope plone 5 fix problem. plone.app.multilingual standard part of plone 5. after installing plone 5, activate via "add ons" control panel of site setup. use "languages" control panel set available languages , translation parameters. for earlier versions of plone, install products.linguaplone via usual add-on package mechanisms. while linguaplone not ship plone 4.x, well-supported content-translation mechanism , work (though plone.app.multilingual better). translation of plone's user interface not require linguaplone; meant support content translation. both solutions support adding translation support custom content types.

Retain Android Application info after crash -

i created custom application class keep global informations of app. i need informations after application restarts crash. don't need store informations in disk because info user current session, if app crashed, should start user before crash. i thought in 2 ways solve problem: 1-track variables changes , persist in sharedpreferences 2-always save in activity saveinstance , retain savedinstancebundle the problem solution 1 overhead in every change. problem solution 2 need serialize every info. do guys know other way solve problem? need store when app crashs , load after starting crash. in 2 scenarios. i'm using following code track whenever app crashes, can show better crash screen user, , allows me send information crash server later debugging. thread.setdefaultuncaughtexceptionhandler(new thread.uncaughtexceptionhandler() { @override public void uncaughtexception(thread thread, throwable ex) { //get information , save information } }...

javascript - Css/Jquery Slide Up Panel -

i trying make slide panel reveals hidden menu css/jquery if @ link http://www.responsivefilemanager.com/filemanager/dialog.php notice when hover on file, hidden menu revealed. can give me example how can accomplish this? demo html <br/><br/><br/> <div class="container-two-div"> <div class="contain-things back"> </div> <div class="contain-things front"> file </div> </div> css .container-two-div , .contain-things { height:50px; max-height:50px; min-height:50px; overflow:visible; background-color:gray; width:100px; } .front { position:relative; top:-50px; transition: 1s; /* transition when mouse on */ background-color:red; color:white; } .container-two-div:hover .front { top:-100px; }

wordpress - Page pulling content from database fails to update -

forgive me ignorance, simple fix, don't know search. built website client , asked last minute create page pulls content third-party database. i've implemented wordpress plugin able find, randomly, every few days or so, fails update. it's supposed update daily , database api pulls updates on originator's site on schedule, know problem isn't database. might culprit here? caching perhaps? here's page: http://gracechurchrolla.com/bible/ here's originator's page same thing , provided api: https://www.churchofthehighlands.com/bible any ideas?

c++ - Why does this program not receive the expected UDP packets? -

i trying receive udp packet using boost asio. code based off of this blocking udp client example asio documentation . i trying receive bootp-like udp packet c6655 ti dsp, being transmitted in 3 second intervals. have wireshark watching same interface program listening on, , can see packets arriving (see below exact packet data, exported wireshark). packets aren't really coming dsp, captured 1 tcpdump , i'm simulating raspberry pi packeth . however, program not receive packets. has 4 second timeout (since dsp broadcasts every 3 seconds). if hits timeout, prints message effect, otherwise it's supposed print number of bytes received. full (compilable) source code of program follows (about 100 lines). the command being invoked parameters 192.168.5.122 67 4000 , means listen on 192.168.5.122:67 4000 millisecond timeout. edit: in addition code below, tried endpoint: udp::endpoint listen_endpoint(boost::asio::ip::address_v4::any(), atoi(argv[2])); ip address 0.0.0.0...

performance - Finding the Space Complexitiy for these methods -

i'm familiar running time both of following methods o(n). however, i'm not familiar space complexity. since these methods consists of assignment statements, comparison statements, , loops, assume space complexity o(1), want make sure. thank you. //first method public static <e> node<e> buildlist(e[] items) { node<e> head = null; if (items!=null && items.length>0) { head = new node<e> (items[0], null); node<e> tail = head; (int i=1; i<items.length; i++) { tail.next = new node<e>(items[i], null); tail = tail.next; } } return head; } //second method public static <e> int getlength(node<e> head) { int length = 0; node<e> node = head; while (node!=null) { length++; node = node.next; } return length; } as described in this post , space complexity related amount of memory used algorithm, depe...

C#: Check particular attribute key-value pair is present using linq -

i want check whether particular attribute key-value pair present using linq. using following code check: bool keypresent = xdocument.element("nosqldb").element("elements").elements("key") .where(el => el.attribute("id").equals(key.tostring())) .any(); my xml looks below: <?xml version="1.0" encoding="utf-8" standalone="yes"?> <nosqldb> <keytype>system.int32</keytype> <payloadtype>a</payloadtype> <elements> <key id="1"> <name>element</name> <descr>test element</descr> <timestamp>2015-10-02t23:54:07.6562371-04:00</timestamp> <children> <item>1</item> <item>2</item> <item>3</item> </children> <payload> <item>cse681</ite...

javascript - Issue while rendering MDL text field with React.js -

i building simple login page using google's material design lite web framework , using react.js handle ui logic. i experiencing strange issue: input text box floating label works fine when render without react, doesn't work when rendered through react class. my code looks like: var login = react.createclass({ render: function(){ return( <div classname="mdl-grid"> <div classname="mdl-cell mdl-cell--2-col"></div> <div classname="mdl-cell mdl-cell--8-col"> <form> <div classname="mdl-textfield mdl-js-textfield mdl-textfield--floating-label"> <input classname="mdl-textfield__input" type="text" id="sample3" /> <label classname="mdl-textfield__label" htmlfor="sample3">text...</label> ...

objective c - iOS central writing is not permitted -

i ios developer. can take value arduino sensor. cannot send message using following method. [peripheral writevalue:datatowrite forcharacteristic:characteristic type:cbcharacteristicwritewithresponse]; " datatowrite " value alloc using nsstring * nsstring* data = @"1"; nsdata* datatowrite = [data datausingencoding:nsutf8stringencoding]; and following code full code of "discovercharacteristics in service" //discover char -(void)peripheral:(cbperipheral *)peripheral diddiscovercharacteristicsforservice:(cbservice *)service error:(nserror *)error { if (error) {nslog(@"discover_char - error");return;} nsstring* data = @"1"; nsdata* datatowrite = [data datausingencoding:nsutf8stringencoding]; (cbcharacteristic * characteristic in service.characteristics) { nslog(@"discover_char - characteristic : %@",characteristic); [peripheral writevalue:datatowrite forcharacteristic:characteristic ...

How To setup Azure DNS server -

i want change name-server of domain, azure websites services offer cname , not name-server, told me can host our dns on azure using virtual machine,, here can provide steps create dns server on azure , how setup name-servers out of it? this isn't direct answer question more suggestion. you can host dns records in azure using azure dns (currently in public preview). here more information service https://azure.microsoft.com/en-us/services/dns/ , steps required service working https://azure.microsoft.com/en-us/documentation/articles/dns-getstarted-create-dnszone/ .

java - new error: Actual and formal argument lists differ in length -

trying finish assignment first year comp class. far everything's been okay, can't figure 1 error out. wondering if out here? tried changing variables doubles , didnt work. import java.util.scanner; public class cellphoneprogram { public static scanner keyboard = new scanner(system.in); //declare x , y coordinates each city public static double xa = 100, xb = 100, xc = 340, xd = 230, ya = 360, yb = 360, yc = 250, yd = 140; public static int getrange(int city) { int range = 0; system.out.println("what maximum distance (in km) center of city " + city + " may travel without losing service?"); range = keyboard.nextint(); return range; } /* error occurs here */ public static double distance(double xf, double xi, double yf, double yi) { double distance = 0; distance = math.sqrt((math.pow(xf - xi)) - (math.pow(yf - xi))); return distance; } public static void main(string[] args) { i...

graph - Minimum Weight Path -

"given connected undirected weighted graph, find maximum weight of edge in path s t maximum weight of edges in path minimum." this seems floyd–warshall algorithm problem. there approach faster o(v^3)? i submit breadth first search (bfs) determine whether s connected t path can run in o(v) time, since each vertex need visited once. i propose therefore, solution problem sort edges weight, , while bfs succeeds in finding path s t remove highest weighted edge graph the last edge removed before bfs fails maximum weighted edge you're looking for. total running time o(e log e) sort edges weight, plus o(ve) run bfs until removing edge disconnects graph.

android - Change TextView on Button Click -

i working on shopping cart app. in there plus , minus button adding items in cart. if user clicks on plus button there textview should change 0 1 or more same things should done if user click on minus button value of textview should decrease. i changed value increase , decrease more 1 row @ once. @suppresslint("inflateparams") public class productlistadapter extends baseadapter { private activity activity; private layoutinflater inflater; private list<product> products; private productlistadapterlistener listener; int t; int count = 0; context context; list<product> rowitems; string[] result; viewholder holder; protected static final string tag = "reviewadapter"; imageloader imageloader = appcontroller.getinstance().getimageloader(); private hashmap<integer, integer> mcounthash; public productlistadapter(activity activity, list<product> feeditems, productlista...

parse.com - Parse rate limit - what counts towards this limit? -

recently, have been hitting parse rate limit every time servers try upload data parse. not clear me why. i use batch inserts, batch updates , batch deletes. throttle batch operations (0.25 seconds between operations) yet still in logs: 10/03/2015 04:05:17 loading parse 10/03/2015 04:05:50 inserted: 851 10/03/2015 04:05:50 updated: {u'code': 155, u'error': u'this application performed 1802 requests within past minute, , exceeded request limit. please retry in 1 minute or raise request limit.'} what not clear whether batch still counts individual operation or parse @ 50 inserts (for example). if what's point? if not treat batch individual operations how can 1802 requests broken down batches of 50 in 0.25 secs bursts hit limit? and before ask, no app tester trying pull data asleep!!! i followed/read various links including this 1 , this 1 still puzzled. any advice appreciated. thanks! according parse's plan faq : batched r...

Uncomment java code in eclipse shortcut -

i comment java code multiple lines using shortcut ctrl + shift + / . : /* * system.out.println("shree"); test123 t = new test123(); * * int result = t.mult(5, 5); system.out.println(result); */ but when try uncomment it, looking this. uncomment used ctrl + shift + \ * system.out.println("shree"); test123 t = new test123(); * * int result = t.mult(5, 5); system.out.println(result); my question is, when used shortcut uncomment java code multiple line initial /* , end */ go * (asterix sign) before every line not go. have remove manually , time consuming. so there shortcut give me solution , save time. instead of commenting /* commented code */ , use ctrl + shift + c comments/uncomments each of selected lines separately using // i'm on eclipse mars, used work way in luna well.

excel - Filter table data in function -

i've created dashboard worksheet performs calculations on table of data (alldatamodel). calculations prevent me using pivot tables. i've applied slicer data table date. while table data appears updated, calculated data isn't updating. how calculated fields use filtered table data? example calculation: =sumif(alldatamodel!$b$2:$b$65536,concatenate("*",c27,"*"), alldatamodel!$g$2:$g$65536) a solution can found search keywords excel sumif filtered range . there many sites , videos available explain this. in case should be: =sumproduct((subtotal(9,offset(index(alldatamodel!$g$2:$g$65536,1),row($2:$65536)-row(alldatamodel!$g$2),0)))*(not(iserror(search(c27,alldatamodel!$b$2:$b$65536)))))

javascript - Chart.js, dashed line, full width chart -

Image
is possible make dashed line on chart.js line chart? , make chart full width? see attached mockup. this current code (just simple example): var ctx = document.getelementbyid("main-line-chart").getcontext("2d"); var line = ctx.setlinedash([5, 15]); var gradient = ctx.createlineargradient(0, 0, 0, 300); gradient.addcolorstop(0, 'rgba(40,175,250,.25)'); gradient.addcolorstop(1, 'rgba(40,175,250,0)'); var data = { labels: ["january", "february", "march", "april", "may", "june", "july"], datasets: [ { label: "my first dataset", pointdot : false, fillcolor: gradient, strokecolor: "#28affa", pointcolor: "#19283f", pointstrokecolor: "#28affa", pointhighlightfill: "#19283f...

android - need to check the icon inside your apk (phonegap application) -

Image
we have created android app using phonegap. when upload app on play store, same error has been shown again , again. although have tried many solutions, still not uploaded. kindly give me suggestions how solve error. thanks. from phonegap documentation : <platform name="android"> <icon src="res/android/ldpi.png" density="ldpi" /> <icon src="res/android/mdpi.png" density="mdpi" /> <icon src="res/android/hdpi.png" density="hdpi" /> <icon src="res/android/xhdpi.png" density="xhdpi" /> </platform> in config.xml also makesure names of images inline above declaration i.e. ldpi.png, mdpi.png , on

html - CSS Selectors - Multiple animations on one trigger -

how can multiple divs transition/animate on 1 hover trigger? see update here: http://jsfiddle.net/hecyn/9/ >> css-line:23 i'm trying here, .inner , .wrap2 rotate on 1 .wrap:hover. not working, when add "+" selector. how can right better. primary question: how can write below: #container:hover + #cube1 + #cube2 + #cube3 { background-color: yellow; } second question: above ok, im kinda trying achieve via css: #:hoveroversomething then{ thing; other thing; next thing; } bear me, little new css animations... , net clouded , without specific simple information. cheers. i think try keyframes animation: https://developer.mozilla.org/en-us/docs/web/css/@keyframes something this: .wrap:hover { animation: test-animation 2s linear; } @keyframes test-animation { //you can add many ranges 0% 100% 0% { opacity: 0; } 50% { transform: scale(1.5); } 100% { opacity: 1; } } https://jsfiddle.net/malt4dda/ regarding question: ...

c++ - unordered_map and pointers with value semantics -

i've defined type term accessed pointer has value semantics; 2 different term objects logically equal if have same contents. need use them map keys. a first attempt might unordered_map<term*, int> , doesn't value semantics. needs custom hash , equality comparison functions. (for number of reasons, want define these globally instead of having supply them template arguments in every case.) the custom hash function can iirc defined like namespace std { template <> struct hash<term*> ... but unordered_map compares keys == , can't define custom operators on built-in types, , pointers built-in types. i define wrapper class holds term* , use key. there simpler solution? if @ definition of unordered_map : template< class key, class t, class hash = std::hash<key>, class keyequal = std::equal_to<key>, class allocator = std::allocator< std::pair<const key, t> > > class unordered_map; you c...

java - how can use StaggeredGridView Designe in android? -

how can design in android xml , java, this picture description designe the same problem answered in link . explained usage of staggeredgridview . hope can solve now

java - hibernate insert three tables at once -

Image
i have customer class, orders class , payment class. customer , orders have one-to-many relationship. orders , payment have one-to-many relationship. i think there problem in orders.java (model) can 1 tell me how solve this? this erd: i think class not mapped this orders java class(model) @entity public class orders implements serializable { private integer orderid; private customer customer; private string orderdate; private list<payment> payments; /** * @return orderid */ @id @generatedvalue(strategy = generationtype.auto) public integer getorderid() { return orderid; } /** * @param orderid orderid set */ public void setorderid(integer orderid) { this.orderid = orderid; } /** * @return customer */ @manytoone @joincolumn(name = "cust_id") public customer getcustomer() { return customer; } /** * @param customer customer set */ public void setcustomer(customer customer) { this.customer = customer; } /** * @return orderda...

rtc - Deliver component from 1 stream to another using scm -

i need deliver selected component stream 'a' stream 'b' through rtc scm commands. suggest combination of scm cmd required deliver these changes. have performed task using build definition. please answer related scm cmd only you don't deliver component stream, delivering change set repo workspace stream. see deliver example : deliver changeset 1764 workspace " accept1 " stream " abcstream1 " c:\local-workspaces\hellojazz>scm deliver 1764 -s 1353 -t 1354 delivering changes: repository: https://localhost:9443/jazz/ workspace: (1354) "abcstream1" component: (1365) "accept1 default component" change sets: (1764) ---$ "no comment" 20-aug-2014 10:14 pm changes: ---c- \10\10.txt deliver command completed. see more in scm commands examples .

r - Error: result would exceed 2^31 bytes -

i trying load json file r using rjson. following error message: error in paste(readlines(file, warn = false), collapse = "") : result exceed 2^31-1 bytes my code follows: jsondata <- fromjson(file= "text.txt", unexpected.escape = "skip" ) the file large (3.47 gb) , kaggle, , assume formatted. possible split json file, or stream it? i using mac, sierra 10.12.6 , latest versions of r , rstudio

python - Pandas dataframe: multiply row by previous row -

i have dataframe input: df1 b c 20/08/17 0.0000% 0.0000% 0.0000% 21/08/17 0.0000% 0.0000% 0.0000% 22/08/17 1.0000% 1.0000% 1.0000% 23/08/17 0.0000% 0.0000% 0.0000% 24/08/17 1.9417% 0.9709% 0.9709% 25/08/17 1.8692% 0.9346% 0.9346% and trying following dataframe output: df2 b c 20/08/17 0.0000% 0.0000% 0.0000% 21/08/17 0.0000% 0.0000% 0.0000% 22/08/17 1.0000% 1.0000% 1.0000% 23/08/17 1.0000% 1.0000% 1.0000% 24/08/17 2.9806% 2.0097% 2.0097% 25/08/17 4.9612% 3.0194% 3.0194% where value df2['a'][1]=df2['a'][0]*(1+df1.sum(axis=1))+df1['a'][1] i apply function whole dataframe. could please me on this? this should work expected: df2 = df.copy() in range(df3.index.size): if not i: continue df2.iloc[i] = (df2.iloc[i - 1] * (1 + df.iloc[i].sum())) + df.iloc[...

themes - The website encountered an unexpected error. Please try again later Drupal 7 -

when click on admin menu in drupal 7 , example, " structure" following error : the website encountered unexpected error. please try again later.1 array ( '%type' => 'pdoexception', '!message' => 'sqlstate[hy000]: general error: 1364 field 'item_id' doesn't have default value: insert {queue} (name, data, created) values (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); array ( [:db_insert_placeholder_0] => update_fetch_tasks [:db_insert_placeholder_1] => a:8:{s:4:"name";s:12:"addressfield";s:4:"info";a:6:{s:4:"name";s:13:"address field";s:7:"package";s:6:"fields";s:7:"version";s:7:"7.x-1.2";s:7:"project";s:12:"addressfield";s:9:"datestamp";s:10:"1444254070";s:16:"_info_file_ctime";i:1505036778;}s:9:"datestamp";s:10:"1444254070";s:8:...

SetDims in NTL is not working -

i'm trying use matrix functions in ntl, mat_zz_p . when try set dimension using setdims() fucntion, hangs. working smaller numbers 5 , 10 etc, fails 10000. hangs whole system. here code snippet : int main() { zz p; long int index; cin >> p; zz_p::init(p); mat_zz_p a; long dime = 9999; a.setdims(dime,dime); return 0; }

javascript - Can't get real element height in React -

i need fit text in 2 rows. have react component can't updated height - height after element rendered. component constructor (props) { super(props) this.state = { text: props.text } } componentdidmount() { let element = reactdom.finddomnode(this) let parent = element.parentnode let originaltext = element.innertext let containerheight = parent.offsetheight let temp = originaltext if (containerheight < element.offsetheight) { while(containerheight < reactdom.finddomnode(this).offsetheight) { temp = temp.substr(0, temp.length-1) this.setstate({ text: temp }) i++ console.log(temp,containerheight,reactdom.finddomnode(this).offsetheight); } temp = temp.substr(0, temp.length-4) + '...' this.setstate({ text: temp }) } } render() { return ( <span> {this.state.text} </...

c# - Ninject Portable in Xamarin results in NotImplementedException -

when use portable.ninject in xamarin.forms app, instantiating standardkernel results in notimplementedexception . i can consistently replicate problem follows: create xamarin.forms application (in vs2017: cross platform app (xamarin)) configure use pcl i'm interested in android , sake of brevity, removed other platform projects. add nuget package portable.ninject pcl , android platforms then, in app.xaml.cs try following: public app() { initializecomponent(); //ommitting ninjectmodules brevity var kernel = new ninject.standardkernel(); //exception thrown here mainpage = new navigationpage(new mainview()); } what missing here? currently i'm using portable.ninject version 3.3.1. tried xlabs.ioc.ninject package (which uses portable.ninject) , got same result. for experience same problem: tldr; clean projects, , rebuild. explanation: @ first had added ninject pcl, , had forgotten add android project. although added ninject librar...

scope - Infinite loop when calling $evalAsync within a $watch function (AngularJS) -

i'm following along tero parviainen's book "build own angularjs" , i'm finding trouble understanding 1 of concepts introduces when talking $evalasync. in 1 of examples declares watcher calls $evalasync: it('eventually halts $evalasyncs added watches', function() {   scope.avalue = [1, 2, 3];   scope.$watch(     function(scope) {       scope.$evalasync(function(scope) { });       return scope.avalue;     },     function(newvalue, oldvalue, scope) { }   );   expect(function() { scope.$digest(); }).tothrow(); }); seeing example, expect digest cycle iterate twice through watchers until stopping. in implementation of scope, code runs until digest not dirty or there no more $evalasyncs in queue. scope.prototype.$digest = function () { var ttl = 10; var dirty; this.$$lastdirtywatch = null; { while (this.$$asyncqueue.length) { var asynctask = this.$$asyncqueue.shift(); asynctask.scope.$eval(asynctask.expression); } dirty...

making images communicate with each other Docker -

i have created webapp in docker. webapp uses other docker images such redis, mariadb. these , running locally. have created image of webapp. have 3 images : webapp(which not up), redis , mariadb up. when tried run image of webapp fails start .. unable connect other images (redis , mariadb). how can make webapp image communicate other required images you need create docker network attach containers together. docker network create net then can either start containers network option: docker run --network net ... or if containers running, can connect them network docker network connect net <container-name> once that, containers can communicate each other using container name hostname, example: redis, mongo ...

mathjax - Android MathView Overflows Width of the Parent View -

Image
i using https://github.com/kexanie/mathview , texcode tutorial show mathematics equations in mathview. when open activity, mathview loads after few time. exceeds parent view width when i've set mathview match parent width. tried put mathview inside horizontalscrollview, takes forever load mathview. need solution load mathview inside parent linearlayout. dependency compile 'io.github.kexanie.library:mathview:0.0.6' activity_main.xml <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:padding="10dp" > <scrollview android:layout_width="match_parent" android:layout_height="wrap_content"> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android...

c++ - combined Scharr derivatives in opencv -

i have few questions regarding scharr derivatives , opencv implementation. i interested in second order image derivatives (3x3) kernels. started sobel second derivative, failed find thin lines in images. after reading sobel , charr comparison in bottom of this page , decided try scharr instead changing line: sobel(gray, grad, ddepth, 2, 2, 3, scale, delta, border_default); to line: scharr(img, gray, ddepth, 2, 2, scale, delta, border_default ); my problem seems cv::scharr allows performing first order of 1 partial derivative @ time, following error: error: (-215) dx >= 0 && dy >= 0 && dx+dy == 1 in function getscharrkernels (see assertion line here ) following restriction, have few questions regarding scharr derivatives: is considered bad-practice use high order scharr derivatives? why did opencv choose assert dx+dy == 1 ? if call scharr twice each axis, correct way combine results? using: addweighted( abs_grad_x, 0.5, abs_grad_y, 0.5, ...

java - test case for spring rest controller for post mapping -

i have spring boot application controller logic shown below @restcontroller public class compare { @postmapping(path = "/soon") public boolean compare (@requestbody string json, @requestheader(value="c_code") string old ) { hash hashobj=new hash(); string new=hashobj.(json); if(old.equals(new)) return true; else return false; } } through postman posting string requestbody , string requestheader. string requestbody been sent function called sha() , returned value function compared string of requestheader. tried writing test case thing got errors. @autowired private webapplicationcontext webapplicationcontext; private mockmvc mockmvc; @before public void setup() { mockmvc = mockmvcbuilders.webappcontextsetup(webapplicationcontext).build(); } @test public void testemployee() throws exception { // me write test case here }

javascript - How to reduce the usage of heavy bootstrap css in production? -

i feel bootstrap heavy use in production using more bandwidth. there way short issue ? hope lot ways there. new development had keen interest know .. you can use following methodologies improve site performance while using bootstrap. method 1 : use minified versions of the .css and .js method 2 : use  gzip  compression compress sent client browsers method 3 : use cdn , content delivery networks helping serve commonly used css js contents. can use 1 of bootstrap cdn instructed bootstrap ( https://getbootstrap.com/docs/3.3/getting-started/ ) <!-- latest compiled , minified css --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-bvyiisifek1dgmjrakycuhahrg32omucww7on3rydg4va+pmstsz/k68vbdejh4u" crossorigin="anonymous"> <!-- optional theme --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7...