Posts

Showing posts from January, 2010

oop - PHP user class with login access -

i've searched login system in google thing i'm trying there myself, , not following guide tells me everything. i have index.php has menu.php included in top, has include login_form.php, calls login.php make login. in login.php uses class user make login. user.php has require_once connection.php i'm failing @ easy fix can't quite see new me. problem error happens: undefined variable: mysql in admin\include\lib\user.php on line 12 connection.php: require_once 'constants.php'; $mysql = new mysqli($db['host'], $db['username'], $db['password'], $db['name']); if ($mysql->connect_error){ die('connection error (' . $mysql->connect_errno.')'. $mysql->connect_error); } user.php -> line 12: $this->password=$mysql->real_escape_string($this->password); as side note index.php require_once connection.php, constants.php (which has $db array host, user, etc..), , class.php. i

iphone - Cell Imageview with Gesture - Which image was tapped? -

i have uitableview cells displayed image, labeltext , detailtextlabel. cell.imageview configured uitapgesturerecognizer: uitapgesturerecognizer *tap = [[uitapgesturerecognizer alloc] initwithtarget:self action:@selector(infoimagetapped:)]; [tap setnumberoftapsrequired:1]; [cell.imageview setgesturerecognizers:[nsarray arraywithobject:tap]]; the method "infoimagetapped" triggered fine. want know image (to more specific, imagenamed) tapped. i tried following code: uiimageview *thetappedimageview = (uiimageview *)tap.view; nslog(@"gesture tag: %@", thetappedimageview.description); in nslog-window: imagenamed (*.png) displayed don't know how write information nsstring variable. i need imagenamed (or reference original image in cell) open alertview image. thanks in advance florian -(void)infoimagetapped :(uitapgesturerecognizer *)gesture { uiimageview *image = (uiimageview *) gesture.view; nslog(@"gesture tag: %@", image.d

reporting services - How SSRS deployment works? -

we working on application asked generate reports. our immediate choice use ssrs. after studying tutorials completed designing of reports. however, not clear on how deploy ssrs project displaying them in gui environment. my questions are: where should deploy project? if deploy in iis, server run it? does iis have capability run these? do need run report server run these reports? please any clarification regarding these aspects. i know how create reports, struggling basic concepts of ssrs. i.e. need more information on how setup in production environment. there 3 parts every report let's cover first: a datasource connection string or equivalent talk database, service or flat file. can contained in report or shared. shared matters in shared datasource may used 1 or many reports. a dataset query, procedure or structure of obtaining data used in report. may contained in report or shared. again shared may used 1 or many reports , may cached on server. the

How to customize submenus isn wordpress theme -

i have wordpress theme , in header.php file displaying menus through line : wp_nav_menu( 'theme_location=menu_2&menu_id=nav&container=&fallback_cb=menu_2_default'); now if hover menu item, displays submenus items. want change layout of submenu items section or div , can't find html of submenus. need in this within css. since don't have link website direct common place it. (use dev tools inspect them) something in css .menu-top-navigation-container {...} // first list item #menu ul li {..} //second list item #menu ul li ul li{...} //second list item linkable text menu ul li ul li a{...} this hypothetical. theme different style them.

sql server 2008 r2 - Get yesterday's rows startign from 10AM -

for previous day used use below expression . date_inserted >=dateadd(day, datediff(day,0,getdate())-1,0) , date_inserted < dateadd(day, datediff(day,0,getdate()),0) how rows yesterday 10am today 10am -- yesterday @ midnight: declare @yesterday datetime = dateadd(day,datediff(day,1,getdate()),0); select ... date_inserted >= dateadd(hour, 10, @yesterday) -- 10 yesterday , date_inserted < dateadd(hour, 34, @yesterday); -- 10 today

android - Notification buttons not showing -

following this guide , other discussions online i've made pice of code should show .addaction method buttons in notification: @suppresslint("newapi") public void generatenotificationsong() { if(android.os.build.version.sdk_int >= 11){ notification.builder builder = new notification.builder(this); builder.setsmallicon(r.drawable.ic_launcher); builder.setcontenttitle(songslist.get(currentsongindex).gettitle()); builder.setcontenttext("next: " + songslist.get(getnextsong()).gettitle()); builder.setongoing(true); //e' in corso builder.setautocancel(true); //intent con activity che devo aprire (la corrente) intent thisintent = getintent(); pendingintent pendingintent = pendingintent.getactivity(this, 0, thisintent, pendingintent.flag_update_current); //aggiungo bottoni alla notifica se android è > 4.1

mysql UNION wrong result? -

i have query this (select s1.m m,ifnull(s2.y,2013) y,ifnull(s2.s,0) planned (select 1 m union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9 union select 10 union select 11 union select 12) s1 left join (select year(p.pdate2) y,month(p.pdate2) m, sum(p.totwdisc) s pro_partial_inv p year(p.pdate2)=2013 group y,m) s2 on s1.m=s2.m) union (select s5.m m,ifnull(s3.y,2013) y,ifnull(s3.s,0) realv (select 1 m union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9 union select 10 union select 11 union select 12) s5 left join (select year(p.paidd) y,month(p.paidd) m, sum(p.totwdisc) s pro_partial_inv p p.status=2 , year(p.paidd)=2013 group y,m) s3 on s5.m=s3.m) union (select s6.m m,ifnull(s4.y,2013) y,ifnull(s4.s,0) proj (select 1 m union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 uni

how to combine two strings in TCL? -

i have following code in tcl: set string1 "do firstthing" set string2 "do secondthing" how make combine 2 strings have "do firstthing secondthing" you can use append this: % set string1 "do firstthing" % set string2 "do secondthing" % append string1 " " $string2 % puts $string1 firstthing secondthing you can put them next other... % set string1 "do firstthing" % set string2 "do secondthing" % puts "$string1 $string2" firstthing secondthing or if strings in list, can use join , specify connector... % set listofstrings [list "do firstthing" "do secondthing"] % puts [join $listofthings " "] firstthing secondthing

c# - Object reference not set to an instance of an object. DataRow dRow2 = ds2.Tables["own"].Rows[0];?/? -

trying call specific row table , keep getting error, have help? database has 2 rows atm 5 columns values filled ds0 local variable inside btnlogin_click function. quick fix, have navigaterecords accept dataset argument , return dataset.

android - Fragment management with drawer layout -

i have app using slider drawer layout used in applications such youtube. have setup such there 1 main activity in main view cycles through multiple fragments attach onto activity. there 3 main fragments in navigation drawer user can switch to. within each of 3 main fragments more fragments user can go clicking button in main fragment. wondering best way manage these fragments while preserving backstack , minimizing need reload of them if user revists fragment. ex flow: main subfragment 1. contacts -> contact details when contact clicked 2. clientlist -> client details when client selected 3. infopage -> info each developer after reading question, suggest in drawerlayout , can create main list containing selection of contacts , clientlist , , infopage . selection of any, can display related info in lets detailfragment . example, selection contacts drawerlayout , contacts displayed in detailfragment . now, clicking of contact detailfragment ope

c# - Get file path if file is in another folder -

i have text file inside drive. inside folder in drive. know filename , drive name. searches file occurance through var file = directory.getfiles(ftppath,filename,searchoption.alldirectories); that ok. if file in folder under drive how ne path in ftppath variable? i not find valid solution this. it should like: ftppath = path.getdirectoryname(file[0]); now path in filename found in stored in ftppath . of course should add checks before accessing file ensure found...

function - Set of points with a deviation from the main route javascript -

Image
here have image main route point (lat,lng) point b(lat,lng) also have object(points) , want know posible objects far main road 5km, on image here. or how can calculate using google map api. idea? posible polilines service or ... sorry english

html5 - Redraw select menu in JQuery Mobile -

i trying make jquery mobile select menu button larger changing data-mini property true false on fly. able change property, select menu not redraw. it works button, using .buttonmarkup({mini: false}) (which redraws button instantly), far know there no equivalent select menus. i have tried .selectmenu("refresh") , .change() - neither redraws select menu button. here illustration of problem: http://jsfiddle.net/yyxuz/ does have solution? hey works me - $('#testselectmenu').parent('div').addclass('ui-fullsize'); jsfiddle demo i noticed won't need $('#testselectmenu').selectmenu('refresh'); approach. /update to play safe (it same thing while removing data-mini attribute , ui-mini class) - $('#testselectmenu').parent('div').attr('data-mini', 'false').removeclass('ui-mini').addclass('ui-fullsize'); i think jqm should handle automatically when call .s

regex - Regular expression to extract text from XML-ish data using GNU sed -

i have file full of lines extracted xml file using "gsed regexp -i filename". lines in file of 1 of either format: <field number='1' name='account' type='string'w/> <field number='2' name='advid' type='string'w> i've inserted 'w' in end represents optional whitespace. order , number of properties not same in lines throughout file although "number" before "type". what i'm searching regular expression "regexp" can give gnu sed command: gsed regexp -i filename gives me file lines looking this: 1 string 2 string i don't care amount of whitespace in result long there after number , newline @ end of each line. i'm sure possible, can't figure out how in reasonable amount of time. can help? thanks lot, jules i'm sure can optimized, works me , answers question: sed "s/^.*number='\([0-9]*\)'.*type='\(.*\)'.

performance - Slow Execution of MySQL Select Query -

Image
i have following query… select distinct * vpas_posts_users (post_user_id =:id , post_type != 4) , post_updated >:updated group post_post_id union select distinct vpas_posts_users.* pas_follow join vpas_posts_users on ( pas_follow.folw_followed_user_id = vpas_posts_users.post_user_id ) (( pas_follow.folw_follower_user_id =:id , pas_follow.folw_deleted = 0 ) or ( post_type = 4 , post_passed_on_by = pas_follow.folw_follower_user_id , post_user_id !=:id )) , post_updated >:updated group post_post_id order post_posted_date desc limit :limit where :id = 7 , :updated = 0.0 , :limit=40 example my issue query taking minute return results. there in query can speed result? i using rds ********edit********* i asked run query explain result below ********edit********** view definitition create algorithm=undefined definer=`mysqluser`@`%` sql security definer view `vpas_posts_users` select `pas_user`.`user_user_id` `user_user_id`, `pas_user`.`user_coun

php - enum list with pre-selected multiselect form -

ok, new sort of thing , building small site work has profiles employees. working on way edit profiles, , when goes "edit" page, need of used values pre-selected. when have dropdown based on enum list, works fine example <?php $table_name = "agents"; $column_name = "assignedabc"; echo "<select name=\"$column_name\"><option>select one</option>"; $q = "select column_type information_schema.columns table_name = '$table_name' , column_name = '$column_name'"; $r = mysqli_query($con, $q); $row = mysqli_fetch_array($r); $enumlist = explode(",", str_replace("'", "", substr($row['column_type'], 5, (strlen($row['column_type'])-6)))); foreach($enumlist $value) echo '<option value="'.$value.'" '.(($value==$rows[assignedabc])?'selected="selected"':"").'>'.$value.'

python - Bingsearch returning 'instancemethod' object has no attribute '__getitem__' -

i have written code; import bingsearch bingsearch.api_key='mykey' r = bingsearch.request("johndalton") r.status_code r[0]['description'] print r[0]['url'] this th bingsearch.py file import requests import urllib2 url = 'https://api.datamarket.azure.com/data.ashx/bing/searchweb/web?query=%(query)s&$top=50&$format=json' api_key = 'mykey' def request(query, **params): r = requests.get(url % {'query': query}, auth=('', api_key)) return r.json['d']['results'] as mentioned in title gives me instancemethod error. how should fix this? @chris barker spot on earlier. you need change line return r.json['d']['results'] return r.json()['d']['results'] . you should proper error checking on requests.get result , on json returned. might not contain items expect , raise keyerror . for request errors might want check request documentation ha

javascript - easyXDM rpc with HashTransport callback not being fired -

i'm using easyxdm 2.4.17. i've setup rpc remote 'tunnel.html' makes ajax calls using jquery. for modern browsers (those postmessage) working fine. when test on ie7 easyxdm falls hashtransport , still works fine except never see ajax response. can see request coming fine callback never being fired reason. my tunnel.html file looks this: <!doctype html> <html> <!--[if lt ie 9]> <script type="text/javascript" language="javascript" src="https://mydomain.net/json2.min.js"></script> <![endif]--> <script src="https://mydomain.net/easyxdm-2.4.17.js"></script> <script src="https://mydomain.net/jquery-1.10.2.min.js"></script> <script> function apitunnel (endpoint, params, method, callback) { var options = { url: endpoint, data: params, type: method,

excel vba - VBA - object required error when setting .DisplayAlerts = False -

background: i sas programmer (a statistical software), i'm using vba make excel play nicely sas. wrote program can execute in sas using following code: *batch convert excel files csv files; %let xlsfile=c:\xlsfile.csv; %let csvfile=c:\csvfile.csv; %let worksheet=1; x 'cd "c:\location_of_vbsfile"'; x "vbsfile.vbs &xlsfile &worksheet &csvfile"; the program opens excel file, selects required sheet, replaces commas, carriage returns, , line feeds, saves file csv file can nicely import file sas. problem: i want to eliminate message boxes may produced. added application.displayalerts = false top of program prevent message boxes being displayed. however, following error, must wrong. error: object required: 'displayalerts' this code: '1 - open excel dim oexcel dim obook set oexcel = createobject("excel.application") 'this added set oexcel.displayalerts = false set obook = oexcel.workbooks.open(wsc

map - Java TreeMap contains a key but a containsKey call returns false (even the key is exactly the same unchanged object) -

why possible loop keyset of treemap , getting .containskey == false ? for (object thisobject : map.keyset()) { if (!map.containskey(thisobject)) { system.out.println("this line should never reached."); } } after lot, lot of different iterations , calls line gets hit. map.get(thisobject) return null . debug shows key ( same reference, value , hash ) , actual value in map. map small (25 elements) treemap<long, double> update: as guessed @rgettman theres custom sort comparator used @ construction of treemap (didn't see because constructed class). comparator (i guess) copy pasted here changing comparator : public int compare(object a, object b) { if((double)base.get(a) > (double)base.get(b)) { return 1; } else if((double)base.get(a) == (double)base.get(b)) { return 0; } else { return -1; } } to ... } else if(base.get(a).equals(base.get(b))) { return 0; ... fixes problem. reason

java - ActiveMQ Running on AWS - EC2 instance, Producer Performance Improvement -

i working on assignment requires me benchmark response times between apache activemq , aws-sqs. in finding found that, activemq producer takes 35 sec / 1000 messages [120 bytes each] consumer takes 250 ms / 1000 messages [120 bytes each] i using maven + git + java based project structure. creating session connectionfactory in following way: cfactory.createsession(false, session.auto_acknowledge); connection synchronous, message reliability important. can tell me logic or reason behind behavior? i suspect producer takes time because has not send wait acknowledgement amq service running on ec2 fact has journaled message. please let me know why producer slow , how can improve upon it. your suspicion correct 'it has not send wait acknowledgement amq service running on ec2 fact has journaled message.' try sending multiple messages in transaction. messages in tx sent without having wait acknowledgement. when commit() client block waiting acknowledgement

python - Easiest paths from Pygame/PyOpenGL to iOS. -

i have a significant game need port tablets. (android has pygame subset android, i'm still investigating). great take python code , move more cross-platform engine. i'm looking engines pure code api, can wrap intermediate glue graphics , audio around. kivy , others use *ml (or json). hoping missed good. best i've seen futile unity3d, boo !!!!!= python. have @ http://ignifuga.org , it's python based , inspired projects cocos2d , andengine.

css - problems placing submit button in a responsive web page -

i have web page displays 1 dropdown box when page loads, , submit button beside it. depending on option user selects dropdown, make ajax calls , if data returned, display drop down list more options. 2 times, in total, can have 3 drop downs on page side side. while, submit button supposed to right of last drop down box that's displayed. problem: depending on mobile device i'm using navigate site, submit button overlaps first drop down box if there's plenty of room on row. same thing happnes when second drop down appears. how can ensure regardless of device, submit button appears beside first drop down? code: i'm showing html... ajax works. ajax code adds select boxes within each div tag. <div class="row-fluid"> <div class="span12" id="l1locations"> <h2><?php echo $title;?></h2> <div class="span3"> <h4>branch:</h4&g

javascript - Overlapping images JS Slider -

could guys recommend me slider works in link bellow?(basically small image gallery images partially overlap each other). slider i sugget spacegallery jquery plugin http://www.eyecon.ro/spacegallery/

phonegap plugins - ErrorType: Argument to path.join must be string -

i working on phonegap application send sms using third party plugin.but facing exception "errortype: argument path.join must string:360:15". please tell me reason of exception! here snapshot of error click here before exception facing missing of plugin.xml file exception. after add of plugin.xml facing error now. let me debug this, thank full of in advance

iphone - Memory not releasing after popToRootViewControllerAnimated -

i using navigationcontroller in app. after push , pop view controller 3 times app crashes because of low memory. code below. - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { self.window = [[uiwindow alloc] initwithframe:[[uiscreen mainscreen] bounds]]; homepagevc *homepage = [[viewcontroller alloc] homepage = [[viewcontroller alloc] initwithnibname:@"mainview-ipad" bundle:nil]; navigationcontroller = [[uinavigationcontroller alloc] initwithrootviewcontroller:homepage]; self.window.rootviewcontroller = navigationcontroller; [self.window makekeyandvisible]; return yes; } when user pushes button, send him view controller. -(ibaction)showmap:(id)sender { mapviewcontroller *mapviewcontroller = nil; mapviewcontroller = [[mapviewcontroller alloc] initwithnibname:@"mapview-ipad" bundle:nil]; appdelegate *appdelegate = (appdelegate *)[[uiappli

jquery ui draggable - Slickgrid TreeGrid drag and drop - How to get row id and details of the row, on which another row, was dragged & dropped -

i'm trying implement drag , drop within slickgrid treegrid. structure- electronics > tv > led > sony lg lcd > samsung toshiba eg - http://mleibman.github.io/slickgrid/examples/example5-collapsing.html brands moved 1 category another. got point got row drag enabled, , gets details row i'm dragging. using following can row dragged - $("#teamgrid").bind("drop", function (e, dd) { data[dd.row] } now, how details or id of row dropped drag-row? there example drag drop enabled within grid? i think figured out - var name = e.target.offsetparent.childnodes[1].innerhtml; var temp = document.createelement("div"); temp.innerhtml = name; alert(temp.textcontent || temp.innertext);

html - How widely supported is the iframe attribute "allowfullscreen"? -

i can't seem find websites detailing support iframe attribute "allowfullscreen". caniuse.com doesn't seem have listing it, example. does have support information chrome, safari, ie , firefox? i've started discovering of own answers: firefox : added support in v18 (january 8, 2013) - source chrome : added support in v27 (may 22, 2013) - source safari: added support in v7 (october 22, 2013) - source internet explorer: added support in v11 microsoft edge: supported it seems difficult find detailed release notes other three, unfortunately.

python - Computing Eulers Totient Function -

i trying find efficient way compute euler's totient function . what wrong code? doesn't seem working. def isprime(a): return not ( < 2 or any(a % == 0 in range(2, int(a ** 0.5) + 1))) def phi(n): y = 1 in range(2,n+1): if isprime(i) true , n % == 0 true: y = y * (1 - 1/i) else: continue return int(y) here's faster, working way, based on description on wikipedia: thus if n positive integer, φ(n) number of integers k in range 1 ≤ k ≤ n gcd(n, k) = 1. i'm not saying fastest or cleanest, works. import fractions def phi(n): amount = 0 k in range(1, n + 1): if fractions.gcd(n, k) == 1: amount += 1 return amount

kif - Objective c - Run block of code for X seconds but return immediately if condition satisfies -

so situation need run code 5 seconds if match condition want return back. doing in kif test steps , don't want block applications main thread. sample pseudo code - + (bool) isverified:(nsstring*)label; { if(<condition match>) return yes; else if(x seconds not passed) <make sure m running function x seconds> else // x seconds passed now.. return no; } if don't want block main thread in case no should returned after 5 sec delay, structure api asynchronously. typedef void(^ccfverificationcallbackblock)(bool verified); @interface ccfverifier : nsobject - (void)verifylabel:(nsstring *)label withcallbackblock:(ccfverificationcallbackblock)block; @end static const int64_t returndelay = 5.0 * nsec_per_sec; @implementation ccfverifier - (void)verifylabel:(nsstring *)label withcallbackblock:(ccfverificationcallbackblock)block { nsparameterassert(block); if( [label isequaltostring:@"moo"] )

What is most efficient HTML5 Canvas Rotation method? -

i want know efficient way rotate specific image on canvas. 1 context.translate(centerx, centery); context.rotate(rect.radians); context.strokerect(-rect.width/2, -rect.height/2, rect.width, rect.height); context.rotate(rect.radians *-1); context.translate(-centerx, -centery); 2 context.save(); context.translate(centerx, centery); context.rotate(rect.radians); context.strokerect(-rect.width/2, -rect.height/2, rect.width, rect.height); context.restore(); 3 context.translate(centerx, centery); context.rotate(rect.radians); context.strokerect(-rect.width/2, -rect.height/2, rect.width, rect.height); context.settransform(1,0,0,1,0,0); i running function multiple objects every animation frame. option#2 out efficient because resets context's state properties, not transform matrix. @ken-abdiassoftware right #3--directly reset identity matrix. o

sql - How can I create a Date Range from a single column? -

i trying query database has these params: transaction date, user email address the resultant table want these params: email address, datediff for datediff, want find difference between earliest transaction date , latest transaction date. how go doing this? my code (clearly not correct) select [email address], datediff(day, [transaction date],[transaction date]) 'datediff' [db].[table] order [datediff] desc you need aggregation minimum , maximum values each email, before doing datediff() : select [email address], datediff(day, min([transaction date]), max([transaction date])) 'datediff' [db].[table] group [email address] order 2 desc;

Maven - deploy webapp to tomcat before Unit test -

im trying startup webapp using tomcat check if starts properly. i have following plugin in pom.xml <plugin> <groupid>org.apache.tomcat.maven</groupid> <artifactid>tomcat7-maven-plugin</artifactid> <executions> <execution> <id>tomcat-run</id> <goals> <goal>run</goal> </goals> <phase>pre-integration-test</phase> <configuration> <fork>true</fork> <path>/../pay-war/target/conf/server.xml</path> <port>8080</port> <addcontextwardependencies>true</addcontextwardependencies> <addwardependenciesinclassloader>true</a

javascript - Is it possible to use the page scrollbar to scroll an inner div? -

i have website has fixed height , scrollable div inside that. possible remove inner scrollbar , change pages' one? current example scrollbar inside div here . i suspect might need done javascript , search on stack overflow shows number of entries referring i'm kind of hoping doesn't need done using javascript. currently, let users scroll inside div it's not elegant solution: .singlepost { position: fixed; top: 270px; bottom: 20px; background-color: white; padding-left: 20px; padding-right: 20px; overflow-x: hidden; } you set every other element on page position: fixed , leaving div expand body , make scrollable. check fiddle example: http://jsfiddle.net/gyatesiii/tnzg5/4/ the next web uses similar tactic.

ajax - jQuery-Codeigniter. Deleting second picture fail -

i have page selected product , pictures. want delete data pictures db , folders , update page via jquery ajax. firstly try using <a href> , can delete 1 picture updating page successfully, after url changed (to end added '#'), script stopped sending (this part commented, can find below ) secondly added button , use .click() , .on event. first picture deletes second not, deletes after refreshing. second attempt - nothing change, button without event. controller main.php: function del_image($picture_id){ $this->load->model('admin/product_crud'); $data['picture_name'] = $this->product_crud->get_picture_name($picture_id); //var_dump($data); unlink('uploads/100/'.$data['picture_name'][0]->url); $data['product_id'] = $this->product_crud->find_product_id_from_picture($picture_id); $this->product_crud->del_picture_fr

How to fill text area and click on button using c#? -

i having problem filling text area , click on button using c# code... please give me example if have dont care if using webbrowser or watin or whatever... <textarea class="textarea" placeholder="say something" style="overflow: hidden;"></textarea> <div class="comment-submit-container"> <button class="comment-submit" type="submit">post comment</button> <img class="comment-submit-loading" width="16" height="16" src="www.notimportantlink.com" alt=""> </div> this have tried using class..basically stackoverflow webbrowser1.documenttext = "text classes"; webbrowser1.documentcompleted += new webbrowserdocumentcompletedeventhandler(webbrowser1_documentcompleted); void webbrowser1_documentcompleted(object sender, webbrowserdocumentcompletedeventargs e) { foreach (htmlelement txt in webbrowser1.documen

mfc - CList's AddTail() assertion error -

i trying create double-dimensional list in mfc in order save , work int , cstring data. so, i've tried this: #include "a.h" //a.cpp a::a() { } a::~a() { } //********************** #pragma once // a.h class a: public cobject { public: a(); virtual ~a(); int id; cstring label; }; //********************** #include "a.h" #pragma once // b.h class b : public cobject { public: b(); virtual ~b(); int anotherid; cstring anotherlabel; clist<a*, a*&> * alist; clist<cstring, cstring&> * testlist; }; //note: b.cpp pretty same a.cpp //********************* //c.cpp void c::foo() { b * b = new b; * = new a; a->id = 1; a->label = l"something"; b->alist->addtail(a); //assertion error! cstring aux = l"another thing"; b->testlist->addtail(aux); //assertion error! } here's problem: when try use addlist() method, receive error "

ios - Removing all numbers from a string -

i have string need remove numerical values from. example h1 --> h thi2341s i34s a876 57834tes9873t --> test and forth... i tried method... nsstring *newstring = [string stringbyreplacingoccurrencesofstring:@"[^0-9]" withstring:@""]; ... though didn't remove numbers string. guessing @"[^0-9]" isn't valid occurrence. ideas of how can achieve without copying method ten times each digit? you have indicate regular expression search should used: nsstring *newstring = [string stringbyreplacingoccurrencesofstring:@"[0-9]" withstring:@"" options:nsregularexpressionsearch range:nsmakerange(0, string.length)]; and note regular expression needs [0-9] , not [^0-9] . have says "any character except digits 0-9".

How do I play the same sound on multiple clicks, using jQuery and Javascript -

currently, have explosion sound firing when bubble's pop, using explode effect jquery. i'm wanting able click on 1 bubble after another, without having pause waiting other sound finish. i've tried using variable change different audio object no luck. appreciated! the same problem happening in jsfiddle: jsfiddle.net/xbrjp/1/ my html <body style="background:black;"> <style> .circlebase { -webkit-border-radius: 999px; -moz-border-radius: 999px; border-radius: 999px; behavior: url(pie.htc); } .type1 { padding:20px; background: white; border:1px solid black; color:black; } </style> <div class="circlebase type1" style="display:table-cell; vertical-align:middle;"> <div align="center">bubble 1</div></div> <div class="circlebase type1" style="display:table-cell; vertical-align:middle;"> <div align="center">bubble