Posts

Showing posts from March, 2013

Step through a word table selection with VBA -

i've been trying write macro changes formatting in big tables in word me. tried find information, there tables, information excel. so situation got this, got table 6 columns. first 2 columns selected, macro started. i'd read first cell of selection top left, manipulation/calculations it, i'd write manipulated data, move on cell right, read data, manipulate it, write , till end of selection. can me code skeleton? awesome! here's possible skeleton, loops through columns 1 , 2 of preexisting table. sub testtable() dim wordapp word.application dim docdocument word.document dim tbltable word.table dim c word.cell dim sstring string dim icolumnnumber integer set wordapp = createobject("word.application") set docdocument = wordapp.documents.open("<location of document e.g. c:\mydoc.doc>") set tbltable = docdocument.tables(1) icolumnnumber = 1 2 each c in tbltable.columns(1).cells sstring = c.range.text 'do

socket.io - Calling socket.emit('init', 'data') from client side javascript function does not execute. -

this question has answer here: how invoke server-side function client-side using socket.io? 2 answers on client side: <a href='javascript:callinit();'> init </a> client side html includes following script above: <script src="/socket.io/socket.io.js"></script> <script>var socket = io.connect('http://localhost:3000'); function callinit(){ alert('inside callinit'); socket.emit('init', 'data'); } </script> on server-side: io.sockets.on('connection', function(socket) { console.log('socket connection established'); socket.on('init', function(data){ console.log('init invoked'); init(); }); }); in above code: alert('inside callinit') executes. console.log('socket connection established'); executes. console.

jsf 2 - faces component content which contains jsf components is not evaluated -

created taghandler , added facelet. facelet content still not evaluated. html code contains ui:fragment text. @override public void encodebegin(facescontext context) throws ioexception{ responsewriter writer = context.getresponsewriter(); content = benefits.getcontent(type); writer.write(content); } <content type="short"> <data><![cdata[ <ui:fragment rendered="#{true}"> <a id="" href="a.xhtml> </ui:fragment> <ui:fragment rendered="{false}"> <a id="" href="b.xhtml"> </ui:fragment> <img src="a.png" alt="" /> </a> ]]></data> public class cardholderbenefitstaghandler extends taghandler { private final tagattribute src; public cardholderbenefitstaghandler(tagconfig config) { super(config); tagattribute attr = null; attr = th

android - google cloud messaging errors on some devices -

i'm developing android app should use gcm deliver notifications. at moment, i'm encountering problems devices <= android 4.0.4. with galaxy nexus (4.3), nexus 7" (4.3) , fujitsu tablet (4.1.1) receive correctly broadcast gcm , show notification. but htc incredible s (4.0.4) , htc flyer (3.2) application doesn't receive nothing. trying debug mode in eclipse, infact, application run on these devices doesn't enter in onreceive() method. here's androidmanifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.xxx.yyy" android:versioncode="3" android:versionname="1.2" > <uses-sdk android:minsdkversion="8" /> <uses-feature android:glesversion="0x00020000" android:required="true" /> <uses-feature android:name=

FONT.COLOR returns NULL in conditional formatting excel vba -

i have sub routine gets conditional formatting properties cell cell in sheet "source" , applies them in sheet "result" in same workbook. works when font.color , font.tintandshade returns null, in result sheet conditional formatting have black font color. (you can check in result sheet conditional formatting > mange rules). the error "invalid use of null" maybe because of type of values. error occurs here: fcfontc = xarr(i, j).formatconditions(ii).font.color fcfontt = xarr(i, j).formatconditions(ii).font.tintandshade here code: sub formatcondition1() dim fc formatcondition dim fcfontc long dim fcfontt integer dim fcc long dim fct integer dim ii integer dim wks1 worksheet, wks2 worksheet dim xarr range, yarr range dim integer, j integer 'dim k integer, l integer worksheets("source").activate worksheets("result").select set yarr = worksheets("result").range("a1:c2") yarr.range("a1:c2").

php - How to print a mysql query to view what's being sent -

i'm trying view (print or echo) on page actual query being sent following: $req1 = mysql_query('select m1.id, m1.title, m1.date_time, count(m2.id) reps, users.username userid, users.username pm m1, pm m2,users ((m1.user1="'.$_session['username'].'" , m1.user1read="no" , users.id=m1.user2) or (m1.user2="'.$_session['username'].'" , m1.user2read="no" , users.id=m1.user1)) , m1.id2="1" , m2.id=m1.id group m1.id order m1.id desc'); i've tried looking on net way "echo $req1" returns resource id. wrong, username variable, , it's returning no records. please explain how actual query, it's running username variables, etc. print? can't figure out how it. thank in advance genuis!!! :) $sql = 'select m1.id, m1.title, m1.date_time, count(m2.id) reps, users.username userid, users.username pm m1, pm m2,users ((m1.user1="'.$_session['username'

sql - Stored Procedure Parameters and Crystal Reports -

i creating stored procedure used data source crystal report. the stored proc takes 2 input parameters - int , comma delimited string list create procedure sp_ap_ytd_payments1 @year int, @companies nvarchar(max) -- sp code here i realize have convert string list array before using in clause. i have 2 questions : how pass parameters sp using exec sp_ap_ytd_payments1 ? from crystal reports, how should user enter second argument ? comma delimited list? i found answer myself. exec sp_ap_ytd_payments1 2013, '925,926,txr' from crystal, user enter comma-dlimited list companies parameter.

javascript - Onclick button doesn't function -

i try create button when page load. <!doctype html> <html> <head> <script> function createbutton(){ var newbutton = document.createelement("button"); newbutton.onclick="document.write('tasto premuto')"; var textbutton = document.createtextnode("premi qui"); newbutton.appendchild(textbutton); document.body.appendchild(newbutton); } </script> </head> <body onload="createbutton()"> </body> </html> the button created succesfully, function have associated onclick event doesn't work. ideas? onclick expects function, not string: newbutton.onclick = function() { document.write('tasto premuto') }; please see jsfiddle of course, should aware document.write() clears dom of current content, rather appending string existing content.

javascript - Firefox SDK page-mod arbitrarily stops working -

i've created extension using add-on sdk, relies in part on page-mod. has been working fine. however, @ point (i'm not sure when, because working on different part of extension when happened) page-mod stopped working. however, code didn't change. i using -p option cfx when running extension (when launching it, type cfx -p firefox_development_profile run (for more see the cfx documentation ) when include profile dir, content script doesn't work. when don't include it, does. there in profile causing page-mod stop working. i made basic page-mod plugin see if there in code causing problem, has same problem. test code (in main.js is) var data = require("sdk/self").data; var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "*.org", contentscript: "alert('opened matching page')", onattach: function(worker) { console.log("been attached") } }); my package.jso

tfs2012 - TFS drop location for this build was empty -

i getting above error drop folder populated within tfs build work activity. have 'copy outputs build' set yes. any reason why error? i think due mis-understanding of tfs. if retry new build instead of queuing new one, of course use cached properties of 1st failed build wrong properties.

c# - How to store Data from static WebMethods into the ViewState -

now have done research. need store data have retrieved ajax call webmethod on page place can pull again anytime. i thought @ first viewstate best option. unfortunately cannot reference in same way can in non-static methods. if make instance of page store in viewstate, believe de-instantiated @ end of method destroying whatever data saved. i need data purpose of database calls doing in other webmethods. the basic method in c# codebehind aspx page looks this: [webmethod] [scriptmethod] public static string populatemodels(string[] makeids) { } so example need save selected makes pull future database calls. since of boxes cascade in terms of filtering , pulling database. update: this code works retrieving , storing data in sessionstate in static webmethods. [webmethod(enablesession = true)] [scriptmethod] public static string populateyears(string[] modelids) { httpcontext.current.session["selectedmodels"] = modeli

cordova - Google auth buttons in the approval page are appears not enabled in froyo's 2.2 default browser since few days -

i have created application managing google accounts tasks , worked perfect until few days when mobile phones android froyo can not press "cancel" or "accept" button on approval page google auth. happens in default froyo's browser, if use firefox there no problem. any idea? did update google not work on froyo browser? google oauth login page 'cancel' , 'accept' buttons not enabled aug 22nd google engineer replied issue. can expected fixed end of week.

time series - R: Linear extrapolation between raster layers of different dates -

there thread dealing interpolation between raster layers of different years (2006,2008,2010,2012). tried linearly extrapolate 2020 approach suggested @ram narasimhan , approxextrap hmisc package: library(raster) library(hmisc) df <- data.frame("2006" = 1:9, "2008" = 3:11, "2010" = 5:13, "2012"=7:15) #transpose since want time first col, , values columns new <- data.frame(t(df)) times <- seq(2006, 2012, by=2) new <- cbind(times, new) # now, apply linear extrapolate each layer of raster approxextrap(new, xout=c(2006:2012), rule = 2) but instead of getting this: # times x1 x2 x3 x4 x5 x6 x7 x8 x9 #1 2006 1 2 3 4 5 6 7 8 9 #2 2007 2 3 4 5 6 7 8 9 10 #3 2008 3 4 5 6 7 8 9 10 11 #4 2009 4 5 6 7 8 9 10 11 12 #5 2010 5 6 7 8 9 10 11 12 13 #6 2011 6 7 8 9 10 11 12 13 14 #7 2012 7 8 9 10 11 12 13 14 15 #8 2013 8 9 10 11 12 13 14 15 16 #9 2014 9 10 11 12 13 14 15 16 17 #10 20

Integrating Facebook login with native login system -

i run web application has own native registration , login system. now add facebook login site, , integrate native registration system. check email returned facebook, , add user database flag indicating facebook user, , authenticate user. while have idea of how implement system, inputs on whether should use facebook sdk javascript, or server-side sdk. see facebook recommends javascript sdk webapps. in case of integrating native system, ideal choice? believe javascript sdk work when login purely facebook, , meant simple authentication-required views. can has worked facebook login decision? you right integrating facebook javascript sdk not choice native log-in system in case have pass input(userid) server side program facebook id/email id synchronize user native system, javascript. 3 way channel > facebook - js(user browser) - server, makes less secure user id can ping server , log user in. i working on same scenario need enable users login facebook option. native

mysql - Rails: Order Posts by Page -

i'd order post results page. kind of have on active admin... or every other website in universe. i'm running rails 3.2.1 for example active admin click on this: http://website.com/admin/users?order=id_desc&page=2 and have number of posts on page two... set on page 3... etc. i'm wondering how standard posts page in rails every page has 10 posts. you want use will_apginate gem https://github.com/mislav/will_paginate

variables - Why does this work (or how)? -

in email today received email getting unused drive letters. this solution : get-childitem function:[d-z]: -name | where-object {-not (test-path -path $_)} powershell magazine brainteaser had solution, same thing. ls function:[d-z]: -n|?{!(test-path $_)}|random i have no idea how function:[d-z]: works. know each character between 'd' 'z' used don't know why syntax works. testing get-childitem function:[d-a]: -name gives error saying get-childitem : cannot retrieve dynamic parameters cmdlet. specified wildcard pattern not valid:[d-a]: so dynamic parameter? how come not show get-help gci -full ? function: psdrive exposes set of functions defined in current session. powershell creates function each single letter drive, named letter followed colon. so, function:[d-z]: lists functions "d:" through "z:" function:[d-a]: doesn't work because , d-a isn't range of letters.

regex - Batch converting straight quotes to smart quotes from MySQL database -

i have mysql table 250 blog entries, using straight quotes (" , ') instead of smart quotes (“ ” , ‘ ’). need take entries , somehow batch find-and-replace replace straight quotes smart quotes. problem these fields contain html, need ensure quotes within <> tags ignored. i've exported appropriate fields , opened in sublime text thinking regex find-and-replace. it's there hit wall, though. suggestions? i don't know how enter smart quotes in sublime text 2, tested following regex (in sublime text 2 itself) single quote case using [] replacement characters: find what: ((?:[^<'>]*|<.*?>)*)'(.*?)' replace with: $1[$2] hopefully help. here rubular it, showing matches.

MS Access 2010: Query time and speed -

i running following insert query in ms access 2010, , need way query run faster. need of columns source_1_table temp_table. source_1_table has 505k records source_2_table has 3959 records insert [temp_table] select * source_1_table ((dbo_source_1_table.field_1)) not in (select [source_2_table].[id_field] [source_2_table])); question 1. how see how long taking query run (similar ssms)? question 2. query seems taking longer 10 minutes run. there way speed query? i've never worked many records in access db before, i'm not surprised it's slow. i solved similar problem in legacy code. think big problem running subquery once every record in main query (someone please correct me if that's not correct). try instead: insert [temp_table] select s1.* source_1_table s1 left join source_1_table s2 on s1.field_1=s2.id_field s2.id_field null

ios - From iPhone app to Universal app, user interface considerations -

as in title, i'm developing iphone app. use nib files, don't use storyboard, , know ipad i'll need replace of controls use iphone, since, instance, in ipad more suitable use popovers in places, , other considerations. i'm not sure if i'd need create separate nib file targeted ipad per each nib file have iphone, or should convenient thing not needed, or can keep 1 nib file if views example scroll views or table views, , resizing things enough... what want guidelines avoid redundant files , work when creating ipad version of existing iphone version, , best practices are, since don´t find how handle this, programmatically speaking, neither in apple's docs nor in posts... thanks in advance edit. question dealing icons , images: let's have image view 50x50 in iphone. have 2 .png images iphone version of image: 50x50 , 100x100 retina display. let's need image 80x80 in ipad. should best way deal this: having 4 versions of image (50x50, 100x100,

actionscript 3 - Change colors in a complex animation made of bitmaps/group -

i have animation of fireball. have choice of either using bitmaps (preferable since makes swf run little smoother) or using large group of objects (10-20 different drawings). made using deco tool , looks awesome! anyhow, it's quite annoying make new one. plus when tried make new 1 didn't quite first one. i'm planning on making several different colors of fireballs. extremely nice if somehow filter colors of entire symbol fireball1 , i'm struggling so. i tried following code, whatever reason, made fireballs disappear completely. may getting confused because i'm adding these new childs of fireball1 class arrays. also, here link picture of timeline, think might understand fireball looks http://tinypic.com/view.php?pic=fd7oyh&s=5 . private var fireball1:fireball1; private var gametimer:timer; private var army1:array; //included arrays in case effects somehow private var colorfilter:colormatrixfilter = new colormatrixfilter(colormatrix); private var colorm

linux - Connecting to a Raspberry PI that is connected to a router that I don't control -

i connecting raspberry pi router of client don't access to. pi receives dynamic ip router. i have web-server controls several pi's connected different routers. i want able ssh pi web-server. don't have it's ip address. i thought of how configuring pi automatically open terminal web-server. though solution have lots of open sessions pi's (there more 50 pi's). i happy hear solutions, thanks. here post explains how connect pi in network. pay particular attention section ip address lookup hostname http://carbonstone.blogspot.com/2013/08/setting-up-truly-portable-raspberry-pi.html basically use ping command lookup pi it's hostname. if want programatically, can parse ping response extract ip address.

ruby - Running both Xcode 4.6 and Xcode 5 (DP5) - Homebrew showing an error -

Image
context: i have both xcode 4.6.3 , xcode 5 (dp5) installed. i've installed command line tools on both (via preference settings). i installed homebrew , ran brew doctor in terminal , following error: question is because have 2 versions of xcode installed? is there way fix this? do need fix this? you don't need reinstall xcode. go xcode preferences menu , click on downloads. see option install "command line tools" under components. after that's installed homebrew stops complaining.

php - Unable to Set Cookie Expiration Time on LocalHost -

Image
i writing cookie , trying set expiration time in localhost. however, showing ending time "when browsing session ends" here code $domain = ($_server['http_host'] != 'localhost') ? $_server['http_host'] : false; setcookie('rememberme', $cookie, time()+86400*7, '/', $domain, false); can please me on why facing issue? this causing cookie destroyed every time close browser. i able fix issue myself. there other issue in code. apologies inconvenience.

c++ - undefined reference to static member variable in a static member function -

this question has answer here: undefined reference static class member 7 answers here header file: class mapobject: public screenobject { static float xoffset, yoffset; public: static float getxoffset() { return xoffset; } }; #endif // mapobject_h however on line return xoffset; following error: undefined reference `mapobject::xoffset' why? put in source file (by looks of mapobject.cpp ) #include "mapobject.h" float mapobject::xoffset = 0; float mapobject::yoffset = 0; //... rest of mapobject code here... in c++ non-const static members must both declared in class definition , defined global scope give linker reference.

python - Check number of columns numpy array that returns 1 if is a 1-dimensional array -

i have defined operations on 3xn numpy arrays, , want loop on each column of array. doing for in range(nparray.shape[1]): however, if nparray.ndim == 1, fails. there clean way ascertain number of columns of numpy array, returns 1 if 1-dimensional array (like matlab's size operation does). otherwise, have implemented if nparray.ndim == 1: num_points = 1 else: num_points = nparray.shape[1] in range(num_points): if you're looking less verbose, this: num_points = np.atleast_2d(nparray).shape[1] that will, of course, make new temporary array take shape, little silly… it'll pretty cheap, because it's view of same memory. however, think explicit code more readable, except might try : try: num_points = nparray.shape[1] except indexerror: num_points = 1 if you're doing repeatedly, whatever do, should wrap in function. example: def num_points(arr, axis): try: return arr.shape[axis] except indexerror: r

codeigniter - Calculate a variable using 2 Mysql tables and make a select based on that variable -

i own online game in become coach of rugby team , started optimize database. website uses codeigniter framework. i have following tables (the tables have more fields posted important now): leagues: id standings: league_id, team_id, points teams: id, active previously, having in leagues table field named teams. representing number of active teams in league (of users logged in recently). so, doing following select random league has between 0 , 4 active teams (leagues less teams first). select id leagues teams>0 , teams<4 order teams asc, rand( ) limit 1 is there way can same command without having add teams field? efficient? or it's better keep teams field in database? later edit this did until now: function test() { $this->db->select('league_id, team_id'); $this->db->join('teams', 'teams.id = standings.team_id'); $this->db->where('active', 0); $query = $this->db->get('standings&

c# - Why isn't this data binding working? -

so i'm brand new wpf data binding, , is.. complicated. @ point, i'm trying create list of premade test items , have displayed in listbox data template when press button. after hours of puzzling through tutorials , msdn best come with. the data item want make list from: class listingitem { private string title; private string user; private string category; //dummy constructor test purposes public listingitem() { title = "testtitle"; user = "testuser"; category = "testcatagory"; } } the quick , dirty list creator: class listmaker { public static list<listingitem> getlisting() { list<listingitem> listing = new list<listingitem>(); for(int = 0; <100; i++) { listing.add(new listingitem()); } return listing; } } the xaml of list itself: <listbox x:name="listing"> <listbox.itemtemplate

python - Executing script in vim creates unwanted whitespace in terminal -

i'm writing vim plugin , @ 1 point in code used silent bang (!) execute python script. executed when plugin loaded, in other words, whenever vim starts up. let's when start vim on top line of terminal window. when exit vim, on bottom line of terminal window whitespace in between command typed , current position. annoying , if has insight, awesome. thanks! here example: in sample_plugin.vim: silent !path/to/script.py i start vim; positioned @ top of terminal. quit vim; positioned @ bottom of terminal. unfortunately, can't post images because i'm new.

python - SQLAlchemy-like relationships without SQLAlchemy -

sqlalchemy gives me nice relationships between objects. when change 1 object's member, it's automatically added other object's list, etc. - don't want use db. i'd keep objects in memory. there module gives kind of behavior without using sqlalchemy? not knowing full context of project working on, can use sqlalchemy sqlite database or easier hold in memory. issue if hold things in memory once restart process lose data. http://docs.sqlalchemy.org/en/rel_0_8/orm/tutorial.html#connecting

java - Does anyone know why I am getting the following error?: Syntax error on token(s), misplaced construct(s) -

hi can me problem. using eclipse android , have created number of buttons , have labelled them correctlt(made sure did) , set them id have included in strings file. when go set butotn onclicklistener , create onclick method error outlined above. there red error lines on dot (period) between button1 , setonclicklistener. dont know going on here. ive included xml , strings classes. n.b. there more code main.java activity dont think necessary question. thanks help! @override public boolean oncreateoptionsmenu(menu menu) { // inflate menu; adds items action bar if present. getmenuinflater().inflate(r.menu.main, menu); return true; } button button1 = (button) findviewbyid(r.id.button1); button1.setonclicklistener (new view.onclicklistener) { } the method in java sample ends @ brace right after "return" statement; next 2 lines outside of method, , 1 errors, being statement, illegal outside of method.

android - Change TextView font which is not in activity_main.xml -

i have listview. contains 3 textview not activity_main.xml. cursor = mydatabase.getjoinedinfo(etsearch.gettext().tostring().trim()); string[] columns = new string[] { "re_value", "g_value", "ke_value" }; int[] = new int[] { r.id.tvhiragana, r.id.tvmeaning, r.id.tvkanji }; dataadapter = new simplecursoradapter(this, r.layout.wordonlist, cursor, columns, to, 0); // assign adapter listview listview.setadapter(dataadapter); how change font of textviews inside listview? final typeface mfont = typeface.createfromasset(getassets(), "fonts/himaji.otf"); layoutinflater ltinflater = getlayoutinflater(); view view = ltinflater.inflate(r.layout.wordonlist, null, false); tvhiragana=(textview) view.findviewbyid(r.id.tvhiragana); tvhiragana.settypeface(mfont); this code not change textview's font. doing wrong? you can style textviews in xml (e.g

php - Syntax error : the right syntax to use near '' at line 1 mysql -

i made function dao generates insert query, , simple query gives syntax error. i checked mysql reserved words , added function, when occur backticks. public static function buildinsert(&$db, $otable) { $db = db::get(); $q = "insert " . $otable->table . " "; $class = get_class($otable); $q .= '('; $i = 0; foreach ($class::$artablefields $key => $value) { $i++; if ($otable->primarykey == $class::$artablefields[$key]) continue; if (empty($otable->arassoc[$key])) continue; if (in_array($key, db::$reservedmysqlwords)) $key = "`" . $key . "`"; $q .= $key; $q .= ($i == sizeof($class::$artablefields) ? '' : ','); } $q .= ')'; $q .= ' values ('; $i = 0; foreach ($class::$artablefields $key => $value) { $i++; if ($otable->primarykey == $class

java - Spring mvc:view-controller and component-scan setting priority -

in spring mvc context have following mappings (there more give general idea). <mvc:view-controller path="/echo" view-name="echo"/> <context:component-scan base-package="com.myapp.controllers"/> the issue running have annotated controller @requestmapping(value = "/e{number}" . in same controller request mapping have redirect dumps user "home" if @pathvariable not integer. however not want them dumped home if matching path/echo. tried setting <property name="order" value="0" /> on view resolve however, without order on context, still taking priority. how can set priority on component scan, or force view-resolver matched first before annotated controllers. having view resolver in front of controllers sounds terrible idea (if it's able done), particularly since urlbasedviewresolver (or something) , subclasses throw exceptions if don't find match rather passing through

angularjs - ng-repeat does not seem to rebind ng-click on a re-rendering -

i have ng-repeat assigned row in table shown below. when user selects down arrow in row, method movedown gets executed, reorders list (see code). when @ dom, looks right - rows reordered, , ng-click sees newly assigned seqnbr. better explanation: initially first row shows data-ng-click='movedown(0);' second data-ng-click='movedown(1);' after selecting first one, first , second row trade places. seqnbr swapped in objects , list reordered, ng-repeate reexecuted. now dom shows new first row has: data-ng-click='movedown(0);' , old first row, second row, has data-ng-click='movedown(1);' however if select new first row, gets executed movedown(1) (the old method associated row). if dom updated, not method binding. html: <tr class='evidencerow' data-ng-repeat="e in data.evidence"> <td><div class='assertion webdiv' style='height:4em;' data-ng-dblclick='openr

javascript - how to detect moving to a new tab in Mobile Safari -

i know how equivalent of $(window).blur event in mobile safari on ios 7. purpose of detecting when tab no longer onscreen. has been asked few times before ( detect moving new tab in mobile safari ), however, answers either no longer work, or give $(window).focus event, rather $(window).blur event. also, $(window).blur fire on closing of safari? per article: http://www.mobilexweb.com/blog/safari-ios7-html5-problems-apis-review page visibility api -webkit-prefixed on ios 7- detect when our tab goes foreground , background. xmlhttprequest 2.0 spec compatible means can request ‘blob’ response. video tracks api covered , allow query , navigate through tracks , contents on media element. the relevant code implement basic demo looks this; can adapt suit requirements. it's great example because not show how capture state change, shows how request data during visibilitychanged event: var eventname = "visibilitychange"; if (document.webkithidden != undef

regex - python re.sub missing group name error -

i'm going crazy have no idea why i'm getting error: traceback (most recent call last): file "file.py", line 154, in <module> main() file "file.py", line 143, in main dld = work() file "file.py", line 100, in work string1= re.sub(find_dev_line, dev_line_to_replace, string1) file "c:\program files (x86)\python27\lib\re.py", line 151, in sub return _compile(pattern, flags).sub(repl, string, count) file "c:\program files (x86)\python27\lib\re.py", line 270, in _subx template = _compile_repl(template, pattern) file "c:\program files (x86)\python27\lib\re.py", line 257, in _compile_repl raise error, v # invalid expression sre_constants.error: missing group name with these lines of code: dev_line_searchterm = "^.+"+devname+".+$" dev_line_to_replace = str(os.path.join(start_dir, "downloads", devname, filename)) find_dev_line = re.compile(dev_line

in app billing - retrieve price from inApp in Android -

please, i'm getting crazy this. i can make purchase 1 of testers i'm not been able retrieve price of product. see, below code "connect": //binding service bindservice(new intent("com.android.vending.billing.inappbillingservice.bind"), mserviceconn, context.bind_auto_create); string base64encodedpublickey; base64encodedpublickey = getstring(r.string.baseencodedpubkey); // compute public key , store in base64encodedpublickey mhelper = new iabhelper(this, base64encodedpublickey); mhelper.startsetup(new iabhelper.oniabsetupfinishedlistener() { public void oniabsetupfinished(iabresult result) { if (!result.issuccess()) { // oh noes, there problem. log.d("tma setup billing", "problem setting in-app billing: " + result); } // hooray, iab set up! else{

c++ - std::map -- what data structure is inside -

i'm beginner , learning c++ having hard times understand std::map concepts, because code i'm playing implies map search tree, i.e. names of std::map objects have *tree in comments. however after reading material http://www.cprogramming.com/tutorial/stl/stlmap.html tend think std::map has nothing tree or hash. so i`m confused -- either variables , comment in code lie me, or subject more complex think :) std::map associative container. requirement standard container must have associative container interface , behavior, implementation not defined. while implementation fits complexity , interface requirements, valid implementation. on other hand, std::map implemented red-black tree , the reference says.

Windows Phone: how to save a log of user actions? -

i want save log of whatever user doing in application. example, if user clicks specific button or icon want record it. how can achieve in windows phone? i use google analytics this. http://devatheart.com/2012/09/02/analytics-for-windows-phone-nuget-to-rule-them-all/

division - C check for number of divisors -

i trying find number of divisors each number 1 100, not understand why not working. compiler said error in line 18, 21 , 24. #include <stdio.h> #include <math.h> #define n 100 int main() { float n; float l (n=1; n<=n; n++) { //genertate list of numbers int a; (a=n; a>=n; a--) { //genarate list of numbers less "n" l = n/a; //divide each number less "n" if (l == round(l)) { //see "l" divisor of "n" l=l+1; //if finds divisor add printf(n, l); //prints number number of divisors } } } } here warning compiler gave: ks-macbook-pro:~ kyle$ gcc /users/kyle/app-tests/c/divisors.c /users/kyle/app-tests/c/divisors.c: in function 'main': /users/kyle/app-tests/c/divisors.c:18: error: nested functions disabled, use -fnested-functions re-enable /users/kyle/app-tests/c/divisors.c:18: error: expected '=', ',

c++ - Get arrays from other classes -

i working on ludum dare project , can't figure out how use array in class using tilesheet. best way store array in class , use in main.cpp file? one way use stl vector class array. in below sample, nnumbers vector of type int , copy made through public accessor method classb uses. // classa.h #include <vector> class classa { public: classa(); std::vector<int> getnumbers(); private: std::vector<int> mnumbers; }; // classa.cpp #include "stdafx.h" #include "classa.h" classa::classa() { for(int = 0; < 5; i++) { mnumbers.push_back(i); } } std::vector<int> classa::getnumbers() { return mnumbers; } // classb.cpp #include "stdafx.h" #include "classb.h" #include "classa.h" #include <vector> #include <iostream> void classb::runoutput() { classa a; std::vector<int> somenumbers = a.getnumbers(); for(unsigned int = 0; < so

Arduino error: ISO C++ forbids declaration of 'LinkedListItem' with no type -

i'm getting error while attempting write program arduino. i'm novice @ c++ simple , obvious missing. attempting create simple templated linked list keep running issues. have following declared within own ino file in sketchbook. when attempt use linkedlistitem class, following error. if remove templating, still same error. error: iso c++ forbids declaration of 'linkedlistitem' no type linkedlist:9: error: expected ';' before '<' token and code: template <class t> class linkedlistitem { public: linkedlistitem(t value); t getvalue(); linkedlistitem<t>* getpreviousitem(); void setprevious(linkedlistitem<t>* previous); linkedlistitem<t>* getnextitem(); void setnext(linkedlistitem<t>* next); private: linkedlistitem<t>* _previous; linkedlistitem<t>* _next; t _value; }; template <class t> linkedlistitem<t>::linkedlistitem(t value) { _value = value

javascript - I've installed the Admob plugin into my Phonegap project... now what? -

following installation instructions on admob phonegap plugin page on github , seems it's gone without errors. however, though functionality theoretically available, don't see how implement it. in javascript or html files place code display admob ad? where code admob ad? just it's clear, have added relevant java .jar files project, i've edited .xml files, plugin enabled. there step, place ad somewhere in web pages. google adsense ad, take snippet of javascript , place in html layout. trying figure out how connect html/javascript interface admob plugin have (successfully) installed in project. an answer ideally code put html/javascript, , put it. had google adsense code, not allowed on mobile apps, i'm trying figure out replace with. have <div> contained google adsense, put in it? the plugin project linked using android admob sdk android native component , doesn't require add phonegap/cordova html/javascript code in way. happening mod

serialization - is there any way to automatically execute registerClassAlias on Actionscript/Air? -

i'm using registerclassalias save custom classes sharedobject it's giving me headache since every time make new class, have write registerclassalias sentence , there hundreds of custom classes save in project. is there way lessen labor or have write registerclassalias manually each time make class want save? you can lessen labor using array of classes, still has filled manually. var classarray:array=[oneclass,twoclass]; // fill elsewhere each(var c:class in classarray) registerclassalias(getqualifiedclassname(c),c);

date - how to use datehelper methods with view -

i using date helper method converting datetime helper class... but have result date "a moment ago" only. takes system date not model.. please me... because in partial view model.helpers.datehelper.getfriendlydate(datetime.now). takes current date.. you put this, <%var createddate = dial4jobz.helpers.datehelper.getfriendlydate((datetime)viewdata["createddate"]); %>

MySQL INNER/LEFT JOIN on 3 tables, where records in 3rd table might not exist -

i've got problem can't seem figure out after bunch of failed attempts. i've got 3 tables need join on reporting, , in 3rd table record might not exist. if record in 3rd table doesn't exist, need report null value data comes 3rd table , records match other conditions. stripped down relevant columns, here table structures: members - this table holds members register website | memberid | insertdate | | ==========|=====================| | 1 | 2013-08-01 18:18:16 | | 2 | 2013-08-02 18:18:16 | | 3 | 2013-08-03 18:18:16 | | 4 | 2013-08-04 18:18:16 | | 5 | 2013-08-05 18:18:16 | registration_steps - this table holds progress of registration processes , whether registration completed or not | memberid | completed | | ==========|===========| | 1 | 1 | | 2 | 1 | | 3 | 1 | | 4 | 0 | | 5 | 1 | purchases - this table holds, well.. purc

canvas - Box2d javascript add images to bodies and manage art assets -

ok have few levels of simple platform built out, so need insight on how assign images bodies, , handle images, etc. game simple platform game, ball palyer chacter , have try reach other side. have obstacles joints , swinging balls, etc. getting started, please let me know if can help... box2dweb.. here example of few bodies inside game in various places.. advice appreciated. pplayer character let me know if can help. function pc(gamepiece){ if (gamepiece == 1) { var ballsd1 = new b2circledef(); ballsd1.density = 1.1; ballsd1.radius = 22; ballsd1.restitution = 0.5; ballsd1.friction = 1; ballsd1.userdata = 'player'; var ballbd = new b2bodydef(); ballbd.lineardamping = .03; ballbd.allowsleep = false; ballbd.addshape(ballsd1); ballbd.position.set(40,0); player.object = world.createbody(ballbd); } ok usi

javascript - Determine if UIWebView handled event -

when user taps in uiwebview want show/hide navigation bar. want if uiwebview didn't done in respond event (selected text, invoked javascript). i've found article determine touch coordinates: http://mithin.wordpress.com/2009/08/26/detecting-taps-and-events-on-uiwebview-the-right-way/ there no information if happened inside uiwebview. edit: solution intercept unused tap events in uiwebview not working in situation, have pretty complicated html-structure iframes. i think can take advantage of uiwebviewdelegate , implement methods like: - (bool)webview:(uiwebview *)webview shouldstartloadwithrequest:(nsurlrequest *)request navigationtype:(uiwebviewnavigationtype)navigationtype and - (void)webviewdidstartload:(uiwebview *)webview to manage whether showing navigation bar or hiding it.

java - Parsing json array with no name in android -

i have json array string no name , want parse how can in android ? my jsonarray : [ { "categoryid":1, "title":"rock", "songs":null }, { "categoryid":2, "title":"jaz", "songs":null } ] try this.. jsonarray jsonarray = new jsonarray(json); (int = 0; < jsonarray.length(); i++) { jsonobject jsonobj = jsonarray.getjsonobject(i); system.out.println("categoryid : " + + " = " + jsonobj.getstring("categoryid")); system.out.println("title : " + + " = " + jsonobj.getstring("title")); system.out.println("songs : " + + " = " + jsonobj.getstring("songs")); }

javascript - Get the value from editItem template field of gridview on update button click of gridview -

i have gridview. there 5 columns. roleid, username, password, role, action. columns template fields. in action column have edit button in item template , in same column have update , cancel link button in edit item template. when click on edit button of action column, update , cancel button appear in action column , gridview goes edit mode textboxes in edititem template. i want validate whatever user enters in textboxes(username) of gridview when edit mode. i want username column values of clicked row(update button) using javascript when gridview in edit mode textboxes visible. i tried following not working. error: 0x800a138f - javascript runtime error: unable property 'cells' of undefined or null reference want values of textbox1(edit item template). textbox1 available in edit mode of gridview when click on editbutton(item template). <%@ page language="c#" autoeventwireup="true" codebehind="gridviewjavascript.aspx.cs" inherits=&

html - Marquee doesnot scroll smoothly, need 100% smooth scroll for marquee -

i using marquee scroll right side left. below code works fine. not scrolling smoothly. content "hover on me stop" blinking or flashing. need 100% smooth scroll below marquee. please me. whether possible without javascript?? <marquee behavior='scroll' direction='left' scrollamount='3' onmouseover='this.stop()' onmouseout='this.start()'>hover on me stop</marquee> if wish try using pure css easiest approach. though need check support older browsers , add vendor prefixes. .marquee-parent { position: relative; width: 100%; overflow: hidden; height: 30px; } .marquee-child { display: block; width: 147px; /* width of text div */ height: 30px; /* height of text div */ position: absolute; animation: marquee 5s linear infinite; /* change 5s value desired speed */ } .marquee-child:hover { animation-play-state: paused; cursor: pointer; } @keyframes marquee { 0% { l

JQuery onclick execute event of input field -

i don´t know if it´s possible , in case want when click on input text field activate function in jquery , after of action execute code of jquery - inside onclick - , put example : <input type="password" name="password" value="" class="input_text_register" id="pass" onclick="jquery("#list").show();"/> i can´t works , supose have error because no works , in case activation input text field open other div show informations thank´s , regards ! $('#pass').click(function () { $("#list").show(); }); or change onclick="jquery("#list").show();" to onclick="jquery('#list').show();"

android - Check if device has hardware volume controls? -

some devices kindle fire not have hardware buttons volume, going add on screen controls, don't want have them there if not necessary. i can't find info on this, i've looked in packagemanager features, plus configuration . is true maybe devices have hardware volume controls exception of kindle fires? android.view.keycharactermap.devicehaskey(keyevent.keycode_volume_up)

java - SVN checkout not working for Jenkins? -

i installed jenkins mac-osx , when try put svn repository link following error failed: svn: e175002: options /prime_source_code/branches/prime_source_code/prime_java_api/primecoreservices failed org.tmatesoft.svn.core.svnexception: svn: e175002: options /prime_source_code/branches/prime_source_code/prime_java_api/primecoreservices failed @ org.tmatesoft.svn.core.internal.io.dav.http.httpconnection.request(httpconnection.java:379) @ org.tmatesoft.svn.core.internal.io.dav.http.httpconnection.request(httpconnection.java:364) @ org.tmatesoft.svn.core.internal.io.dav.http.httpconnection.request(httpconnection.java:352) @ org.tmatesoft.svn.core.internal.io.dav.davconnection.performhttprequest(davconnection.java:708) @ org.tmatesoft.svn.core.internal.io.dav.davconnection.exchangecapabilities(davconnection.java:628) @ org.tmatesoft.svn.core.internal.io.dav.davconnection.open(davconnection.java:103) @ org.tmatesoft.svn.core.internal.io.dav.davrepository.opencon