Posts

Showing posts from July, 2013

RegEx, How to get all matches and group? Ruby 1.9.3p125 -

let's have following string: google-com, awesome-net(ooops), facebook-com / rocket-yet i want extract words ending -com have them grouped. for now, have tried: ^\w+[-]com that works fine catches first match. how others? maybe using parentheses can't figure out how to.. having matched strings matchdata object (ruby) can work array . i'm using ruby 1.9.3p125 1.9.3p125 :124 > original => "google-com, awesome-net(ooops), facebook-com / rocket-yet" 1.9.3p125 :125 > results = original.match(/(\w+-com)/) => #<matchdata "google-com" 1:"google-com"> just use findall option , work: \w+-com i tested in http://rubular.com/

objective c - Class Name with a "+" -

i working on ios project in xcode , see classes have names "+"; example: tableviewcontroller+tableview.h , class named: @interface rktableviewcontroller (tableview) opposed rktableviewcontroller+tableview . what + , (tableview) ? if subclassing uitableview shouldn't class declared as: subclassed name : parent class name format? the + in filename isn't semantically important. naming file "classname+categoryname.h/m" popular convention naming files containing categories. @interface rktableviewcontroller (tableview) @end declares category called "tableview" on rktableviewcontroller class. categories used add methods class outside main implementation. see apple documentation on categories here: http://developer.apple.com/library/ios/#documentation/cocoa/conceptual/objectivec/chapters/occategories.html

pic - Reading data from RCREG on pic18f4525 from bluetooth device -

i have project in trying send data android phone pic18f4525 through bluetooth device. currently, trying pic recognize simple letters 'a'. from understand, when pic receives data through portc.7 (rx pin), store 8-bit information rcreg register , have read data. know pic receiving data receive flag being set. also, hooked scope receive pin of pic , receiving correct 01 sequences. my question is, how read rcreg register access information? can tell, can use readusart usart.h header file not compile me trying access data without header file. there way this? have tried storing data directly (i.e. value = rcreg) , can 'read' register (the receive flag gets reset know i'm reading it) pic thinks value 0xff no matter send. i using mplab version 8.85, icd2, , cc8e compiler. how read data appreciated. have read data sheet using usart on pic, read through compiler manual, , did many searches on topic no avail. thanks help. update: done!!! after few hours of mess...

ios - ZXing running (crashes...) on iPod -

i got weird problem zxing 2.0 on ipod touch (version : 5.1.1). searched on internet , stackoverflow think ignore origin of issue couldn't find anything. coded app using zxing running on iphone simulator 5.1 , when try run on ipod device (i didn't test other device yet), compiles , crash @ running no log in console (and cant type on it). this screen appeared on xcode (i got developer version 4.3.2) green arrow last line pasted , "signal sigabrt" written. libsystem_kernel.dylib __pthread_kill: 0x35e70324: mov r12, #328 0x35e70328: svc #128 0x35e7032c: blo 0x35e70344; __pthread_kill + 32 (arrow line) i think it's related libzxingwidget.a static library , configured build settings armv6 armv7 , i386 in 2 different configurations didn't work either. i have no idea anymore, suggestion ! edit : forgot mention next thing on thread stack gsregisterpurplenamedport . try rebooting device. coring in gsregisterpurplenamedport pretty com...

haskell - Meaning of a newtype statement -

i have statement: newtype state st = state (st -> (st, a)) hence type of state is: state :: (st -> (st, a)) -> state st i cannot understand meaning: are st , a placeholder of 2 data-type? right? does statement means state function take argument function? yes , yes. st state type , a answer type.

git - Trying to push to BitBucket but I get "master conq: repository access denied." "fatal: The remote end hung up unexpectedly" -

i'm doing push changes bitbucket repository: $: git push origin master conq: repository access denied. fatal: remote end hung unexpectedly what error mean , how fix it? debug info bitbucket: ssh -t -v git@bitbucket.org openssh_5.3p1, openssl 1.0.0-fips 29 mar 2010 debug1: reading configuration data /etc/ssh/ssh_config debug1: applying options * debug1: connecting bitbucket.org [131.103.20.167] port 22. debug1: connection established. debug1: permanently_set_uid: 0/0 debug1: identity file /root/.ssh/identity type -1 debug1: identity file /root/.ssh/identity-cert type -1 debug1: identity file /root/.ssh/id_rsa type 1 debug1: identity file /root/.ssh/id_rsa-cert type -1 debug1: identity file /root/.ssh/id_dsa type -1 debug1: identity file /root/.ssh/id_dsa-cert type -1 debug1: remote protocol version 2.0, remote software version openssh_5.3 debug1: match: openssh_5.3 pat openssh* debug1: enabling compatibility mode protocol 2.0 debug1: local version string ssh-2.0-openss...

pull - Listing incoming branches in Mercurial -

i happen work against server repo has lot of named branches. pull branch i'm working on, keep me local repositories less cluttered. sometimes, want find out branches in server repo have new changesets can pull. is there way can list either branch names, or branch heads? opposite of: $ hg log -r "outgoing() , head()" sure, can along lines of: $ hg incoming | grep branch | uniq but i'd happy find more mercurial-native , cross platform solution (i work on windows). for time being, decided stick grep way. added hgrc : [alias] remote = !hg incoming | grep branch | sort | uniq on windows, use grep , uniq found in unxutils . the sample output looks this: d:\projects\myproject>hg remote branch: 1.4-stable branch: next-major branch: ticket-199 branch: ticket-90 unfortunately, command still lists changesets under hood, running can take time.

ruby on rails - how to display charts/graphs based on user specific data -

in ror project, use sqlite database storing registered users data. using highcharts , able generate charts based on data database. need generate graphs each user based on specific data in database. my database columns id, name, category 1 , category2, catogery 3 in sqlite3 database, need when user logs-in shld able see pie-graph using data category1, category2 , category 3 columns . any appreciated. there's few ways of doing this, here's one controllers/charts_controller.rb class chartscontroller < applicationcontroller def pie_chart_for_users @this_user = user.find(1) end end views/charts/pie_chart_for_users.html.erb <script type="text/javascript"> var $j = jquery.noconflict(); $j(document).ready(function() { new highcharts.chart({ chart: { renderto: 'users_chart', plotbackgroundcolor: null, plotborderwidth: null, plotshadow: false }, title: { text: 'unknown u...

php - Embedded form in Symfony 1.4 and validator compare -

i created embedded forms tutorial: http://prendreuncafe.com/blog/post/2009/11/29/embedding-relations-in-forms-with-symfony-1.3-and-doctrine but have 1 problem. how can compare 2 or more values in example? compare name in table bookmark , example 1 name can numbers. can make this, dont know must set validator this. in bookmarkform.class.php have 1 value, can't values in form. in example have values , can use own validator form symfony? i'm not quite if you're asking for, postvalidator allow validation requires access multiple fields. here's example of how create custom postvalidator .

Link magento log_url_info table to products -

i want create report on items viewed within store. have relevant report writing , sql skills, little confused data within log_url_info table. i understand entries value in url field such 'http://www.mystore.com/catalog/product/view/id/526' demonstrate visit product id 526, cannot see simple way link data individual product record in relevant product tables, given additional data stored in table. anyone ideas?? pull id out of url, load appropriate product. if (preg_match('%/catalog/product/view/id/([0-9]+)%', $url, $match)) { $id = $match[1]; $product = mage::getmodel('catalog/product')->load($id); echo $product->getname(), ', ', $product->getsku(), php_eol; }

Post to wall without feed dialog giving "NetworkOnMainThreadexception" | Android -

i trying post on users wall application without showing feed dialog box. have activity edittext getmessage , button onclick()=posttowall . following question: android facebook post on wall without dialog warnings here code: public void posttowall(view v){ string message = getmessage.gettext().tostring(); postmessage(message); } public void postmessage(string message){ log.d("test", "testing post wall"); try{ string response; bundle parameters = new bundle(); parameters.putstring("message", message); response = facebook.request("me/feed", parameters, "post"); log.d("test", "got response "+response); if(response == null || response.equals("")){ log.v("error", "blank"); } } catch(exception e){ e....

iphone - Forcing termination of app when accepting incoming call -

i need force quit app when pressed answer button in incoming call , when tap on reject app should continue working. i had tried pacing exit(0) in applicationdidenterbackground. the app force quitting . problem relaunching automatically itself. any suggestion , ideas?? never ever call " exit " within app code. apple will reject apps quit out on own, user isn't doing explicitly. apple says in "ios human interface guidelines" (look in "don't quit programatically" section) the official & approved way quit app user manually tapping on home bar button , hitting "-" badge on shaking apps in "mini" dock. i'd thing should in case handle things in applicationwillresignactive: app delegate method.

python - Passing a member function as a function arg? -

i've written simple select function sqlite, i'm confused @ how pass member function... e.g.: .fetchone() , .fetchmany() . def select(cursor, select="*", table="reuters", fetch=".fetchone()", tologfile=false, logfile=""): if tologfile: logfile = open(logfile, 'w') logfile.write(str(cursor.execute("select * ?;".replace('?',table).replace("select * ", "select "+select)).fetchone())) logfile.close() else: return str(cursor.execute("select * ?;".replace('?',table).replace("select * ", "select "+select)).fetchone()) how pass member function arg? you can pass self.fetchone pass function. if want default value use none in function definition , add if whatever none: whatever = self.fetchone in function itself. if want call method on object self keep passing string , use code (based on else code since ...

PHP and form data validation -

i beginner in php-codeignitor.so dont know question waste guys. but there easy way validate form data ? ex.i have table , contain text field "username",there insert button too,whern user clicked on insert add text field. so how can value(s) in php ? because user can add number of fields there. $username = $_post("username"); //what retrieve in case ? array ? also how can handle situation this. thank you. if set array in form, array in $_post. form fields: <input type='text' name='username[]' /> <input type='text' name='username[]' /> php: $users_array = $_post['username'];

How do i draw the content of DIV on html5 canvas using jquery -

suppose have div , inside div have few form controls textboxes,dropdow checkbox,radiobutton etc. want when user clicks particular button, content of div drawn on canvas. search google having sample code or example found none. please guide me how draw content of div on html5 canvas using jquery controls looks style sheet. question updated <div class="login"> <form method="post" action="www.mysite.com"> <fieldset> <div class="login-fields"><label class="" for="username" id="username-lbl">user name</label> <input type="text" size="25" class="validate-username" value="" id="username" name="username"></div> <div class="login-fields"><label class="" for="password" id="password-lbl">password</label> ...

c# - Unsubscribing from anonymous delegate event -

i'm having trouble figuring out way of unsubscribing anonymous delegate events found in pre-made helper file helps allow movement of controls @ run time. reason want unsubscribe these events control (in case buttons) become locked again , not able moved. here method in helper class: public static void init(control control) { init(control, direction.any); } public static void init(control control, direction direction) { init(control, control, direction); } public static void init(control control, control container, direction direction) { bool dragging = false; point dragstart = point.empty; control.mousedown += delegate(object sender, mouseeventargs e) { dragging = true; dragstart = new point(e.x, e.y); control.capture = true; }; control.mouseup += delegate(object sender, mouseeventargs e) { dragging = false; control.c...

javascript - How to find out if something is one of the HTML color names without having to check every single one? -

this question has answer here: javascript function convert color names hex codes 12 answers i have string texarea, want find out if string 1 of html color names here ). know compare string every single one, uses quite space , isn't good. there function maybe iscolorname(color)? or won't around checking every single one? this question offers partial anwsers : javascript function convert color names hex codes a complete 1 : create in memory canvas , : if (suspectedcolor.indexof('(')>=0 || suspectedcolor.indexof('#')>=0) { // see http://www.w3.org/tr/2dcontext/#dom-context-2d-fillstyle iscolorname = false; } else { context.fillstyle = suspectedcolor; iscolorname = context.fillstyle!="#000000" ; // ok, let exercice check colorname isn't black } it works because of : context . fillstyle [ = valu...

join - Combine 3 MySQL queries -

i mysql newbie. combine following 3 queries , result set one, no success. differences between queries in clause (kw_research.id_country=) , in select columns (global_value, local_value, us_local_value). appreciated. thank you. query 1, select dn_domains.sid, dn_domains.domain, dn_domains.tld, kw_keywords.id_keyword, kw_keywords.keyword_name, kw_research.id_research, dn_tlds.value, (kw_research.local_search * kw_research.aprx_cpc * '0.42' * dn_tlds.value * '12') global_value (((dn_domains join kw_keywords) join kw_research) join dn_tlds) , co_domain_keyword dn_domains.sid = co_domain_keyword.id_domain , kw_keywords.id_keyword = co_domain_keyword.id_keyword , kw_keywords.id_keyword = kw_research.id_keyword , dn_domains.tld = dn_tlds.tld , kw_research.id_country = '1' order dn_domains.sid asc result: +-----+------------------------+------+------------+-...

javascript - Need application like dropdown menu bar like google docs -

i need dropdown menu bar 1 used in google docs. for example here: https://docs.google.com/document/d/18w9-fks55wifnjxl9q50pyonr7-nnsimzjqhoppbm4e/edit?pli=1 the top menu file, edit, view, help. i want same menu able use in application in css, javascript ok too. there many js/css type of menus systems. on or use links provided here. quite simple customize have fun. http://csswizardry.com/2011/02/creating-a-pure-css-dropdown-menu/ http://www.lwis.net/free-css-drop-down-menu/

Custom gdb 7.4.1 for Android: cannot access memory -

i've built gdb 7.4.1 android (applied android patches ndk-r8 , configured arm-linux-androideabi ). works fine on devices, on other refuses set breakpoints reporting "cannot access memory". i used original gdbserver ndk assuming protocol compatible. has run similar problems? need build gdbserver 7.4.1 sources well? or missing external patches? just solved it. apparently, gdbserver provided android ndk r8 not compatible gdb 7.4.1. building gdbserver sources , replacing ndk 1 solves problem completely.

itunesconnect - How to change company name in iTunes Connect -

when log itunes connect, page header says [itunes connect logo] torben gundtofte-bruun, torben gundtofte-bruun [sign out button] why name listed twice? guess 1 of fields should have been company name, right? how change this? the field inside itunes connect referencing typically show user , company name in following format: joe bloggs, example corp as individual registered developer account , not company, name diplayed twice in field above. if wish change name of company, need contact apple (telephone best immediate response , kickstart "ios developer program company assignment" process) , tell them this. you'll receive email above title can login online , provide relevant information, include faxed copy of company's ceritificate of incorporation , (sometimes) company letterhead more info apple may or may not request. find country's contact number here: https://developer.apple.com/contact/phone.php hope helps!

haskell - Where to add 'always running' thread to Yesod applications -

i'm writing yesod application, needs fork several non-web services. (udp listeners, tcp listening port, etc.) where correct place splice in fork, such work seamlessly, regardless of whether app running in 'yesod devel' or deployed production. thanks, chris. p.s. want add pseudo-main, forked (at service start) whichever webserver runs app through wai. you should put in makeapplication function in scaffolded application.hs file. this function run once every instance of web application started 1 , , since run 1 instance of application, place should it. 1 note theoretically possible run multiple instances of same wai application in same process, e.g. if want 2 instances listen on different ports, default never happen

Starting properties of objects in Winforms form vb.net -

in software course, each time submit assignment, have include document starting properties of each object in form. e.g. textbox1 location: 241, 115 name: textbox1 size: 100, 20 tabindex: 0 it's real pain scroll through properties viewer , copy , paste each customised value 30+ objects on form... wondering if there'd easy piece of code or way getting (at least partially) automated printout/view of properties of objects. was thinking sort of private sub past bottom of program , run on load, gets objects, , outputs non-default properties report or something? ideas on how this? any help'd great! why not in initializecomponent method, should able cut , paste need there. private sub initializecomponent() me.button1 = new system.windows.forms.button() me.label1 = new system.windows.forms.label() me.suspendlayout() ' 'button1 ' me.button1.location = new system.drawing.point(0, 0) me.button1.name = "button1...

c# - What to pass for pinned string in P/Invoke? -

assume c function: void do_something(const char* str) it stores string somewhere later reference . furthermore, have signature in c# call function: [dllimport("nativelib")] static extern void do_something(string str); now, need when passing string method: do need pin string (with gchandle.alloc() ) (or marshaller creating copy)? if need pin it, pass "original" string (i.e. string passed gchandle.alloc() )? or need pass return value of gchandle.addrofpinnedobject() ? is string correct data type (for do_something ) in case? or should use intptr instead? storing pointers through interop boundary bad idea, can modify c code make copy of string instead. pinning string suggested in upvoted answer isn't going work, pinvoke marshaller must convert string char* , releases converted string after making native call, invalidating pointer. must marshal string yourself. declare argument intptr , use marshal.stringtohglobalansi() create point...

SVG: fill pattern with holes -

Image
in svg, want use fill pattern leave "holes" in pattern other shapes drawn, example (which wasn't drawn svg). think i'm supposed use clipping and/or masking i'm not seeing how. the whole svg superimposed on image needs visible through "holes" (and through background pattern). can't obscure image filling holes solid color. you should use 'compound paths'. see this fiddle simple example. when have pattern, apply overlay on image. the reference cited in answer robert longson worth read.

lucene - Hibernate Search 4.1.1 NoSuchMethodError FSDirectory.open -

i trying use hibernate-search 4.1.1-final + lucene 3.5 hibernate 4.1.3 , spring 3.1.1 frameworks (dependency using maven) enable pojo-based text search. followed hibernate-search documentation. based on doc, here hibernate configuration: <bean id="sessionfactory" class="org.springframework.orm.hibernate4.localsessionfactorybean"> <property name="datasource" ref="datasource" /> <property name="mappingresources"> <list> <value>com/mytutorial/user.hbm.xml</value> </list> </property> <property name="hibernateproperties"> <props> <!-- other hibernate-specific properties --> <prop key="hibernate.search.default.directory_provider">filesystem</prop> <prop key="hibernate.search.default.indexbase">c:/temp/</pro...

c++ - ntdll.dll [Frames below may be incorrect /missing, no symbols loaded for ntdll.dll] -

since few weeks have run situation , upsetting, my program debugs well, no errors, when run program initial part of job, after few seconds terminates 'break continue' option, , in call stack when have look, turns out error ntdll.dll , msvcr100d.dll seems windows related sdk problem, seems bad pointer too. have somehow no control on this. installed windows sdk 7.0 nothing seems change, using : windows 7 64 bit, boost 1.48, visual studio compiler (full version), opencv2.3, c++. i have tried many options, eg. go task manager, , right click on devenv.exe , selecting 1 in 'set affinity' reinstalling windows sdk, reinstalling several times own project. nothing has helped me, can 1 suggest me solution please. for more clarity here call stack ntdll.dll!77e615de() [frames below may incorrect and/or missing, no symbols loaded ntdll.dll] ntdll.dll!77e615de() ntdll.dll!77e5014e() msvcr100d.dll!_getptd_noexit() line 500 c ntdll.dll!77eb73bc() ...

Magento logs print array contents -

mage::log works fine me, except when comes printing array info. for example, if have array $result, , this: mage::log('[cartcontroller: getdeliverleadtime(country): ' . $result . ')'); in system.log file get: [cartcontroller: getdeliverleadtime~(country): array ) * i want print actual structure , contents of array, normal print_r do.* if var_dump of array nothing, i.e. [cartcontroller: getdeliverleadtime~(country): ). if print_r get: [cartcontroller: getdeliverleadtime~(country): 1) this blocker me can't debug need - if shed light on how magento print contents of arrays in logs, appreciated. i read on alanstorm.com meant happen default, not me. thanks paul you have return print_r string, print_r($result, true) should trick.

anchors and iframes? -

i have html document iframe in it. now, if click button/link in iframe, want parent document scroll top. i'm not sure how make work. when put anchor @ top of parent document, , have button window.parent.location = '#anchorname'; , browser opens iframe document itself, having parent 1 vanish. first of all, suggest usage of jquery scrolltop (see here ) scroll on top. not enough, however, need call function page in iframe, so, supposing function scrolls document called 'foo', can call function page in iframe way: window.parent.foo(); hope helps.

numpy - Pixel neighbors in 2d array (image) using Python -

i have numpy array this: x = np.array([[1,2,3],[4,5,6],[7,8,9]]) i need create function let's call "neighbors" following input parameter: x: numpy 2d array (i,j): index of element in 2d array d: neighborhood radius as output want neighbors of cell i,j given distance d . if run neighbors(im, i, j, d=1) = 1 , j = 1 (element value = 5) i should indices of following values: [1,2,3,4,6,7,8,9] . hope make clear. there library scipy deal this? i've done working it's rough solution. def pixel_neighbours(self, p): rows, cols = self.im.shape i, j = p[0], p[1] rmin = - 1 if - 1 >= 0 else 0 rmax = + 1 if + 1 < rows else cmin = j - 1 if j - 1 >= 0 else 0 cmax = j + 1 if j + 1 < cols else j neighbours = [] x in xrange(rmin, rmax + 1): y in xrange(cmin, cmax + 1): neighbours.append([x, y]) neighbours.remove([p[0], p[1]]) return neighbours how can improve this? edi...

Using facebook javascript sdk to process fql query -

i have put implemented facebook connect on web-site using javascript sdk. process fql query. so have 2 questions: is possible using javascript fql " select id, name user uid in (select uid1 friends uid2=me()) " ? because when tried php sdk code using facebook doc php: $app_id = 'my_id'; $app_secret = 'my_app_secret'; $my_url = 'post_auth_url'; $code = $_request["code"]; $_request["code"] quite not recognized , don't know " 'post_auth_url' " because didn't use php sdk process facebook-connect. have idea? using method: 'fql.query' part of deprecated rest api. a better, future-proof way imho send queries against graph api: fb.api("/fql?q={your urlencoded query}", callback() { … } );

java - How to get CPU, RAM and Network-Usage of a Java7 App -

i found older article how-to-monitor-the-computers-cpu-memory-and-disk-usage-in-java , wated ask, if there new in java 7. want current cpu-, ram- , netzwork-usage of app periodically. has work linux (mac) , windows. data must not extremely detailed, 3 values enough (cpu: 10%, ram 4%, network 40%). cool if data app , not whole os-system, work, too. thank's help answering own question ;p code have written... networkdata: public class networkdata { static map<string, long> rxcurrentmap = new hashmap<string, long>(); static map<string, list<long>> rxchangemap = new hashmap<string, list<long>>(); static map<string, long> txcurrentmap = new hashmap<string, long>(); static map<string, list<long>> txchangemap = new hashmap<string, list<long>>(); private static sigar sigar; /** * @throws interruptedexception * @throws sigarexception * */ public ne...

jquery - How I can check whether a page is loaded completely or not in web driver? -

i writing java webdriver code automate application. how can correctly check whether page has been loaded or not? application has ajax calls, too. i have declared implicit wait webdriver. selenium you. or @ least tries best. falls short, , must little bit. usual solution implicit wait solves of problems. if know you're doing, , why you're doing it, could try write generic method check whether page loaded. however, can't done every web , every situation. related question: selenium webdriver : wait complex page javascript(js) load , see answer there. shorter version: you'll never sure. the "normal" load easy - document.readystate . 1 implemented selenium, of course. problematic thing asynchronous requests, ajax, because can never tell whether it's done or not. of today's webpages have scripts run forever , poll server time. the various things under link above. or, 95% of other people, use implicit wait implicity , explicit wa...

bash - If redirecting STDERR to STDOUT and redirecting STDOUT to a file, why are STDERR messages not showing in the file? -

i made quick little script, test.sh, looks following: echo "stderr" > /dev/stderr echo "stdout" > /dev/stdout according answers so question , , advanced bash-scripting guide , following should redirect stderr stdout script above: $ sh /tmp/test.sh 2>&1 and indeed does: $ sh /tmp/test.sh 2>&1 |tee file; $ cat file stderr stdout the question wondering output stderr go in following code? $ sh /tmp/test.sh > file 2>&1 $ cat file stdout i using gnu bash, version 4.0.24(2)-release. i'm seeing output stderr going file, expected: $> sh test.sh > file 2>&1 $> cat file stderr stdout this bash 3.2.48. $> bash --version gnu bash, version 3.2.48(1)-release (x86_64-apple-darwin11)

php - wordpress is not working after transferring the website -

i've transferred website new hosting... i've changed wp-config necessary afterword... website not coming up... shows oops! link appears broken . suggestions: search on google: well i've tried change url prefixes http://example.com/ form demo.example.net/example still nothing changes... when try reach wp-admin typing http://armeniantradenetwork.com/wp-admin redirects me link http://demo.softty.net/atn/wp-admin plz meeeeeeeeee!!! if domain has change, need edit /wp-content/themes/*theme name*/functions.php , add this update_option('siteurl','http://armeniantradenetwork.com/'); update_option('home','http://armeniantradenetwork.com/'); update next login admin panel, go settings -> permalinks , click save changes - rebuild permalinks.

sql - exporting by year and month from 100 tables -

i've been asked export data out of 100 tables. for each table this: select * table1 datepart(yyyy,table1.dos)=2011 , datepart(mm,table1.dos)=01 and then: select * table1 datepart(yyyy,table1.dos)=2011 , datepart(mm,table1.dos)=02 etc... i need every year , every month every table i need export these data sets csv can please give me guidance on how can automate instead of using import/export wizard manually? dynamic sql sp_msforeachtable. here link info , examples: http://weblogs.asp.net/nunogomes/archive/2008/08/19/sql-server-undocumented-stored-procedure-sp-msforeachtable.aspx

parsing - How do I build an array of names gathered from a text file which correspond to an array of links gathered from the same file? -

i need create array of names correspond links images have stored in array. both names , links images found in same text file, , links images follow corresponding names in file. build array of image links parsing text file using following code: import re images = [] open('html_test.txt') f: line in f: images.extend(re.findall(r'"([^"]*\.(?:jpg|gif)[^"]*)"',line)) using similar method build list of names, if there 1 name per image link. unfortunately number of image links following each name variable, names followed 1 image link, followed many. what think need count how many links images follow each name, create duplicate entries in name array each name followed more 1 image. (the number of duplicate name entries per name equal number of image links follow each name minus 1.) when try however, count of total number of names in entire text file. know how go building array of names each name entered array once each link image...

Rails in place editor -

i looking rails inplace editor plugin or gem modifying rails application built in rails 2.3.11 ruby version 1.8.7. please suggest applicable gem or plugin or alternate solution. thank https://github.com/bernat/best_in_place

sql server cant enter int 00X as 3 digits, but only as 1digit -

i using sql server 2008. want keep pk's in form 001,002 etc. ms sql not allowing me that. how can stop converting 001 1 ? use varchar datatype instead of int data type. or keep pk int , when use in query convert in varchar , use left padding 00x on it. declare @id int set @id = 1 select right(replicate('0',2) + cast(@id varchar(3)),3)

mysql - need to connect my same apps with one database -

i have 3 servers 3 applications on aws ec2 using mysql database, each of application having amember client subscription app, connects sql databse created in each instance in way every amamber app having diffrent database in each server, working device roku need pass xml attributes amember varify user can watch online streaming tv. the objective need make 1 database connected each server using amember each server access 1 database . options my options aws rds ,dynamodb now can put me in right direction, that. in simple words need connect multiple apps (same app) 1 database hellllp if need connect mysql database, dynamodb not answer. isn't mysql database. rds mysql database. connects other mysql database. haven't mentioned language[s] using, however. googling "connect mysql [language]" should help.

javascript - Y combinator: Some functions do not have fixed points -

the wikipedia article on y combinator provides following javascript implementation of y combinator: function y(f) { return ( (function (x) { return f(function (v) { return x(x)(v); }); }) (function (x) { return f(function (v) { return x(x)(v); }); }) ); } the existence of y combinator in javascript should imply every javascript function has fixed point (since every function g , y(g) , g(y(g)) should equal). however, isn't hard come functions without fixed points violate y(g) = g(y(g)) (see here ). functionals not have fixed points (see here ). how proof every function has fixed point reconcile given counter-examples? javascript not untyped lambda calculus in proof y(g) = g(y(g)) applies? the problem lambda expressions cannot interpreted functions in mathematical sense, i.e. mappings 1 set another. the reason cardinality of set of functions set a on larger cardinality of a , not functions a a can element ...

session - Android browser logs out of ASP.NET website -

i have asp.net webforms application being used motorola tablets (android 3.2) wenn users navigate logs out. in logfile cant find unusual, im using formsauthenticationticket log user in. any idea how solve or troubleshout issue? the problem in datetime settings, switched date time setting auto , the timezone manuel. it seems ok now.

c# - Why do my TextBoxes in different tabs of a TabControl lose their undo history? -

i have tabcontrol textbox controls in contenttemplate . when type text in 1 tab , switch tab, undo history in original tab gone when go back. another problem comes text selected deselected , caret moves beginning of textbox . if make window hardcoded tabitem controls, undo history preserved. issue has binding or templates. here xaml main window <window x:class="tabbedtextareatest.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" title="mainwindow" height="350" width="525"> <grid> <grid.rowdefinitions> <rowdefinition height="auto"/> <rowdefinition/> </grid.rowdefinitions> <button command="{binding addnewtab}">add tab</button> <tabcontrol itemssource="{binding tabs}" gri...

VBScript Wildcard equivalent to T-SQL "%" -

i'm trying see if file exists has current date in filename. in t-sql when want search within string, enclose in "%" characters this: %june 14 2012% how do in vbscript? use "*", since you're looking files.

python - How can I generalize my pandas data grouping to more than 3 dimensions? -

i'm using excellent pandas package deal large amount of varied meteorological diagnostic data , i'm running out of dimensions stitch data together. looking @ documentation, may using multiindex may solve problem, i'm not sure how apply situation - documentation shows examples of creating multiindexes random data , dataframe s, not series pre-existing timeseries data. background the basic data structure i'm using contains 2 main fields: metadata , dictionary consisting of key-value pairs describing numbers are data , pandas data structure containing numbers themselves. the lowest common denominator timeseries data, basic structure has pandas series object data entry, , metadata field describes numbers (e.g. vector rms error 10-meter wind on eastern pacific 24-hour forecast experiment test1). i'm looking @ taking lowest-common-denominator , gluing various timeseries make results more useful , allow easy combinations. instance, may want @ diffe...