Posts

Showing posts from March, 2010

php - trying to adjust regex to remove new lines -

hi looking adjust regex: /\[quote\](.+?)\[\/quote\]\r\n/is to ignore new lines (basically want quote system remove new lines after quote bbcode stop there being double space after quoting. currently i'm doing replace: $replace = "<div class=\"quote\"><span class=\"strong\">quote</span><br />$1</div>"; so directly removes new line, breaks if quote code last thing on page , no new line after it. figured out simple way: $body = str_replace("[/quote]\r\n", '[/quote]', $body); just remove them before it's checked in text. simple solution , no fuss.

xcode4.6 - Xcode 4.6.2 app crashes on every second run -

xcode 4.6.2 seems quite buggy. when run second time any project sigabrt crash within first second. removed xcode , reinstalled, (yeah try turn off , on again). removed command line tools , simulators, didn’t either. ok, found solution. please open menu product -> scheme -> edit scheme, select run youappname.app on left, tab info. choose gdb instead of lldb in debugger field. upd: in new xcode 4.6.3 bug has been fixed. update xcode.

dropdownbox - Javascript dropdown button with a scrollover -

i'm new javascript (and coding in general). i've been going through w3schools trying learn bit javascript. i've been attempting build button hover on effect drops down text on click, , pulls when clicked again. i'm attempting place on 1 of pages can have text seo without having bog page. far, have figured out how toggle text, have not had luck actual buttons or drop effect. assistance or advice appreciated. <script language="javascript"> function toggle() { var ele = document.getelementbyid("toggletext"); var text = document.getelementbyid("displaytext"); if(ele.style.display == "block") { ele.style.display = "none"; text.innerhtml = "show text"; } else { ele.style.display = "block"; text.innerhtml = "hide text"; } } </script> show text text goes here you have 2 main options animation effects - css

Octave and Matlab "wat" matrix/vector inconsistencies -

i've noticed various cases in matlab , octave functions accept both matrices , vectors, doesn't same thing vectors matrices. this can frustrating because when input matrix variable number of rows/columns, interpreted vector , don't expect when height/width 1 making difficult debugging , weird conditional edge cases. i'll list few i've found, i'm curious others people have run into (note: i'm looking cases code accepts matrices valid input. raises exception when non-vector matrix given argument doesn't count) 1) "diag" can used mean diagonal of matrix or turn vector diagonal matrix since former used square matrices isn't egregious in matlab, in octave can particularly painful when octave interperets vector beginning nonzero element , else zeros "diagonal matrix" ie t=eye(3); size(diag(t(:,3))) == [3,3] size(diag(t(:,2))) == [3,3] size(diag(t(:,1))) == [1,1] 2) indexing row-vector logicals returns row-vector ind

html - Get a div to with background to stretch to the bottom of the parent div -

i have 2 divs inside div--one background color, other white. i keep trying figure out out able both of them stretch bottom of outer div, depending on whichever on longest, without leaving white space on left div or cutting off background or content on 1 of them. end cutting off left div. in project both divs dynamic , can anywhere empty long. show solid color bottom of page on left side when menu longer content on right. likewise, when content shorter menu, don't want have cut off. i have created jsfiddle example of problem i'm having: http://jsfiddle.net/nkatz/ it looks right if menu shorter body: http://jsfiddle.net/nkatz/1/ here code: html <div class="mainbox"> <div class="leftbox"> <a href="#">here</a><br /> <a>here</a><br /> <a>here</a><br /><a>here</a><br /> <a>here</a><br /> <a>here</a><

asp.net mvc - <li> doesn't work. MVC -

i have view in trying display text bulleted items (<ul> <li>) doesn't seem work. tried <ul><li> without enclosing them in <div> still no luck. preventing display bullets in front of text. @model udp.models.mcvm @{ viewbag.title = "mcreport"; layout = "~/views/shared/_reportslayout.cshtml"; } <div class="span-24 last" > @* code filling grid goes here*@ </div> <div class="prepend-1 span-22"> <strong> notes : </strong> <ul type="circle" > <li> listings sorted according user defined sort, , may not display in order used determine median values.</li> <li> time ranges based on 360-day year commonly called 'banking year'.</li> <li> listings 'disqualified' median value calculati

javascript - Event fails to fire after DOM change in jQuery 1.9 -

i trying code cancel button user input. user able edit item after double-clicking on , cancel button allow user cancel action. the double-clicking part of code works great, text-input box appears cancel button attached. since dom has changed, jquery no longer select new element, , therefore when cancel button clicked event not fired. illustrate, code following: <div id="main"> <ul class="todolist"> <li id="todo-1" class="todo"> <div class="text">new todo item. doubleclick edit </div> <div class="actions"> <a href="#" class="edit">edit</a></div> </li> </ul> </div> var currenttodo; $('.todo').on('dblclick', function () { $(this).find('a.edit').click(); }); $('.todo a').on('click', function (e) { e.preventdefault(); currenttodo = $(this).clos

java - Pass runtime arguments to Object containing Injections -

context: based on xml java ee application receives, want make new areeconfiguration object in injection of 3 objects happens. selection of correct instance<> happens based on information in xml. therefore, passing around information xml. i have datastructure should filled these areeconfiguration objects @ runtime: private hashmap<integer, areeconfiguration> configurations = new hashmap<integer, areeconfiguration>(); public void parsenewconfiguration(element el) throws invaliddescriptorexception { if(!isvalidconfiguration(el)) throw new invaliddescriptorexception(); int key = getuniquekey(); areeconfiguration cfg = new areeconfiguration(key, el); configurations.put(key, cfg); } my areeconfiguration object should (ideally) constructed essential xml information , inject objects. later, want use information xml pick right instance<>. public class areeconfiguration { @inject private instance<areeinput> ais; private areei

Java XML Null Node -

this question has answer here: getnodename() operation on xml node returns #text 1 answer xml file: <?xml version="1.0" encoding="utf-8"?> <personnel> <employee type="permanent"> <name>ali</name> <id>3674</id> <age>34</age> </employee> <employee type="contract"> <name>hasan</name> <id>3675</id> <age>25</age> </employee> <employee type="permanent"> <name>ahmet</name> <id>3676</id> <age>28</age> </employee> </personnel> xml.java: public class xml{ documentbuilderfactory dfk; document doc; public void xmlparse(string xmlfile) throws

php - Get first character of a string, that is a French accent -

this question has answer here: wrong output when using array indexing on utf-8 string 1 answer i have strange problem , not sure how resolve it. first character of text field database. character, apply css style make big. if try following code, understand problem: <?php $str_en = "i sentence."; echo $str_en[0]; echo "<br /><br />"; $str_fr = "À tous les jours je fais du php."; echo $str_fr[0]; echo "<br /><br />"; $str_fr = "Étais-tu ici?"; echo $str_fr[0]; ?> the code above output: i à à it seems french character using more 1 bytes in string. problem not sentence start french character. have idea how have function convert this: <?php $str_fr = "Étais-tu ici?"; ?> to this $str_fr = "<span class='firstletter'>É</span>tais-tu

mysql - ISQL For each author, list their number, last name, and number of books they written -

select a.author_num, a.author_last, count(w.book_code) book.book b, book.author a, book.wrote w (b.book_code=w.book_code , w.author_num=a.author_num) order a.author_last desc; i have 3 tables; book, author, , wrote. need find how many books author has written. need sub-query? you can use group by select a.author_num, a.author_last, count(w.book_code) book.book b, book.author a, book.wrote w (b.book_code=w.book_code , w.author_num=a.author_num) group a.author_num, a.author_last order a.author_last desc; although feel column names aren't quite correct

php - XPath return null if attribute not found? -

i'm using xpath query find attribute values. however, want go through each div , if attributes not found, return nothing. there way this? html: <div id="a" class="a">text</div> <div>text</div> <div id="b" class="b">text</div> xpath: $values = $xpath->query('//div/@id | //div/@class'); result: array('a', 'a', 'b', 'b'); desired result: array('a', 'a', '', '', 'b', 'b'); as of now, i'm kind of in xpath already, , stay in direction right now. why not selecting <div> elements , use domelement::getattribute() obtain attibute values? note method return empty string if current element didn't has attribute requested. (what should want). try this: $html = <<<eof <div id="a" class="a"></div> <div></div> <div id="b&quo

Exact mechanics of time limits during Google App Engine Python's urlfetch? -

i have http request in code takes ~5-10 s run. through searching site, i've found code increase limit before timeout: from google.appengine.api import urlfetch urlfetch.set_default_fetch_deadline(60) my question: number '60'? seconds or tenths of second? responses seem imply it's seconds, can't right. when use 60, time out in less 10 s while testing on localhost. have set number @ least 100 avoid issue - worry invoke ire of google gods. it's seconds, can passed in fetch function. have tried fetch website? sure it's timeout not error? https://developers.google.com/appengine/docs/python/urlfetch/fetchfunction

c++ - When should a non-virtual method be redefined? -

virtual methods part of c++ implementation of polymorphism . other avoiding overhead associated rtti ** , method lookups, there compelling reason omit virtual ? assuming virtual added base class @ time, purpose redefining non- virtual method serve? **whether it's measurable on modern cpus or not irrelevant question. well, there little reasons redefining function no virtual. in fact recommend against looks same function call on exact same object behave differently based on static type of pointer/reference used. overriding virtual member function allows specialize behavior of derived type. overloading non-virtual member function instead provide alternative behavior, in might not obvious casual reader of functions/behaviors executed.

php - Laravel - syntax error, unexpected end of file -

i have website works fine on host, i'm trying install on localhost. i've downloaded , configured work on localhost - database & url. the problem error: unhandled exception message: syntax error, unexpected end of file location: c:\program files (x86)\easyphp-12.1\www\laravel\view.php(386) : eval()'d code on line 118 and don't know causes it. solutions? p.s. i've setup in windows' host file 127.0.0.1 myproject.dev . there error within 1 of views. if there more detailed stack trace should show details of view, although name md5() string it's bit hard find. might want delete compiled blade views in storage/views , let blade re-compile views. if still error check views make sure have proper closing tags, e.g., @endif or @endforeach always double check views syntax errors.

javascript - Get all elements below a specific element -

in javascript, possible obtain list of elements element hovering over? i'm using element cursor, , want other elements in page underlined when cursor element hovering on each of other elements. <div id="cursor">|----------|<br/>|----------|<br/>>i'm spaceship!><br/>|----------|<br/>|----------|<br/></div> <div id="hi">try select text</div> <p>i want automatically highlight elements cursor element hovers over.</p> <p>here's element.<p> http://jsfiddle.net/fu3qn/ the :hover pseudo-class applies whatever you're cursor over. have quick @ fiddle mouse triggers red background each element hovered: http://goo.gl/zurp6 secondly, if using element cursor, can instruct mouse pass through using pointer-events: none rule. note, support outside of svg property limited. other this, alternative way use elementfrompoint , return single element. i'm not sure

php - some questions about the usage of Iterator function -

code from: http://php.net/manual/en/class.iterator.php(example #1 basic usage) <?php class myiterator implements iterator { private $position = 0; private $array = array( "firstelement", "secondelement", "lastelement", ); public function __construct() { $this->position = 0; } function rewind() { var_dump(__method__); $this->position = 0; } function current() { var_dump(__method__); return $this->array[$this->position]; } function key() { var_dump(__method__); return $this->position; } function next() { var_dump(__method__); ++$this->position; } function valid() { var_dump(__method__); return isset($this->array[$this->position]); } } $it = new myiterator; foreach($it $key => $value) { var_dump($key, $value); echo "\n"; } ?&g

PHP: Returning a value from a non-native array? -

i have function that's sending query , receiving array in following format: { "id1" : 312293.23451244, "id2" : 6.03937464, "id3" : 1 } using php, how return value "id1"? thanks! $data = '{ "id1" : 312293.23451244, "id2" : 6.03937464, "id3" : 1 }'; $json = json_decode($data, true); return $json['id1'];

database - Rails inverse_of doesn't work with conditions -

here models: class flight < activerecord::base has_many :seats, dependent: :destroy, inverse_of: :flight end class seat < activerecord::base belongs_to :flight, inverse_of: :seats end it seems inverse_of works well, when i'm using conditions doesn't work: f1 = flight.first s1 = f1.seats.first s2 = f1.seats.second s3 = f1.seats.where(id: 0..1000000).third s1.flight.equal? s2.flight => true s1.flight.equal? s3.flight => false what explains this? how can make work? s1.flight.equal? s2.flight => true the above yields true because s1.flight , s2.flight refer the exact same ruby object . s1.flight.equal? s3.flight here, s1.flight , s3.flight refer different ruby objects . both contain same record data (including same :id value) the problem you're using ruby's equal? method, when should using rails' == or eql? comparators. from the ruby object docs == (aliased eql? , equal? ) equality — @ object level, ==

Android GridView Focus Issueon children? -

i have gridview custom adapter set. getview() method of custom adapter returns linearlayout 2 textview , edittext arranged horizontally. have made custom numeric keyboard entering text in edittext. keyboard contains next , prev buttons creating problems. want next button automatically focus next edittext in next row , prev button. next button onkeypress seems like: view v=getwindow().getcurrentfocus().focussearch(view.focus_forward); if(v!=null) v.requestfocus(); the code seems right. problem is, suppose 3 rows visible of gridview,if focus on third edittext , next pressed,it focuses on nothing. dont know how solve issue. if knows how solve it. thanx in advance. can maintain collection of ids of edittext 's in same order, while adding them rendering. in case, clickhandler or next/prev button, u can check following: clickhandler of prev: if present selection first in list, might want set focus on last element in list. clickhandler of next: if present selec

c++ - "Invalid use of incomplete type" in basic Hunter/Prey exercise -

so current assignment make basic hunter , prey simulation, , after having several other issues professor advised put in main.cpp thing working now. my current issue in creature::find() function it's claiming grid class incomplete though it's pre-declared @ top of file. initial thought place grid class before creature , causes lot more or same error (referring creature being incomplete) since grid 2d array of creature pointers. below relevant bits of code, whole file can found on dropbox here . class grid; //*** error: forward declaration of 'class grid' //other stuff... class creature { public: grid* thegrid; coords position; int stepbreed; int stephunger; char face; bool hasmoved; creature(grid* _grid, coords _position, char _face) //constructor { thegrid = _grid; position = _position; face = _face; stepbreed = stephunger = 0; hasmoved = false; } vector<coords&g

ruby on rails 3 - RE: Flying Sphinx and Sidekiq -

i'm afraid i've reached point of total helplessness re: flying sphinx , sidekiq. appears sidekiq , fs not able communicate in production. i in ts3 , using sidekiq run delta indexing - works great in development , worked time in production yesterday. today when run: heroku run bundle exec sidekiq -q ts_delta i following error: undefined local variable or method `decode_frame' for websocket::frame::incoming::server:0x000000048cac40 and @ end long series of: disconnect attempted... not connected disconnect attempted... not connected disconnect attempted... not connected disconnect attempted... not connected disconnect attempted... not connected disconnect attempted... not connected disconnect attempted... not connected disconnect attempted... not connected disconnect attempted... not connected disconnect attempted... not connected disconnect attempted... not connected i can provide more info on can solve - @ computer until 2 today (it's been lon

C Program Not Compiling -

i need find largest number (which double). problem in program? isn't compiling. #include<stdio.h> #include<stdlib.h> void dobig(double *parr[5],int *len,double *big); void main() { double *big; double arr[5]={1.00,2.321,3.54337,4.333333,5.5555555}; double *parr=&arr[5]; int size=sizeof(arr)/sizeof(int); int *len=&size; dobig(parr,len,big); printf("the largest number %p/n",*big); system("pause"); } void dobig(double *parr,int *len,double *big) { int i; double pbig=*parr; for(i=0;i>*len;i++) { if(pbig<*(parr+i)) { pbig=*(parr+i); } *big=pbig; } } here's problem: double *parr=&arr[5]; arr has 5 elements. valid index range 0 - 4. i have commented inside code problems: #include<stdio.h> #include<stdlib.h> void dobig(double *parr,int *len,double *big); // prototype didn't match. want // pa

html - CSS3 gradient for background-image opacity -

i have background image hero element on website i'm working on. want make background image in .hero div on gradient transparency complete opacity on edges backgrounds of both divs blend each other. to illustrate, here's code i'm using right in body of index.html : <div class="hero"> <div class="hero-inner"> <h1>my awesome hero element</h1> </div> </div> ... , what's in style.css .hero { background-color: black; width: 800px; } .hero-inner { width: 700px; height: 200px; margin: auto; background-image: url('http://i.imgur.com/pxzvxmr.png'); } .hero-inner h1 { position: absolute; font-family: arial, sans-serif; color: white; padding: 10px; background-color: rgba(0, 0, 0, 0.7); left: 50px; top: 20px; font-size: 48px; } here's jsfiddle . how make background image in .hero-inner blend in background color of .hero on edge

css - Background for html back that is fixed for the screen -

i'm working on basic html page , have background image bg.jpg. problem depending on screen size have , how many pixels screen has i'm not able view whole background image want. how make background fixed can see whole background? if mean full page background image can css3 background-size property body { background: url(bg.jpg) no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; } if need attach it, kinda fixed , shouldn't scrolled, use background-attachment: fixed; /* used in above css declaration using css short hand*/

linux - Can PHP (with Apache or Nginx) check HTTP header before POST request finished? -

here simple file upload form html. <form enctype="multipart/form-data" action="upload.php" method="post"> send file: <input name="userfile" type="file" /> <input type="submit" value="send file" /> </form> and php file pretty simple too. <?php die(); as see, php script nothing in server side. when uploading big file, process still cost long time. i know, php code executed after post process ended. php must prepare array named $_post , $_files before first line code parsed. so question is: can php (with apache or nginx) check http header before post request finished? for example, php extensions or apache modules. i told python or node.js can resolve problem, want know if php can or not. thanks. ================ update 1 ================ my target try block unexpected file-upload request. example, generated unique token post target url (like http://some.com/u

Images staying at same position in html -

i'm working on basic html page , i'm still learning html. anyway have 2 images on pages i've placed on position want problem if resize web page/ browser image isn't @ it's correct position anymore. or because gave speficic location pixels want remain @ same location no matter how big browser window is. if understand me. my current code: <div style="position: absolute; left: 590px; top: 320px;"> <img src="map.png" width="215" height="202"> </div> you have use percentage, example: html <img class="imageel" src="folder-image-transp.png" width="215" height="202"> css img.imageel{ position:absolute; left: 50%; top: 50%; } if want element remain @ middle of screen, have apply margin big half of image. example: img.imageel{ position:absolute; left: 50%; top: 50%; margin-left: -(half of image width)px margin-top: -(h

api - Google Earth Plugin for Android -

i trying add map of moon on phonegap / android app. when try use google earth api on app, receive following error: the google earth plugin available on windows , mac os x 10.6+. is there alternative way, maybe api, create map of moon on mobile device. there not current published api's google earth android version. current version handle search intents. can launch google earth in android , fly location following intent: please keep in mind google change @ time , following code might not work. // new intent launch intent myintent = new intent(); // send intent directly google earth activity can handle search myintent.setclassname("com.google.earth", "com.google.earth.earthactivity"); // doing search query myintent.setaction(intent.action_search); // change address address want fly myintent.putextra(searchmanager.query, "2900 frenchmen street, new orleans, la"); // trap activitynotfound in case google earth not

iphone - Website from with in the app to get app data -

i have seen apps discover, file management application, has web pages built in application. pages can accessed on wifi entering iphone ip number , port number on web browser. page can read , write data iphone app. whats process behind this?. steps have take create such web page in iphone app.

multithreading - Approach to serve multiple users concurrently with dancer -

for reason not find answer question below, because obvious. during experiments perl dancer, added route, sleeps 10 seconds , returns something. did in order simulate long-running operation. noticed, during these 10 seconds, dancer not serve other request. understand because dancer single-threaded. now single-threaded approach not suitable mildly demanding applications. believe there must nuber of established solutions. don't seem know right search strings google for. to make things clear: don't mind, when reqest initialted long running operation itself gets blocked. want other requests sill being served. could please enlight me in terms of how webservers traditionally handle long-running operations, without blocking other requests ? will there threads/processes each session, or can threads/processes spawned on-demand, in situations, know operation take long time how session information preserved when going multi-threaded, i.e. when browser not talk same proce

cabal: installing documentation under hsenv -

i have hsenv sandbox project, , can't cabal install install documentation libraries. following: cabal install --enable-documentation $package installs package, without generating haddock docs (only license , such copied docs directory). build log contains only: install-outcome: installok docs-outcome: ok tests-outcome: nottried i can't useful information out of cabal install, verbose=3. outside of hsenv, works fine. ideas on how fix, or @ least debug this?

java - How to make this code thread-safe using double checked locking? -

this question has answer here: java double checked locking 11 answers single threaded version: private final list<element> list = new arraylist<element>(); public element getelementat(int index) { if (index >= list.size()) { (int = list.size(); <= index; i++) { list.add(createelement(i)); } } return list.get(index); } now trying make thread-safe version double checked locking: import com.google.common.collect.immutablelist; import com.google.common.collect.immutablelist.builder; ... private volatile list<element> list = immutablelist.of(); public element getelementat(int index) { if (index >= list.size()) { synchronized (this) { if (index >= list.size()) { builder<element> newlistbuilder = immutablelist.<element> builder();

powershell - Import-CSV returns null when piped files -

i have piece of code should grab .csv files out of directory , import them, using pipe character delimiters. $apeasy = dir .\apeasy\*.csv | import-csv -delimiter '|' the problem returns null. without exception, no matter do. weird thing works: dir .\apeasy\*.csv it returns fileinfo object, should getting piped import-csv file import. in addition, these 2 commands work: $csvfiles = dir .\processed_data_review -filter *.txt | import-csv -header(1..19) -delimiter "$([char]0x7c)" dir .\lims -filter *.csv | import-csv | ? {$_.samplename -like "????-*"}| export-csv -path .\lims_output.txt -notypeinformation i have no idea what's going on here. i'm dealing basic pipe-delimited file, quotations around every field (which fine, can import data those). nothing special going on here. file there, import-csv isn't getting reason. so question this: cause file grabbed 'dir' fail piped import-csv? edit: overall goal of read csv files i

java - Getting an error while creating new instance SQLITE -

i have error while making creating new instance writing data database sqllite this code of database class package com.example.tttt; import android.content.contentvalues; import android.content.context; import android.database.cursor; import android.database.sqlexception; import android.database.sqlite.sqlitedatabase; import android.database.sqlite.sqliteopenhelper; public class info { public static final string key_nom = "nom_personne"; public static final string key_id = "id_personne"; public static final string key_prenom = "prenom_personne"; private static final string database_name = "infodb"; private static final string database_table = "infotable"; private static final int database_version = 1 ; private dbhelper ourhelper; private context ourcontext ; private sqlitedatabase ourdatabase ; private static class dbhelper extends sqliteopenhelper { public dbhelper(contex

osx - Mac OS X - Making Keychain Certificates available to Atlassian Bamboo -

i have bamboo plan builds package, , want sign package developer certificate. in build script, have this: productsign --sign "name of certificate" "input.pkg" "output.pkg" running script command line works expected. however, running script bamboo, error: productsign: error: not find appropriate signing identity "name of certificate" i presume must because of context build script run in when run bamboo. how make certificate usable in bamboo? installed in system , not login . if need run bamboo root , you'll need copy appropriate certificates login keychain system keychain using keychain access (applications > utilities). having said that, better run bamboo user instead of root . e.g. if need use mobile provisioning profiles sign ios builds on same server, being root not work.

java - Output accumulates each iteration instead of resetting -

the code runs first time run again using while loop , lets first time entered aa , becomes cc runs again enter aa again come out cccc again comes out cccccc don't want need not keep data string each time loops. import java.util.*; public class secretcypher { public static void main(string args[]) { scanner kb = new scanner(system.in); stringbuffer e = new stringbuffer(); system.out.println("welcome secret cypher!"); char loop = 'y'; while(loop == 'y' || loop == 'y') { system.out.println(""); system.out.println("enter cypher in upper case."); string s = kb.nextline(); char[] cs = s.tochararray(); (int = 0; < cs.length; i++) { e.append((char)('a' + (cs[i] - 'a' + 2) % 26)); } if(s == s.tolowercase()) {

javascript - Stripe customer integration on bootstrap html site -

i built ecommerce website using twitter bootstrap wish take subscription payments using stripe. want create new customer has subscription using example code seen here on stripe site. has option execute code using various languages (curl,ruby,python,pho,java). how can implement on basic bootstrap based website has no real backend? you need real backend 1 way or another. use heroku, or build simple backend on server. nginx/gunicorn/supervisor/flask stack. i've used this tutorial several times, , nice (you need follow link @ bottom , configure supervisor finish it). also, check out flaskr tutorial bootstrap site plugged in , ready on top of stack can started stripe python integration. good luck-- you've got lot of work : )

tracing - How to do a specific action when ANY Unknown Breakpoint gets Hit in GDB -

i have read following question: do specific action when breakpoint hits in gdb here, use 'command' decide when specified breakboint gets hit. my question is: suppose put breakpoints on functions matching given pattern: gdb$rbreak func_ => 100 breakpoints (say) when execute code, want same action - on hitting each of these functions. hence, cannot define like: command break_point_number // since don't know how many breakpoints there can please suggest me: how can specific action-set when breakpoint gets hit in gdb? thanks. with new enough version of gdb can use range: (gdb) rbreak whatever ... gdb creates breakpoints n, n+1, ..., m (gdb) commands n-m > stuff > end i forget when feature went in. with older version of gdb, i'm not sure can done. it can done difficulty: use set logging write output file, "info break", "shell" run scripts edit file gdb commands, "source". painful.

C++ template; partial specialization implementation -

given template class single parameter, can define implementation specific specialization: template<int n> struct foo { foo( ); }; foo<2>::foo( ) { //works (on ms visual 2012, though it's not correct form) } for multiple parameter template, possible define implementation partial specialization? template <class x, int n> struct bar { bar( ); }; template <class x> bar<x,2>::bar( ) { //error } for partial specializations, need first define specialization of class template before can go defining members: template <class x, int n> struct bar { bar(); }; template<class x> struct bar<x,2> { bar(); }; template <class x> bar<x,2>::bar( ) { } the correct form first 1 said works is: template<int n> struct foo { foo( ); }; template<> foo<2>::foo( ) { //works }

asp.net - ColdFusion Encryption from .NET Membership Tables -

i have client implementing znode uses aspnet_membership table store password. table contains encrypted password, password salt , using "passwordformat" of 2. gather, "2" recoverable encrypted password. the coldfusion server bluedragon 9 alpha. if don't know bd, no worries, coldfusion supports "should" work , have cf 10 test on well. if know better way i'm ears. need able create user/password , store in asp membership table via coldfusion. in addition need able check user/password login. when looking @ web.config file, znodemembershipprovider "system.web.security.sqlmembershipprovider" type. the machinekey entry looks this: (took out 2 key values) <machinekey decryption="aes" decryptionkey="[64 character string]" validation="sha1" validationkey="[128 character string]"/> if try this: encrypt('mypassword', '[64 character string]', 'aes'

check the neighbours of a cell in a vector Matlab -

i have 2 vectors k=[1 1 1 2 1 2 1 4 2 10 4 5 1] and l=[2 0 1 2 1 2 1 3 2 0 1 2 1] i want compare value of 7th element in each vector neighbours of value, neighbours 5 elements next element in each side. k , 7th element 1 , neighbours 1 1 1 2 1 2 (left neighbours) , 4 2 10 4 5 1 (right neighbours). for l , 7th element 1 , neighbours 2 0 1 2 1 2 (left neighbours) , 3 2 0 1 2 1 (right neighbours). if difference between 7th value , each of neighbours above threshold i'll e.g x=1, if not i'll thing e.g x=2 . so in example i'll set threshold 3, k 7th element value 1 , difference between , 2 of neighbours 10,5 more threshold value 3 x 1. l 5th element value 1 , difference between , of neighbours less threshold value 3 x 2. i'm wondering if assist me condition, i'm not sure if can done without loops save time. you can check condition using any , or : n = 5; % reference index t = 3; % threshold v = l; % used pass vector l if-statement %

c# - RavenDb, how can I query properties of T in a 'List<T>' which itself is a property of an object stored in Ravendb? -

ravendb, how can query properties of t in list of 'ts' property of object stored in ravendb? my question ravenb load complete object contains list memory in order query properties of objects contained in such list? point list may contain million elements , want select few through linq query? can such query executed on server side or object, containing list, loaded client side memory in entirety query properties?

c++ - overloading operator<< not working -

im having trouble outputting data members of card object using overloaded operator<< i'm getting error says "js::operator<<(std::__1::basic_ostream >&, js::card const&)", referenced from: linker command failed exit code 1 (use -v see invocation) // //main.cpp #include "card.h" #include "deck.h" #include <iostream> using std::cout; using namespace jasonsteindorf; int main(int argc, const char * argv[]) { //deck d; //d.shuffle(); card c(5,3); //5 of clubs card c2; //ace of diamonds cout << c; //not working ???????? should says 5 of clubs c.displaycard(); //works return 0; } // //deck.h #ifndef js_deck_h #define js_deck_h #include <iostream> using std::cout; #include <vector> using std::vector; namespace js { //forward declaration class card; class deck { public: deck(); void shuffle(); private:

multithreading - Will Tcl Interp created in separate threads share any global data? -

in c++ code, if create 1 tcl interp per thread, , use tcl_evalex script, , result tcl_getstringresult, thread safe? there's no shared data between these threads except const data. after searching on google found in tcl threading model doc: http://www.tcl.tk/doc/howto/thread_model.html tcl lets have 1 or more tcl interpreters (e.g., created tcl_createinterp()) in each operating system thread. however, each interpreter tightly bound os thread , errors occur if let more 1 thread call same interpreter (e.g., tcl_eval). i guess means if don't shared data between interpreters, there should no issue? i create 1 tcl interp per thread, , use tcl_evalex script, , result tcl_getstringresult , thread safe? yes. tcl's engine uses thread-specific data extensively, transferring interpreter between threads impossible [*] (things break horribly), have up-side thread-safety guaranteed @ same time. main thing remember use tcl's built-in memory allocator fu

java - Open the default app when an image is pressed from a LinearLayout -

i have linearlayout contains 3 images: <linearlayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingbottom="0dp" android:paddingleft="0dp" android:paddingright="0dp" android:paddingtop="0dp" tools:context=".mainactivity" android:orientation="horizontal" android:layout_gravity="center" > <imageview android:id="@+id/imgfb" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/fb" android:padding="5dp" /> <imageview android:id="@+id/imgtw" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/tw" android:padding="5dp" /> <

R & Inkscape: text labels in SVG graphics exported from R did not recognized as a text in Inkscape -

i constructed dendrogram in r code: data(iris) aver<-sapply(iris[,-5],function(x) by(x,iris$species,mean)) matrix<-dist(aver) clust<-hclust((matrix),"ave") clust$labels<-row.names(aver) plot(as.dendrogram(clust)) i wanted save dendrogram svg file using code: install.packages("cairo") library(cairo) svg("plot.svg") plot(as.dendrogram(clust)) dev.off() here problem started: when imported "plot.svg" inkscape (ver: 0.48.4) , selected label (e.g. "setosa") not recognized text, rather "user defined" object. specifically, when selected "letter" in label , inspect xml editor (ctrl+shift+x) in inkscape obtained information: **id**: use117 **x**: 142.527344 **xlink:href**: #glyph0-8 **y**: 442.589844 on other hand, when manually wrote "setosa" using "create , edit text objects" tool, , inspected in xml editor, returned: **id**: text4274 **sodipo

Creating a Tkinter Button to 'clear' Output -

i have basic program spits out string of values, not quite sure how clear these values. @ moment have set exit window , start new 1 i'm not rewriting on new values time. there simple way add button says 'clear' , that? code below: def create_widgets(self): self.entrylabel = label(self, text="please enter list of numbers:") self.entrylabel.grid(row=0, column=0, columnspan=2) self.listentry = entry(self) self.listentry.grid(row=0, column=2, sticky=e) self.entrylabel = label(self, text="please enter index value:") self.entrylabel.grid(row=1, column=0, columnspan=2, sticky=e) self.indexentry = entry(self) self.indexentry.grid(row=1, column=2) self.runbttn = button(self, text="run function", command=self.psifunction) self.runbttn.grid(row=2, column=0, sticky=w) self.answerlabel = label(self, text="output list:") self.answerlabel.grid(row=2, column=1, sticky=w) s