Posts

Showing posts from February, 2015

javascript - Metaslider flexslider move:1 -

i have been trying fix time now, still no luck. on wordpress install i'm using metaslider - flexslider carousel. the images in carousel have different heights, resized fit carousel: result: images have different widths. on doesn't cause problems, when clik next/prev need carousel move 1 image @ time. moving entire visible part. could please me? http://denkkamer.com/nieuwesite/projecten/ i read code: "move: 1;" should work. doesn't. // carousel options itemwidth: 0, //{new} integer: box-model width of individual carousel items, including horizontal borders , padding. itemmargin: 0, //{new} integer: margin between carousel items. minitems: 1, //{new} integer: minimum number of carousel items should visible. items resize fluidly when below this. maxitems: 5, //{new} integer: maxmimum number of carousel items should visible. items resize fluidly when above limit. move: 1, ...

Postal Code listing in PHP/JSON/MySQL -

Image
i have database of ~980k postal codes, , form user can input either zip code, city, state, and/or country. i'd create script auto populates other fields based upon results of another, before arrive there i'm curious best manner parse amount of data select box form. not appropriate way? have on code far, looking pseudo code or thoughts. database looks so took recommendation sakamaki izayoi , found script modified work application. once reaches 3 characters searches database of ~980k postal codes , returns results instantly. let me know guys's thoughts. form <input type="text" id="quote_shipper_postalcode" name="quote_shipper_postalcode" class="form-control" maxlength="5"> javascrpit $(document).ready(function(){ var ac_config = { source: "ajax/ajax_postal_codes.php", select: function(event, ui){ $("#quote_shipper_city").val(ui.item.city); $("#quo...

Shell/Unix - Getting MAC Address -

i know how our mac address on unix environment, know ifconfig -... i'm getting others stuff (i want mac address, nothing more). is possible ? as root user (or user appropriate permissions type "ifconfig -a" from displayed information, find eth0 (this default first ethernet adapter),locate number next hwaddr. mac address..

Get link from anchor tag using Java -

i'm trying value of href attribute anchor tag ( a tag) using java, without third party api. know class of label. website looks this: <html> <body> <div id="uix_wrapper"> <div id="button"> <label class="downloadbutton"> <a href="link want get">button</a> </label> </div> </div> </body> </html> you can use regular expression if try avoid using third-party libraries. basic expression example is <a href="(.*?)"> and should work. can try out using https://www.debuggex.com/ the result in second group.

jquery - Make div container clickable, except export button -

i want create highcharts chart whole div has onclick function, don't want export button handle event on click. should react normal export button. i have tried jquery tricks avoid it, getting highcharts buttons class: highcharts-button , doesn't work : jquery("#container").on('click', ':not(.highcharts-button, .highcharts-button *)', function(e){ e.stoppropagation(); alert('click'); }); here jsfiddle . (problem is: don't want see alert pop when click export button). one way filter event target, e.g: jquery("#container").on('click', function(e){ if ($(e.target).closest('.highcharts-button, .highcharts-contextmenu').length) return; e.stoppropagation(); alert('click'); }); -jsfiddle-

php - How to return multiple value from one function? -

i create simple web in php , want return multiple variables 1 function. possible or not. , possible how? you can return array function dosth(){ $a = 2; $b = 5 $c = 9; return array($a,$b,$c); } and use list() method single values: list($a, $b, $c) = dosth(); echo $a; echo $b; echo $c;

jquery - Getting average or number of columns Highstock -

i'm working highstock column chart. http://jsfiddle.net/gh/get/jquery/1.9.1/highslide-software/highcharts.com/tree/master/samples/stock/demo/column/ $('#container').highcharts('stockchart', { chart: { alignticks: false }, rangeselector: { selected: 1 }, title: { text: 'aapl stock volume' }, series: [{ type: 'column', name: 'aapl stock volume', data: data, datagrouping: { units: [[ 'week', // unit name [1] // allowed multiples ], [ 'month', [1, 2, 3, 4, 6] ]] } }] }); when change range bigger on navigator joins bars , values. there way getting average of these 2 values, not sum? or, there possibility amount of columns, visible...

php - WordPress : is_page_template not working when called from wp_enqueue_scripts action -

i trying enqueue different css files depending on page template use. the function is_page_template("index.php") called wp_enqueue_scripts action function (where styles , scripts called) returns false. use index.php template - reported "what file" plugin working template. what way page template respect of adding scripts html header? function the_scripts() { if( is_page_template('index.php') ) { print "this index.php"; } else { print "failed"; } } wp_enqueue_style( [style_1], [path_1] ); ... wp_enqueue_style( [style_n], [path_n] ); } add_action( 'wp_enqueue_scripts', 'the_scripts' ); i think ( is_page() && !is_page_template() ) work in wp_enqueue_scripts hook check if default page template in use.

c# - How to access a ref bool variable passed into the constructor? -

i have main form, calls smaller form. in main form have bool called _dataready set false , purpose of smaller form check few things , see if data ready, in case sets _dataready true . here problem: call mini form input parameter such ( ref bool _dataready ) problem don't have access outside of constructor block. i tried making private bool , set ref that, after changing state of private bool ref did not take changes, unlike how object oriented programming works. here of code: //this how call mini form within main new frmaccounting(mytextbox1.text.trim().replace(",", "").toint32(),ref _dataready).showdialog(); this constructor of mini form , code: public frmaccounting(decimal price,ref bool _dataready) { initializecomponent(); dataready=_dataready; } private bool dataready; however setting private bool within form ( dataready ) true not change ref (again unlike how objects work)... that's thought happen. my question i...

javascript - Fancybox modifiy. How to modify fancybox to stop at last item on each gallery? (gallery 1 gallery 2 etc) -

this question has answer here: how create separate fancybox galleries on same page? 1 answer i'm using fancybox plugin photo gallery. have multiple galleries more items (photos) , want know how stop slideshow when hits last item on each gallery. fancybox.js not modified. thanks you need add option loop: false when calling in fancybox. you can read more options in the fancybox docs

convert rows to columns in mysql -

Image
i have table in database looks like: i trying create query gives me result like: and when searching trough forum did found information converting rows columns using aggregate function and/or using predefined statement. example did found did try following queries doesn't work don't understand how work copy query. did try use data in it: select fk_playerid name, roundid roundno, score from( roundid, case when roundid = 1 score end 1, case when roundid = 2 score end 2, case when roundid = 3 score end 3, cup ) cup group fk_playerid and second one: select fk_playerid name, roundid roundno, score max(case when'roundid' = 1, score end) roundno1, max(case when'roundid' = 2, score end) roundno2, max(case when'roundid' = 3, score end) roundno3 cup order fk_playerid and question how query must , need little explanation how works. the second 1 pretty close: select c.fk_playerid, p.name max(case when c.roundid = 1 c.score ...

Oracle SQL: Function with a cursor using no data found return value -

i trying write function extract code string, value in table based on code , return value lookup table. this function: create or replace function maths_f (id in varchar2) return number res_code varchar2(2); points number(3,0); cursor c1 select substr(substr(lcstring, instr(lcstring,'02')+2),1,2) sdata s s.id = id; begin open c1; fetch c1 res_code; select c_points points lcresults l l.lc_code = res_code; return points; close c1; exception when no_data_found return 99; end; i running statement test function: select id, lcstring, substr(substr(lcstring, instr(lcstring,'02')+2),1,2) result, maths_f(id) points sdata id = 's00101620' ; the result of query s00101620 11ot02ov29hv05ot03ox30oq ov 99 there value of 35 in c_points in lcresults table lc_code 'ov'... why function finding no data?

c++ - How to make io_service.run(); blocking -

i have method need io_service.run(); block method returning while actual rest call not yet done. added "init" value response body check. restclient::response restclient::get(std::string url){ restclient::response ret = {}; ret.code = 404; ret.body = "init"; boost::asio::ssl::context ctx(boost::asio::ssl::context::sslv23); ctx.set_verify_mode(boost::asio::ssl::verify_none); //ctx.set_default_verify_paths(); boost::asio::io_service io_service; client c(io_service, ctx, "httpbin.org", "/get", "https", ret); io_service.run(); return ret; // res.body returned init } in way io_service.run() block method returning until call finished or timed-out? if want run() keep running when there no "work", can lock service queue using boost::asio::io_service::work object: http://www.boost.org/doc/libs/1_58_0/doc/html/boost_asio/reference/io_service__work.html the usual pattern us...

asp.net - Get minimun value from list -

i have class abc this public class abc{ public int id {get;set;} public int usercount {get;set;} } now add following records list of type abc list<abc> lstabc = new list<abc>(); lstabc.add(new abc(){id=1,usercount=5}); lstabc.add(new abc(){id=2,usercount=15}); lstabc.add(new abc(){id=3,usercount=3}); lstabc.add(new abc(){id=4,usercount=20}); i've list of type int list<int> lstids = new list<int>(); lstids.add(1); lstids.add(3); lstids.add(4); now want find out minimum value of usercount comparing both list id in lstabc should match items presesnt in lstids . can minimum value of usercount using loops there way value in optimized way avoiding loops? you can use enumerable.join link both lists: var joined = id in lstids join x in lstabc on id equals x.id select x; int minvalue = joined.min(x => x.usercount); this more efficient loops since join uses set find matching items. there...

python - What is the name parameter in Pandas Series? -

in doc of series , use parameter of name , fastpath not explained. do? the name argument allows give name series object, i.e. column. when you'll put in dataframe , column named according name parameter. example: in [1]: s = pd.series(["a","b","c"], name="foo") in [2]: s out[2]: 0 1 b 2 c name: foo, dtype: object in [3]: pd.dataframe(s) out[4]: foo 0 1 b 2 c if don't give name series named automatically. here 0 in dataframe object: 0 0 1 b 2 c for fastpath , it's internal parameter , issue has been reported : https://github.com/pydata/pandas/issues/6903

java - JAXB unmarshall unordered elements with multiple occurrences of one of them -

i have xml: <package> <metadata> <title>title</title> <language>en</language> <meta name="cover" /> </metadata> </package> another examples of correct xml's: <package> <metadata> <language>en</language> <title>title</title> </metadata> </package> <package> <metadata> <meta name="content" /> <language>en</language> <meta name="cover" /> <title>title</title> </metadata> </package> and want unmarshall java class using jaxb library. difficulty amount of "meta" element can 0 multiple , order of elements "title" "language" , "meta"s can random. my class looks like: @xmlrootelement(name = "package") @xmlaccessortype(xmlaccesstype.fi...

javascript - Google Analytics don't show any stats on Angular site -

i have code this: (function(i,s,o,g,r,a,m){ i['googleanalyticsobject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new date();a=s.createelement(o), m=s.getelementsbytagname(o)[0];a.async=1;a.src=g;m.parentnode.insertbefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', bmb.vars('ga')['trackingid'], { 'cookiedomain': 'none' }); ga('set', 'appversion', bmb.version()); i have cookiedomain because i'm testing on localhost and in angular: bmb.site.$module.config(function ($analyticsprovider) { $analyticsprovider.virtualpageviews(false); $analyticsprovider.firstpageview(false); $analyticsprovider.registerpagetrack(function (page, title) { if (title) { page = {page: page, title: title} } if (window._gaq) _gaq.push(['_trackpageview', page.pa...

android - The behavior of onSurfaceTextureDestroyed is different on some devices -

i encountered strage thing when use textureview on work. implemented 4 methods of surfacetexturelistener: onsurfacetextureavailable onsurfacetexturesizechanged onsurfacetexturedestroyed onsurfacetextureupdated doing such thing quite easy, it's unnecessary paste code. there no doubt onsurfacetextureavailable called when activity started , onsurfacetexturedestroyed called when activity destroyed. but things changed in case of foreground , backgroud switching. for devices, onsurfacetextureavailable , onsurfacetexturedestroyed not called during foreground , backgroud switching. but devices such coolpad 8670 android 4.4.2, onsurfacetexturedestroyed called when activity go backgroud , onsurfacetextureavailable called when activity return foregroud. i don't know why. is there way of avoiding calling of onsurfacetexturedestroyed when activity go background devices?

c++ - Not able to overload existing std::vector functions -

i doing poc implementation , per requirement need extend std::vector insert api take single parameter (value inserted) , internally code add in end of container. i created custom class (valvector) derived std::vector , defined custom insert api accepts single parameter while compiling throws error. appreciate quick response. below snippet code error message: #include <iostream> #include <vector> using namespace std; typedef bool bool; template<class t, class allocator = allocator<t>> class valvector : public std::vector<t, allocator> { public: bool insert(const t& elem) { return (this->insert(this->end(),elem)!=this->end()); } }; int main () { std::vector<int> myvector (3,100); std::vector<int>::iterator it; myvector.push_back (200 ); valvector<int> mkeyar; mkeyar.insert(10); // std::cout << "myvector contains:"; (auto it=mkeyar.begin(); it<mkeyar.end(); it++) ...

icalendar - HTML in iCal attachment -

can ical attachment contain html in description property? if so, restrictions? after doing research , testing. answer qualified no. meaning: throw in there, shouldn't. it not strictly forbidden rfc, description not appropriate property html content. description should plain text version of content. property x-alt-desc fmttype declaration of text/html appropriate property html content. the following example worked in both outlook , gmail/google calendar, not appear supported thunderbird(w/lightning): (please, forgive ouput. generated outlook) x-alt-desc;fmttype=text/html:<!doctype html public "-//w3c//dtd html 3.2//e n">\n<html>\n<head>\n<meta name="generator" content="ms exchange server ve rsion 08.00.0681.000">\n<title></title>\n</head>\n<body>\n<!-- converted f rom text/rtf format -->\n\n<p dir=ltr><span lang="en-us"></span><span lan...

android - OSMDROID - How to select the best tiles provider depending on the usage policy -

i developing android app show online maps relating point of interests nearby current location of end-users. using osmdroid, osmdroidbonuspack , mapnik tile provider. my main concern tiles providers' usage policy avoid "forbidden" responses when users start using app. don't expect have many users in case. checking osm (mapnik) usage policy, says not allow use maps in app distributed without prior permission. asked permission in case did not it, thinking use mapquest maps registered in mapquest website private key used in app. problem don't see way add mapquest key when using osmdroid. summarising have 2 questions: what best tile provider in terms of usage policy publish android app? in case select mapquest , how can add private key? why not required add mapquest key when using mapquestosm ? open free? thank much, regards, since you're talking osm, assume referring mapquest open (osm-based), not standard mapquest (proprietary d...

blender - overlapping of geometries in Scenekit -

Image
i'm have put plane onto same height edges of cube are. see created in blender , can download blender file here . plane little bigger hole overlap. the whole rendering little funny. frame around hole due plane , cube edge having same hight. want plane visible. how can fix this? edit: can change height tinywiny bit prefer different approach due shadows , reflections , stuff. i'm little confused because referring hole while seems cube not have hole , adding plane on top of it. what seeing called depth fighting , it's because both objects have same z-value, yes. scnmaterial exposes properties writestodepthbuffer , readsfromdepthbuffer can that. check scnnode 's renderingorder property.

Are deceptive redirect hyperlinks safe to use in emails? -

we're generating emails programmatically. need include hyperlink takes people page on website a, want use website b track click before redirecting. is safe show url website a, in hyperlink takes them website b? is, this: here's page wanted: <a href="http://website-b.com/sometrackingtoken"> website-a.com/thethingyouwereexpecting </a> ... or sufficiently scam-like email clients might object it? note: we do want website-a.com url visible email recipient. the sites on different domains. you can set visible link , href property 2 totally different things , there's little no consequences, pretty standard mailers need tracking. the thing is, why not wrap text instead of literal link? present button if you're worried "click ability". if want present link that's same, why not append parameters on end trigger tracking action? /x vs /x?token=xxx can grab , and process @ point of handling request. suppress di...

Remembering Google Two Factor authentication while clearning cookies -

i have enable 2-factor authentication on google. want clear cookies in browser (firefox/iceweasel) @ end of session while retaining "remember 30 days" feature. i've tried rules retaining specific cookies accounts.google.com, google.com, google.co.in, etc, appears either stay logged in, or have log in second factor. so question is: 1. "remember.." feature working via cookies? 2. cookies allowing login separate allowing second factor authentication? if yes, cookies retain? found answer on superuser, bottom line is: keep google cookies or enter authentication code every time. https://superuser.com/questions/702976/which-cookie-is-the-googles-two-factor-authentication-related-cookie

c# - Push Table to screen -

i have ajax request when branch of jsstree clicked $("#jstree").bind("select_node.jstree", function(evt, data) { var idargument = data.node.text; $.ajax( { type: "post", url: "webform1.aspx/brancheselectionnee", data: json.stringify({ id: idargument }), contenttype: "application/json; charset=utf-8", success: function(msg) { ; } }); }); so, call function, make new "page" (because it's static) , call function return system.web.ui.webcontrols.table . public static string brancheselectionnee(string id) { var page = (webform1)httpcontext.current.currenthandler; system.web.ui.webcontrols.table tableau = page.brancheselectionneenonstatique(id); var stringwriter = new stringwriter(); using (var htmlwriter = new htmltextwriter(stringwriter)) { tableau.rendercontrol(htmlwr...

java - cannot build libgdx game for android when depending on jersey client -

i'm trying write libgdx multiplayer game. rest server ready , want connect libgdx client. added following core dependencies. project(":core") { apply plugin: "java" dependencies { compile "com.badlogicgames.gdx:gdx:$gdxversion" compile "com.badlogicgames.gdx:gdx-box2d:$gdxversion" compile "com.sun.jersey:jersey-client:1.17" compile "com.sun.jersey:jersey-json:1.17" } } when running desktop target fine. when running android target error. error:android gradle build target: org.gradle.tooling.gradleconnectionexception: not execute build using gradle installation '/users/miroo/.gradle/wrapper/dists/gradle-2.2-all/7a0ga9ywrcnpyp1ikd5yba574/gradle-2.2'. what doing wrong? appreciated ;-) thanks in advance. amiroo --update-- it' seems both dependencies (jersey-client , jersey-json) each cause separate error. error above caused jersey-json dependency jersey-client projec...

jquery - Load only one ID element from another website -

i know can this <!doctype html> <html> <head> <meta charset="utf-8"> <title>load remote content object element</title> </head> <body> <div id="siteloader"></div> <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script> <script> $("#siteloader").html('<object data="http://tired.com/">'); </script> </body> </html> and load web site in page,but problem on url have 1 element, , i​ want specific id content website id #sidebar-wrapper possible? it typically not possible load content website , read using javascript due browser security restrictions. need server-side script download data first on server , serve client.

nav - How to save images in Navision? -

i new navision , in project data comes web portal via xml inserted navision tables using xml ports. according our new requirement need store images in nav tables don't know how that? possible? you can store images (nav supports .bmp) in field type blob . answer above correct except "blob files ". should "blob fields "

key value observing - [iOS]KVO setValuesForKeysWithDictionary -

i using setvaluesforkeyswithdictionary populate model object . model object defined as @interface commonmodel : nsobject @property (nonatomic,copy)nsstring *imageurl; @property (nonatomic,copy)nsstring *name; @property (nonatomic,copy)nsstring *uuid; @property (nonatomic,strong)metadatamodel *metadata; @property (nonatomic,copy)nsstring *type; @property (nonatomic,copy)nsstring *age; @end and init class follows commonmodel *model = [[commonmodel alloc] init]; [model setvaluesforkeyswithdictionary:dic]; the dic server data { category = random; created = 1436348796510; duration = 259; metadata = { path = "/songs/396677ea-2556-11e5-afe1-033c8b2070b7"; }; modified = 1436348796510; name = "\u6ce1\u6cab"; type = song; url = "http://www.devinzhao.com/pomo.mp3"; uuid = "396677ea-2556-11e5-afe1-033c8b2070b7"; } i knew type should "song" not song. when u...

numpy - Print all the non-zero element in a 2D matrix in Python -

i have sparse 2d matrix, typically this: test array([[ 1., 0., 0., 0.], [ 0., 0., 0., 0.], [ 0., 2., 1., 0.], [ 0., 0., 0., 1.]]) i'm interested in nonzero elements in "test" index = numpy.nonzero(test) returns tuple of arrays giving me indices nonzero elements: index (array([0, 2, 2, 3]), array([0, 1, 2, 3])) for each row print out nonzero elements, skipping rows containing 0 elements. i appreciate hints this. thanks hints. solved problem: >>> test array([[ 1., 0., 0., 0.], [ 0., 0., 0., 0.], [ 0., 2., 1., 0.], [ 0., 0., 0., 1.]]) >>> transp=np.transpose(np.nonzero(test)) >>> transp array([[0, 0], [2, 1], [2, 2], [3, 3]]) >>> index in range(len(transp)): row,col = transp[index] print 'row index ',row,'col index ',col,' value : ', test[row,col] giving me: row index 0 col index 0 value : 1.0 row index 2 col index 1 value :...

What is Clojure volatile? -

there has been addition in recent clojure 1.7 release : volatile! volatile used in many languages, including java, semantics in clojure? what do? when useful? volatiles "faster atom" no atomicity guarantees. introduced atoms considered slow hold state in transducers. there new set of functions ( volatile! , vswap! , vreset! , volatile? ) create , use volatile "boxes" hold state in stateful transducers. volatiles faster atoms give atomicity guarantees should used thread isolation

c# - Is there any OnClick event of Telerik RadGrid Command Item? -

when add commanditemdisplay="top" in telrik radgrid mastertableview , 1 button addnewrecordbutton , 1 linkbutton initinsertbutton . now, code on onclick event i.e., button/linkbutton enable , disable based on condition. all need is: there radcombobox (outside of radgrid) in web page , radgrid. when first time page loads, , user forgets select item radcombobox , clicks on "add new" button of radgrid button should disable @ time , alert should come (select item combobox first) now, when user select item radcombobox, , click on "add new" button of radgrid should perform "add" functionality //---this part done below code (replied roman) working fine disable "add new" button , show alert. but how create requirement using code? put line of code should work per need. please guide. please note new in telerik controls if ask basic please forgive , try guide me in simple way. thanks in advance. use radgrid_itemc...

How to use Authorization & Authentication in Asp.net, C#? -

i using roll management , trying give page , folder access according user or user group, using server created ad group user authentication. i have default1.aspx page default , subdir1 folder give different access separate user group i using below logic in web.config. <location path="subdir1"> <system.web> <authorization> <allow users ="?" /> </authorization> </system.web> </location> i facing problem provide same access 2 or more directory same user should have provide allow user code twice both folder? i can use logic repeating value folder want access providing in 1 logic. i have got answer configure folder/page access, have make different access shown below.. configure access specific file , folder, set forms-based authentication. request page in application redirected logon.aspx automatically. in web.config file, done following code. this code grants user...

reactjs - React setState is null -

i can't undestand how can pass information between 2 pages? i'm using react router , can pass id through link , take correct string array. looks this: //my array var data = [ {id: 1, title: "breaking news #1", text: "this 1 test new", date: "12.05.2015"}, {id: 5, title: "breaking news #2", text: "this *another* test new", date: "03.05.2015"} ]; //my fetch function componentdidmount: function() { var id = this.props.params.id; var dt = data; var post = []; (var i=0; i<dt.length; i++){ if (dt[i].id == id){ post.push(dt[i]); }; }; this.setstate({post : post}); }, and after i'm trying map info using function this.state.post.map(function (p) { , have error uncaught typeerror: cannot read property 'post' of null as understood state null. why? update: to clarify problem want share code, ...

java - ElasticSearch Multiple Data Directories, choose where to place the index -

i'm running elasticsearch on multiple servers. servers equal, have 2 disks: 1 ssd, , 1 hdd. needless say, ssd faster yet smaller. i know can set multiple data directories in es added paths elasticsearch.yml . but, default, (from i've found) es automatically chooses data directory take based on percentage of disk space available. some indices more important me others, newer ones (those queried lot) need on ssd, , queried less can on hdd. what need done - if possible @ time? add index path? this not possible in elasticsearch. yes, can specify multiple data paths, cannot "assigned" indices. at moment, es stripe data on file level data paths, means shards spread on paths: path directory store index data allocated node. path.data: /path/to/data can optionally include more 1 location, causing data striped across locations (a la raid 0) on file level, favouring locations free space on creation. example: path.data: /path/to/da...

html - How do I add an overlay effect here?CSS -

i have page: link on page,you find product list.i want add @ list overlay effect. code html: <a href="http://www.altradona.ro/lenjerie-sexy/rochii-sexy/rochie-7033-black.html" title="rochie 7033 black" class="product-image"> <img src="http://www.altradona.ro/media/catalog/product/cache/1/small_image/252x252/9df78eab33525d08d6e5fb8d27136e95/1/4/1432654037.png" data-srcx2="http://www.altradona.ro/media/catalog/product/cache/1/small_image/504x504/9df78eab33525d08d6e5fb8d27136e95/1/4/1432654037.png" width="252" height="252" alt="rochie 7033 black"> </a> i should add effect a tag can inspect site see clearer code, sample. i tried use css code not working: code css: .regular a:hover{ opacity:0.4; background:url("http://www.altradona.ro/media/wysiwyg/overlay.png"); } what wrong code? can please me solve problem? thanks in advance! here simple exam...

excel - How to avoid subset out of range when running a delete rows with variable -

Image
i know may have been asked in various formats, new coding , don't understand how apply function. i keep getting subscript out of range error message when running vba. sub keeponlyatsymbolrows() dim ws worksheet dim rng range dim lastrow long set ws = activeworkbook.sheets("sheet1") lastrow = ws.range("a" & ws.rows.count).end(xlup).row set rng = ws.range("a1:a" & lastrow) rng .autofilter field:=1, criteria1:="<>*international sbu*" .offset(1, 0).specialcells(xlcelltypevisible).entirerow.delete end ws.autofiltermode = false end sub for context sheet @ moment 178 rows long , goes ak number of rows vary each update number of columns won't be careful when hard code name of sheets : set ws = activeworkbook.sheets("sheet1") because if change name in excel, you'll have in code (you'll find out pretty shortly error message) so differe...

php - Catchable fatal error: Object of class mysqli_result could not be converted to string -

i quite new in php , mysql , keep getting error while try delete selected file server: <?php $nombre_archivo = $_post['delete']; if( isset($_post['submit4']) ){ $con=mysqli_connect("####","####","####","####"); if (mysqli_connect_errno()) { echo "failed connect mysql: " . mysqli_connect_error(); } $user = mysqli_query($con,"select `user` `archivos_servidor` `nombre_archivo`='$nombre_archivo'"); mysqli_close($con); } unlink("../uploads/".$user."/".$nombre_archivo); ?> thank consideration on matter you missed fetch record. should use one. $nombre_archivo = $_post['delete']; if( isset($_post['submit4']) ){ $con=mysqli_connect("####","####","####","####"); if (mysqli_connect_errno()) { echo "failed connect mysql: " . mysqli_connect_error(); } $result = mysqli_query($con,"select `user` `a...

javascript - Login Ajax form not working, redirecting to another page -

i have created ajax form handle errors in login form, instead of showing errors in form area, directs me page json error response <div class="container-fluid bg-primary" id="login"> <div class="row"> <div class="col-lg-3 text-center"> </div> <div class="col-lg-6 text-center"> <h1>&nbsp;</h1><h3>&nbsp;</h3> <h2 class="section-heading">login profile</h2> <hr> </div> <div class="col-lg-3 text-center"> </div> <h2>&nbsp;</h2> <h2>&nbsp;</h2> <h2>&nbsp;</h2> </div> <div class="col-md-4 col-md-offset-4 "> <form id='loginform' action='/users/login/' method='post' accept-charset='utf-8'> ...

angularJs / ui-router : ability to change state during resolve -

i have 2 siblings states, , b match same url want go or b according asynchronous server answer. i have created third state, pivot . aim of "pivot" intermediate state redirect or b based on asynchronous server call done in parent state. pivot has url: ^/?page attribute in configuration (but , b don't have attribute). pivot sibling of a , b . pivot has $state.go() in it's onenter method. the problem encounter : - when page displayed first time, parent's state resolve run twice. - when clicking on link switch b or b a, error: null not object (evaluating '$state.$current.locals[name]') triggered. see http://jsfiddle.net/opeaucelle/6gqygkt7 $stateprovider .state('root', { abstract: true, views: { 'main': { template: '<ui-view name="body"></ui-view><hr />' + 'resolvenames : <li ng-repeat="resolvename in resolvenames...

oculus - DK2 Head tracking not working "HMD powered off, check HDMI connection" on Windows -

Image
part 1 - description of problem i have dk2 , working on vr project. project uses firefoxnightly. i've downloaded , installed webvr enabler add-on got http://mozvr.com/downloads/ i have downloaded , installed latest sdk , runtime windows https://developer.oculus.com/downloads/ i getting on oculus configuration utility (while oculus plugged in): however, have gone on computer windows.. installed on windows computer , shows oculus rift connected head tracking still not working. edit: tried connecting oculus rift "second" pc ( dell laptop ) , doesn't recognize oculus rift. still no head tracking. edit 2: tried installing on third pc without success. i'm getting "service unavailable" on oculus configuration utility my display mode set shown in image. part 2 - questions what doing wrong? there step forgot do? weird thing is, have same project running on mac without having problems. yes, on windows can see screen thr...

C# recursive generics in generics -

i playing ddd time , have found ayende's base class construction entity. construct base assembly necessary objects. came (simplified without implementation): public abstract class baseentity<t, tkey> t : baseentity<t, tkey> { } public interface iaggregateroot { } public interface iunitofwork { void commit(); } // open changes if public interface iwriteunitofwork : iunitofwork { void insert<taggregateroot, t, tkey>(taggregateroot aggregateroot) taggregateroot : baseentity<t, tkey>, iaggregateroot t : baseentity<t, tkey>; } everything fine untill use constructions in project. specifics of project simplified without implementation: public abstract class entity : baseentity<entity, guid> { } public class customer : entity, iaggregateroot { } public abstract class context : iwriteunitofwork { public void insert<taggregateroot, t, tkey>(taggregateroot aggregateroot) taggregateroot : baseentity...

java - Eclipselink Workbench - Identiy column -

we working eclipselink workbench generate java persistence objects our eclipse projects. have tables identity columns , found no option tell eclipselink column identiy column. found thousends of hints annotations of jpa solve problem generate our deployment.xml workbench , use no annotations: eclipse link jpa documentation does know how handle it? i found solution of own. in few seconds (not few days me). 1. enable native sequencing in session object (tab login => options => native sequencing) 2. know navigate generated java obect , select descriptor tab. 3. enable sequencing. take primary key , write down "identity" name. test , happy. puh. native sequencing - non oralcle db

java - How can I disable checkstyle warnings for missing final modifiers on lambdas? -

i getting checkstyle warnings missing final modifiers when writing lambdas in java 8. want warnings when writing normal methods, not in lambdas. for example, summing list of bigdecimals this: values.stream().reduce(bigdecimal.zero, (a, b) -> a.add(b)); gives me following checkstyle warnings: - variable 'a' should declared final. - variable 'b' should declared final. is there way make checkstyle ignore when writing lambdas? what version of checkstyle running. should have been fixed in version 6.5, if running earlier version it's known bug. source: https://github.com/checkstyle/checkstyle/issues/747

angularjs - how to test $window.open using jasmine -

this function $scope.buildform = function (majorobjectid, name) { $window.open("/formbuilder/index#/" + $scope.currentappid + "/form/" + majorobjectid + "/" + name); }; this jasmine test spec it('should open new window buildform , expected id', function () { scope.majorobjectid = mockobjectid; scope.currentappid = mockapplicationid; var name = "departmentmajor"; scope.buildform(mockobjectid, name); scope.$digest(); expect(window.open).tohavebeencalled(); spyon(window, 'open'); spyon(window, 'open').and.returnvalue("/formbuilder/index#/" + scope.currentappid + "/form/" + scope.majorobjectid + "/" + name); }); but when try run opening new tab , don't want happen, want check whether given returnvalues present not!! first of expectation (window.open)...

javascript - Date picker issue on form submit -

how can assign selected date instead of new date() in following code? so here each time when refresh, give me selected date in textbox instead of becoming blank $(".date-pick").datepicker('setdate', new date()); try .. use onclose event of datepicker set value of date .... "$(this).val()" have value of selected date , set value html element using "document.getelementsbyclassname('.date-pick').value" $( ".date-pick" ).datepicker({ onclose: function(datetext, inst) { document.getelementsbyclassname('.date-pick').value= $(this).val(); } });

c - WA in CPRMT(common permutation) -

#include<stdio.h> void compare(char a[], char b[]); void sort(char a[], char b[], char c[], int k); int main() { char a[1001], b[1001]; while((scanf("%s%s", a,b))!=eof) { compare(a, b); } return 0; } void compare(char a[], char b[]) { int i,j,k,l,m; i=0;k=0;j=0; char c[1001]; while(a[i]!='\0') { while(b[j]!='\0') { l=a[i]; m=b[j]; if(l==m) { c[k]=a[i]; k++; } j++; } i++; j=0; } c[k]='\0'; sort(a,b,c,k); } void sort(char a[], char b[], char c[], int k) { int i,m,n,j,o,p,h,l[k]; for(i=0;i<=k;i++) { l[i]=c[i]; } for(i=0;i<k;i++) { for(j=0;j<k-1;j++) { if(l[j]>l[j+1]) { m=l[j]; l[j]=l[j+1]; l[j+1]=m; c[j]=l[j]; c[j+1]=l[j+1]; } } } i=0; while(l[i+1]!='\0') { if(l[i]==l[i+1]) { m=0; n=0; j=0; ...

ios - Download and Save Video to Camera Roll -

this seems should straight forward based on examples , docs i've read, still unable work strange reason. i using alamofire frame work download video instagram. once downloaded, want save video camera roll. here code download video , save disk: let destination: (nsurl, nshttpurlresponse) -> (nsurl) = { (temporaryurl, response) in if let directoryurl = nsfilemanager.defaultmanager().urlsfordirectory(.documentdirectory, indomains: .userdomainmask)[0] as? nsurl { let finalpath = directoryurl.urlbyappendingpathcomponent("\(scripts.datetostring2(date: nsdate())).\(response.suggestedfilename!)") instagramengine.downloadmediapath = finalpath scripts.log("final path >> \(finalpath)") return finalpath } return temporaryurl } let request = alamofire.download(.get, self.videourl, destination) request.response { _, ...

android - How to display 30 row in listview with different view i need to display -

how display 30 row in listview different view need display 1 4 7 10 13 .......textview 2 5 8 11 14 .......edittext view 3 6 9 12 15 .........image view here code getting error public view getview(int position, view v, viewgroup parent) { if(position==0){ v=getlayoutinflater().inflate(r.layout.secondactvity, null); textview t1=(textview)v.findviewbyid(r.id.textview1); t1.settext(names[position]); log.d("view number", position+""); } else if(position==1){ v=inflater. log.d("view number", position+""); edittext e1=(edittext)v.findviewbyid(r.id.edittext1); } else if(position==2){ v=getlayoutinflater().inflate(r.layout.thirdactivty, null); imageview im1=(imageview)v.findviewbyid(r.id.imageview1); im1.setimageresource(img[position]); log.d("view number", position+""); } you have 2 solutions display differe...

Xcode can't import PDF asset -

Image
since xcode6 can use vector assets, our designer starts export pdf format assets instead of png. this's very convenience found can't import pdf through "import action" right click, see pdf files unavailable state gray color: and can import dragging directly. is there wrong? please check following link, might of : http://martiancraft.com/blog/2014/09/vector-images-xcode6/

c# - nested loops from classic asp to asp.net webforms -

<% sql ="select distinct qf_id,description vwwqf_avg_4 teacher_id ="&teacher_id &" order qf_id" objrs1.open sql, dbdsn, adopenforwardonly, adlockreadonly count=1 while not objrs1.eof '************************************************ main loop performa questions ******************************** qf_id=objrs1("qf_id") %> <tr> <td align=center><%=count%></td> <td align=left class="fd1"><%=objrs1("description")%></td> <% sql ="select * vwwqf_avg_4 teacher_id ="&teacher_id &" , qf_id = "&qf_id&" order offered_course_id" 'response.write sql & "<br>" objrs2.open sql, dbdsn, adopenforwardonly, adlockreadonly while not objrs2.eof '******************************************** inner loop average in each selected course ************************ ...

java - JAXRS 2.0 Receive undefined number of parameters -

i'm considering expose jaxrs method receive undefined number of parameters: so, i'd able handle like: public class foo { property1, property2, list<keyvaluepair> ... } public class keyvaluepair { string key, string value } then, @post public response update(foo document) { (keyvaluepair pair : document.pairs) { ... } } i have no idea achive this. i'll appreciate lot help. all. mainly json. jee aplication using api libraries.the implementation depends of each container. actually, containers wildfly 8.2 , glassfish 4.1. note solution json. one way handle use jackson's @jsonanysetter . can read more @ jackson tips: using @jsonanygetter/@jsonanysetter create "dyna beans" . example @path("json") public class jsonresource { @post @consumes(mediatype.application_json) @produces(mediatype.application_json) public response post(model model) { return respo...

php - how to set html layout in loop -

i want set html layout view in loop multiple categories. html code here...there many of categories came (wp-admin) woocommerce. given code layout of how show categories in home.php want add more categories in home.php through loop.thanks html code far... <div class="selected-products-wrapper clearfix"> <div class="category-list"> <span class="category-main" style="background-color: #5d973e"> <div class="category-main_logo"> <img src="" alt="" class="v-middle"></div> <span class="category-main-title"> <a href="<?php echo get_term_link($cat->slug, 'product_cat'); ?>"> <?php echo $cat->name; ?></a></span> <div class="category-main-yakataheader"><img src=""></d...