Posts

Showing posts from March, 2012

objective c - NSPointerArray access pointer fails -

i have code in cocoa library: -(nspointerarray *) getrequestsfromcalendar:(int) calid { nspointerarray * reqs=[[nspointerarray alloc] initwithoptions:nspointerfunctionsopaquememory]; for(int i=0;i<5; ++i){ request * newreq=new request(); [reqs addpointer:newreq]; } (nsuinteger i=0;i<5;++i) { void * ptr=[reqs pointeratindex:i]; std::cout<<*((request *) ptr)<<std::endl; } here have expected values printed "request1" "request1" "request1" "request1" "request1" return reqs; } when call function other cocoa library, , access nspointerarray, nspointerarray * array=[obj getrequestsfromcalendar:1] (nsuinteger i=0; i<[array count]; ++i) { void * ptr=[array pointeratindex:i]; std::cout<<*((request *) ptr)<<std::endl; } prints not expected values ????aod?)@"?? .... request c++ class overloaded std::ostream & operator <...

sql - intersect and topcount and order function in MDX query -

i use sql server 2008 r2 , use ssrs , use adventure work database. i write mdx query 10 city in top ten in both years 2003 , 2004. with set [best cities in cy 2003/2004] intersect( order( topcount( [customer].[customer geography].[city], 10, ( [measures].[internet sales amount], [date].[calendar].[calendar year].[cy 2003] ) ), [measures].[internet sales amount], bdesc ), order( topcount( [customer].[customer geography].[city], 10, ( [measures].[internet sales amount], [date].[calendar].[calendar year].[cy 2004] ) ), [measures].[internet sales amount], bdesc ) ) select [measures].[internet sales amount] on columns, [best cities in c...

i want to install seagate crystal reports v7.0 in windows 7 -

i having segate crystal report 7.0. using in 1 of vb6 project.now developing applications need install segate crystal report 7.0 on windows 7.0. not able install. when try install. ater 16 % of installation shows error , exits. want install seagate crystal reports v7.0 on windows 7.

regex - .NET regular expression parameters recognizer -

i try write .net regular expression recognising "parameters" in code language: for example in code language have single line, in general don't think code-language, string line... set = myfunc (@param1,@param2) #this in-line comment , 2 parameter not wil recognized @param3 @param4 i need match @param1 , @param2 parameters in language. i need perform search using .net regular expression. possible? the regex this: var rx = new regex(@"(?<!#.*)@[a-za-z0-9_]+"); var res = rx.matches(str).oftype<match>().toarray(); it return match each parameter before #, i've told in comment, it's primitive caveman club modern in comparison. it looks @ + letters/numbers/_ not preceded # (the (?<!#.*) ).

sql - SQLite select record where a value is within a string -

Image
i have db structured this: table1 (_id integer primary key autoincrement, titolo varchar(50) not null, autore varchar(50) not null, id_categoria varchar(20) not null, testo text, unique(titolo,autore)) table2 (_id integer primary key autoincrement, titolo varchar(50) not null unique, attiva integer(1) default(0)) how can select row table2._id within table1.id_categoria ? tthe table1.id_categoria field "1-2-3-..." want check if integer field _id of table2 in field string id_categoria of table1. try this: select table2.*,table1.id_categoria table1,table2 table1._id=table2._id , instr(table1.id_categoria, table2._id)

Grails: Is it possible to query PostgreSQL server version? -

in grails 1.3.9 application need maintain there query using like . customer installations can use different postgresql database versions (7.3 , 9.x). the search pattern can in general contain non-ascii characters. such select .. columns pattern statements don't work postgresql 7.x , have handled in different way. is there way in grails determine postgresql server version in runtime solve this? if can issue raw sql: select version();

Immidate command during MySQL Transaction -

during sign process, i'm using transaction enclose operations involved in setup of account in event of problem can rolled back. the last item occurs billing process if payment successful, commit operation called finalise account creation, if say, user's card declined, roll back. however, wondering best way write log of attempted billing database without particular write operation being 'covered' transaction protecting other database operations. possible in mysql? log table in question not depend on others. holding on data in application write after rollback operation difficult due legacy payment libraries created before started using transactions. i'd avoid if mysql has solution. i not use transactions goal in mind. operations describe seem have full right exist independently. for example, invoice has header , 1 or more lines. use transaction ensure don't store incomplete invoice in database because application error: there's no circumstan...

AngularJS directive -

i adding following div multiple times on page. <div class="box span6"> <div class="box-header"> <h2 class="custom"><i class="fa-icon-group" style="opacity:.7"></i><span class="break"></span>[text]</h2> </div> <div class="box-content"> <p><strong>[text 2]</strong></p> <ul> <li ng-repeat = "course in courses">{{course}}</li> </ul> </div> </div> i'd write directive don't know how pass values directive. eg. want pass "name" text , "email address" "text 2" , list of books "courses". is there way pass values directive passing values function? arguments function html attributes directive. in link , compile functions, attributes object, contains normalised names , values...

php - CAS Authentication failed! while using ohocas client -

i've setup rubycas-server mysql backend. when tried login via phpcas client, redirected rubycas-server url. but, after entering username & password - got error cas authentication failed! you not authenticated. you may submit request again clicking here. if problem persists, may contact administrator of site. can u tell me...whats wrong phpcas client..please me. this problem comes development servers when use no ssl::setnocasservervalidation(); after using setnocasservervalidation() , cas client internally calls curl using https, main cause of error. so fix go cas library file ../cas/cas/client.php reach function private function _readurl($url, &$headers, &$body, &$err_msg){} and add line $url = str_replace("https", "http", $url); as first line of function _readurl(... please don't in production environment cas recommends use of ssl on production.

unix - "set" command error found in tcsh with the varValue that contain curly brace -

please tell me how resolve missing } error message using tcsh command. %set aaa = {123 456} missing }. %set aaa = '{123 456}' echo $aaa missing }. add comma: set aaa = {123,456}

c++ - Linphone Compiling - configure: error: cannot run C compiled programs -

i trying compile linphone windows when run "./configure --prefix=/opt/linphone --enable-shared --disable-static" error message claiming cannot run c compiled programs. i using mingw on windows 8, have installed c++ , c compilers , mingw developer tools it appears target mismatch error. mingw32 binaries cannot run on windows 32-bit kernel. should try installing mingw64 binaries. try building linux or windows machine. had issue resolved later compiling on mac.

sql server - Add a filter like in SharePoint -

Image
is possible add filter in "sql server report builder" in sharepoint? i using sql , want filter "sponsor" (addidas, fila, nike etc) it looks in report builder: id name title sponsor 001 addidas bosch jeffrey unknown my problem when choose more 1 customer in "which customer", shows me 1 customer in table. should display customers choose. don't parameters set. did wrong? way, using 1 dataset. thanks in advance! andrew

Ruby MongoDB combine $ne and $or -

i have query using mongodb drive in ruby, $elements cursor. want x value can except 1, 2 , 3. here's i've tried. $elements.find({ "x" => {"$and" => {"$ne" => 1, "$ne" => 2, "$ne" => 3}} }).to_a but $and apparently not valid operator. tried this. $elements.find({ "x" => {"$ne" => {"$or" => [1, 2, 3]}} }).to_a but let elements x =1 through anyways. how accomplish want? also, link might find tutorial or documentation appreciated, can myself next time. i think want $elements.find({ "x" => {"$nin" => [1, 2, 3]} }).to_a about documentation... http://docs.mongodb.org/manual/reference/operator/

html - Comparing data of two textboxes is not working using jquery -

i want compare data of 2 text boxes using jquery compare password , confirm password while making email account. still have following stuff. css .test { display:none; } html <input type="text" name="t1" /> <input type="text" name="t2" /> <label class="test" name="lblerror">error</label> jquery $("#t2").click(function () { if ($("#t1").val() === $("#t2").val()) {} else { $("#lblerror").removeclass("test"); } }); demo please me, how can compare these 2 strings while leaving second text box named t2 . thanks in advance. try this you using name id in jquery, wrong. convert name id. work. <input type="text" id="t1" /> <input type="text" id="t2" /> <label class="test" id="lblerror">error</label> js $(function(){ $(...

android - Get id of TextView in Fragment from FragmentActivity in ViewPager -

i'm working viewpager 3 fragments , want change text of textview in third page. in page have button that when pressed, go sd images select one. when done, returns page , want update textview path of image. problem when try access textview from fragmentactivity it null. here code sherlockfragmentactivity: public class tabsfacturasactivity extends sherlockfragmentactivity { protected myapplication myapplication; private static final int file_select_code = 0; private myadapter madapter; private viewpager mpager; private pageindicator mindicator; private textview textviewimg; private int lecturas = 0; private simpledateformat dateformat = new simpledateformat("dd/mm/yyyy"); private boolean adjunto = false; private string filepath; private boolean eslecturaat = false; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout....

WCF DataContract Attribute -

i have question [datacontract] attribute. i have written code below: here not using [datacontract] attribute test class. class test { [datamember] public string strproperty { get; set; } [datamemer] public string strproperty2 { get; set; } } class checktotal:iservice { public string testmethod(test obj) { return obj.strproperty+strproperty2; } } for sending data client getting values correctly. here necessary use [datacontract] attribute test class? if removed [datamember] test class property getting error while sending client. not getting errors if not using [datacontract] attribute. please give me brief explanation example can understand when give attribute , when not give attribute. thanks, satya pratap. the datacontractserializer can deal classes not have datacontract attribute if provide default con...

Paths to execute PHP scripts to connect with servers from Android -

im doing android app connects mysql server store data. using xampp possible access php scripts android getting ip address of server plus php file name(the scripts must in httdocs folder) example: 192.168.1.1/namescript.php my question is...if has server (not using xampp), path execute scripts same? mean, random path of script, without server ip before?(192...in case) connection server done in php file dont know how works servers without xampp. thanks you need web address/ip identify file accessing. /namescript.php web request have no idea going. need identify web portal script can found : example 198.123.1.45/some/path/to/script.php . xampp local testing correct? can away having in root folder, when on live server might not have flexibility either because of server limitations or better file management.

PHP DOM and JavaScript with HTML entities -

i'm using phps dom build html document. at end of document, create script element. if script has entites, specifically, < , >, these converted &lt; , &gt; this problem if have strings containing characters (or in case regexs) is there non hackish way (ie not string replacement) prevent behaviour in script tags only? this not problem. characters encoded &lt; or &gt; if use domdocument::savexml() . if use domdocument::savehtml() < , > in <script> tag. example: <?php /** * php dom , javascript html entities * * @link http://stackoverflow.com/q/18487515/367456 */ $doc = new domdocument("1.0"); $doc->loadxml('<head/>'); $javascriptcode = "\n if (1 < 4) {\n alert(\"hello\");\n }\n"; $script = $doc->createelement('script'); $script->appendchild($doc->createcdatasection($javascriptcode)); $head = $doc->getelementsbytagname('head...

Uninstalling Python 2.7 on OSX 10.8.4 -

main problem: i've installed python3.3 - if run in terminal: python script.py (where script.py coded in version 3.3) i'll python 2.7 output e.g.: print('string',var) --> ('string',var) instead of: print('string, var) --> string var how can uninstall python 2.7 macport (without reading through shell commands (time restriction)?) this 1 didn't worked. second (smaller) problem: if type in terminal python , i'll python2.7 idle output. how can change this, command python refers python3.3 (instead of using command python3) ( about me: python2.7 novice, absolutely no shell knowledge, os x 10.8.4 user, xcode , macport installed. ) bad idea uninstall pre installed version of python. better idea alias python whatever want in bashrc/bash_profile. in home directory, aka ~, might have .bash_profile (if don't have one, can make it). can edit favorite text editor , add alias python='python3' or whatever want called whe...

objective c - Upload file with Dropbox SDK for iOS get Error Code 403 -

i'm trying upload file using dropbox sdk ios, have setup correctly framework, , link dropbox account, when i'm trying upload file receive error: [warning] dropboxsdk: error making request /1/files_put/sandbox/dbapp.sqlite - (403) forbidden 2013-08-28 15:07:12.418 myapp[3761:c07] file upload failed error - error domain=dropbox.com code=403 "the operation couldn’t completed. (dropbox.com error 403.)" userinfo=0x11e77ef0 {sourcepath=/users/piero/library/application support/iphone simulator/6.1/applications/553acc67-d119-44a9-b7e0-7188773ad496/documents/dbapp.sqlite, destinationpath=/sandbox/dbapp.sqlite, error=forbidden} this code use: nsstring *filename = @"dbapp.sqlite"; nsstring *destdir = @"/"; nsstring *oldpath = [[self applicationdocumentsdirectory] stringbyappendingpathcomponent:@"dbapp.sqlite"]; [[self restclient] uploadfile:filename topath:destdir withparentrev:nil frompath:oldpath]; anyone can me? i have found ...

url - How to get details from QR code? -

i got string qr generated image. how can url out of it. string got following. ahr0cdovl2r1yml6emxllwludgvydmlldy5zmy5hbwf6b25hd3muy29tlzg3m2fhmta5lnr4da== can me information out of it? thanks that string encoded in base64 . decoded version of string is: http://dubizzle-interview.s3.amazonaws.com/873aa109.txt if need integrate software, find library has base64 decoder decode such strings.

symfony - Symfony2 event subscriber does not call listeners -

i trying set simple event subscription based on example given here - http://symfony.com/doc/master/components/event_dispatcher/introduction.html . here's event store: namespace cookbook\inheritancebundle\event; final class eventstore { const event_sample = 'event.sample'; } here's event subscriber: namespace cookbook\inheritancebundle\event; use symfony\component\eventdispatcher\eventsubscriberinterface; use symfony\component\eventdispatcher\event; class subscriber implements eventsubscriberinterface { public static function getsubscribedevents() { var_dump('here'); return array( 'event.sample' => array( array('samplemethod1', 10), array('samplemethod2', 5) )); } public function samplemethod1(event $event) { var_dump('method 1'); } public function samplemethod2(event $event) ...

html - Correct way to position elements using CSS -

hi want position navigation next site name in header, proven difficult , have had use position:absoutle , margins have go minus numbers appear correctly. i wondering if there easier way make these appear side side? click here view jsfiddle ! or view code below: index.html <header> <h1>imanage</h1> <nav> <ul class="maina"> <li><a href="home">home</a></li> <li><a href="projects">projects</a></li> <li><a href="settings">settings</a></li> </ul> </nav> </header> style.css header { width:auto; height:50px; background-color:#374348; } header > h1 { font-size:16px; font-weight:bold; text-align:left; color:#fff; padding:10px; } .maina > li { display:inline; list-style:none; } header > nav { text-align:center; width:300px; height:auto; border:medium #999; position:a...

vb.net - Instantiated List as valid IList Argument -

this no means serious issue me have worked around it, more inquisitive difference , why 1 compiles , won't. take @ following examples: this builds. sub foo() dim somel ilist(of integer) = new list(of integer) bar(somel) end sub sub bar(byref argsomel ilist(of integer)) 'do stuff end sub notice bar's argument of ilist. , somel actual list(of int) following not compile: sub foo() dim somel new list(of integer) bar(somel) end sub sub bar(byref argsomel ilist(of integer)) 'do stuff end sub are not both (foo()) calling bar argument of list not ilist? byref extends scope of called function include callee function's variable byref parameter -- ie allows changing variable of callee. it entirely superfluous if vb allowed multiple return values. dim local1 , local2 int (local1, local2) = bar(local2) this hints @ solution example - don't use byref , sub, use byval , function. function bar(byval foo ilist(of integer)) ilis...

java - WebScarab : Getting a PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException while connecting via https -

hope doing well.i know there many answers alike issue going ask still no 1 seems help. please help!!! issue:- trying connect secure website(https) using webscarab, can capture traffic.http working fine me. using webscarab proxy. 'client.gethostconfiguration().setproxy("127.0.0.1", 8008);' but everytime gets exception ( suncertpathbuilderexception ) stated above. have tried adding website certificate java using keytool utility also. added proxy (reverse) entry in webscarab (127.0.0.1 , 443) , changed program use proxy server. 'client.gethostconfiguration().setproxy("127.0.0.1", 443);' then got following exception :- org.apache.commons.httpclient.protocolexception: server stbeehive.oracle.com failed respond valid http response. i tried creating .p12 certificate (for website want connect to) , importing webscarab. but inspite of these methods not able proper response. i using webscarab proxy firefox capture traffic , wor...

loops - Powershell Remove Oldest Items -

i trying use while loop remove old files in multiple directories (starting oldest) until there 1 left, @ point program should end. program should run if there more 1 file in directory @ runtime. here environment: top folder folder 1 folder 2 etc in folder 1, folder 2, etc there should 1 file. script should delete latest , nothing @ if there 1 file in there begin with. i have semi-accomplished using following code: $basedir = "c:\test" set-location -path c:\test $a = get-childitem -recurse $basedir if ($a.count -gt 1) { { $a | sort-object lastwritetime -descending | select-object -last 1 | remove-item } while ( $a.count -gt 1 ) } it run when there more 1 file present, correct. it correctly deletes oldest file, keeps on trying delete same file rather rechecking directory. all need @ point getting re-run loop once has deleted file, rather trying delete same file on , over. thank you, sincerely, , apologise ...

Android DialogFragment onResume can't access views? -

i'm doing in wrong place, have dialogfragment represents dialog camera button (among other things) , i'm using built-in camera app (calling via intent) returns dialogfragment's onactivityresult(). this works great, goal find attachments linearlayout in dialog , attach copy of captured image it. e.g. takes pics , appear in dialog's "attachments" section. the issue appears when dialogfragment's onactivityresult() triggered, i'm unable view, it's null: @override public void onactivityresult(int requestcode, int resultcode, intent data) { if (requestcode == camera_pic_request && resultcode == activity.result_ok) { try { linearlayout attachments = (linearlayout) getview().findviewbyid(r.id.landmarkattachmentview); // <- getview() null i threw in debug log in couple of suspect methods thought might trigger when camera returned, had dialogfragment's view available, none of them logged: @ove...

css - Responsive Image full screen and centered - maintain aspect ratio, not exceed window -

so want img displayed as big possible (filling width when landscape / height when portrait) no crop no skew or stretch (original aspect ratio) centred both vertically , horizontally also, image's original size not known. i've tried quite few different options this, including flexbox 1 (to vertical center), nothing seems tick boxes. ideally i'd css solution of course, have been looking js well. thanks jsfiddle demo to center it, can use technique shown here: absolute centering . to make big possible, give max-width , max-height of 100% . .classname { position: fixed; top: 0; bottom: 0; left: 0; right: 0; max-width: 100%; max-height: 100%; margin: auto; overflow: auto; }

sql server - Calculating the difference bwteen dates in a specificed date range -

i'm trying calculate days between 2 dates rows faly within 2 dates only. essentially if record falls in financial year '2012-11-01 00:00' , '2013-10-31 23:59' want know how many nights there between b.depart , end of year, ie '2013-10-31 23:59'. the error is: conversion failed when converting varchar value 'null' data type int. this have got to: case when b.depart between '2012-11-01 00:00' , '2013-10-31 23:59' datediff (minute, b.depart, '2013-10-31 23:59') else 'null' end '2012/13 nights' help appreciated! case when b.depart between '2012-11-01 00:00' , '2013-10-31 23:59' datediff (minute, b.depart, '2013-10-31 23:59') else null end '2012/13 nights' instead of 'null' treated varchar, go null.

javascript - Why does jQuery compress whitespace? -

i have ajax call returns table. here's row table: <tr> <td>1</td> <td>excelsior</td> <td>a</td> <td>erika d. kirby (sr)<br/>ariana m. johnson (jr)<br/>maddison z. lacey (so)<br/>jada f. holm (sr)</td> <td>1:53.45</td> <td></td> <td></td> <td>8.00</td> </tr> i use jquery write table existing div element: function display_scores( args , response ) { $("#results").html( response ); } here, repsonse contains table in question. when it's rendered, whitespace between parts of names gone. fourth cell: <td>erikad.kirby(sr)<br>arianam.johnson(jr)<br>maddisonz.lacey(so)<br>jadaf.holm(sr)</td> what happened whitespace?

html - Auto expand outer table to prevent overlay due to position: absolute -

this continuation of posted question: center table , align right div . on previous question, j08691 provided perfect solution center table , right align div. i've encontered problem pagediv , pagelinks elements overlay each other if put them in outer table. see example: http://jsfiddle.net/hockchailim/uecfg/4/ . there way auto expand outer table prevent such overlay? <table id="outertable" border="1"> <tbody> <tr> <td> <div id="pagingdiv" style="width:100%;"> <div id="gotopage" style="float:right">&nbsp; page 3 of 42 | page#: <input style="height:14px;width:21px;" /> <a href="#go">go</a> </div> <table id="pagelinks" style="margin:auto;"> <tbody> <tr> ...

vba - Highlighting cells in excel based on complex conditions -

Image
i trying nested conditioned formatting. here example explain: have 3 tables, each of them highlighted (green, or red) based on condition. in each table, red highlighting specific rows "lasso", while green highlighting row "stepwise". now, highlight in blue column names (val, eq, eff, size, ..) if cells in corresponding columns highlighted in each table in both green , red . example: mom highlighted in 3 tables, , highlighted in every table in both green , red (i.e. both lasso , stepwise). in case, want highlight the cells f2,f9 , f16 in blue. then, highlight in purple column names (val, eq, eff, size, ..) if cells in corresponding columns highlighted in each table in green or red . example: ump highlighted in tables, not in green , red in every table (as see, in table 1, highlighted in red, not green). in case, want highlight cells k2,k9 , k16 in blue. this looking for: i apologize if explanation bit confusing. ready give further detai...

android viewpager - How to write variable of activity that contains fragment class from inside current Fragment? -

i have activity indefinite number of fragments. inside fragments there variable need access in activity call intend activity bar correctly. variable of current fragment on screen. because call depends of fragment are. due fragment manager creates 3 fragment @ time can't write variable calling inside fragment because don't know last writes variable. need identify fragment displayed. tried inside control visibility overriding setuservisiblehint(boolean b) , write variable when true same happends. not guaranteed current fragment last writting. tried getting current fragment activity call fragment method , variable. difficult identify current fragment. tried this: getsupportfragmentmanager() .findfragmentbytag("android:switcher:"+r.id.myviewpager+":"+myviewpager.getcurrentitem()).getvariable(); but have null pointer exception.

vb.net - Download to root directory -

okay, have been searching ages find no luck. i using: me.downloader.downloadfileasync(new uri(fileurl), path.getfilename(fileurl), stopwatch.startnew) to download file want save root directory of program in file called launcher. so example, if program on desktop , open , click start want create launcher folder if it's missing download files , if it's not download files it. i've been looking everywhere find code allow me , have tried lots of different things. at moment, justs saves in root directory of program is. thanks. try this: dim basedir string = appdomain.currentdomain.basedirectory dim launcherdir string = path.combine(basedir, "launcher") if not directory.exists(launcherdir) directory.createdirectory(launcherdir) end if dim targetfile = path.combine(launcherdir, path.getfilename(fileurl)) me.downloader.downloadfileasync(new uri(fileurl), targetfile, stopwatch.startnew)

colors - Jquery Fade Out on RollOut -

the jquery script below has 2 background colors set initiate on rollover , rollout respectively. there way have rollover color fade away on rollout rather fadein color? thanks in advance assistance. jquery jquery(document).ready(function($){ //set anchor link opacity 0 , begin hover function $("#menu-sample-menu li").hover(function () { $(this).stop().animate({backgroundcolor:'#3333cc'}, 300); //on mouse-off }, function () { $(this).stop().animate({backgroundcolor:'#000000'}, 200); }); }); html <nav id="access"> <ul id="menu-sample-menu" class="menu"> <li id="menu-item-198" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-198"><a href="http://www.threecell.com/demo/category/health-care-professional/">health care professional</a> </li> <li id="men...

refactoring - Rails refactor: Duplicate code in some controllers. Where does it belong? -

i have similar (duplicate?) code appearing in few controllers. it's in #update action, it's in #update_multiple action...and it's in both. in cases it's code that's primary purpose set belongs_to relationship, setting product_id on controller's model. uses first_or_create if referenced product not exist created first. duplicate code: product = product.where(params[:product]).first_or_create if params[:product] if product && params[:project][:code].present? project = project.where(params[:project]).first_or_create product.project = project if project end product.save if product quick overview or relationships: _items & _files belong_to product . products can belong_to project . where can/should extract to? i'm not sure if should go product (and project) models? or perhaps in applicationcontroller? or helper? here's examples of code in 'wild': #disk_files_controller.rb ... def update product = pro...

php - Text process and insert it to database -

i grabbed html code , inserted database. it looks this, don't need exactly. need same html code want links inside have href="#" , don't know how can this. <div id="olpdivid"> <span class="olpcondlink" ><a class="buyaction olpbluelink" href="/gp/offer-listing/b002ydzsqm/ref=dp_olp_new/192-2317768-5155903?ie=utf8&condition=new">4&nbsp;new</a>&nbsp;from&nbsp;<span class="price">$164.99</span></span> <span class="olpcondlink" ><a class="buyaction olpbluelink" href="/gp/offer-listing/b002ydzsqm/ref=dp_olp_used/192-2317768-5155903?ie=utf8&condition=used">18&nbsp;used</a>&nbsp;from&nbsp;<span class="price">$80.00</span></span> <span class="olpcondlink" ><a class="buyaction olpbluelink" href="/gp/offer-listing/b002ydzsqm/ref=dp_olp_refurb...

string - bash word splitting mechanism -

i new bash , seeing there automatic word splitting done bash: a="1 2 3 4" if echo "a" echo $a got 1 2 3 4 , has done word splitting implicitly. if loop through "a", got 1, 2, 3, , 4 respectively. i read here that the shell scans results of parameter expansion, command substitution, , arithmetic expansion did not occur within double quotes word splitting. and found if have b=$a; echo "$b" i "1 2 3 4" so, here problem: when word splitting done? change string itself? take effect when use echo or for (loop)? more general, how bash handle on earth? great thanks!! read man bash . assignment, says all values undergo tilde expansion, parameter , variable expansion, command substitution, arithmetic expansion, , quote removal [ ... ] word splitting not performed, exception of "$@" explained below under special parameters. pathname expansion not performed. word splitting not h...

java - invalid_grant error with Google Cloud Storage and Service Account -

i'm getting invalid_grant error when try access google cloud storage api service accounts. can't figure out what's wrong following code. idea ? it's first application using google storage api. appreciated. source code public static void main(string[] args) throws exception { httptransport httptransport = new nethttptransport(); jsonfactory jsonfactory = new jacksonfactory(); list<string> scopes = new arraylist<string>(); scopes.add(storagescopes.devstorage_full_control); credential credential = new googlecredential.builder() .settransport(httptransport) .setjsonfactory(jsonfactory) .setserviceaccountid("xxxx") .setserviceaccountprivatekeyfromp12file(new file("key.p12")) .setserviceaccountscopes(scopes).build(); storage storage = new storage.builder(httptransport, jsonfactory, credential).setapplicationname("test") ...

php - Using AJAX to update multiple fields from SQL -

i'm sure there's easy answer i've looked everywhere , can't seem find answer. have dropdown box @ start of form office names being populated sql table. depending on office user selects, want other fields filled out corresponding information record. used w3schools php ajax database page guide shows how update 1 id in page , need update input field address, city, state, zip, , contact. here's relevant code isn't working. code trigger script dropdown: <select name="users" onchange="showoffice(this.value)" class="field select" tabindex="1" > the script on page: <script> function showoffice(str) { if (str=="") { document.getelementbyid("practice_name").innerhtml=""; document.getelementbyid("contact").innerhtml=""; document.getelementbyid("address").innerhtml=""; document.getelementbyid("city").innerhtml=""; document...

html - How can I best accomplish this shape on a div with dynamic text inside it? -

http://i.imgur.com/sc1nnfp.png i need create css. can use image if absolutely necessary, either way needs expandable (probably vertically best one). http://jsfiddle.net/vr2wf/ <div id="cta"> <div class="callus">call today!</div> <div class="phonenumber">404-555-5555</div> </div> #cta { font-family: arial, sans-serif; font-weight: bold; font-size: 20px; padding: 10px 20px; color: #fff; text-align: center; text-transform: uppercase; background: #232323; max-width: 400px; margin: auto; } .callus, .phonenumber { display: inline-block; } here solution: http://codepen.io/chovanec/pen/temkh <div class="rib"><div class="text">call today</div><div class="arrow"><!-- --></div></div> .rib .text { font-family: sans-serif; color: #fff; background: #000; padding: 20px...

javascript - Simple simple content slider -

can 1 help? i looking content slider can hold images , text , has dot navigation. i have searched many on net nothing simple. guys have looked , looked, looked @ questions may have been answered. have looked @ similar questions on right hand side. i have found http://jsbin.com/uhowak/2 don't want whizz first image want loop. please can help? thanks you can try twitter bootstrap carousel http://getbootstrap.com/javascript/#carousel you can download page http://getbootstrap.com/ unzip file, can either include whole bootstrap library, in zipfile/dist/js/bootstrap.min.js or include carousel only zipfile/js/carousel.js you need include jquery library bootstrap js work http://jquery.com/

reflection - Polymorphic instantiation in Scala using TypeTag and ClassTag -

in scala 2.9 1 implement polymorphic instantiation as def newinstance[t](implicit m: manifest[t]) = m.erasure.newinstance.asinstanceof[t] but of 2.10 manifest being replaced typetag , , not clear me how achieve similar typetag . prefer if typetag version preserved available type information. i know above works traits/classes not require constructor args, , ven not work, works enough need. if can better new reflection apis great. typetag not yet replacement manifest because it's part of experimental , unstable scala reflection. shouldn't use production of now. for use case showed, runtime class needed (not full type information generics etc.), scala 2.10 introduced classtag , can use this: def newinstance[t: classtag] = implicitly[classtag[t]].runtimeclass.newinstance.asinstanceof[t] or: def newinstance[t](implicit ct: classtag[t]) = ct.runtimeclass.newinstance.asinstanceof[t] anyway, manifest isn't deprecated yet, guess can still use...

c++ - how do i run quickfix examples? -

i have installed quickfix on mac , keen understand examples come described here http://www.quickfixengine.org/quickfix/doc/html/examples.html . trouble documentation poor , gives no instructions on 1) process start first 2) how start 3 applications. know find instructions this? here configurations, when attempting run apps see "configuration failed: no sessions defined acceptor" on ordermatch side: executor.cfg: [default] connectiontype=acceptor reconnectinterval=5 sendercompid=* defaultapplverid=fix.5.0 [session] beginstring=fixt.1.1 targetcompid=* heartbtint=5 socketacceptport=56156 socketconnecthost=127.0.0.1 transportdatadictionary=/users/asifshaikh/downloads/quickfix/spec/fix50.xml starttime=07:00:00 endtime=23:00:00 filestorepath=store ordermatch.cfg [default] connectiontype=initiator reconnectinterval=5 sendercompid=sender defaultapplverid=fix.5.0 [session] beginstring=fixt.1.1 targetcompid=exec heartbtint=5 socketconnectport=56156 socketconnecthost=127.0...

c# - how to send specific keys in the keyboard? -

i want send (tab) key active form (as if pressed tab key) i using sendkeys.send(keys.tab.tostring()); it work fine other string for example : sendkeys.send("my string"); not work tab key can me? according site, need use code: {tab} sendkeys.send("{tab}"); http://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys.send.aspx

javascript - How do I make local js files work? -

on local testing out stuff i've built. this script trying include in file in same folder: <script src="/colorpicker/js/evol.colorpicker.min.js" type="text/javascript" charset="utf-8"></script> the colorpicker on desktop in folder called work/demo/ the colorpicker not working. make work on local? there number of things (but xmlhttprequest) can done using javascript blocked file:/// uris security reasons in browsers. in general, development purposes, recommend installing web server (either directly on workstation or in virtual machine) , using testing. that said, if want test without web server, don't use root relative uris . i.e. not start uris / character hit top of file system, not top directory consider part of site.

Create DataTable via Linq -

please advice how can create datatable following source: public class myclass : iequatable<my> { public int field1 { get; set; } public int field2 { get; set; } } list<myclass> lst = new list<myclass>(); myclass e = new myclass; e.field1 = 1; e.field2 = 2; lst.add(e); how can create datatable field1 , field2 values using linq ? unfortunately can't use cool linq specific code can create datatable, add columns, loop on list you've populated datatable dt = new datatable(); dt.columns.add("field1"); dt.columns.add("field2"); lst.foreach(l => { var dr = dt.newrow(); dr[0] = l.field1; dr[1] = l.field2; dt.rows.add(dr); });

html - Add floating button at the center of image -

i have following div tag, displays image , beneath image, adds text appears in center. question - add floating button 'test me' @ center of image. response appreciated ? test css - div.imgdiv { width:275;height:155 } #paragraphname { margin-left:120px; margin-top:0px } you give button width , margin:0 auto; left-right centering.

linked list - Can't get LinkedList implementation to work (Python) -

i felt should make question earlier today, because problem different before. , wanted leave other question reference. pretty cluttered. if problem, let me know. from can tell, nothing added linked list. doesn't print or give me errors, , problem. it's supposed insert words alphabetically. seems logical me. redid of insert(). i feed files single words on each line. functions of list insert , print. example text (not including blank lines): here code: import sys, os, copy, fileinput class node: def __init__(self, word): self.data = word self.next = none def nextnode(self): if self.next not none: return self.next else: return none def getdata(self): return self.data def setnext(self, node): self.next = node def hasnext(self): if self.next == none: return false else: return true class linked_list: def __init__(self): self.head ...

computer vision - Facial features extraction in MATLAB -

i have project in need make neural network face recognition. inputs of network should features of face needs recognized. i searched lot , found surf detector of matlab's computer vision toolbox 1 me extract features of face. surf detector extracts keypoints of face , each of them sets vector 64 or 128 values. problem number of keypoints varies,and need same each face, able feed inputs of neural network. so thought extract features can presented single number, proportions of nose,mouth,eyes face, or distance between eyes, etc. how can these features, , enough serve inputs neural network need recognize faces? on output of neural network there same number of neurons there different people in database, , in training phase i'm going feed network extracted face features photo, , if photo of let's third of 5 people in database, output layer [0,0,1,0,0]. is approach , can give me code extracts face features face in matlab? proportions of nose/mouth/eyes face , ...

css3 - Adding custom class based on Bootstrap CSS 2.3.2 -

i've included bootstrap css, , want add custom class in own css file. it exact copy of .btn-success modified colors , class name only: .btn-mine { color: #ffffff; background-color: #ff8d53; border-color: #ef8343; } .btn-mine:hover, .btn-mine:focus, .btn-mine:active, .btn-mine.active, .open .dropdown-toggle.btn-mine { color: #ffffff; background-color: #ea793e; border-color: #dc5930; } .btn-mine:active, .btn-mine.active, .open .dropdown-toggle.btn-mine { background-image: none; } .btn-mine.disabled, .btn-mine[disabled], fieldset[disabled] .btn-mine, .btn-mine.disabled:hover, .btn-mine[disabled]:hover, fieldset[disabled] .btn-mine:hover, .btn-mine.disabled:focus, .btn-mine[disabled]:focus, fieldset[disabled] .btn-mine:focus, .btn-mine.disabled:active, .btn-mine[disabled]:active, fieldset[disabled] .btn-mine:active, .btn-mine.disabled.active, .btn-mine[disabled].active, fieldset[disabled] .btn-mine.active { background-color: #ff8d53; borde...

c++ - signal handler vs event handler -

recently in interview asked me point out difference between signal handlers , event handlers. have never encountered event handlers in linux after searching google find event handlers present in windows. i want more information regarding question. information welcome. i found user have write event handler function in order capture events while default signal handlers provided kernel program. event handlers take care of events external program keyboard interrupt, mouse click etc. event handlers polling continuously on particular slot event happen. here might consume cpu life cycles. signal handlers used interprocess communication between 2 process. user can define own signal handler process handle particular signals. in signal handling mechanism don't think cpu cycles consumed unne...

android - Verify mobile number without verification code -

as title states, want verify user's mobile number when registering app. however, not want use typical verification code method user has code texted them. instead, thinking of trying snapchat does, have user text server, if that's happening behind scenes, , app showing user how many of people in contact list have app. i've been doing lot of research, , "snapchat way" doesn't seem highly endorsed or attempted. nonetheless, want give shot. know of can find tutorials, documentation, sms verification services, me "snapchat way"? usual , highly , appreciated. here link explain snapchat , do. https://github.com/whispersystems/textsecure-ios/issues/17 a new way of verifying mobile number explained here "comment" mobile phone no. verification

smarty3 - smarty concatanate a var from a file and a normal smarty one in the smarty include section -

hi trying evaluate variable file , normal 1 seems harder looks : this works: {config_load file="archive_page.conf" section="profile"} {include file="header.tpl" title=#pagetitle# keywords=#keywords# description=#description#} i use var , concatenate text below doesn't work have tried variations '', "" leads either error message or 1 of variables display text... {config_load file="archive_page.conf" section="profile"} {include file="header.tpl" title=#pagetitle#$myvarhere keywords=#keywords# description=#description#} i tried various things can't work, appreciated. use cat variable modifier : title=#pagetitle#|cat:$myvarhere

loops - simple multiplication arrays in java -

i want create simple java program simple loops , arrays. should multiplication table. if rows 3 , columns 5 then, should display rows, columns , inside matrix should give multiplication of row , column. output should this. 1 2 3 4 5 1 1 2 3 4 5 2 2 4 6 8 10 3 3 6 9 12 15 this want create simple loops. new java not able figure out how can this. kindly let me know. i have done code till here. import java.util.*; class cross_multiplication { public static void main(string a[]) { system.out.println("how many rows required? : "); scanner in1 = new scanner(system.in); int num_rows = in1.nextint(); system.out.println("how many cols required? : "); scanner in2 = new scanner(system.in); int num_cols = in2.nextint(); //int arr1 [] = new int[num_rows]; //int arr2 [] = new int[num_cols]; for(int i=0;i<num_rows;i...

loops - Or statement help in Java -

im making dog text adventure game java class, , latest assignment add probability , training game. basically have random number generated, , if number associated skill "shake " instance greater set number, dog perform trick successfully. that part working 100% me. now adding training im running problems. have each skill set initial value of 1. each time skill performed value increases 1. my goal have max value of 3, , if max valued reached, dog performs trick every single time executed! here have, can explain why not working //sit if(trick.equalsignorecase("sit")){ if(roll >= 4 || sitskill == 3){ system.out.println("\n" + name + " sat down you!"); energy -= 10; food -= 5; sitskill ++; happy ++; } else{ system.out.println("\n" + name + " did not perform trick successfuly."); energy -= 10; ...

Outlook 2010 not respecting CSS, even <font> tags for every text -

we need our emails on machines have helvetic neue. our font stack is: font-family: 'helvetica neue',helveticaneue,helvetica,arial,sans-serif; we have style declarations in each td, each div, each table, body , everything. still, outlook breaks , defaults ugly times new roman when doesn't find first font in listing -- isn't supposed go through fonts , show ones exist (arial on windows)? frustrated, put these style declarations in ugly , laborious <font> tags around text. , text has these declarations, styling done on again inside font tag's <style> . litmus shows outlook 2003, 2007 , 2010 showing these in arial on windows. yet, @ our office, folks receiving these emails in times new roman. missing? directions or pointers why outlook 2010 (the version use) forces times new roman? other questions, such 1 -- outlook 2010 overriding font-family arial times new roman -- not answer question. thanks! below example of code: ` <table a...