Posts

Showing posts from August, 2015

php - Codeigniter Remote Database Connection Issue -

a codeigniter project( in windows ) required connect remote mysql database( in linux server ). here database.php configuration. $active_group = 'default'; $active_record = true; $db['default']['hostname'] = 'xxx.xxx.x.xxx'; $db['default']['username'] = 'username'; $db['default']['password'] = 'password'; $db['default']['database'] = 'database'; $db['default']['dbdriver'] = 'mysql'; $db['default']['dbprefix'] = ''; $db['default']['pconnect'] = true; $db['default']['db_debug'] = true; $db['default']['cache_on'] = false; $db['default']['cachedir'] = ''; $db['default']['char_set'] = 'utf8'; $db['default']['dbcollat'] = 'utf8_general_ci'; $db['default']['swap_pre'] = ''; $db['default']...

Magento 1.9 Change Layout Columns -

i want change " /checkout/onepage/success/ " layout 2-colunms left aside block 1-column-layout. i tried change in: app/design/frontend/base/layout/checkout.xml app/design/frontend/rwd/default/layout/checkout.xml but nothing changed. yes i've cleared cache! in backend "system -> configuration -> design -> actual package" " rwd " in use" translation, layout, skin empty. standard "default". please help! in rwd theme go path ' /frontend/rwd/default/layout/checkout.xml ' find ' checkout_onepage_success ' section , replase <action method="settemplate"><template>page/1column.phtml</template></action> to <action method="settemplate"><template>page/2columns-left.phtml</template></action> solve problem....simple.

javascript - How To use js variable into another file -

i have javascript variable has value on-change. want use variable in file calculation. for example have variable in index.php follow: $(function() { $("#sel").on("change", function() { var vall = $(this).find('option:selected').attr('value') alert(vall); }); }); and in file calculate.php have code , want use "vall" variable multiple "$total variable" public function getgrandtotal(){ $quote = mage::getmodel('checkout/session')->getquote(); $total = $quote->getgrandtotal(); $gt = $total * var vall ; // "vall" variable multiply total return mage::helper('checkout')->formatprice($gt); } that should done ajax like: $("#sel").on("change", function() { var vall = $(this).val(); $.ajax({ type:'post', url : "url call", data:{val : vall}, // send vall here val in back...

azure - How to know the complete list of providers and available extensions in ARM template -

i know can find list of available providers , related extensions resources can defined in arm template regards parimi. resource manager providers, regions, api versions , schemas might you're looking for. includes sections on of resource providers , in each of sections gives links rest api docs, schema, , related quickstart templates

c++ - VS 2015 and FLTK Callback issue -

i trying move fltk projects , compile under vs 2015 community edition. while this, getting error. have code below: #include <fl/....> .... class cwindow { private: .... fl_input *_textinputeditor; .... void _cbtextinput(fl_widget *refobject, void *objdata) { // when callback triggered. } public: .... void createwindow() { .... _textinputeditor = new fl_input(....); _textinputeditor->when(fl_when_enter_key); _textinputeditor->callback((fl_callback*)&cwindow::_cbtextinput, this); .... when try compile, error: error c2440 'type cast': cannot convert 'void (__thiscall cwindow::* )(fl_widget *,void *)' 'fl_callback (__cdecl *) this same code compiles mingw 5.x (ide: c::b) under win 7. can me here? want call private method of cwindow class. the signature incorrect. _cbtextinput should static. problem access member variables. static void _cbtextinpu...

php - Sf2 RedirectResponse not working -

i using httpfoundation component in project without using full symfony2 framework. try make redirectresponse if credentials true , redirect user ( like stated in documentation ), return statement not working. i have: use symfony\component\httpfoundation\redirectresponse; $logged = 1; if ($logged == 1) { $response = new redirectresponse('http://google.com/'); return $response; } else { die("not logged"); } nothing happens when execute this. if instead, redirected google: if ($logged == 1) { $response = new redirectresponse('http://google.com/'); echo $response; } why work echo not return ? don't want use echo in class libraries. any solutions? try: $response->send(); instead echo $response; .

c - What is the counterpart to the GetExplicitEntriesFromAcl() Win32 API function? -

the getexplicitentriesfromacl win32 api function allows retrieve explicit entries of file acl. when change entries, convert result new acl using setentriesinacl , apply acl file setsecurityinfo inherited entries seem lost , (changed) explicit entries left. is there counterpart function "setexplicitentriesinacl" replaces explicit entries within acl structure , keeps inherited entries intact? edit1: code sample i'm using code similar following lines acl update: int removeaclaccessrights( handle hfile, psid sidptr, dword accessrights, access_mode accessmode ) { pacl oldacl = null, newacl = null; psecurity_descriptor secdesc = null; pexplicit_access entrylist = null, entryitem; ulong entrycount, entryindex; int r; // pointer existing dacl r = getsecurityinfo(hfile, se_file_object, dacl_security_information, null, null, &oldacl, null, &secdesc); if ( r != error_success ) goto _cleanup; r = getexplicitentriesfro...

python - Multi threaded server send function -

i got multi threaded server code , works when type send client not sending send function work if send data string knows what's problem? #!/usr/bin/env python import socket, threading class clientthread(threading.thread): def __init__(self, ip, port, clientsocket): threading.thread.__init__(self) self.ip = ip self.port = port self.csocket = clientsocket print "[+] new thread started "+ip+":"+str(port) def run(self): print "connection : "+ip+":"+str(port) clientsock.send("welcome server ") data = "dummydata" while len(data): data = self.csocket.recv(2048) print "client(%s:%s) sent : %s"%(self.ip, str(self.port), data) userinput = raw_input(">") self.csocket.send(userinput) print "client @ "+self.ip+" disconnected..." host = ...

swift - Difference between 'for index' and traditional 'for loop' -

i'm new swift , pretty new programming. i'm not sure if it's because it's 2:34 can me identify difference between these 2 loops? the first 1 resulting in values want yet uses (as swift documentation explains) 'traditional c loop' 1 after using seems swift preferred 'for index' loop (which clearer me), problem loop returns every number rather meeting conditional. func findlargestprimefactor(number: int) { var = 2; < number; += { if number/i % 1 > 0 { } else { print(i); } } } findlargestprimefactor(13195); below returning every number 13195 func findlargestprimefactor(number: int) { in 2...number { if number/i % 1 > 0 { } else { print(i); } } } findlargestprimefactor(13195); i've realised how stupid mistakes were, first of have no idea why doing += i, didn't make sense @ all. also, conditional never being met because declared ...

java - How to place configuration file for Tomcat with several virtual hosts? -

i've got tomcat (7 or 8) 2 virtual hosts 2 clones of application should work. each application should have it's own configuration file. , shouldn't placed in *.war - somewhere in server environment. when have single application in tomcat, can place configuration file in <context:property-placeholder location="file:${catalina.home}/conf/myapp.properties"/> this how spring find configuration file due applicationcontext.xml. but when have 2 hosts, should place configuration files in different directories. i've added context attribute in host in server.xml <context docbase="" path="xxx"> <environment name="app.name" value="myapp1" type="java.lang.string" override="false"/> </context> here first host gets environment variable "app.name" "myapp1". second host gets variable "myapp2" value. i've modified but tomcat falls filenot...

Access - How to display cascading dropdown values on table as a part of result data -

i have 2 cascading dropdown boxes (a, b) on access form. when select value dropdown a, dropdown b loaded based on value of dropdown a. once select value dropdown b, table underneath these 2 dropdowns display data 6 different columns. want display value dropdown , dropdown b in table. somehow values both dropdown doesn't display on table. seems both dropdowns hidden on page. don't know how resolve this. thanks could because of settings on dropdown? have deactivated scrolling and/or made number of entries in dropdown less number of items in list?

arrays - Parsing substrings from a string with "sscanf" function in C -

i have gps string below: char gps_string[] = "$gprmc,080117.000,a,4055.1708,n,02918.9336,e,0.00,316.26,00,,,a*78"; i want parse substrings between commas below sequence: $gprmc 080117.000 4055.1708 . . . i have tried sscanf function below: sscanf(gps_string,"%s,%s,%s,%s,%s,",char1,char2,char3,char4,char5); but not working. char1 array gets whole string if use above function. actually have used strchr function in previous algorithm , got work it's easier , simplier if can work sscanf , parameters in substring. by way, substrings between commas can vary. comma sequence fixed. example below gps string example not contain of parts because of sattellite problem: char gps_string[] = "$gprmc,001041.799,v,,,,,0.00,0.00,060180,,,n*" there have been number of comments in other answers stating there number of problems strtok() , suggesting using strpbrk() instead. example of how used can found @ arrays , strpbrk in c i not have...

How to split an 8 character string into groups of two in python -

this question has answer here: split string every nth character? 15 answers looking split simple string of 8 random digits: mystring = "08928192" so read as: mystringx = "08" mystringy = "92" mystringa = "81" mystringb = "92" looking method simple follow , gives me these strings shown. number generated random.rand_range() function earlier own. need arises need way randomly define objects map co-ordinates , 2 other properties( going health , size) resource-management style game working on. rest of code easy enough, part stumped me. many archangelarchitect mystring = "08928192" n = 2 output = [mystring[i:i+n] in range(0, len(mystring), n)] print(output)

jquery - append a button with an action and attributes -

i making table data mysql , display them. user add information , data added , appended using ajax. the problem each line of table contain delete button. , when appending new line, able append button it. but button don't actions until refresh page. if take facebook. when new status or photos added, multiple button actions appended with. how append button action. so in table every delete button should take row id delete it. here scripts: to append button new line: var btn = '<button type="button" id="delete">delete</button>'; $("#before_tr").before("<tr><td>"+name+"</td><td>"+address+"</td><td>"+phone+"</td><td>"+btn+"</td></tr>"); as creating elements dynamically. you need use event delegation . have use .on() using delegated-events approach. delegated events have advantage can process events...

java - How to upload a file using Apache HttpPost -

i've got curl call this: curl -i -x post -h "content-type: multipart/form-data" -f "file=@data_test/json_test.json" http://domain.com/api/upload_json/ all need java implementation call. i've made code, file, appears server, seems null. public static void uploadjson(string url, file jsonfile) { try { httppost request = new httppost(url); entitybuilder builder = entitybuilder .create() .setfile(jsonfile) .setcontenttype(contenttype .multipart_form_data) .chunked(); httpentity entity = builder.build(); request.setentity(entity); httpresponse response = gethttpclient().execute(request); logger.info("response: {}", response.tostring()); } catch (ioexception e) { logger.error(e.getmessage()); } } what proper way build request? closeablehttpclient httpclient = httpclientbuilder.cre...

svg - vue.js: uppercase tagname for filter not recognized -

i trying out vue.js use form inputs change svg-element, example position , filter-value of rect. below part of example, using 2 range inputs. see https://jsfiddle.net/tyk4ltkg/ position not giving problem: y coordinate (ypos) of rect example correctly updated after changing input slider. however, blur-filter not responding. although number gets updates input range dom-element, tag seems converted lowercases (stddeviation), after browser (chrome) seems ignore it. how can fix ? thanks! <div id='app'> <input type='range' v-model='stdev'> <input type='range' v-model='ypos'> <svg id="#mymainsvg"> <defs> <filter id='mymainfilter'> <fegaussianblur in='sourcegraphic' :stddeviation=stdev ></fegaussianblur> </filter> </defs> <rect :y=ypos width=100 height=100 style="filter:u...

ruby on rails - Error running '__rvm_make install', -

i getting errors when try update ruby 2.2.4 or 2.2.3. on osx el capiton searching binary rubies, might take time. no binary rubies available for: osx/10.11/x86_64/ruby-2.3.0. continuing compilation. please read 'rvm mount' more information on binary rubies. checking requirements osx. certificates in '/usr/local/etc/openssl/cert.pem' date. requirements installation successful. installing ruby source to: /users/shishirsapkota/.rvm/rubies/ruby-2.3.0, may take while depending on cpu(s)... ruby-2.3.0 - #downloading ruby-2.3.0, may take while depending on connection... ruby-2.3.0 - #extracting ruby-2.3.0 /users/shishirsapkota/.rvm/src/ruby-2.3.0 - please wait ruby-2.3.0 - #configuring - please wait ruby-2.3.0 - #post-configuration - please wait ruby-2.3.0 - #compiling - please wait ruby-2.3.0 - #installing - please wait error running '__rvm_make install', showing last 15 lines of /users/shishirsapkota/.rvm/log/1454687438_ruby-2.3.0/install.log ./tool/rbinsta...

python - SQLAlchemy not behaving correctly after table dropped -

i have test code creates tables , drops them each test case. however, tests fail after first 1 because relying on code uses sa.table() first , creates new tables if calling method errors nosuchtableerror . however, error not thrown after tables first dropped, though engine correctly reports not exist, , not created again. i've reproduced behavior follows: >>>import sqlalchemy sa >>>from sqlalchemy import * >>>m = metadata() the tables don't exist, calling sa.table here errors expected: >>>t = sa.table('test', m, autoload_with=eng) ... nosuchtableerror: test but if create table , drop it, sa.table not error expected: >>>t = sa.table('test', m, column('t', string(2))) >>>m.create_all(eng) >>>eng.has_table('test') true >>>t = sa.table('test', m, autoload_with=eng) >>>eng.execute('drop table "test" cascade') <sqlalchemy.en...

c# - WPF DataGrid: how to show object with double values -

Image
i have object this: public class mchistructure { [system.runtime.serialization.optionalfield(versionadded = 2)] public double chiv1plus; [system.runtime.serialization.optionalfield(versionadded = 2)] public double chiv1minus; [system.runtime.serialization.optionalfield(versionadded = 2)] public double mv1plus; ... } and have datagrid shows, in first column, variable names and, in second column, double values. know if there possibility hide of values (for example, if 1 negative must hidden) thanks all it code behind application, @ first yo should create model class , populate code-behind. that's all. please, see example: model: public class mchistructure { public string titlefield { get; set; } public double chiv1plus { get; set; } public double chiv1minus { get; set; } public double mv1plus { get; set; } } code-behind of window: public mainwindow() { initializecomponent(); filldatagrid(); } priv...

android - skd manager and Intel HAXM -

Image
hi guys new android studio. trying create new project, , virtual phone won't show , give me error: emulator: error: x86 emulation requires hardware acceleration! please ensure intel haxm installed , usable. cpu acceleration status: hax kernel module not installed! i checked online , seem have install intel haxm. went tools->android->skd manager, , got this... what should do? alright, alternative way install is, have download haxm installer , install externally(instead of 1 provided android studio or ecilpse) intel website. try one. may work. https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager

Remove a comment if user does not exist Ruby on Rails -

i error undefined method 'email' nil:nilclass when try access post comment user has been deleted in db. i wonder: how can remove comments has been created users no longer exists "on fly"? i tried this <%= div_for(comment) %> <% if comment.user.email.nil?%> <% comment.destroy %> <%else%> <p><%= comment.body %></p> <p class="comment-submitted-by"><%= time_ago_in_words(comment.created_at) %> ago <%= comment.user.email %></p> <%end%> but still error. you're still getting error because you've referenced comment.user.email , , user nil . need check comment.user.nil? , or you're @ risk deleting comment because user's email missing (though maybe disallow that): <% if comment.user.nil? %> <% comment.destroy %> cleaning on fly going finicky , cumbersome. looks want dependent: :destroy on user#c...

python - loading titan graph database with mogwai -

im trying start learning gremlin communicate titan db 0.5.4, , since im gonna use mogwai execute the gremlin queries later, thought better learn both of them side side. stuck @ first step. couldn't know how load graph of gods. gremlin query: gremlin> graph = titanfactory.open('titan-berkeleydb-es.properties') while im reading mogwai docs found class: class mogwai.gremlin.base.gremlinmethod(path=none, method_name=none, classmethod=false, property=false, defaults=none, transaction=true, imports=none) gremlin method returns graph element configure_method(klass, attr_name, gremlin_path) sets methods internals im not sure if right approach, , if its, im not sure how pass parameters . take @ quickstart: http://mogwai.readthedocs.org/en/latest/quickstart.html

build - generated files from ANTLR conflict in visual studio between release and debug modes -

i use antlr4 visual studio , c# . during build process antlr4 tool generates 6 c# source files (i.e parser, lexer, visitor, listener etc) correspond parser antlr generates. files generated in obj/debug directory of project (assuming debug mode chosen). add these files links in solution explorer inspecting generated code. if try change release mode antlr4 generates same files in obj/release directory of project , these files in conflict (dublicate classes in same namespace) files produced in obj/debug directory. the question is: when in release mode having done aforementioned actions, there way exclude generated files in solution explorer debug mode (while on release mode) or have manually exclude obj/debug directory solution explorer in order avoid conflict? thanks in advance i struggled on same problem. main problem, have linked files projects debug configuration. links still there when switch release configuration , have duplicate definitions in project. vi...

replace tabs with "" in R dataframe -

i have large dataframe (df) has couple of unwanted tabs. need replace tabs empty string parsing work. i have tried following , neither works: df[ df == "\t" ] = "" (tried both "\t" , "\\t") df <- as.data.frame(sapply(df, function(x) gsub("\\t", "", x))) df<- data.frame(apply((df),margin = 2,function(x){gsub("\\t","",x,fixed = true)}),stringsasfactors=false)

java - Writing number to .mat gives other result than to text file -

i'm measuring runtime of system arraylist<long> runtime . different entries of list i'm getting through system.nanotime(); returns long. i'm writing arraylist text file looping on list , using long.tostring(); each entry. so far good, create .mat file jmatio (matlab file format). in following way (remember arraylist<long> runtime ): // convert arraylist array because jmatio accepts arrays long[] runtimearr = new long[runtime.size()]; int = 0; (long : runtime) { runtimearr[i] = a; i++; } // write .mat file. arraylist<mlarray> list = new arraylist<mlarray>(); mlint64 m = new mlint64("runtime", runtimearr, 1); list.add(m); new matfilewriter("runtime.mat", list); // creates .mat if open .mat file in matlab displayed numbers different in text file (i'm using format long g in matlab). example in matlab i'm getting 1988336630 , in text file 1993496993. why this? edit: here complete example public class...

c++ - Testing if boost property tree stores a primitive or a subtree -

i'm parsing json file in value corresponding key can primitive (string) or subtree. useful example storing information people single employer, example { "employer" : "nasa"; } or people multiple employers, example { "employer" : { "weekdays" : "taco bell" , "weekends" : "google inc" } } while parsing employer key need test whether property tree value stores primitive (single employer) or subtree (multiple employers). i've tried get_value_optional shown below, still initialized employername that's empty string. there way go this. boost::optional<std::string> employername = propertytree.get_value_optional<std::string>(); if( employername.is_initialized() ) { std::string name = employername.get(); // returns empty string if propertytree stores subtree } found answer: propertytree.size() .

asp.net - Multiple repeater in one updatepanel -

i have repeater inside updatepanel of repeater have button. when click on of button, page refreshed. how can use more repeater button inside updatepanel? i : <asp:updatepanel runat="server"> <contenttemplate> <script type="text/javascript"> sys.application.add_load(firejquery); function firejquery() { $(".usage").persiandatepicker(); } </script> <asp:repeater id="repeater1" runat="server" onitemcommand="rpteducation_itemcommand"> <itemtemplate> <div class="col-md-1"> <asp:button id="btnaddanother" runat="server" text='<%# databinder.eval(container.dataitem, "button") %>' commandname='<%# databinder.eval(container.dataitem, "button") %>' /> </div...

VBA Excel Backup: Save copy of current workbook via VBA under a new name, keep VBA scripts, no prompt -

i need make vba script can take complete copy of current workbook , save under new name. it need complete copy vba scripts , everything. the user may not prompted - new file name (and location) provided code. surely sufficient? application.displayalerts = false activeworkbook.saveas filename:="c:\data.xlsm" application.displayalerts = true

c# - Multidimenstional Arrays And Observable Collection -

i've seen many observablecollection<t> examples of 2-dimensional object, i'm working multi-dimensional object. the faith life church daily bible reading api produce json data, below (this shortened, brevity)... { "dailychapter": [{ "date": "2016-02-01", "book": "esther", "chapter": 7, "verses": [{ "number": 1, "text": "so king , haman came banquet esther queen." }, { "number": 2, "text": "and king said again unto esther on second day @ banquet of wine, thy petition, queen esther? , shall granted thee: , thy request? , shall performed, half of kingdom." }] }, { "date": "2016-02-02", "book": "esther", "chapter": 8, "verses": [{ ...

formset - How do I order the inline_formset in Django by query -

i have formset risikozeileset = inlineformset_factory( risikobeurteilung, risikozeile, form=risikozeileform, can_delete=false, exclude=('user','rz_fuerkarelevant', 'rz_istueberschrift', 'rz_artdergefahr_txw', 'rz_abschnittmaschricht_txw',), extra=0) how can force appear on form ordered rz_abschnittmaschricht_txw, excluded field.

javascript - Gulp move files without the directory structure -

this question has answer here: can remove folder structure when copying files in gulp? 2 answers how move files using gulp different folders in src directory dist folder without keeping directory structure src. for eg: var sourcefiles = [ "src/folder1/test.js", "src/folder1/test1.js" ]; should moved dist folder i.e: dist/test.js dist/test1.js using this: gulp.task("movefiles",function(){ return gulp.src(sourcefiles, {base: "src"}) .pipe(gulp.dest("dist")); }); moves dist/folder1 ie dist/folder1/test.js dist/folder1/test1.js i ended solving issue without using base option: gulp.task("movefiles",function(){ return gulp.src(sourcefiles) .pipe(gulp.dest("dist")); });

codenameone - Youtube video keeps playing until app is closed -

some questions playing youtube videos in webbrowser component. i played youtube video in webbrowser component. keeps playing when form backed well. stops playing when app removed. tried webbrowser.stop() , webbrowser.destroy() method etc in command no success. string getvideourl = "https://www.youtube.com/embed/" + videoid + "?autoplay=1"; webbrowser player = new webbrowser(); player.seturl(getvideourl); f.addcomponent(borderlayout.center, player); however webbrowser.reload() solves problem on android phones not on android tablets. while viewing video, if mobile set sleep user, display goes out while watching video. how disable sleep mode? mobile screen display out problem. when video completes, youtube video gives video link of related videos & can played too, how can disable that. don't want make other videos play app the video doesn't play in android icecream sandwich , below. try: webbrowser.setpage("<html><h...

configuration - Strategy for accessing an application-wide setting on the client in a .NET Core web app -

we in process of re-writing 1 of our applications using asp.net core. architecture we're trying has web api running on different url presentation. root url api change in different environments, of course, i'm trying figure out how can set configuration , access web api root url in javascript requires retrieving data. example, have ajax call fetch data api: $.ajax({ datatype: "json", url: "http://this.url.will.change/api/whatever", //this change! success: function(response) { //load items } }); i've set appsettings.json files various build/deploy scenarios , have them reading , injecting nicely, can store url there. { "data": { "defaultconnection": { "connectionstring": "whatever" } }, "appsettings": { "apirooturl": "http://apiroot/api/" } } i considered writing urlhelper extension provide w...

c# - Windows Universal App - Download all Blobs from Azure Container -

i have universal windows app. i trying download blobs azure container when app starts. code: public mainpage() { this.initializecomponent(); downloadblobs(); } public async void downloadblobs() { cloudstorageaccount storageaccount = new cloudstorageaccount(new storagecredentials("accountname", "accountkey"), true); cloudblobclient blobclient = storageaccount.createcloudblobclient(); cloudblobcontainer container = blobclient.getcontainerreference("containername"); //--------------------- int filename = 1; var client = storageaccount.createcloudblobclient(); blobcontinuationtoken continuationtoken = null; string prefix = null; bool useflatbloblisting = true; bloblistingdetails bloblistingdetails = bloblistingdetails.all; int maxblobsperrequest = 2500; list<ilistblobitem> blobs = new list<ilistblobitem>(); { var listingresult = await container.listbl...

Unable to get service for dashDB output node in IBM bluemix -

while configuring dashdb output node in ibm bluemix, drop-down list service displays nothing time. can explain , how can set service? you have create service in bluemix , bind node-red application. follow steps below add dashdb service applications: 1) go bluemix dashboard , select node-red application 2) select "add service or api" button open catalog 3) in catalog select "dashdb" service (under "data , analytics" session) 4) dashdb services page opens - select create button create new instance of service 5) create new instance , take node-red application page 6) see message asking restage application - click on "restage" button after application restaged/restarted should able launch again , see new service created in drop-down menu dashdb output node.

regex - Schematron regexp:test fails with broad expression -

i going nuts here.. the test fails using broad match-anything regex '^.+$' (shown in sample file) works specific '^c.+$' i tried test="string-length(.) &gt; 0" , fails. please help. this xml file: <article> <back><ack> <title>acknowledgements</title> <p>the authors thank <funding-source rid="sp1">cnpq</funding-source> (process numbers <award-id rid="sp1">303287/2013-6</award-id> , <award-id rid="sp1">303559/2012-8</award-id>), <funding-source rid="sp2">fapesp</funding-source> (process number <award-id rid="sp2">2012/12207-6</award-id>) , <funding-source rid="sp3">capes</funding-source> (process number <award-id rid="sp3">12357-13-8</award-id>) financial support.</p> </ack></back></article> this schematron file fails: <sc...

python - Scrapy table with tr as header how to import it -

i want import table in scrapy organized this: <tr class="header1"> <tr class="row1"> <tr class="row2"> <tr class="row3"> <tr class="header2"> <tr class="row4"> and on different rows between headers, how can import header have item first attribute header name or text? like header1, row1 header1, row2 header1, row3 header2, row4 you can iterate on "row" nodes and, every node, preceding "header" sibling . imagine have following input html: <table> <tr class="header1">header 1</tr> <tr class="row1">row 1</tr> <tr class="row2">row 2</tr> <tr class="row3">row 3</tr> <tr class="header2">header 2</tr> <tr class="row4">row 4</tr> </table> now, here how can parse it: >>> row in res...

c# - Textblock crash and Image refresh -

i have problem ui of app. first of textblock crashes when try scroll it. happen when there lots of rows in (like 500). use textblock view log file saved in applicationdata folder. <scrollviewer x:name="scrolllog" visibility="collapsed" grid.row="2"> <textblock x:name="textlog" text="" textwrapping="wrap"/> </scrollviewer> there's maximum of rows textblock can handle? second problem image control doesn't refresh. use code load different images in it. file = await applicationdata.current.localfolder.getfileasync(imagename); irandomaccessstream stream = await file.openasync(fileaccessmode.read); await currentwallpaper.setsourceasync(stream); currentwallpaperimage.source = currentwallpaper; stream.dispose(); how can solve problem? maybe can force refresh of control?

Use of an integer code in URIMatcher class in Android -

according android documentation, have provide int code every uri match. adduri(string authority, string path, int code) and documentation explains: add uri match, , code return when uri matched. what role "code" play? i understand in case of urimatcher.no_match returns -1, invalid matches!, other codes 1, 20, 14 etc? for example, private static final int people = 1; private static final int people_id = 2; private static final int people_phones = 3; private static final int people_phones_id = 4; private static final int people_contactmethods = 7; or private static final int deleted_people = 20; the above code has been taken here . this code returned urimatcher.match() . can use switch statement take action based on type of uri matched. here example own project.

javascript - Uglify css classname like instagram or facebook -

how can uglifiy css files on instagram or facebook? e.g _8f735 , _ oofbn , _6ltyr it's react plugins or something? saw on instagram , facebook. have @ css modules . example react css modules : in context of react, css modules this: import react 'react'; import styles './table.css'; export default class table extends react.component { render () { return <div classname={styles.table}> <div classname={styles.row}> <div classname={styles.cell}>a0</div> <div classname={styles.cell}>b0</div> </div> </div>; } } rendering component produce markup similar to: <div class="table__table___32osj"> <div class="table__row___2w27n"> <div class="table__cell___2w27n">a0</div> <div class="table__cell___1ovw5">b0</div> </div...

shell - cd doesn't work in bash while read loop -

i'm writing simple script cd multiple folders file, cd doesn't work. i have tried solutions in why doesn't "cd" work in bash shell script? , shell script change directory variable but didn't work. here script: cat filename.txt | while read line; echo $line line=$(echo $line | tr -d '\r') cd "$line" done + inputfile=drugs800folders.txt + ifs= + read -r line + line=cid000000923 + cd cid000000923 + awk '$11 < 0.05 {print $1 $2 $3 $8 $10 $12}' groups.txt + ifs= + read -r line + line=cid000001003 + cd cid000001003 filterfuncoutput.sh: line 5: cd: cid000001003: no such file or directory + exit @charles duffy works, , did awk first folder in list, not remaining folders after first line first line selects first file in list ? unless have lastpipe shell option set (and prerequisites operation met), elements of shell pipeline in bash run in own subshell. consequently, side effects o...

python - Multivariate polynomial division in sage -

i try simple division of polynomials in 2 variables using sage. unfortunately, unexpected result, illustrated in code below. tried several different ways instantiate ring , variables, result stays same. using %-operator rest of division yields same results. ideas? r, (x, y) = polynomialring(rationalfield(), 2, 'xy').objgens() t = x^2*y^2 + x^2*y - y + 1 f1 = x*y^2 + x f2 = x*y - y^3 (q, r) = t.quo_rem(f1) print "quotient:", q, "reminder:", r assert q == x , r == x^2*y-x^2-y+1 (q, r) = r.quo_rem(f2) # error, expected q = x, r = -x^2+x*y^3-y+1 print "quotient:", q, "reminder:", r assert q == x , r == -x^2+x*y^3-y+1 output: quotient: x reminder: x^2*y - x^2 - y + 1 quotient: 0 reminder: x^2*y - x^2 - y + 1 --------------------------------------------------------------------------- assertionerror traceback (most recent call last) <ipython-input-8-861e8a9d1112> in <module>() 10 (q, r) = ...

Java - how to call an add() method in a different class -

this homework, , becoming little frustrated how can't figure out simple. to simplify code, have 3 files right now: 1 class add() method created among other things, 1 file tests (made prof), , 1 creates object (which won't post, b/c working). here's add() function. edit 2: i'm going add method prints array, maybe that's problem? public class population { private person[] pop = new person[15]; private int numpop = 0; public void add(person c){ // object created in class, works fine for(int = 0; < pop.length; i++){ if(pop[i] == null) { pop[i] = c; numpop++; } else {} } public string listpeople(){ system.out.println("population "+numpeople+" people follows:"); int = 0; while (i<numpeople){ system.out.println("a "+pop[i].getage()+"year old person named "+pop[i].getname()); i++; //fyi methods wor...

Python code, Time delay on console text -

i'm making code should print text on console , every letter should came little delay. i've tried this from time import sleep print "h", sleep(0.1), "e", sleep(0.1), "l", sleep(0.1), "l", sleep(0.1), "o" but puts random "none" there. should do? please :?: sleep returns none, gets printed. print each char without newline , sleep: import sys time import sleep c in "hello": print c, # note comma sleep(0.1) print # final newline but avoid spaces inbetween, you'll have this: import sys time import sleep c in "hello": sys.stdout.write(c) sleep(0.1) sys.stdout.write('\n') depeding on environment, might need flush stdout buffer: import sys time import sleep c in "hello": sys.stdout.write(c) sys.stdout.flush() sleep(0.1) sys.stdout.write('\n') sys.stdout.flush()

c++ - Using IOCP with send() and recv() -

i trying figure out best way handle multiple connections c++ tcp server. stumbled upon epoll() sadly it's available linux , i'm doing on windows. after research seems best way handle sockets on windows use of i/o completion ports. use them, client application uses send() , recv() (i cannot change that), meaning need use same functions send , receive data client. these functions don't seem used iocp ( wsasend() / wsarecv() used instead). i'd know if there's still way able use iocp send() , recv() ? or should other methods? i need use same functions send , receive data client that's incorrect. client has no idea how data , out of tcp connection, either way same exact tcp segments sent across network. if server i/o bound, wsaasyncselect and/or wsaeventselect work (and save trouble of multithreading). compute-bound services iocp worthwhile, because distribute work items available thread simultaneous requests can spin , calculations...

php - Bootstrap Contact Form issue! messages are not being sent to attached email -

i having trouble figuring out contact form. doesn't send messages email attached it. of guys know might doing wrong? provided code below feel free view actual set on www.kelliehannon.com clicking contact button. here html: <!-- contact form --> <form id="contact-form" name="contact-form" method="post" data-name="contact form"> <div class="row"> <div class="col-xs-12 col-sm-6 col-lg-6"> <!-- full name --> <div class="col-xs-12 col-sm-12 col-lg-12"> <div class="form-group"> <input type="text" id="name" class="form form-control" placeholder...

http - Can I be banned for running HEAD requests? -

i have specific idea relies on running head requests on few third party urls on daily basis. reminder, type of request not download content (body) of webpage , lightweight. goal assess if url still available. i know if possibly forbidden third party website? in opinion, should not since won't downloading content. information after know whether url still valid or not. thanks!

javascript - snap.svg making a perfect "circle pointer" -

first off, sorry topic name. can't explain want make precisely in 1 sentence. then! want make circle square on stroke, within there 6 "hoverable" squares. here test i've made : var s = snap(500, 500); var thecircle = s.circle(250,250,100).attr({fill:'none',stroke:'red','stroke-width':'2'}); var pointer = s.rect(240,340,20,20); var william = s.g(thecircle, pointer); var hover1 = s.rect(240,290,20,20).attr({'value':'0'}).addclass('hovering'); var hover2 = hover1.clone().transform('r60,250,250').attr({'value':'60'}).addclass('hovering'); var hover3 = hover1.clone().transform('r120,250,250').attr({'value':'120'}).addclass('hovering'); var hover4 = hover1.clone().transform('r180,250,250').attr({'value':'180'}).addclass('hovering'); var hover5 = hover1.clone().transform('r240,250,250').attr({'value...

entity framework - WithRequiredPrincipal, why still have to define Required or ForeignKey to be able to compile? -

public class admin : entitytypeconfiguration<admin> { //[foreignkey("blog")] -- if enable this, compiles public int adminid { get; set; } public string adminname { get; set; } public string adminpicture { get; set; } //[required] -- or if enable this, compiles public virtual blog blog { get; set; } } public class blog : entitytypeconfiguration<blog> { public int blogid { get; set; } public string blogname { get; set; } public string blogurl { get; set; } public virtual admin admin { get; set; } public blog() { hasrequired(a => a.admin).withrequiredprincipal(b=>b.blog); } } as long defining hasrequired , withrequiredprincipal keys, why vs still creates below error. unable determine principal end of association between types 'dummy.models.blog' , 'dummy.models.admin'. principal end of association must explicitly configured using either relationship fluent api or data ann...