Posts

Showing posts from July, 2010

c++ - Access violation on a private array inside a class -

for part borrowed code rasterteks dx11 tutorial modified lightly or own use , taste. getting read access violation while using below inputclass set keystates. #include "inputclass.h" inputclass::inputclass() { } inputclass::inputclass(const inputclass& other) { } inputclass::~inputclass() { } void inputclass::initialize() { // initialize keys being released , not pressed. (int = 0; i<256; i++) { keystate[i] = false; } return; } void inputclass::keydown(unsigned int input) { // if key pressed save state in key array. keystate[input] = true; return; } void inputclass::keyup(unsigned int input) { // if key released clear state in key array. keystate[input] = false; return; } bool inputclass::iskeydown(unsigned int input) { // return state key in (pressed/not pressed). return keystate[input]; } below main callback loop, 1 registered windowclass: lresult callback wndproc(hwnd hwnd, uint message, wpar

regex - UIMA RUTA : regular expression in WORDLIST -

is there way have regular expressions in wordlist? need implement same mentioned in https://issues.apache.org/jira/browse/uima-3382 . or there alternate way resolve it? edit : wordlist defined list of text items. if have list of regular expressions want mark same type. there way it? for e.g. - want find date in document, there number of format date, regular expressions more concise way cover possible cases. trying use syntax below, matches cases there single word without special regex syntax. declare date; wordlist dateformatlist='dateformat.regex'; document{-> markfast(date, dateformat, true,1)}; what can change in rules items in dateformatlist treated regular expressions? thanks regular expressions in wordlists not supported in near future, if not volunteer implements it. problem wordlists use trie , not fst lookup process, makes desired functionality not straightforward implement. it possible simulate desired functionality wordlists in rare

caching - ModX PHP page keeps showing cached version of Vimeo API data -

i've got webpage http://wheelhousenyc.com/page?a=2932612,2932615,2932618,2932620 which dynamically generated in modx using snippet calls vimeo simple api. it pulls list of album & video info. edited info on vimeo, page won't update. i tried clearing cache modx manager setting 'clear cache on save' page setting 'clear cache on save' snippet clearing browser cache loading page machine nothing works! and direct call api uri at http://vimeo.com/api/v2/album/2932612/videos.xml does return correct new data. furthermore, different page on site, uses vimeo advanced api, returns correct info. switch problem page use advanced, take lot of work , doesn't require it. what's going on?

regex - how to replace strings in postgresql by using regular expression? -

t.emailaddresses contains comma separated email addresses. i want replace email address '0', how can regular expression ? i wrote replace(), want write in regex wayemailaddresses select t.emailaddresses, replace (replace (replace (replace (t.emailaddresses, 'jack@example.com', '0'), 'jack@mybox.com', '0'), 'emly@example.com', '0'), 'emly@mybox.com', '0') replaced_email_address table t t.id = 100; thanks in advance!!! the general regex syntax replacing be: select regexp_replace(mycolumn, $rxb$^jack@example\.com$$rxb$, $$0$$, 'g') mytable; but... if you're replacing literal (something doesn't change, there's no point. it's useful if want maybe replace email starts jack for example, select regexp_replace(mycolumn, $$^jack.*$$, $$0$$, 'g') mytable;

c# - Call jquery button click event from code behind -

i using below code display div on button click event. there way call button click event c# code behind. $(document).on("click", '#addnew', function (e) { e.stoppropagation(); if ($newentry.is(":hidden")) { $newentry.slidedown("slow", "easeoutbounce"); $newentry.slidedown("slow", "easeoutbounce"); $filter.slideup("slow"); return false; } else { $newentry.slideup("slow"); return false; } }); use code : protected void mybutton(object sender, eventargs e) { scriptmanager.registerstartupscript(this.page, this.gettype(), "tmp", "<script type='text/javascript'>myfunction(params...);</script>", false); } more rea

Accessing Hawtio Management Console with Openshift -

Image
i have created basic openshift fuse instance , trying login hawtio console. however, not able figure out password is. have tried openshift credentials admin/admin , openshift/openshift. same goes jenkins instance setup well. am missing simple? your username , password created when application created via openshift web console.

hardware - Persisting an output in comb logic block -

i'm having issue persisting value of gpo. want change @ point in code below. gpo_int <= gpo_int when n_wr = '1'; gpo <= gpo_int; write : process(n_en, n_wr) begin if n_wr = '0' , n_en='0' case addr(15 downto 12) when x"f" => -- i/o case addr(11 downto 8) when x"0" => -- gpo gpo_int <= data; when others => gpo_int <= gpo_int; end case; when others => gpo_int <= gpo_int; end case; end if; end process; gpo_int signal of std_logic_vector(7 downto 0) := x"00"; firstly gpo_int not persisted (i can see gpo change x"00" when n_rw goes '1'. there way of doing more neatly (defining truth table comb logic)? it seems asking latch. in fpgas particularly, that's not right thing (for variety of reasons). can not use clocked process create persistence need using flipflop? process

c - RSStail crashes with segmentation fault 11 -

i'm trying monitor rss feed using rsstail ( https://github.com/flok99/rsstail ), piping url rsstail program. reason, rsstail crashes after few minutes segmentation fault 11. have no idea why crashing, , there no reports online seem indicate rsstail has issues segfaults on osx. how should going figuring out segfault? i'm considering debugging rsstail using gcb, might overkill rights shouldn't happening. if 1 has alternative rsstail produces command line output, appreciated.

java - Find Nested self referred records in same table -

i have problem find nested self referred records db. how can retrieve nested self referred records mysql database.. consider example below id refid name value 1 na 10 2 na b 20 3 1 c 30 (it refering id 1) 4 1 d 40 (it refering id 1) 5 2 e 50 (it refering id 2) 6 3 f 60 (it refering id 3) 7 6 g 70 (it refering id 6) input --> id=1 output ---> id= 3,4,6,7 id -> 1 |-> id 3, 4 |-> id 6 |-> id 7 want find sub levels.... now want find self referred nested sub records db... if want find id=1 means should display sub records of it. i.e wherever refid = 1 , referred id have refid means come display how can retrieve data db.. is sql query can able retrieve records db mysql not support recursive queries. you either create function creates recursion within mysql, or let client code hand

c# - ridicilous mindate maxdate error while settting datetime -

i writing desktop application in c# using vs2013. getting absurd error has not produced, in opinion. setting datetimepicker's mindate , maxdate properties somewhere in code in such way: datetime mindate = datetime.parse(...); datetime maxdate = datetime.parse(...); ... if (maxdate < dtpmanuelfirst.mindate) { dtpmanuelfirst.mindate = mindate; dtpmanuelfirst.maxdate = maxdate; } else { if (mindate > dtpmanuelfirst.maxdate) { dtpmanuelfirst.maxdate = maxdate; dtpmanuelfirst.mindate = mindate; } else { dtpmanuelfirst.mindate = mindate; dtpmanuelfirst.maxdate = maxdate; } } very know mindate value less maxdate value. when mindate bigger dtpmanuelfirst.maxdate second if condition, updates maxdate property no problem whereas error "value not valid mindate. mindate must less maxdate." on updating mindate property. ridiculous since checking these conditions. in addition, values not supporting error whe

cloudera - How to print debug statments in Giraph -

i find below statement before print log statement. if (log.isdebugenabled()) how can enable or disable debug statements when running giraph program? , can 1 find logs of these statements? to access logs try yarn logs --applicationid application_1399469361545_0003 where can find application id in console output.

ruby - Get all Friends using FQL -

my code here query = "select uid user " + "where uid in (" + " select uid2 friend uid1 = #{fb_user_id}" + ")" url = "https://graph.facebook.com/fql?q=#{query}&access_token=#{fb_access_token}" escape_url = uri::escape(url) uri = uri.parse(escape_url) # configure http settings hit url. http = net::http.new(uri.host, uri.port) http.use_ssl = true http.verify_mode = openssl::ssl::verify_none request = net::http::get.new(uri.request_uri) response = http.request(request) # extract response body. response = json.parse(response.body) it return only 10 friends i want extract all friend how can any other way extract friends list please 1 me unless using v1.0 application api call return friends using application. friend list returns friends use app: list of friends returned via /me/friends endpoint limited list of friends have authorized app. https://developers.facebook.com/docs/

python - __init__ values vs instantiation value -

i new python , kivy, stuck @ under standing __init__ variable instantiation, code follows: from kivy.uix.button import button kivy.uix.gridlayout import gridlayout kivy.uix.boxlayout import boxlayout spots={} class spot(button): ''' classdocs ''' def __init__(self, **kwargs): ''' constructor ''' super(spot,self).__init__(**kwargs) self.ismine=false self.text="x" class game(boxlayout): def attachtogrid(self): self.m.clear_widgets() spots.clear() r in range(0,25): c in range(0,25): id=str(r)+","+str(c) spots[id]=id self.m.add_widget(spot(text=id)) my issue although passing id value text property (last line of code), still getting 'x' text default in spot class; , if remove default text (self.text="x") class id text working. could

javascript - HIghlight words in DOM without injecting additional Nodes -

i want specific text (ranges/nodes) in dom highlighted (spellchecking) without inserting additional nodes dom . unfortunately, solutions (i found spellchecking) exist out there rely on modifying dom (adding additional spans wrap text ranges). would absolute positioning of divs lower z-order text range has highlighted (for example, black text on top of yellow background/rectangle) work? of course, might problematic whenever window/container size changes. do know of other solutions work?

c# - Picturebox ablt to allow label 'x' to be moved around freely -

i doing project have display picture in picturebox , when part clicked on 'x' appear , there textboxes display x , y axis. problem project need coordinates of person face displayed in picturebox. how ensure 'x' can produced twice in picturebox. how allow 'x' able moved in case user has accidentally chosen wrong spot. below codes, hope help. using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.windows.forms; namespace camera { public partial class camdisplay : form { public camdisplay() { initializecomponent(); this.picturebox1.imagelocation = @"c:\center90\center90(1).jpg"; } bool mousedclicked = true; private void picturebox1_mouseclick(object sender, mouseeventargs e) { base.onmouseclick(e); if (mousedclicked == true)

excel - Making diagram by vertices' coordinates -

Image
i have vertices' coordinates build graph should this: the problem don't know how point coordinates excel. this: x y ----------- 5 16 5 13 5 10 5 7,5 5 3,5 x y ----------- 12,5 15 12,5 8 i know may done in opengl example necessary implement in ms excel. possible using diagram tool? i not sure mean diagram tool basic example using inserted scatter straight lines , markers chart:

java - Intermittent "Socket closed" exception with HttpUrlConnection -

i have servlet application running under jboss 7.1.1/java 1.7 sends http requests server. works fine of time, (from 1 couple of times day) “socket closed” exception. i’ve been trying find out might causing far i’ve been unsuccessful. way, has been happening while application running under older versions of jboss/java versions might not relevant. here’s excerpt method happens: . . . . . try { httpurlconnection conn = (httpurlconnection) urlendpoint.openconnection(); conn.setrequestmethod("post"); conn.setdoinput(true); conn.setdooutput(true); conn.setrequestproperty("content-type", "text/xml; charset=utf-8"); conn.setrequestproperty("charset", "utf-8"); dataoutputstream out = new dataoutputstream(conn.getoutputstream()); out.write(env.getbytes("utf-8")); out.flush(); out.close(); inputstream iss = null; conn.connect(); try { iss = conn.getinputstream(); // excepti

Jaspersoft Studio does not display well a report template created in iReport -

i created report template using ireport . want show report template in jaspersoft studio too. problem printwhenexpression tag not work in jaspersoft studio nothing filtered. is normal? i found problem. choose language groovy in ireports , java in jaspersoft studio. causes not work "==" , "!=" operators in java work fine groove. changed language java , replaced operators equals() or new boolean(!$f{field_name}.equals(object)).

spring - How to enable "distributable" programmatically with WebApplicationInitializer -

our webapp configured using spring's webapplicationinitializer like: @order(1) public class mvcwebapplicationinitializer extends abstractannotationconfigdispatcherservletinitializer { @override public void onstartup(servletcontext servletcontext) throws servletexception { // how enable "distributable" here? } } this app run on tomcat cluster , must therefore marked "distributable" (as explained here ). happens adding "distributable" element web.xml. how mark webapp distributable java based config?

php - ajax loaded single checkbox showing udefined on javascript validation -

hiall, i have simple html from <form id="adda" name="adda" method="post" action=""> select batch :<br/> <select name="standard" id="standard" onchange="return changestudent(this.value);" > <option value="0">-select batch-</option> <option value="1">batchname1</option> <option value="2">batchname2</option> </select> students : <div id="s"> <input type="checkbox" name="sname" value="<?=$raw2['id']?>" /><?=$raw2['firstname']?> <?=$raw2['lastname']?><br /> </div> <input type="button" value="add" onclick="return val();" style="width:80px; height:28px; color:#8a4e00; background-color:#8bc33f;cursor:pointer;ma

c# - Open xml cannot get a drawing element -

i going through docx, uscing open xml find images. so, doing drawings, got docproperties child, title containing list<drawing> sdtelementdrawing = worddoc.maindocumentpart.document.descendants<drawing>() .where(element => element.getfirstchild<drawing>() != null && element.getfirstchild<docproperties>().title.value.contains("image")).tolist(); and docx xml looks likes in first part(it bigger, copy relevant part) : <w:drawing> <wp:anchor distt="0" distb="0" distl="114300" distr="114300" simplepos="0" relativeheight="251658240" behinddoc="1" locked="0" layoutincell="1" allowoverlap="1" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingdrawing"

android - Google Maps Location - Blue dot No and Button Yes -

i have app google maps custom marker in location . i'm trying map showing location button not blue dot. i've tried not works: mapa.setmylocationenabled(false); mapa.getuisettings().setmylocationbuttonenabled(true); this code not shows button , blue dot. how do? the location button visible when my location layer enabled setmylocationenabled method. can simulate behavior adding similar button of own center on user's location when pressed.

c++ - ThreadSanitizer reports "data race on operator delete(void*)" when using embedded reference counter -

please have @ following code: #include <pthread.h> #include <boost/atomic.hpp> class referencecounted { public: referencecounted() : ref_count_(1) {} void reserve() { ref_count_.fetch_add(1, boost::memory_order_relaxed); } void release() { if (ref_count_.fetch_sub(1, boost::memory_order_release) == 1) { boost::atomic_thread_fence(boost::memory_order_acquire); delete this; } } private: boost::atomic<int> ref_count_; }; void* thread1(void* x) { static_cast<referencecounted*>(x)->release(); return null; } void* thread2(void* x) { static_cast<referencecounted*>(x)->release(); return null; } int main() { referencecounted* obj = new referencecounted(); obj->reserve(); // thread1 obj->reserve(); // thread2 obj->release(); // main() pthread_t t[2]; pthread_create(&t[0], null, thread1, obj); pthread_create(&t[1], null, thread2, obj); pthread_joi

Android Tab sometimes located along with Action Bar but sometimes below it, how to control? -

i using titanium build android app, use tabgroup , have 2 tabs. when run on simulator (genymotion virtual device: samsung galaxy note 3 ), 2 tabs show in tabbar occupy full screen width right below actionbar. there 2 bars @ top of screen. but if test on real device (i using lg g pad), tabbar somehow merge actionbar, 2 tabs shown inside actionbar, next app icon. , there 1 bar @ top of screen. want. is there anyway control tabs appear? i testing ti sdk 3.2.3.ga , api level 19 thanks.

php - Codeigniter Session Expires on Clicking on Google Geo Map -

i using google geo map state , city wise. when click on map, genrating jquery data table pop works dynamic. using ajax , json output jquery data table work dynamic. issues is, when click on map, pop loads, when close pop , refresh, ci session getting destroyed , user getting logged out. kindly in fixing this. thanks

java - GetMap() return null on Android with Google Maps API v2 -

i have problems google maps api v2. have tried many tutorials , searched many answers (include stack overflow) have found not work. can draw map xml tag <fragment> . no problem, works. when try map in mainactivity.java getmap() return null , don't know why. mainactivity.java package com.example.testmaps; import android.app.activity; import android.os.bundle; import com.google.android.gms.maps.googlemap; import com.google.android.gms.maps.mapfragment; import com.google.android.gms.maps.model.latlng; import com.google.android.gms.maps.model.markeroptions; public class mainactivity extends activity { private googlemap mmap; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); mmap = ((mapfragment) getfragmentmanager().findfragmentbyid(r.id.map)).getmap(); //here mmap null mmap.addmarker(new markeroptions() .position(new latlng(10, 10))

javascript - Karma/Jasmine doesn't find html file -

i have spec opens iframe local html file src. var template = document.createelement('iframe'); template.src = 'template.html'; i tried find file via javascript @ runtime file not found , karma shows 404 warning. i have read , tried preprocessor , proxy, base/ url fix , still nothing... happy have input here.

ember.js - Ember Component: Animation effect while showing the component -

i have ember component defined, , when click on button toggling property shows component. i need apply animation effect when showing component. animation effects slidedown/slideup. i not sure how give animation effect ember components. template: <script type="text/x-handlebars" data-template-name="index"> <button {{action 'showdiv'}}>show div</button> <br> <br> {{#if showdiv}} {{temp-animation}} {{/if}} </script> app.js: app.indexroute = ember.route.extend({ actions:{ showdiv: function(){ this.controller.toggleproperty('showdiv'); } } }); app.indexcontroller = ember.controller.extend({ showdiv:false }); jsbin demo you need take advantage of didinsertelement event on component. here working fiddle: http://jsbin.com/poxupuso/1/edit i refactored code little bit. pulled actions out of route , put them the controller. app.indexrou

c# - Binding a DataGrid -

i've created code-first c# project entity framework , wpf. have created entity named personel entity. i'm dragging , dropping entity mainwindow doesn't show data. think have in mainwindow.xaml.cs file don't know do. here datagrid code in xaml: <datagrid x:name="personelentitydatagrid" autogeneratecolumns="false" enablerowvirtualization="true" itemssource="{binding}" margin="19,259,18,10" rowdetailsvisibilitymode="visiblewhenselected"> <datagrid.columns> <datagridtextcolumn x:name="addresscolumn" binding="{binding address}" header="address" width="sizetoheader"/> <datagridtextcolumn x:name="agecolumn" binding="{binding age}" header="age" width="sizetoheader"/> <datagridtextcolumn x:name="idcolumn" binding="{binding id}" header="id" width=&qu

r - Dynamically allocate a data.frame with grace -

i have data frame supposed grow (adding rows) during runtime. wise pre-allocate data frame beforehand (cmp. the r inferno ). pre-allocation routine should accept kinds of data frame composition (i.e. number of columns , column classes). example arbitrarydf<-function(){ return(data.frame(c="char",l=true,n=4.5,stringsasfactors=false)) } returns arbitrary data frame use template. need n <- 10 rows, might do: data<-as.data.frame(lapply(arbitrarydf(),function(x){eval(parse(text=paste(class(x),"(",n,")")))}),stringsasfactors=false) which returns desired data frame. >data c l n 1 false 0 2 false 0 3 false 0 4 false 0 5 false 0 6 false 0 7 false 0 8 false 0 9 false 0 10 false 0 >sapply(data,class) c l n "character" "logical" "numeric" needless say, use of eval() ugly. there more straightforward solution this? as said, routi

c# - Child Trigger event on parent Script -

i making game in unity3d , have situation. i have parent children. eg: parent: child 1 child 2 child 3 on parent , child 3 have component box collider 2d property trigger checked. on parent have script ontriggerenter2d function but if child 3 collide object trigger function on parent's script. i don't need trigger event when child collide. what can do? i solved putting kinematic rigidbody on child.

javascript - keyup event not working inside contenteditable:true tag -

i don't know problem code. keyup event not triggered inside contenteditable tag. here code : $(document).on( 'keyup' , '#editable_div span' ,function (e) { e.preventdefault(); $(this).removeclass('abc'); }); fiddle example i have updated fiddle , made work way wanted. please try this: http://jsfiddle.net/w2p9t/7/ js code: var spanscontent = array(); $("#editable_div span").each(function(){ spanscontent.push($(this).html()); }); $(document).on( 'keyup' ,function (e) { e.preventdefault(); for(var i=0;i<spanscontent.length;i++) { if($($("#editable_div span")[i]).html()!= spanscontent[i]) { $($("#editable_div span")[i]).removeclass('abc'); } }

javascript - jQuery animation works with only one element -

i need make working elements under nothing should fade (images). currently works div.logo tag i guess @ moment reason mine <h1> element allowing animations underneath when getting .top() , .left() , on, doing last element in list. i need borders of each element in resulting list. any appreciated demo: http://jsfiddle.net/z9b8s/ js: function displaythese(selectorstring) { var $heading = $(selectorstring); var h1top = $heading.position().top; var h1bottom = h1top + $heading.height(); var h1left = $heading.position().left; var h1right = h1top + $heading.width(); var divs = $('li').filter(function () { var $e = $(this); var top = $e.position().top; var bottom = top + $e.height(); var left = $e.position().left; var right = left + $e.width(); return top > h1bottom || bottom < h1top || left > h1right || right < h1left; }); return divs; } (function fadeindiv() {

How to access multidimensional array programmatically in Java? -

suppose have multidimensional array, , number of dimensions known @ runtime. , suppose have integer number of indices. how apply indices array access array's element? update suppose: int [] indices = new int { 2, 7, 3, ... , 4}; // indices of element int x = indices.length; // number of dimensions object array = .... // multidimensional array number of dimensions x ... i want fetch element addressed indices indices array . update 2 i wrote following code based on recursion: package tests; import java.util.arrays; public class try_multidimensional { private static int element; public static int[] tail(int[] indices) { return arrays.copyofrange(indices, 1, indices.length); } public static object[] createarray(int ... sizes) { object[] ans = new object[sizes[0]]; if( sizes.length == 1 ) { for(int i=0; i<ans.length; ++i ) { ans[i] = element++; } } else {

navigation - Bootstrap navbar positioning in css -

usually navbar elements such menu link placed want them in html file. reasons need in css file. is there way example change alignment of navbar-menu links left right? way: margin-left: xx px; not here because destroys responive behaviour of bootstrap. thanks lot! try float: right; property navbar-menu links think should work. or use .pull-right or .pull-left class of bootstrap.

google cloud messaging - Device to Device push notification using android gcm without third party server -

we planning wirte messaging/chat kind applicaiton on android.we planning use gcm exchange messages.the traditional way have application server store gcmid of users , if user1 wants send message user2, 1.the user1 send message application server payload contains message , receipent id i.e user2 2.the application server retrieves gcmid of user2 , call sender.send(regid2 , message) 3.user2 receives message. i see rest api call https://android.googleapis.com/gcm/send . so if somhow user1 has gcmid of user2 why can't directly call gcm api user1 device reduce load on server , cost of operations on server.pls advise me on this. note:we not planning use upstreaming i did same using device_to_device_messaging_using_google_cloud_messaging_gcm_-_android_example tutorial. tut having complate sever client code using gcm. go through it,will achieve want.

wpf - how to bind itemsource to combox which is in datagrid having again another itemsource -

this id code.. how bind itemsource combox in datagrid having again itemsource <datagrid x:name="dgdata" autogeneratecolumns="false" borderbrush="aqua" minwidth="500" minheight="270" itemssource="{binding selectedaccdtlist}" background="transparent" canuseraddrows="true"> <datagrid.columns> <datagridtextcolumn header="sr.no." binding="{binding selectedaccdtlist.instcode}" /> <datagridcomboboxcolumn header="accessory_name" selectedvaluebinding="{binding selectedacclist, mode=twoway}" selectedvaluepath="itemcode" displaymemberpath="itemname" /> <datagridtextcolumn header="accessory_scope" binding="{binding accscop}"/> <datagridcomboboxcolumn header="accessory_type" itemssource="{binding accctyp}&qu

macros - iMacros code to like Friends Facebook statuses -

i have written code in imacros , firefox addon it designed of friends facebook statuses. have .csv file contains link each of facebook profiles. the code runs not friends statuses. can see might wrong it? version build=8300326 recorder=fx set !errorignore yes set !timeout_tag 1 set !timeout_step 1 set !timeout_page 30 set !replayspeed fast tab t=1 set !datasource c:\users\tanpham\documents\imacros\list<sp>friend<sp>facebook.csv set !datasource_columns 1 set !loop 1 set !datasource_line {{!loop}} url goto={{!col1}} set !encryption no wait seconds=5 tag pos={{!loop}} type=a attr=title:like<sp>this wait seconds=4 tag pos={{!loop}} type=a attr=title:like<sp>this wait seconds=4 why using tag pos={{!loop}}? do 'like' buttton's positions change after each page refresh? if yes, might use recording mode export html elements.

php - How to change user profile page url structure in wordpress? -

i want change user profile page url structure in wordpress. current url structure http://www.mydomainname.com/user/vendorname=testname want change url http://www.mydomainname.com/user/testname . functionality in user profile page should remain same now.

javascript - Prevent child elements from firing hard coded click event of parent elements -

i have div class called 'cat'. in mouseover event div displayed 2 anchor link on click event hard coded. when anchor clicked parent div click gets fired. tried return galse, not working. code below function onload() { $('.cat').css('cursor', 'pointer'); $('.cat').mouseenter(function (e) { $('<div />', { 'class': 'tip', html: 'name: ' + $(this).data('cat-name') + '<br/>web name: ' + $(this).data('web-name') + '<br/>total no. of subcategories: ' + $(this).data('total-subcategory') + '<br/><br/><a href="#" onclick = "return addsubcategory(' + $(this).data('cat-id') + ',this)">add sub category</a>&nbsp;<a href="#" onclick = "editcategory(' + $(this).data('cat-id') + ',this)">e

php - What type of array is this and how to display this array -

how display using php , type of array please explain array ( [name] => ajin [username] => ajin [password] => password ) it's associative array. how can define it: $array = array('name' => 'ajin', 'username' => 'ajin', 'password' => 'password'); and can output print_r() : print_r($array); it outputs: array ( [name] => ajin [username] => ajin [password] => password ) you can read more array in manual . can example iterate through array using foreach display it: foreach ($array $key => $value) { echo $key . ': ' . $value . php_eol; } this outputs: name: ajin username: ajin password: password or can access individual values $array['name'] : echo $array['name'];

OpenGL ES 3.1 support (Android L developer preview) -

i installed android l developer preview image on nexus 5 yesterday in hopes start implementing compute shaders. code expected give me gles31 capable opengl context is; glsurfaceview glview = new glsurfaceview(context); glview.seteglcontextclientversion(3); ... the exact same code creates opengl es 3.0 context on android 4.4.4. but instead getting opengl es 3.0 context without new gles31 capabilities. am missing fundamental in regard opengl context creation - or case opengl es 3.1 not supported on current android l developer preview image (= lpv79)? are absolutely sure nexus5 hardware support opengl es 3.1? afaik adreno 330 supports es 3.0, , es 3.1 introduced in adreno 420 gpu.

objective c - Can't call my #define variable -

i started playing #define option, defined variables in global.h file. #define golfer_data_name @"name" #define golfer_data_union @"union" #define golfer_data_gender @"gender" #define golfer_data_junior @"junior" #define golfer_data_memno @"memno" #define golfer_data_searchmode @"searchmode" #define golfer_data_email @"e-mail" but can't access golfer_data_name or golfer_data_union anywhere in code. i'm sure missed what? appreciated. if you're importing file in pre-compiled header file ( .pch ), shouldn't need re-import in other file in project (though doesn't hurt, , may future readability). presuming xcode, when create new file in project, may not quite sync rest of project immediately. fix this, can try saving file (cmd+s), cleaning project (cmd+shift+k), or building project (cmd+b). after this, imports should working fine. this similar when you've created ne

c# - IEnumerable or Array for return type -

what best way return public api in c#? array or ienumerable? , both have more or less same functionalities in c# linq operations,foreach iteration support etc. but 1 preferable , in situation? c# makes easy - arrays implement both ilist<t> , ienumerable<t> . depends on intended usage of api. i refer guidelines collections recommended practices on returning collection types. usage guidelines arrays mentions this: do prefer using collections on arrays in public apis. so have: if want allow access elements index, return ilist<t> . more or less implies elements in fixed order. if want iteration-based access, can return ienumerable<t> . not allow access index, , makes no guarantees element order.

javascript - clicking items inside a famo.us scrollview -

i have scrollview number of images. events working such scrollview can dragged around. i want able click on single image detail view used a: surface.on 'click', => @parent.navto('detail') however, has effect if click image when scrolling above event fire. i guess whole reason mobile browsers have 300ms delay - tell if you're clicking or dragging. famous have other events listen for? in inputs/fastclick.js see 'touchstart' 'touchmove' , 'touchend' do have track if drag motion happened, in our own code, or famous engine assist this? fwiw i'm using genericsync pipe events around, , make view work on desktop. constructor: (@parentview, @data) -> scrolldir = 1 # 0 horiz, 1 vertical super({ direction: scrolldir paginated: true pagestopspeed: 5 }) @addcontent() @mousesync = new famous.inputs.mousesync({direction: scrolldir}) @mousesync.pipe(this) addcontent: () -> comics = comics.fi

ios - Can't UnWrap Optional - None Swift -

i assure have checked answers prior posting question on unwrapping object, thing not seem work me. trying pass on text value cell tapped label on next screen. override func prepareforsegue(segue: uistoryboardsegue!, sender: anyobject!) { if(segue.identifier == "detailviewsegue") { var dvc:detailedviewcontroller = segue.destinationviewcontroller detailedviewcontroller let path:nsindexpath = self.tableview.indexpathforselectedrow() var seguerecipename:string = recipemgr.recipename[path.row] string dvc.detailedrecipelabel.text = seguerecipename } } the problem occurs @ line - dvc.detailedrecipelabel.text = seguerecipename //can't unwrap optional - none i know i'm supposed check nil value of seguerecipename before assigning. print check on console , not null. error occurs when i'm assigning value 2nd view controller class object. i'm sure others learning swift :) dvc.detailedrecipelabel nil

html - Javascript: Pause/Unpause javascript Tetris game -

i have started working off javascript tetris template , i've got stuck trying implement pause feature. trying create window.onkeydown function when button clicked game pause , toggle continue once clicked again. here snippet of code function get(id) { return document.getelementbyid(id); }; function hide(id) { get(id).style.visibility = 'hidden'; }; function show(id) { get(id).style.visibility = null; }; function html(id, html) { get(id).innerhtml = html; }; function timestamp() { return new date().gettime(); }; function random(min, max) { return (min + (math.random() * (max - min))); }; function randomchoice(choices) { return choices[math.round(random(0, choices.length - 1))]; }; if (!window.requestanimationframe) { // http://paulirish.com/2011/requestanimationframe-for-smart-animating/ window.requestanimationframe = window.webkitrequestanimationframe || window.mozrequestanimationframe || window.orequestanimatio

Android/Gradle espresso test not starting activity -

i'm having difficulty convincing new android build system run tests. when running test gives unable resolve activity for: intent error has been discussed in other questions there nothing in there have fixed problem. i've stripped down test package not rely on main package ( com.wealdtech.app ) @ still have problem starting activity. my test activity: package com.wealdtech.test; import android.app.activity; import android.os.bundle; public class tilelayouttestactivity extends activity { @override public void oncreate(final bundle savedinstancestate) { super.oncreate(savedinstancestate); } } and test class: package com.wealdtech.test; import android.test.activityinstrumentationtestcase2; public class tilelayouttest extends activityinstrumentationtestcase2<tilelayouttestactivity> { public tilelayouttest() { super(tilelayouttestactivity.class); } @override protected void setup() throws exception { super.setup(); setacti

php - Wordpress - get meta data only from "published" articles -

i have dropdown meta data posts: <form name="search" action="" method="get" class="form-dropdown"> <select name="city"> <option>stadt wählen</option> <?php $metakey = 'city'; $counties = $wpdb->query( $wpdb->prepare( " select distinct meta_value $wpdb->postmeta pm join $wpdb->post p on pm.post_id = p.id meta_key = %s , post_status = 'published' order meta_value asc ", $metakey ) ); if ($counties) { foreach ($counties $city) { echo "<option value=\"" . $city . "\&qu

google api nodejs client - How can Dimensions be included in the API call object? -

see - https://github.com/google/google-api-nodejs-client/issues/189 looking see if has worked around this? fix found @ https://github.com/google/google-api-nodejs-client/issues/189#issuecomment-47358326 excerpt: found own issue think. including "dimension" on call obj instead of "dimensions".

java - Android get multiple content Provider with single cursor -

hello , creating application in have deal multiple content providers. every content have create cursor. example create cursor phone contacts , create call logs etc.i wonder necessary create new cursor every time content.i want know there way multiple contents single cursor code shorten. in advance it not possible, , if was, that's not way go. imagine got database multiple tables: customers, sales, products; , each time ask customers, brings sales , products too. not efficient, right? the correct way go use 1 cursor each data set need. ps: remember shorter code != better. easy maintainable code == better. called scalability . read more here .

c# - How to Create Excel type navigation in asp.net grid -

i working on asp.net. have grid view have multiple textboxes in different columns. what want excel type navigation in gridview textboxes. here gridview textbox code: <asp:templatefield itemstyle-cssclass="right" headerstyle-cssclass="center"> <headertemplate>units invoiced</headertemplate> <itemtemplate> <asp:textbox id="txtinvunit" runat="server" cssclass="textbox nav textboxfocus" text='<%# eval("units invoiced")%>' style="text-align: right;" onblur="calculateramt(this);"> </asp:textbox> <ajaxt:filteredtextboxextender runat="server" id="atxtinvunit" validchars="0123456789" filtermode="validchars" filtertype="custom" targetcontrolid="txtinvunit">

ios - NSDictionary with no data at all -

i trying save data plist file created xcode. var dict: nsmutabledictionary = nsmutabledictionary(contentsoffile: plistpath); dict = nsmutabledictionary(dict.setvalue(speedstring, forkey: "speed")); if (!dict.writetofile(plistpath, atomically: true)) { nslog("failed save data"); } the dictionary safely wrote file. problem set break point after if statement, debugger showed nsdictionary has 0key/value pair, weird. in xcode, added key/value pair in it. i added code test if (dict.valueforkey("speed") == nil) { nslog("key missing"); } the console did print out "key missing". your second line creates new dictionary. throwing away dictionary read in first line. not appending dictionary, replacing new empty dictionary.

utf 8 - How to convert encoding type of multiple .txt & .pro files from ANSI to UTF-8 -

i have multiple .txt files encoding format ansi in folder named folder1 . need convert utf-8 encoding type files in empty folder name folder2 . don't want convert files 1 one - want convert them @ time. use multibytetowidechar() cp_acp convert data widechar , use widechartomultibyte() cp_utf8 convert in utf8 if talking c++ static int to_utf8encodefile(std::wstring filepath) { int error_code = 0; //read text file in ansi encoding type std::string filename(filepath.begin(), filepath.end()); std::string filecontent; filecontent = readfile(filename.c_str()); if(filecontent.empty()) { return getlasterror(); } int wchars_num = multibytetowidechar( cp_acp , 0 , filecontent.c_str() , -1, null , 0 ); wchar_t* wstr = new wchar_t[wchars_num]; error_code = multibytetowidechar( cp_acp , 0 , filecontent.c_str() , -1, wstr , wchars_num ); if(error_code == 0) { delete [] wstr; return getlasterror(); }

Android AlertDialog.Builder OnClickListener on custom button -

i display omn alert dialog. created layout , used on onclicklistener. (when click on element of list, displays details it) when alertdialog appears, fine own dismiss button works. sadly doesn't , don't know how manage this. this xml file : <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/detaildialog" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@color/popup_background" > <button android:id="@+id/dismissalert" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_aligntop="@+id/firstdivider" android:layout_centerhorizontal="true" android:background="@color/popup_background" android:text="dismiss" android:textcolor="@co

python - Why does db.insert(dict) add _id key to the dict object while using pymongo -

i using pymongo in following way: from pymongo import * = {'key1':'value1'} db1.collection1.insert(a) print this prints {'_id': objectid('53ad61aa06998f07cee687c3'), 'key1': 'value1'} on console. understand _id added mongo document. why added python dictionary too? did not intend this. wondering purpose of this? using dictionary other purposes , dictionary gets updated side effect of inserting document? if have to, say, serialise dictionary json object, a objectid('53ad610106998f0772adc6cb') not json serializable error. should not insert function keep value of dictionary same while inserting document in db. clearly docs answer question mongodb stores documents on disk in bson serialization format. bson binary representation of json documents, though contains more data types json. the value of field can of bson data types, including other documents, arrays, , arrays of documents. following document

c# - Setting generic type only in one class -

i have 2 generic classes: public class first<t> { ... } public class second<t> { ... } i use second class parameter first class constructor: var instance = new first<int>(new second<int>()); is possible specify generic type (integer in example) first class constructor this: var instance = new first<int>(new second()); ? i believe type inference generic constructor arguments being added c# 6. right now, answer no.

osx - Invalid Mac App Store Validation using iCloud Entitlements -

Image
i've been trying validate app mac app store. able submit ios version without hitch. at point in time i've configure app id in dev portal unique icloud identifier, eliminates possibility shared icid problem (icloud id). i've recreated certificates, app id, icloud container, , distribution provisioning profiles. *after days of troubleshooting, i've narrowed issue down. if assign icloud container app id, validation fails. if un-assign it, validation passes. i have opened several tickets apple on course of week, haven't had response i'm hoping can help. the errors reported validation tool: my app id: com.proj-build.cocoa-notes icloud container id: icloud.com.proj-build.cocoa-notes the prefixed icloud in icloud container id confuses me. ios app not specify prefix in entitlements file (using different container id) , validated. prefix or no prefix on mac not work. any ideas doing wrong? entitlements configuration below <?xml version="

excel - vlookup matching with one column but not several -

Image
got following issue. my sheet below. when i'm doing vlookup , column column below, have value lm-un-f-gt25 retrieved =vlookup(a3;c2:c58;1;false) when i'm doing vlookup , column list of columns below, nothing retrieved... =vlookup(a3;b2:e58;1;false) why? thanks. edit seems value on b column seen when doing lookup on list of columns...weird, no? vlookup searches search value in first column of range. search value not in first column of range b2:e58, column b. search value in column c. why no results second formula. from microsoft: "[vlookup] searches value in first column of table array , returns value in same row column in table array." see: http://office.microsoft.com/en-us/excel-help/vlookup-hp005209335.aspx since want know "if value have in cell a3 present in other cells namely b2 e58", perhaps countif better fit. try: =countif(b2:e58,a3) that tell how many times value in cell a3 appears in range b2:e58. or ma

javascript - Dropdown holds its selection after page refresh -

i want dropdown list return first value after page refresh. <!doctype html> <html> <head></head> <body> <div> <li><label>type2</label> <select id="sss"> <option selected id="one1">one</option> <option id="two2">two</option> </select><br></li> </div> <script> document.getelementbyid('sss').selectedindex=0 </script> </body> </html> it works in firefox not in ie10. can please help? solved it! had force script run after page loaded. <!doctype html> <html> <head> <script> function loaded() {document.getelementbyid('sss').selectedindex=0;} </script> </head> <body onload="loaded()"> <div> <li><label>type2</label>