Posts

Showing posts from June, 2013

css - Displaying results in a table horizontally -

i'm using bootstrap 3 , trying figure out how results align horizontally in table , not vertically. see bootply i want achieve this: peter| orange, banana, apple john | apple, orange mary | sam | orange but keep getting this: peter| orange, banana, apple john | apple, orange mary | sam | orange the html <div class="container"> <div class="row"> <br> <span class="label label-default\">table</span> <h2>table 2</h2> <table><tbody><tr><td><span class="label label-default">mary</span></td></tr><tr><td><span class="label label-success"></span></td></tr></tbody></table><table><tbody><tr><td><span class="label label-default">john</span></td></tr><tr><td><span clas

java - Unable to find Randoop eclipse plugin -

my requirement generate test cases automatically in java, considering use randoop. there url for downloading randoop plugin eclipse . can't access eclipse market-place network. tried downloading eclipse-plugin github , randoop jar file not present on it. how can install plugin ? as say, link points source code.. unfortunately couldnt find link built jar file, in case need build apache ant. there dependency: plume.jar - (i think source code it.. https://github.com/mernst/plume-lib if you'd need build jar first too!) once built , have jar, can install described here: how install plugin eclipse .zip

hadoop - Can Spark store last 10 minutes data for real time application -

i trying make real time analytics application. overall procedure need follow is: logstash pumping .log data file kafka producer topic, kafka producer send kafka consumer topic. then, after need spark should read kafka consumer topic take input of last minutes data kafka consumer topic real time analytics , simultaneously kafka consumer should write data hdfs later historical analysis. have read spark can read hdfs can spark read directly kafka consumer topic? procedure following right or not? please suggest me. yes. first of all, idea possible. however, might have consider performance of spark-stream, well. since spark-stream works in micro-batch environment, no in real-time system, spark stream can slow sometimes. if want better performance, better use flink. see : flink-streaming

How to read from file in c++ in ccs in linux ? -

i have got problem, want write code reads file, tried ifstream type doesn't work on linux. had similar problem ? write code in code composer studio,on code blocks works. have error "method 'fail' not resolved.) down below code: #include <iostream> #include <fstream> using namespace std; int main () { ifstream infile ("input.txt"); if (infile.fail()) { cout << "could not open file\n"; } else { cout << "file opened succesfully\n"; } }

c# - How to set DateTime object to null and sent as parameter to stored procedure? -

i call stored procedure visual studio project , passing datetime parameter. here c# code: datetime? dtstartfrom = null; var result = _context.database.sqlquery<damageeventsdtl>("spdamageeventsdtl @dtstartfrom", new sqlparameter("dtstartfrom", dtstartfrom)).tolist(); here how variable defined in stored procedure: @dtstartfrom date on row exception: the parameterized query '(@dtstartfrom nvarchar(4000))spdamageeventsdtl @dtstartfrom' expects parameter '@dtstartfrom', not supplied. so guess there problem null values, tryed way: datetime? dtstartfrom = dbnull.value; but on row above error: cannot implicitly convert type 'system.dbnull' 'system.datetime?' any idea how can set datetime object null , sent parameter stored procedure? your parameter name should match of query: new sqlparameter("@dtstartfrom", dtstartfrom); edit: datetime? dtstartfrom = null; sqlparameter sqldateparam

MongoDB: unconditional updates? -

this seems silly question haven't yet found answer. if wanted add same field->value every record in mongodb collection, appropriate shell command so? tried doing multi update blank query ({}) resulted in error: multi update works $ operators i'm bit puzzled how around this. suggestions? the error says all: can modify multiple documents using $ modifier operators . had this: > db.coll.update({ }, { a: 'b' }, false, true); which replace first object in collection { a: 'b' } if multi false. wouldn't want replace objects in collection same document! use $set operator instead: > db.coll.update({ }, { '$set': { a: 'b' } }, false, true); this set a property of every document (creating necessary) 'b' .

javascript - Submit button not working in bootstrap tabs -

i have been trying make work submit button not working @ all. bootstrap tab window using is: <!-- nav tabs --> <ul class="nav nav-tabs" role="tablist"> <li role="presentation" class="active"><a href="#home" aria-controls="home" role="tab" data-toggle="tab">add new game</a></li> <li role="presentation"><a href="#profile" aria-controls="profile" role="tab" data-toggle="tab">profile</a></li> <li role="presentation"><a href="#messages" aria-controls="messages" role="tab" data-toggle="tab">messages</a></li> <li role="presentation"><a href="#settings" aria-controls="settings" role="tab" data-toggle="tab">settings</a></li> &l

Selenium Python error: (5, 'OpenSCManager', 'Access is denied.') when a service is stopped -

in selenium python script in setupclass method have code stops tomcat service. used work fine getting error: error: (5, 'openscmanager', 'access denied.') error details: c:\python27\python.exe "c:\program files (x86)\jetbrains\pycharm community edition 5.0.3\helpers\pycharm\utrunner.py" g:\test_runners\selenium_regression_test_5_1_1\regression_testcase\split_into_parts\regressionproject_testcase_part1.py true testing started @ 09:13 ... error traceback (most recent call last): file "g:\test_runners\selenium_regression_test_5_1_1\base\basetestcase.py", line 35, in setupclass service_info(action_stop, globals.machine, globals.service_tomcat) file "g:\test_runners\selenium_regression_test_5_1_1\utilities\helpermethods.py", line 136, in service_info win32serviceutil.stopservice(service, machine) file "c:\python27\lib\site-packages\win32\lib\win32serviceutil.py", line 409, in stopservice return controlse

css - Is there a way to group selectors? -

this question has answer here: can css class inherit 1 or more other classes? 27 answers i'm trying address div , table , ul , dl , etc. children of selector using less. i love write this. .myclass { ... &.otherclass > (div, ul, dl, table) { // define rules... } } i expect following output. .myclass.otherclass > div, .myclass.otherclass > ul, .myclass.otherclass > dl, .myclass.otherclass > table { // rules } but parenthesis seems not supported, compiles is, resulting invalid css of course. is there syntax or other way have such shortcut in definitions? your solution: .myclass { ... &.otherclass { > div, > ul, > dl, > table { // define rules... } } } as comment, removing > selector after first selector, produce different result: this example div { > sp

javascript - ChartJS Bar chart painting second bar to the right -

i have barchart using latest version of charts.js. need show bars , @ right, bar has nothing rest. (the first bars thre monthly values, last bar forecast month) see here better understand mean. https://jsbin.com/diqetaxeqi/edit?js,output the forecast bar has it's own y axis on right. i've struggled setting bar right , have solved creating new dataset filling values 0 make sure last bar drawn. problem labels not centered anymore bars 0 value still painted. how can solve better? thanks your code requires 2 different datasets ? or can 4 like: data: [18739460, 33056135, 36562034, 3234234] ?

c++ - How to use Magick++ to convert YUYV to RGB? -

reading images device via v4l2. images in yuv 4:2:2 format, aka v4l2_pix_fmt_yuyv, aka yuy2. what i'd either convert blob of bytes rgb, or better yet how instantiate magick++ image object , tell data in yuyv instead of rgb24. can done? magick++ documentation bare-bones , provides 0 help: http://www.imagemagick.org/api/magick++/classmagick_1_1image.html you can convert yuv422 rgb888 . let data image data load in yuv422 format then: u = data[0]; y1 = data[1]; v = data[2]; y2 = data[3]; ... ... and then: rgb[0] = yuv2rgb(y1, u, v); rgb[1] = yuv2rgb(y2, u, v); ... ... using following formula yuv2rgb : r = y + 1.140*v g = y - 0.395*u - 0.581*v b = y + 2.032*u

Fastest way to find string into a file PHP with ~ 5000 lines -

i know fastest way find string in file using php. have been told quickest way read file using file() function, find string in whole file have foreach. whereas if use file_get_contents or something, have strpos() on file. the point not know if strpos() faster (i think is). know if, better content of file , strpos() once, or file line line , strpos() foreach line until find value (or until end if value not found). using strpos file_get_contents like if( strpos(file_get_contents("filename.txt"), $string) !== false) { // stuff } would fastest way

angularjs - getting only values from json data -

i making http request /result json data . data in format [{"name":"first","total":830,"passed":678,"failed":152}]} here's angularjs script- analyzer.controller('checkvalue',function($scope,$http) { $scope.cases = []; $http.get('/result').success( function(data) { $scope.cases = data.responsedata; }); }); it doesn't work has key , value in data.how can values ? you can try: $scope.cases = object.keys(data.responsedata).map(function (key) { return data.responsedata[key]; });

c# - How use ContextFlyout in a StackPanel in UWP? -

in gridview, trying show context menu when user right clicks item. i tried: <gridview.itemtemplate> <datatemplate> <stackpanel orientation="vertical" width="120" background="lightblue"> <stackpanel.contextflyout> <menuflyout> <menuflyoutitem text="change color" click="changecoloritem_click" /> </menuflyout> ... but stackpanel.contextflyout throws error. missing? update the error is: the attachable property 'contextflyout' not found in type 'stackpanel' contextflyout property of uielement, , stackpanel derived uielement. contextflyout property of uielement, , stackpanel derived uielement. yes right, careful contextflyout property available since introduced version 3.0, version 10.0.14393.0. need check api contract version , device family version. for api contract version 1.0/2.0, @ig

html - Flex item with justify-content: space-between is not displaying correctly -

i have menu bar sub-menus. want on same line menu "account" or "profile" link on right, , want pure css3/flex. but guess there wrong in css code because last link ("account") diplaying under main menu, justify-content: space-between nav element not working. how can ? here code : nav { font-size: 20px ; background-color: white; display: flex; flex-direction: row; justify-content: space-between; } nav ul { display: flex; flex-direction: row; margin: 0; padding: 0 ; position: absolute; background-color: white; list-style-type: none; } nav ul li { padding: 0; margin: 0; } nav ul li ul { display: none; margin: 0; padding: 0; box-shadow: 3px 3px 3px 0px #dddddd; background-color: white; } nav ul li:hover ul{ display: block; } nav { color: #333; display: block; margin: 0; padding: 10px 20px; text-decoratio

django - how to resolve You don't have permission to access / on this server -

hi need in integrating django apache , mod_wsgi on centos6. getting following error every time---"forbidden don't have permission access / on server." django project path= /home/mchauras/esapp/eswebsite apache version 2.2.15 .conf file looks this---- <virtualhost *:80> documentroot /home/mchauras/esapp/eswebsite/ alias /static /home/mchauras/esapp/eswebsite/esapp/static <directory /home/mchauras/esapp/eswebsite/esapp/static> options indexes followsymlinks includes execcgi allowoverride none order deny,allow allow </directory> <directory /home/mchauras/esapp/eswebsite/eswebsite> <files wsgi.py> options indexes followsymlinks includes execcgi allowoverride none order deny,allow allow </files> </directory> wsgidaemonprocess esapp python-path=/home/user/myproject:/home/mchauras/esapp/eswebsite/myvenv/lib

Apache Flink JDBC InputFormat throwing java.net.SocketException: Socket closed -

i querying oracle database using flink dataset api. have customised flink jdbcinputformat return java.sql.resultset. need perform further operation on resultset using flink operators. public static void main(string[] args) throws exception { executionenvironment environment = executionenvironment.getexecutionenvironment(); environment.setparallelism(1); @suppresswarnings("unchecked") datasource<resultset> source = environment.createinput(jdbcinputformat.buildjdbcinputformat() .setusername("username") .setpassword("password") .setdrivername("driver_name") .setdburl("jdbcurl") .setquery("query") .finish(), new generictypeinfo<resultset>(resultset.class) ); source.print(); environment.execute(); } following customi

ios - Reset CKNotificationInfo badge value only for the current device -

i'm testing 3 idevices. device 1 fires cksubscription change notification. device 2 , 3 receives notification , badge number increases 1. i coded reset badge number 0 everytime app comes foreground below.(in applicationdidbecomeactive:) ckmodifybadgeoperation *badgeresetoperation = [[ckmodifybadgeoperation alloc] initwithbadgevalue:0]; [badgeresetoperation setmodifybadgecompletionblock:^(nserror * operationerror) { if (!operationerror) { [uiapplication sharedapplication].applicationiconbadgenumber = 0; } }]; [[ckcontainer defaultcontainer] addoperation:badgeresetoperation]; if user taps app on device 2, above code executed. works well. badge number reset 0. issue badge number on device 3 become 0 simultaneously, though didn't tap app on device 3. i hope device 3 remains increased badge number since user didn't tap it. api reference says 'this operation object can update badge current device or of user’s devices.' https://developer.a

javascript - How can I do jQuery doesn't work for a specific element? -

i have jquery fadeout page smoothly when click on "href" link. i have ecommerce, have cart can see products have added. (online store: www.backlabel.com ) you can delete cart directly "x" on top of product. "x" have "href" property, page load jquery , bad because whole page re-load. i wish jquery not work on "x" button. can code in follow jquery? // delegate clicks on "a" tag (links) $(document).on("click", "a", function (event) { // href attribute var newurl = $(this).attr("href"); // veryfy if new url exists or hash if (!newurl || newurl[0] === "#") { // set hash location.hash = newurl; return; } // now, fadeout html (whole page) $("html").fadeout(function () { // when animation complete, set new location location = newurl; }); // prevent default browser behavior. return false; });

dependency injection - Java method with @Inject annotation: False-positive for the rule "Unused "private" methods should be removed"? -

we using java 8 , dependency injection (guice). have false-positive sonar issue, unused method, although method invoked via reflection guice injector, due inject annotation. affected code: @inject private void settransactionalcommandstack(transactionalcommandstack transactionalcommandstack) { ... } sq reports violation of rule squid:unusedprivatemethod unused "private" methods should removed at place , says private method 'settransactionalcommandstack' never used . the eclipse environment has check unused methods detects correctly , puts warning if have no @inject annotation method. same expect in sonarqube. i tested both annotation javax.inject.inject , com.google.inject.inject. in both cases sonarqube reports method unused. sq version: 5.3 java plugin version: 3.14 this issue has been fixed in version 4.0 of java analyzer, compatible sq lts 5.6 . see corresponding jira ticket sonarjava-1179

date - Apache PIG - Guarantee that all the value in a column follow the Schema 'yyyy-MM-dd' -

i've dataset 4 columns , want know if column b have value in following format: ('yyyy-mm-dd'), if job detect value not corresponds format want put value null. could in pig or must python embed pig? many thanks! (sorry reply answer instead of comment don't have enough reputation comment on question) this might useful :- java udf date regex extractor pig?

excel vba - VBA runtime error 13 Type Mismatch If statment -

i receive runtime error '13': type mismatch when try run code. debug highlights 'if' statements, can't figure out mistake is. appreciated. dim integer dim lastrow long workbooks("template part_ii.xlsx").worksheets(2).activate lastrow = cells(rows.count, 1).end(xlup).row = 2 lastrow if cells(i, 1).value <> "#n/a" , cells(i, 1).value <> "00000000-000" cells(i, 1).copy worksheets(1).range("a2:a" & lastrow).pastespecial xlpastevalues end if next and in fact i'm trying this: have 1 sheet have 100 rows of various ids , want copy ids sheet without possible non id strings in case can #n/a or 00000000-0000, don't want non copied cells appear blanks in destination range. wrap accesses cell inside check ensures cell contains no error value (e.g. cell 'containing' division 0) ... = 2 lastrow if not iserror(cells(i, 1).value) if cells(i,

Redmine workflows doesn't work -

i have working redmine workflows , roles. try change workflow role, changes doesn't make sense. have same list of statuses before workflow update. redmine version 3.0.4. thank john answer. yes work users out admin permissions. admins workflow change doesn't make sense.

mysql - how can i fetch table records through joins? -

lets suppose have database table x_tush in there column license,so each license 123 have n number of columns associated it,say address_id,status,address_type,etc. each license have n number of networks (101,102,108,113,114) 123 license there exist 3 records 101,102,114 , 2 records 108,113. please replicate records exist 101,102,114 113,108,as there 2 records associated it? select * xpna; -- networks needed select distinct network x_pns_address network in (101,102,113,114,108 ) temp aln; -- identify license lest 5 network select license,address_type ,contact ,address_line1,address_line2,city xpna network in (101,102,108,113,114) group license,address_type ,contact ,address_line1,address_line2,city having count(network) < 5 temp msn; select * msn,aln temp table1; -- insert missing values in temp table insert xpna select n.license, n.network, n.address_type , n.contact , n.address_line1, n.address_line2, n.city table1 n left join x_pns_address x on x.

Wordpress NGINX redirect everything to new domain EXCEPT -

i have unusual setup in have angularjs application running on http://example.com pulls data via wordpress api located @ http://api.example.com . http://api.example.com needs have /wp-login , /wp-admin , /wp-content , , /wp-includes urls work if still regular wordpress site. however other url's http://api.example.com/category/excategory or http://api.example.com/this-is-a-post-title need redirect 301 http://example.com domain. example: http://api.example.com/category/excategory redirects http://example.com/category/excategory but http://api.example.com/wp-admin (and after it) does not. i've tried kinds of crazy things, location blocks seem either conflict, or weird url's go nowhere. here's try failed: location ~ /wp-(?:admin|login|includes|content) { index index.php; try_files $uri $uri/ /index.php?$args; } location / { return 301 $scheme//example.com$request_uri } put code in wp theme functions.php file. should redirect url

php - Laravel 5 Has One Relationship with Form Binding -

i have spent pretty 2 days on simple , small. have model called user has 1 user note relationship. on user model's side have belongsto relationship defined , user's model defines hasone side of relationship. the form using binds $user model meanwhile usernote model has own table maps user user_id. i have been trying shown below right; {{ form::textarea($user->notes, null , [ 'class' => 'form-control', 'placeholder' => 'note content']) }} somebody out there me figure out?b need able add note , if user has no note yet should not getting errors because if shown below error: {{ form::textarea('usernote[content]',... }} your advice appreciated. class user{ ... public function note() { return $this->belongsto(usernote::class); } } class usernote{ protected $fillable = ['content', 'user_id']; ... public function user() { return $this->hasone(user::class, 'user_id'); } }

java - Speedup image upload using Httpurlconnection -

is there way speedup process of uploading image web server. app developing takes long upload image. code works , know able upload image server successfully. based code off of tutorial found here. public string uploadfile(string apipath, string filepath, string type) { string path = ""; string result = ""; switch (type) { case "m": path = "merchant/" + apipath; break; case "c": path = "customer/" + apipath; break; } log.i(apisecuritymanager.class.getsimplename(), m_token); string href = "http://tysomapi.fr3dom.net/" + path + "?token=" + m_token; log.i(apisecuritymanager.class.getsimplename(), href); try { string myip = getip(); string charset = "utf-8"; file file = new file(filepath); printwriter writer; outputstream outputstream; url url = new url(href); ht

c# - MVC Model Validation Multiple View -

i have model class 6 fields(all required field validation). have 2 views using model. have 3 fields in 1 view(lets abc.cshtml) , 6 in another(lets xyz.cshtml) problem is,when submitting form in abc.cshtml , checking modelstate.isvalid property in controller,it validating fields not presented on view,so property appears false. model public class usermodel { [required(errormessage = "enter username")] public string username { get; set; } [required(errormessage = "enter password")] public string password { get; set; } [required(errormessage = "enter firstname")] public string firstname { get; set; } [required(errormessage = "enter lastname")] public string lastname { get; set; } [required(errormessage = "enter contact")] public string contact { get; set; } [required(errormessage = "enter address")] public string addres

css - Fix the first row of a HTML table -

i want make first row of html table visible when user scrolls down page. i tried style "position: fixed", problem when that, the cells of first row start have different widths compared cells of other rows . my table styled "table-layout: fixed, width: 100%". do know why please? in css tr{ position:absolute; }

java - X509 certificate signed with bouncy castle is not valid -

i went quite long way make java sign csr , @ last able this, openssl tells it's not valid. same csr signed openssl passes verification step. all same x509 version (1), no extensions, subject, issuer same. i suspect problem subject dn (email especially) or dates. verification: openssl verify -verbose -cafile src/test/resources/ca.cer.pem o.cer.pem o.cer.pem: ok openssl verify -verbose -cafile src/test/resources/ca.cer.pem client.cer.pem client.cer.pem: c = ru, st = moscow, l = moscow, o = hoofs, ou = it, cn = danee yaitskov error 20 @ 0 depth lookup:unable local issuer certificate file sizes similar: 1229 jul 28 12:45 client.cer.pem 1233 jul 28 13:00 o.cer.pem it complains there missing certificate in chain but, don't see such information. how check next parent certificate? info certificate: openssl x509 -in o.cer.pem -text -noout certificate: data: version: 1 (0x0) serial number: 1192228 (0x123124) sign

java - Jetty 9 and GzipHandler -

i'm trying configure jetty 9 server serve data gzip compressed. unfortunatelly can't find description fits use case. think have use new gziphandler instead of gzipfilter (starting jetty 9.3 gzipfilter dummy). my setup war file deployed on jetty 9 installation or run maven-jetty-plugin. no embedded jetty. have jetty-env.xml in /src/main/resources/meta-inf/resources/web-inf . there no other jetty related config files. appreciate setup doesn't need changes on jetty installation. should possible enable compression additional configuration in war file. compress static (files /src/main/resources/ , webjars) , dynamic (generated jersey) content. i hope did such setup , can give me hint. regards, johannes the jetty distribution solution if using jetty-distribution , go add gzip module configured ${jetty.base} eg: $ cd /path/to/mybase $ java -jar /path/to/jetty-dist/start.jar --add-to-start=gzip you have added gziphandler configuration of server. loo

python - better maintainable way to combine strings from multiple options -

i have scenario user can pass in multiple options. each option passed in, text , merge text multiple options , return single string. here how i'm doing 3 options accept today. code looks unmaintainable , add more options, logic worse: if (len(self.options.passedin.split(",")) > 0): #multiple options passed in ops = self.options.passedin.split(",") op in ops: if (op == "option1"): op1_text = get_text_for_option1() elif (op == "option2"): op2_text = get_text_for_option2() elif (op == "option3"): op3_text = get_text_for_option3() #all 3 passed in if ("option1" in ops , "option2" in ops , "option3" in ops): op1_op2 = op1_text + " " + ' '.join(w w in op1_text.split() if w not in op2_text.split()) op3_op1_op2 = op1_op2 + " " + ' '.join(w w in op1_op2.split() if w not in op3_text.split()) return

unificationengine - Posting a Tweet with Unification Engine -

when adding connection using twitter connector offered unification engine , parameters need used , how passed in uri? to send tweet use curl -xpost https://apiv2.unificationengine.com/v2/message/send \ --data "{ \"message\": { \"receivers\": [{\"name\": \"name\", \"address\": \"twitter_handle\" , \"connector\": \"unique_connection_identifier\"}],\"parts\": [{\"id\": \"1\",\"contenttype\": \"text/plain\", \"data\":\"message_content\" ,\"size\": message_content_size,\"type\": \"body\",\"sort\":0}]}}" \ -u user_accesskey:user_accesssecret -k where user_accesskey:user_accesssecret got when add user using ue_appkey:ue_appsecret curl -xpost https://apiv2.unificationengine.com/v2/user/create -u ue_appkey:ue_appsecret \ --data '{}' -k response data: {"status&quo

javascript - Convert URI to FIle Object JS -

Image
in ionic app , using cordova-filechooser plugin able uri of selected file . then using cordova-plugin-filepath got absolute path of file nativeurl on phone how file object path or uri ? want append formdata , post . use cordova file transfer plugin.in plugin need give file url upload .reference here link

sed - Bash delete line beetwen two pattern containing "/" -

this question has answer here: escape string sed replace pattern 14 answers i've problem : able delete lines beetwen 2 pattern in file. for example able delete line equals "line 1" beetwin "blablabla++" , "blablabla--" line1 blablabla++ line1 line2 line3 blablabla-- line1 i've found way sed : sed '/blablabla++/,/blablabla--/{/line1/d}' ./file it working great. thing in real file more : line1/script blablabla++ line1/script line2/script line3/script blablabla-- line1/script how ? edit i've choosen bad example. the thing don't know line need delete (the line sent parameter). know 1 thing sure contain "/" characters. the thing when : sed '/blablabla++/,/blablabla--/{/$1/d}' ./file the "/" $1 contain mess sed. you made bad example, because sed cmd works bo

html - Twitter Bootstrap tabs not hiding content -

i have little problem code. tabs load when click on inactive tab doesn't hide content of first tab , displays content of both tabs. there can do? thank much! <ul style="list-style:none"class="available-tabs nav nav-tabs" id="tabs" data-tabs="tabs"> <li class="active"> <a data-toggle="tab" href="#featured-tab-body">featured projects</a></li> <li> <a data-toggle="tab" href="#available-latest-tab">latest projects </a> </li> </ul> <div class="available-content tab-content container"> <div id="available-featured-tab"> <div class="featured-list-wrapper"> <div class="row"> <div class="col-md-12"> <div class="featured-list-content"> <div class="row featured-tab-head&q

ios - How to use swift files in objective c -

i want use swift files in objective-c code. found different link how it. my project name is: test-project. i imported #import "test-project-swift.h" .m file use needed classed in objective c source code. i watched video , there no problem, have 'test-project-swift.h' file not found. as recognized: looks problem "-" need change "_" - "test_project-swift.h". i've checked objective-c generated interface header name in project settings.

gcc - Suppress the "All warning being treated as errors" warning? -

i have warnings errors (-wall -wextra -werror) enabled on gcc project, , cc1plus.exe outputting message "all warnings being treated errors" on stderr. causing problems other tools in our build process. is there way suppress output?

Spring boot and logging location -

i use spring boot 1.3.7. in application.properties have logging.file=syste.log logging.path=/home/apps/log my jar file located in /home/apps at runtime, logging file located apps running (/home/apps). why value in logging.path not used? according the documentation specifying both logging.file , logging.path not supported (or handled), should specify full path in logging.file setting: logging.file=/home/apps/log/syste.log

regex - How to extraxt the experience from resume using python? -

i have extracted mail id, phone number- using regular expressions have extracted name using core nlp server had extracted skills giving in set , comparing words. didn't have idea how extract years of experience using python - can please give idea regarding it? examples: 2 years of experience two years of experience 2010-2014 like there many possibilities you can take couple of approaches. if there lots of possibilities, say, can treat machine learning problem , use approach 1. otherwise 1, if possibilities limited (say, around 5), can use second approach. approach 1: consider machine learning problem. classify each sentence in text 0 or 1 depending on if contains year of experience. can done training data manually. against each training example, assign label. example: job experience: 3 years (label 1) studying 2 years (label 0) working hard years (label 0) two years of experience (label 1) experience: 2010-2014 (label 1)

Python Parallel Process Matrix Computation -

i have extremely large matrix files (2k x 14k pixelated matrix) need processed. computation follows. a sub-matrix parsed ( 7 x 7 ) , eigenvectors , eigenvalues computed , sub matrix shifts on , computes again , again until entire matrix computed. there functions conduct calculations matrix shift simple loop. my question this: there built in parallel processing function allow me compute faster while not having re-write current code? skeptical there function out there inherently "understands" computation this. any or insight particular type of built in function or general advice appreciated. cheers! pie

ios - Trigger local notification on applicationDidBecomeActive -

i'm developing alarm app using uilocalnotification object. in code, when alarming , users click notification panel, app show view controller. added codes in different life cycles below satisfying situation: when alarming up, app in foreground, the app in background , users click notification panel trigger app, the app killed , users click notification panel trigger app. when alarming up, if users click app icon trigger instead of clicking notification panel, function not triggered in didreceivelocalnotification. how code satisfy situation? for triggering notification if app killed, ios can check scheduled notifications automatically , response in launchoptions object -(bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions{ [self registernotification]; uilocalnotification *localnotification = [launchoptions objectforkey:uiapplicationlaunchoptionslocalnotificationkey]; if (localnotificatio

handle docker container data while developing wep application -

i pulled image magento2 installation. now trying container /var/www/html data in host after can handle phpstorm. i tried overwrite in container /var/www/html docker run --name development-phase -d -p 5000:80 -v /u01/magento2:/var/www/html magento2 while creating volume data flows: host /u01/magento2 container /var/www/html but looking data flow should be container /var/www/html host /u01/magento2 i have referred stack overflow link suggest copy container data host before creating volume, in case docker cp command affect prerequisite setting of magento2 page not load properly. that's behavior of volumes in docker: -v /host/path:/container/path not copy data -v /container/path copy data , creates new volume random name so, might want try docker run --name development-phase -d -p 5000:80 -v /var/www/html magento2 then find out random path looking @ value of property source "destination":"/var/www/html" using docker

python 2.7 - Copy instance of class of package -

i work rosbag package provided ros.org . code looks like import rosbag bag_path = "/path/to/bag/file.bag" bag = rosbag.bag(bat_path) and want is, copy instance bag correctly, because want process data in 2 different threads. unfortunatelly, class bag not provide proper function copy() . so, how copy instance of external class properly? thank support. the copy package can used create new , identical instances of custom classes. import copy class testclass: def __init__(self, a, b, c): self.a = self.b = b self.c = c x = testclass(1, 2, 3) y = copy.copy(x) x , y have save variable properties, if change x.a , y.a not affected.

wordpress - Linkedin scraper can't read Open Graph information -

the linkedin scraper can't read our wordpress website ( https://www.aeternuscompany.nl/ ) open graph data. if people share update in linkedin link of our website, link-preview leaves empty. in facebook works fine. we tried different things: another theme different share plugins different open graph plugins we ask hosting-company if there see problems (everything seems correct) we check socialdebug.com debugs in open graph data see image example thank help! open graph tags added in website. as per linkedin docs ( https://developer.linkedin.com/docs/share-on-linkedin ), the first time linkedin's crawlers visit webpage when asked share content via url, data finds (open graph values or our own analysis) cached period of approximately 7 days. try after couple of days check if changes reflected.

mysql - Web App database ECONNRESET -

i have expressjs application hosted on azure web app on enabled. i using bookshelfjs connect mysql database hosted in virtual server on azure. after sometime, when call web application below error, told me failed connect database server: select * `member` `name` = 'alvin' limit 1 -read econnreset" is related expressjs timeout problem? according similar issue on mysql giving "read econnreset" error after idle time on node.js server , seems mysql connection issue. as answer said: mysql indeed prune idle connections. please try add pool setting in mysql connection configuration in knex . e.g, var knex = require('knex')({ client: 'mysql', connection: { host : '127.0.0.1', user : 'your_database_user', password : 'your_database_password', database : 'myapp_test' }, pool: { min: 0, max: 7 } }); please refer http://knexjs.org/#installation-pooling

python - Why client socket connection is not closed after all data received from server? -

i'm learning socket programming in python, server code: import socket srvsock = socket.socket(socket.af_inet, socket.sock_stream) srvsock.bind(('', 23000)) srvsock.listen(5) while true: clisock, (rem_host, rem_port) = srvsock.accept() print "conection established host %s , port %s" % (rem_host, rem_port) while true: strg = clisock.recv(20) if not strg: print 'conection closed' clisock.close() break clisock.send(strg) client code: import socket clisock = socket.socket(socket.af_inet, socket.sock_stream) clisock.connect(('', 23000)) clisock.send("hello world rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr dsadsadsa tttttt\n") while true: data = clisock.recv(20) print type(data) if not data: clisock.close() break print data i'm sending data stream client server , @ same time receiving data server, after successful data

Datatables buttons pdfHtml5 exportOptions to remove nested tags -

i'm trying optimize datatables buttons pdfhtml5 export of page. table data contains nested html tags creating additional space above , below cell data, makes pdf long. the text in cell wrapped in 2 nested <div> , <p> . in pdf export, need contents of <p> <td> <div class="flagimg" style="background-image: url(...)"> <div class="flagtext"> <p>name of country</p> </div> </div> </td> i'm trying remove nested html tags using exportoptions, i'm not sure how write syntax correctly. can me this? $(document).ready(function() { var buttoncommon = { exportoptions: { format: { body: function(data, column, row) { data = data.replace(/<div class="flagtext"\">/, ''); data = data.replace(/<.*?>/g, ""); return data; } } } }; var otable =