Posts

Showing posts from September, 2014

mod proxy - tcpsndbuf causing max CPU load -

i run web application, stripped max avoid high tcpsndbuf values. still failcnt on tcpsndbuf reached after few days , very, little traffic. i thought application container issue described in thread . the tcpsndbuf values rise , rise. seems buffer value never released completely. thus, continuously increases until breaches limit , demands it's tribute of 100% cpu throttle. however, after ruling out different sources hibernate configs, mysql driver error, want focus on openvz managed parallel plesk/power panel , apache proxy_mod. the reason why belive it, fact numeruous process of /usr/sbin/apache2 -k start listed in process list (parallels power panel, processes) i use proxy_mod route port 80 application server on different port same host. how can analyse socket states in detail? e.g. buffer locked application, when has been assigned? can see proxy_mod connections? type of data available? other hints on tcpsndbuf provoking max cpu load highly welcome. you ha...

javascript - How to remove underline from jQuery input mask plugin textboxes -

Image
i want remove underline masked input implemented using jquery inputmask plugin- http://github.com/robinherbots/jquery.inputmask to remove mask, use placeholder option. assigning empty string placeholder, removes mask. can assign placeholder when creating mask: $('input').inputmask("mask name", {"placeholder": ""}); or change afterwards: $('input').inputmask({"placeholder": ""});

How can I pass parameters to the Jenkins build flow? -

how can pass parameters jenkins build flow? i have build flow runs 4 jobs in sequence . lets take example : build("job1", param1:value1, param2:value2) build("job2", param1:value1, param2:value2) build("job3", param1:value1, param2:value2) build("job4", param1:value1, param2:value2) i passing 2 parameters each job. parameters same. want pass "param1","param2" build flow. how can ? try this pass parameters double quotes build("job1", param1:"value1", param2:"value2")

android - NullReferenceException in MvvmCross Messenger -

this code in viewmodel public icommand gotocartcommand{ get{ return new mvxcommand (() => { var cartviewmodel = mvx.resolve<cartviewmodel>(); if (cartviewmodel != null) { cartviewmodel.cartlist.add(new cartitemviewmodel() { name = name, id = id, unitprice = double.parse(price), quantity = 1, description = description, image = image }); } cartlistcount = cartviewmodel.cartlist.count; var messanger = mvx.resolve<imvxmessenger>(); var message = new mymessage(this,"product has been added",cartlistcount); messanger.publish(message); }); } } public class mymessage : mvxmessage { public int cartlist_count{ get; set;} public string message{ get; set;} public mymessage(object sender,string _message,int _cartlist_count) : base(sender) { ...

java - Purpose of getters/setters in this class -

this question has answer here: why use getters , setters? 38 answers in class, have constructor take in 4 parameters. , values initialized appropriately. set int imageid mimageid, etc.. what purpose of sequence of getters/setters if member variables initialized parameters? from i've read. getters/setters every field or member variable makes class "public". or purpose of getters/setters broadcast "intent" class? public class page { private int mimageid; private string mtext; private choice mchoice1; private choice mchoice2; public page(int imageid, string text, choice choice1, choice choice2 ){ mimageid = imageid; mtext = text; mchoice1 = choice1; mchoice2 = choice2; } // start of getters/setters public int getimageid(){ return mimageid; } public void setimageid(int id){ mimageid = id; } public string get...

ios - Swift Parse and Search Bar not giving results -

i have parsetableviewcontroller, parsetableviewcell , uisearchbar outlet on view. data comes expected when search nothing happens , crashes app. here code, there no error. think i'm missing point here.. thank you import uikit import parseui import parse class profiltableviewcontroller: pfquerytableviewcontroller, uisearchbardelegate{ let backgroundimage = uiimage(named: "a.png") var arka: uiimageview! @iboutlet weak var searchbar: uisearchbar! override func viewdidload() { super.viewdidload() arka = uiimageview(frame: view.bounds) arka.contentmode = .scaletofill arka.clipstobounds = true arka.image = backgroundimage arka.center = view.center view.addsubview(arka) self.view.sendsubviewtoback(arka) tableview.backgroundview = arka self.addeffect() } override init(style: uitableviewstyle, classname: string!) { super.init(style: style, classname: classna...

Externalizing persistence.xml orm properties within an OSGi container using Felix, JPA, Aries and Hibernate -

i’m working on large refactoring of project goal of using jpa aries within osgi container persistence (rather plain old j2ee stack). currently far good, i’m following guidance of tasklit blueprint (it managed jpa) example website , works fine (i’m using felix 5, aries jpa 2.1 version , hibernate 4.3+ orm) i’m trying make solution configurable possible, persistence.xml this: <persistence-unit name="audit" transaction-type="jta"> <jta-data-source>osgi:service/javax.sql.datasource/(osgi.jndi.service.name=jdbc/audit)</jta-data-source> <properties> <property name="hibernate.dialect" value="org.hibernate.dialect.derbydialect"/> <property name="hibernate.hbm2ddl.auto" value="create-drop"/> </properties> </persistence-unit> i have externalized datasource configuration using blueprint-cm configadmin datasource working good. but i’m lef...

php - unable to live site in server laravel5 -

iam getting error after uploaded project server. when visited link somedomain.com/demo got following error. error? how can solve please me. warning: require(/home/siddins/public_html/demo/project/app/http/helpers/backend/helpers.php): failed open stream: no such file or directory in /home/siddins/public_html/demo/project/vendor/composer/autoload_real.php on line 54 fatal error: require(): failed opening required '/home/siddins/public_html/demo/project/app/http/helpers/backend/helpers.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/siddins/public_html/demo/project/vendor/composer/autoload_real.php on line 54 my index.php this: <?php /** * laravel - php framework web artisans * * @package laravel * @author taylor otwell <taylorotwell@gmail.com> */ /* |-------------------------------------------------------------------------- | register auto loader |-------------------------------------------------------------------------- | |...

css - Background-image scale on hover - not smooth everytime -

i have simple div hover increase background image size. it works, apart if move mouse in , out quickly, image jerks opposed smoothly growing , shrinking again. this css: .block__left { background: url("http://tpwd.texas.gov/state-parks/big-bend-ranch/gallery/big-bend-ranch-camping-_u8e2700.jpg") no-repeat; background-position: right -500px bottom -30px; width: 100%; height: 600px; -webkit-transform: scale(1, 1); -ms-transform: scale(1, 1); transform: scale(1, 1); -webkit-transition: 0.6s ease-in-out; transition: 0.6s ease-in-out; } .block__left:hover { -webkit-transform: scale(1.1, 1.1); -ms-transform: scale(1.1, 1.1); transform: scale(1.1, 1.1); } here fiddle the question is: how make smooth every time? i'm testing in chrome. would work? .block__left { backface-visibility: hidden; } ...

firefox - How to create a xpi file from scratchpad -

i have developed add-on in scratchpad environment , developing finished , want create final xpi file. i replace this: cu.import('resource://gre/modules/ctypes.jsm'); by this: var {cu} = require("chrome"); var{ctypes} = cu.import("resource://gre/modules/ctypes.jsm", null); then using nodejs (jpm init , jpm xpi commands) created xpi file not worked properly. what did follow jpm tutorial: https://developer.mozilla.org/en-us/add-ons/sdk/tutorials/getting_started_%28jpm%29 , https://developer.mozilla.org/en-us/add-ons/sdk/tools/jpm#installation i did on windows system: we downloaded node.js npm came it created directory, in directory did jpm-init command line filled out prompts filled in code addon: we created similiar addon demo addon here: https://github.com/noitidart/jpm-chromeworker i cant share actuall addon personal user. above simpler , shows how it. we did our jsctypes in chromeworker, , have communicate index.js vi...

scala - Increase Spark memory when using local[*] -

how increase spark memory when using local[*]? i tried setting memory this: val conf = new sparkconf() .set("spark.executor.memory", "1g") .set("spark.driver.memory", "4g") .setmaster("local[*]") .setappname("myapp") but still get: memorystore: memorystore started capacity 524.1 mb does have with: .setmaster("local[*]") i able solve running sbt with: sbt -mem 4096 however memorystore half size. still looking fraction is.

ssl - App Transport Security in Simulator -

i trying connect http://localhost simulator debugging. since ios 9 there app transport security enabled , connections without tls 1.2 getting blocked. is there way allow connections url in debug-builds without adding target? you can add following property application's plist file allow connection development: <key>nsapptransportsecurity</key> <dict> <key>nsallowsarbitraryloads</key> <true/> </dict> i hope helps.

Apache : Directory index forbidden by Options directive:/srv/www/htdocs/testFolder -

saw duplicate questions , solutions, not seem solve below problem i trying allow access folder through apache, , /var/log/apache2/ throws above error. my httpd.conf is # forbid access entire filesystem default <directory /> options followsymlinks allowoverride none order deny,allow allow </directory> i tried options +indexes, options doesnt seem work. tried change permissions of folder too. added dummy index.html in folder well the folder located @ /srv/www/htdocs/testfolder. any ideas? change config options -indexes followsymlinks allowoverride order allow,deny allow after create .htaccess file in folder , add options +indexes to it. need reload apache.

image - I want to show a picture in QWidget, but it doesn't work -

my code is:but can't find image in qwidget. can if want show image ? , what's wrong code? qttest::qttest(qwidget *parent) : qwidget(parent) { qhboxlayout * m_viewlayout = new qhboxlayout(); this->setlayout(m_viewlayout); qhboxlayout * showlayout = new qhboxlayout(); qhboxlayout * btnlayout = new qhboxlayout(); m_viewlayout->addlayout(showlayout); m_viewlayout->addlayout(btnlayout); widget1 = new qwidget(); showlayout->addwidget(widget1); qpixmap image("c:\\users\\zhq\\desktop\\1.png"); qpainter painter(widget1); painter.drawpixmap(qpoint(0,0),image); widget2 = new qwidget(); showlayout->addwidget(widget2); qpushbutton * btn = new qpushbutton("btn"); btnlayout->addwidget(btn); showlayout->addstretch(); } there's couple of thing wrong code. assuming image loaded correctly, should paint image in void qwidget::paintevent(qpaintevent * event) of widget. not paint outside of paint events. also, you're doing it...

api - What HTTP status code should I use for nickname validation? -

i building api , 1 of endpoints nickname validation company. read lot http status codes , entity validation 422 seems best choice. how 1 field validation in example? what http status code should use nickname validation? for example exists i think 409 conflict appropriate pick the 409 (conflict) status code indicates request not completed due conflict current state of target resource. code used in situations user might able resolve conflict , resubmit request. server should generate payload includes enough information user recognize source of conflict. user 1 picked username, user 2 wants same, can't, because conflicts user 1's username or has not allowed chars for this, 422 unprocessable entity mentioned seems ok. the 422 (unprocessable entity) status code means server understands content type of request entity (hence 415(unsupported media type) status code inappropriate), , the syntax of request en...

php - Using an array value to retrieve from another array -

i have created array, 1 of intended string used php display field record retrieved sqlite3. my problem ... doesn't. the array defined, "1" being first database field, , "2" second database field: edit : have re-defined problem script can see whole thing: //if have array (simulating record retrieved database): $record = array( name => 'joe', comments => 'good bloke', ); //then define array reference it: $fields = array( 1 => array( 'db_index' => 'name', 'db_type' => 'text', 'display' => '$record["name"]', 'form_label' => 'name', ), 2 => array( 'db_index' => 'comments', 'db_type' => 'text', 'display' => '$record["comments"]', 'form_label' => 'comments', ), ); //if use lines: print "e...

python - How can I find an element inside a frameset? -

how can find element inside frameset using python splinter? <frameset border="0" rows="100"> <frame id="banner898989898"> # id change each new login ..... <body> <div id="1"> <div class="2"> <div> <form id="2"> <input type = text id = "3"> # want find element , fill i tried find_by_css , fi nd_by_xpath , find_by_tag, find_by_name , find_by_value , find_by_id webdriver: find_element_by_xpath . i got elementdoesnotexist exception, although succeded in finding other elements syntax above.

javascript - Is there another option for jquery opacity? -

i have series of sliders control items / links on site. http://wp11004271.server-he.de/alloytoy4.0/ . @ moment there 2 options these links, available (dark background) , unavailable (light background). add in-between variables links available in capacity. var filter = {}; var unmarkitem = function (alloy) { var domalloy = $('#alloy_' + alloy); domalloy.css('opacity', 1); // alloys[alloy].marked = false; }; var markitem = function (alloy) { var domalloy = $('#alloy_' + alloy); domalloy.css('opacity', 0.2); // alloys[alloy].marked = true; }; iam familiar true or false want add other options. thoughts on add? you using marked boolean, means, can 2 values assigned to: true or false . if want more options, recommend use marked integer, means number without decimal places (guess thats right word it, if not, correct me) wit...

node.js - PM2 run task requiring 'sudo' -

i have task must run using sudo (sets listener on low port). there way specify in pm2 json start file declaration? i did research after vexii's comment , found 1 way access privileged ports works me. on unbuntu system, sudo apt-get install libcap2 then arrange setcap run before node started. in case put following in rc.local, run .bashrc or .profile in user account adding 'sudo' comand. setcap "cap_net_bind_service=+ep" /usr/bin/nodejs what allow program run node access privileged port on system. i'd finer grained solution got me going.

javascript - Keep elements order which are in a row on smaller screens -

Image
this may trivial question can't head around it. created container fluid has rows inside, pretty basic stuff, i'd not stack in mobile version , keep still in panel. it stays in panel in mobile version, result horrifying. i'm displaying 2 rows on top of each other, 1 holds information player points, ratio, score etc , lower 1 has values. but, when stacked make no sense @ all. i'm creating elements dynamically javascript , shouldn't important, problem don't know class change @ point. //creates row function createrow(pos,name,coef,ratio,points){ //this horizontal row var upper_row = document.createelement("div"); upper_row.classname = "row"; //these horizontally positioned elements var koht = document.createelement("div"); koht.classname = "col-xs-1 suurem"; koht.textcontent = pos; var tyhi = document.createelement("div"); tyhi.classname = "col-xs-7 suurem"; ...

web services - Can you use soapui to automate functional tests to run multiple tests in one instance? -

from i've seen online functional test can automated send request through soapui harness , response can verified. use soapui write hundred tests , have these automatically run , record response no user interaction? please note don't have access soapui pro, free version. you can create test suite in soap-ui, inside test suite can define test cases.when execute test suite, test run in single shot.you can put assertions validate these response.

android - what does deviceready event in cordova really do -

when creating watcher in cordova, need fire after device ready. in ionic framework using following code that. $ionicplatform.ready(function() { $cordovaplugin.somefunction().then(success, error); }); i want know code doing..? somefunction() , done .then(success, error); this question answered existing cordova documentation: cordova documentation - deviceready event i recommend read tutorials or guides on how start hybrid app development. success() called, when device has fired device ready event. error should self-explaining.

java - How to return FileSystemResource or json with Spring RestController? -

i have method download zip file , @ moment use filesystemresource it. problem extension controller, ccheck if file zip file , throw exception if isn't so. exception create json object error details , return it. problem type of rest api because have : @requestmapping(value = "/zipdownload", produces="application/zip", method = requestmethod.get) public filesystemresource getzip(@requestparam(value="filepath", required=true) string filepath ) throws fileextensionexception{ return file.getzipfile(filepath); } and services: public filesystemresource getzipfile(string filename) throws fileextensionexception { string ext=filenameutils.getextension(filename); if (!ext.equals("zip")) throw new fileextensionexception(ext + " , not zip"); return new filesystemresource(new file(filename)); } the exception public class fileextensionexception extends exception { private static final long serialversionui...

apache - Bulk 301 Redirect for URLs with Query Strings -

this first post hoping can help. have found similar answers nothing try seems work. have redesigned client website, old site old. has lot of redirects needed , site had lot of query string urls. i need 301 redirect in bulk urls have following in url: /suppliersearch.php?start={query string} to /wedding-directory everything have tried has been ignored redirect. any great. rewriteengine on rewritecond %{query_string} ^start= [nc] rewriterule suppliersearch\.php$ /wedding-directory/? [r=301,l,nc] if apache 2.4 or later; can use qsd flag instead of redirection ..directory/? .

ios - AFNetworking need to bypass ssl checking -

i have app connects directly hardware routers. since ios 9 updated afnetworking , getting ssl errors when attempt connect on https . this isn't ios 9 app transport security issue, have added relevant .plist entry bypass , connections work fine on http . i need bypass certificate checking each router has it's own self signed certificate, can't add certificates app every users different. i use afhttprequestoperation subclass connections , have set self.securitypolicy.allowinvalidcertificates = yes; following error: error during connection: error domain=nsurlerrordomain code=-1200 "an ssl error has occurred , secure connection server cannot made." userinfo={_kcfstreamerrorcodekey=-9806, nslocalizedrecoverysuggestion=would connect server anyway?, nsunderlyingerror=0x7fa9f3611b40 {error domain=kcferrordomaincfnetwork code=-1200 "an ssl error has occurred , secure connection server cannot made." userinfo={nserrorfailingurls...

oracle - Showing Different aggregate for different products -

i want code used generate aggregate product product. product aggregate can year date(ytd), months date(mtd) , quarter date(qtd). user pass parameter on basis code should decide kind of output user wants. if year passing in parameter code should generate aggregate starting of year sysdate. if quarter no passing in parameter code should generate aggregate starting of quarter sysdate. if month passing in parameter code should generate aggregate starting of month sysdate. it means on basis of parameter should able decide kind of user want 3. input data this- product table product_id product_name price 1 mobile 200 2 t.v. 400 3 mixer 300 and sales table- product_id sales_date quantity 1 01-01-2015 30 2 03-01-2015 40 3 06-02-2015 10 ...

c++ - Installing Ingres Database on Mac OS X 10.10 -

i need - using macbook pro yosemite installed. started next year in college , have subject databases. tutor wants use ingres database, there no release mac (there release windows, linux , solaris). i googled community installer/package found old tutorials on building source code. still did not found clear step step tutorial on how , compilers required. could please tell me how install ingres on mac or point me tutorial? other than http://community.actian.com/wiki/building_ingres_on_mac http://community.actian.com/wiki/osx_installer cause don't understand them. please if can. thanks i've no experience ingres directly, have considered virtual machine setup such vagrant? run ingres server in linux vm, , forward ports host machine.

ios - EXC_BAD_ACCESS with viewWillTransitionToSize and Xcode 7 -

i exc_bad_access viewwilltransitiontosize in xcode 7. solution posted here exc_bad_access viewwilltransitiontosize , xcode 6.3 worked untill upgraded xcode 7. override func viewwilltransitiontosize(size: cgsize, withtransitioncoordinator coordinator: uiviewcontrollertransitioncoordinator) { super.viewwilltransitiontosize(size, withtransitioncoordinator: coordinator) if let safecoordinator = coordinator uiviewcontrollertransitioncoordinator? { // error: exc_bad_access here print("coordinator != nil") safecoordinator.animatealongsidetransition({ context in self.tableview.frame = cgrectmake(0, 0, size.width, size.height) }, completion: nil) } else { print("coordinator == nil") } } any appriciated.

share option in windows phone app -

Image
i wanna provide share option windows app apps in windows phone, android develpement. please 1 tell, possible in windows phone. (using rt, not in silver light) thank in advance. for example: below image i using below code using " how use sharelinktask namespace in windows phone 8.1? " link. protected override void onnavigatedto(navigationeventargs e) { datatransfermanager dtmanager = datatransfermanager.getforcurrentview(); dtmanager.datarequested += dtmanager_datarequested; } private async void dtmanager_datarequested(datatransfermanager sender, datarequestedeventargs e) { e.request.data.properties.title = "code samples"; e.request.data.properties.description = "here great code samples windows phone."; e.request.data.setweblink(new uri("http://code.msdn.com/wpapps")); } // click button share web link private void btnsharelink_click(object sender, routedeventargs e) { windows.applicationmodel.datatransfer.datat...

Jquery Steps and FormValidation (re-validate) -

i using jquery steps , formvalidation when onstepchanged cannot re-validate fields. onstepchanging: function(e, currentindex, newindex) { var fv = $('#form1').data('formvalidation'), // formvalidation instance // current step container $container = $('#form1').find('section[data-step="' + currentindex +'"]'); // validate container fv.validatecontainer($container); var isvalidstep = fv.isvalidcontainer($container); if (isvalidstep === false || isvalidstep === null) { // not jump next step return false; } if (currentindex === 3) { // form $.ajax({ type: "post", url: url, data: $('#form1').serialize(), datatype: 'json', cache: false, async: false, success: function(data){ if (data.result === 'error...

What is the benefit of sending to a channel by using select in Go? -

in example directory of gorilla websocket there file called hub.go. https://github.com/gorilla/websocket/blob/master/examples/chat/hub.go here can find method on type hub this. func (h *hub) run() { { select { case c := <-h.register: h.connections[c] = true case c := <-h.unregister: if _, ok := h.connections[c]; ok { delete(h.connections, c) close(c.send) } case m := <-h.broadcast: c := range h.connections { select { case c.send <- m: default: close(c.send) delete(h.connections, c) } } } } } why not send c.send channel straight in last case this? case m := <-h.broadcast: c := range h.connections { c.send <- m } it's method of guaranted nonblocking send channel. in case of c.send chan ca...

java - Implementing Button onClickView inside a class that extends OnClickItemListener -

i have class extends fragment , implements onclickitemlistener , gridview. need add 3 clickable buttons inside class , onclick(view v) cannot implemented because class implements onclickitemlistener . in xml layout buttons inside linearlayout . how can implement works? thank you. no matter do, need set click listener on buttons. means have find buttons in view (probably in oncreateview ) , call view.setonclicklistener(new view.onclicklistener()) . if want fragment listener, add interface class fragment implements onclicklistener, onitemclicklistener , when find view call view.setonclicklistener(this)

vba - Type mismatch error 13 arrays -

i have read through examples on stackoverflow , still can't seem statement right - can point me going wrong please? the error type mismatch @ point trying split line of text held in linetext multidimensional array orders() . tried raworders(j) orders(y, x) same result. dim raworders() string dim orders() string dim linetext string dim h integer dim p integer dim x integer dim y integer dim j integer dim filepath string dim filename string dim filenum integer filenum = freefile() open filename input #filenum raworders = split(input$(lof(filenum), #filenum), vbnewline) close #filenum redim orders(3, 21) h = 1 p = 0 j = 0 x = 0 y = 0 while not raworders(p) = "" linetext = raworders(h) while j <> 21 orders(y, x) = split(linetext, ",") *errors out here giving type missmatch* x = x + 1 j = j + 1 loop y = y + 1 h = h + 1 p = p + 1 loop dim splitres() variant 'one dimension dim ...

javascript - Add function if song/track ended? -

i'm using jplayer plugin want add event function if last song/track + playlist ended. as can see in docs event fired when playlist ended. var playlength = myplaylist.playlist.length var currentsong = 0; $("#jpid").jplayer( { ready: function() { // $.jplayer.event.ready event $(this).jplayer("setmedia", { // set media m4v: "m4v/presentation.m4v" }).jplayer("play"); // attempt auto play media }, ended: function() { // $.jplayer.event.ended event currentsong++; if(currentsong==playlength) ------> show html }, supplied: "m4v" ); as don't know if myplaylist.current object or , index can check playlist finish using own counter your code need this var currentsong = 0; $("#music").bind($.jplayer.event.ended,function(event){ currentsong++; if(myplaylist.playlist.length == currentsong) { $('.show').html('ended'); ...

Regex expressions (“illegal escape character”) -

i using regular expressions finds strings "override="/var/logs/test/" or "override="/var/logs/sample/" in .xml file. i have final string pattern: public final static string regex_logpath="override=\"\/var\/logs\/([^\"]*)\/"; it works fine (i build successful (total time: 0 seconds) while running project in netbeans ide), strings found. when attemp compile code .jar file, error msg: error: illegal escape character public final static string regex_logpath="override=\"\/var\/logs\/([^\"]*)\/"; compile failed; see compiler error output details. build failed (total time: 0 seconds) you don't have escape forwards slashes, not special (escape-able) characters.

google analytics - Limiting the local stored data size in Android GoogleAnalytics SDK -

i have android app tracks usage using googleanalytics sdk. this app used in various network situations, of not have internet connection. in case, there no internet connection, googleanalytics data keeps on accumulating. is there way limit buffer of locally stored data in googleanalytics ? or keep on collecting until hits system limit , throws exception ?

performance - Very slow "update table" operation on Postgres -

i'm using postgres 9.2, reason i've problem slow updates on relatively small table (16k rows). table ddl: create table my_categories ( id serial, category_id integer, is_done smallint default 0, expected_number_of_flags integer default 0 not null, number_of_flags integer default 0 not null, is_active smallint default 0 not null, constraint my_categories_pkey primary key(id) ) (oids = false); create index my_categories_idx on my_categories using btree (category_id); and here stats update row: explain analyze update my_categories set expected_number_of_flags = expected_number_of_flags + 1 category_id = 96465; update on my_categories (cost=4.27..8.29 rows=1 width=26) (actual time=199746.281..199746.281 rows=0 loops=1) -> bitmap heap scan on my_categories (cost=4.27..8.29 rows=1 width=26) (actual time=50.937..51.193 rows=1 loops=1) recheck cond: (category_id = 96465) -> bitmap index scan on my_categories_idx (cost=0.00..4.27 row...

php - base64 image code not work in gmail -

i use zend_mail , render smarty tpl email template. try send logo in email message (code using base64): <img src="data:image/png;base64,ivborw0kggoaaaansuheugaaao8aaaa1cayaaacp1bzwaaaacxbiwxmaaa7caaaowge... this doesn't work in gmail, image still hidden... i found this: base64 images gmail don't know how load headers, tried use $mail->addheader(...); but doesn't bring effect, how can solve problem code logo in base64 work in email client ?

c# - Delete host from dns zone -

i trying delete host using below code selected zone not deleting. string query = "select * microsoftdns_zone containername = '" + zonename + "' , ownername='" + recordname + "'"; objectquery qry = new objectquery(query); managementscope scope = new managementscope(@"\\" + dnsservername + "\\root\\microsoftdns"); scope.connect(); managementobjectsearcher s = new managementobjectsearcher(scope, qry); managementobjectcollection col = s.get(); foreach (managementobject obj in col) { obj.delete(); } please help. below code delete domain record. bool deleterecordfromdns(string zonename, string dnsservername, string recordname) { try { string query = string.format("select * microsoftdns_atype ownername = '{0}.{1}'", recordname, zonename); objectquery q...

javascript - Load specific data from external source -

given script load data specific div of external source on click. load data form div of external source. trying load specific things want. load image, title, post label, date , comments only, not text summery, in same order. script: $(function() { var page = null; var counter = 0; function getnext() { // grab next element array of date-outer divs , copy .content div if (counter >= page.length) return; var elm = $(page[counter]).clone(); elm.find('script').remove(); // remove script tags in div elm.appendto('#load-here'); counter++; } $('button.btn').click(function(e) { if (page === null) { page = false; // prevents request being made twice $.get('http://test-html-site.blogspot.com/search/label/', function(data) { page = $(data).find('.date-outer'); getnext(); }); } else if (pag...

html - cURL using php and json -

hey guys having trouble curl using php. have front-end on 1 server, middle on 1 server, , back-end on server. suppose communicate each other using curl. front-end person enters there username , password, there front-end uses curl send middle $_post fields username , password, after middle passes them along back-end checks within database , echo's whether credentials legit. reason keep getting "null" after tries login. should print "success" or "no". think problem json variable back-end echoing. not sure here code fragments. doing wrong? front-end <?php // sends user name , password middle end , checks cookies $username = $_post['username']; $password = $_post['password']; $url1= "https://web.njit.edu/~kc328/mid.php"; $cookie="cookie.txt"; $postdata = array("ucid" => $username, "pass" => $password); //authenticate against our database $ch = curl_init(); //echo $ch; curl_set...

scala - Implicit writes for child class type -

i have class person , class employee. class employee extends class person. my current implicit writes convert classes json looks this: implicit val implicitpersonwrites = new writes[person] { def writes(v: person): jsvalue = { json.obj("label" -> v.label, "age" -> v.age) } } implicit val implicitemployeewrites = new writes[employee] { def writes(v: employee): jsvalue = { json.obj("label" -> v.label, "age" -> v.age, "company" -> v.company) } } the problem object of type employee, implicit write person superclass used. @ end fields specific employee class not present in output. how make implicit writes in case of inheritance? three options: (best in circumstances) use composition instead of inheritance. instead of class employee(...) extends person(...)) have class employee(person: person, company: string) . if have fixed hierarchy of subclasses, then, mention in comment, dispatch on...

TFS Build Script Definition - Not Getting Latest Code -

for 1 of our build scripts (tfs 2013), when run manually or during check-in (continuous integration trigger), build script not picking latest code changes. looked in logs , have correct changeset number impacted files (in case .vb files). tried several different .vb files. tried recreating build script scratch no avail. have several other build scripts similar web applications have no issues same build settings. project builds fine. set clean build true. configurations set "any cpu|release". output location set singlefolder. build template set tfvctemplate.12.xaml. thoughts or suggestions appreciated. so, after bit of kicking tires figured out. had actual compiled .dll in case checked tfs. hence, build server grab old version checked in versus compiling project on fly. removed .dll source control resolve issue.

php - Move laravel project to new server -

have existing laravel (v4) project in 1 server. want upload new server. can explain steps how this? i new in laravel. have done far: have downloaded files machine , uploaded new cpanel server. created mysql database , imported tables. follow following steps: create new database phpmyadmin of new cpanel import previous database new database in app/config/database.php change data config new database configure just transfer files , folder new cpanel if paths not changed website should work fine.

sql - Missing Attribute after applying joins and merge on Rails -

i have 2 models; category has_many :locations location belongs_to :category reverse_geocoded_by :latitude, :longitude |obj,results| if geo = results.first obj.address = geo.address obj.city = geo.city obj.country = geo.country_code end end after_validation :reverse_geocode when apply, nearest category location. used near scope in geocoder gem here. category.joins(:locations).merge(location.near("tignale")) in sql select locations.*, (69.09332411348201 * abs(locations.latitude - 45.7426301) * 0.7071067811865475) + (59.836573914187355 * abs(locations.longitude - 10.7091062) * 0.7071067811865475) distance, case when (locations.latitude >= 45.7426301 , locations.longitude >= 10.7091062) 45.0 when (locations.latitude < 45.7426301 , locations.longitude >= 10.7091062) 135.0 when (locations.latitude < 45.7426301 , locations.longitude < 10.7091062) 225.0 when (locations.latitude >= 45.7426301 , locations.longitude < 1...

html - getting a message to be displayed on javascript method -

firstly show code. html: <label>password </label> <input type="password" id="pword"><br> <label>confirm password </label> <input type="password" id="confpword" onkeyup="passwordvalidation(); return false;"> <span id="themessage" class="themessage"></span><br> js: function passwordvalidation(){ var username = document.getelementbyid("uname"); var password1 = document.getelementbyid("pword"); var confpword1 = document.getelementbyid("confpword"); var themsg = document.getelementbyid("themessage"); var gc = "#ff6666"; if (password1.value == confpword1.value){ themsg.style.color = gc; themsg.innerhtml = "passwords match"; }else{ themsg.style.color = gc; themsg.innerhtml = "passwords not match"; } } i cant wor...

plugins - How to Configure SonarQube for delphi? -

i want configure sonarqube can analyze delphi project too, , when search online saw there used delphi plugin sonarqube. when @ plugins latest build doesn't show delphi plugin. is plugin still available in other way? or possible configure sonarqube delphi without plugin? as of g. ann response discontinued puglin sonar, searching internet, , (3 days) developer fabricio columbus made happen! we tested , running current version of sonar: compatible sonarqube 4.5.x , sonarqube 5.1.2 https://github.com/fabriciocolombo/sonar-delphi release: https://github.com/fabriciocolombo/sonar-delphi/releases jar: https://github.com/fabriciocolombo/sonar-delphi/releases/download/0.3.3-snapshot/sonar-delphi-plugin-0.3.3-snapshot.jar ps: translated portuguese english google translate.

parse.com - Parse error when using example Python code for REST API "Authentication failed because the remote party has closed the transport stream" -

i can't figure out going on. using example python code found here basic query on parse class. using following code: import json,httplib connection = httplib.httpsconnection('api.parse.com', 443) connection.connect() connection.request('get', '/1/classes/my-class', '', { "x-parse-application-id": "my-app-id", "x-parse-rest-api-key": "my-rest-api-key" }) result = json.loads(connection.getresponse().read()) print result i following messages: runtime error (ioexception): authentication failed because remote party has closed transport stream. traceback: line 280, in do_handshake, "c:\program files\rhinoceros 5.0 (64-bit)\plug-ins\ironpython\lib\ssl.py" line 120, in __init__, "c:\program files\rhinoceros 5.0 (64-bit)\plug-ins\ironpython\lib\ssl.py" line 336, in wrap_socket, "c:\program files\rhinoceros 5.0 (64-bit)\plug-ins\ironpython\lib\ssl.py" line 1156, in connect, ...

Matlab Neural Network Structure -

Image
i'm full newbie in neural networks. generated nn in matlab. further need know exact structure of nn, because need implement in java(static connections , weights, no learning). can explain how connect neurons , math operations perform in each element? nn params next(taken matlab): iw{1,1} - weight layer 1 intput 1 [2.8574 -1.9207; 1.7582 -1.2549; -4.5925 0.23236; 12.0861 12.3701; 2.503 -1.9321; -2.1422 2.6928] lw{2,1} - weight layer [-0.51977 5.3993 3.4349 5.2863 3.1976 -0.67102] b{1} - bias layer 1 [-3.2811; -6.956; -3.0943; 11.1103; 0.14842; -3.3705] b{2} - bias layer 2 [1.4657] transfer function tansig appreciate help. you have nn has 2 inputs, hidden layer of 6 neurons , output layer of 1 neuron. each of neuron in each layer, take outputs previous 1 , multiply them number , offset result another. the numbers show numbers mentioned. for example, neuron 1 hidden layer output hidden1=2.8574*in1 -1.9207*in2-3.2811 . take whatever s...

logging - Create log method to log parameters and their values on current executing method in java -

i want have method - example logutil.logcurrentmethod() , return parameters of method executed , values. example : public void temp(int first, string second, int third){ logutil.logcurrentmethod() //something } and when call : temp(1, "2", 3); to print: first: 1 second: 2 third: 3 i want that, because annoying log parameters of methods 5 parameters example. logcurrentmethod can take parameters, idea make logging easier. problem when copy paste log lines, don't change parameters names (so have example logged width , width instead of width , height or that). can create new object{}.getclass.getenclosingmethod() method , pass method (and use reflection take names), don't know values. other approach pass parameters log method , pass new object{}.getclass.getenclosingmethod() , think there should easier , more convenient way. in advance. you can 2 ways- by using interceptor- logging interceptors also refer this- oracle doc intercep...

plone - How to include resources and bundles with Addons? -

when making plone 5 addon, how add our own resources registry now? (aka our own css , js outgoing bundles?) i've read http://docs.plone.org/adapt-and-extend/theming/resourceregistry.html , isn't helpful... can point me working example of collective addon or better addon documentation? vangheem's example.plone5resource in collective on github has examples of several strategies. examples vary extent need requirejs handle dependencies , whether or not want resources compiled bundle manager. "legacy" bundles easiest if you're updating plone 3 or 4 resource.

c - Why a 2D array is used for stack? Why cant a 1D array be used for a stack? -

here, s[20][20] declared in function pre_post . push operation involves pushing string stack s. how done? why cant execute program 1d array s s[20] stack?? #include<stdio.h> #include<string.h> #include<ctype.h> void push(char item[],int *top,char s[][20]) //pushes symbol item onto stack s { *top=*top+1; //top incremented strcpy(s[*top],item); //item written onto stack } char *pop(int *top,char s[][20]) //pops out topmost element of stack s { char *item; item=s[*top]; *top=*top-1; return item; } void pre_post(char prefix[],char postfix[]) //function convert prefix postfix { char s[20][20]; int top,i; char symbol,ch[2]; char *op1,*op2; top=-1; for(i=strlen(prefix)-1;i>=0;i--) //scans expression in reverse manner { symbol=prefix[i]; //the last symbol scanned first ch[0]=symbol; ch[1]='\0'; ...

Kafka consumer list -

i need find out way ask kafka list of topics. know can using kafka-topics.sh script included in bin\ directory. once have list, need consumers per topic. not find script in directory, nor class in kafka-consumer-api library allows me it. the reason behind need figure out difference between topic's offset , consumers' offsets. is there way achieve this? or need implement functionality in each of consumers? kafka stores information in zookeeper. can see topic related information under brokers->topics . if wish topics programmatically can using zookeeper api. it explained in detail in below links tutorialspoint , zookeeper programmer guide

playframework - Play 2.4 com.avaje.ebean.Model -

this first post please gentle. working through tutorials using play. on version 2.4, tutorials using earlier version. followed guide play website incorporating ebeansin 2.4. my build.sbt name := """please-work""" version := "1.0-snapshot" lazy val root = (project in file(".")).enableplugins(playjava, playebean) scalaversion := "2.11.6" librarydependencies ++= seq( javajdbc, cache, javaws, "org.avaje.ebeanorm" % "avaje-ebeanorm" % "6.8.1" ) // play provides 2 styles of routers, 1 expects actions injected, // other, legacy style, accesses actions statically. routesgenerator := injectedroutesgenerator my application.conf db.default.driver=org.h2.driver db.default.url="jdbc:h2:mem:play" # db.default.username=sa # db.default.password="" ebean.default = ["models.*"] my plugin.sbt // play ebean support, enable, uncomment line, , enabl...