Posts

Showing posts from January, 2015

sql server 2008 - SQL - Select Record High For Each Day of the Week -

it returns rows sorted countofrecords desc. i'd have 7 rows here, showing highest value ever specified day. each day of week should occur once , once. possible without lot of pain? select count(*) countofrecords, cast(floor(cast([visit].[datetimeentered] float)) smalldatetime) dateentered, datepart(dw, visit.datetimeentered) dayoftheweek visit inner join useragent on useragent.useragentid = visit.useragentid useragent.isbot = 0 group cast(floor(cast([visit].[datetimeentered] float)) smalldatetime), datepart(dw, visit.datetimeentered) order countofrecords desc edit1: think both answers getting @ same thing. i've accepted 1 posted first. i'm going mention worked right off bat while other did not. i'm getting following errors when run marc_s's query: msg 207, level 16, state 1, line 29 invalid column name 'rownum'. msg 207, level 16, state 1, line 25 invalid column name 'countofrecords'. msg 207, level 16, state 1, line 26...

How to build a jar file from clojure source code on Windows XP -

could please tell how build jar file clojure source code on window xp, wihout using maven or such software? clojure , windows xp without tool, you're bound quirky steps manually. have clojure.jar in current directory, along target folder compilation named classes , clojure source file in src/awesome.clj following code: (ns awesome) (defn life-universe-and-everything [] (println "42")) in order compile issue following commands on command line: edit: use semicolon instead of colon separate classpath elements in windows environments java -cp clojure.jar;classes;src clojure.main clojure 1.3.0 user=> (compile 'awesome) this produce compiled classes classes folder. please note if code depends on library, need adapt -cp parameter values when starting jvm. than, create jar file using: jar cvf awesome.jar -c classes . finally, call function: java -cp clojure.jar;awesome.jar clojure.main -e "(use 'awesome) (life-universe-and-ev...

c# - Getting control value when switching a view as part of a multiview -

i have following code in aspx page: <asp:button id="display_button" runat="server" text="display" onclick="button1_click" /> &nbsp; <asp:button id="edit_button" runat="server" text="edit" onclick="button2_click" /> &nbsp; <asp:button id="save_button" runat="server" text="save" onclick="button3_click" visible="false" /> &nbsp; <asp:multiview id="multiview1" runat="server" activeviewindex="0"> <asp:view id="view1" runat="server"> <asp:formview id="view_program" runat="server"> <itemtemplate> <%# eval("status").tostring().trim() %> </itemtemplate> </asp:formview> </asp:view> <asp:view id="view2" runat="server"> ...

ASP.Net MVC: Can you use Data Annotations / Validation with an AJAX / jQuery call? -

can use data annotations / validation ajax / jquery call? if so, please provide example or post shows example. basically have seen example of how use data annotations, full post back. there way ajax / jquery call? not sure how since not sure how construct model object on client side. (i assume have do.) someone told me can done, don't understand how can be. thanks help. if use html.ajaxform (instead of html.beginform) validate using ajax. however don't think can validate using jquery. microsoft has it's own ajax libraries , call/maintain themselves. don't think can hook own code in between.

c# - How to replace a page by date -

there way replace page @ date&time ? example: want @ friday default.aspx down, , other page turn default.aspx... , @ sunday first default.aspx return. someone have idea? maybe better change display of default.aspx. need replace screen "we down while" or that. i mean button that... using c#. asp.net well, create second page users go when page down, , call applicationdown. then, program redirect page friday's , saturday's only. if ((datetime.now.dayofweek == dayofweek.friday && datetime.now.hour >= 17) || datetime.now.dayofweek == dayofweek.saturday) { response.redirect("applicationdown.aspx"); } seems odd way of doing things, work if put @ top of default.aspx's page load.

javascript - Is it possible to invoke a JS function from a different thread? -

i'm trying make 2 different browsers communicate each other through native code host (c++) using js window.external. the syntax like: on destination.js: window.external.register("dest", eventcallbak); function eventcallback(senderid, data) { alert("message recieved " + senderid + " data of " + data); } on source.js: window.external.sendmsg("source", "dest", "hello dest! source..."); i've managed synchronously, saving eventcallback parameter, save idispatch , invoke when asked (all in same thread). no problems there. the troubles begin when trying asynchronously, meaning - saving eventcallback idispatch on 1 thread, , invoke later on in thread, causes invoke method fail hresult of e_unexpected . any ideas? thanks, two browser instances use different instances of js vm. cannot in general take 1 object 1 vm/heap , pass vm/heap. so need invent kind of marshaling here. ...

javascript - jQuery $.inArray() returns 0 -

if have array ('a', 'b') , check $.inarray('a', thearray); index, 0, , false. need check result further , it's annoying... is there quick method trough can true/false, , not indexes? basically have string in html5 data attribute: data-options="a,b,c" , 3 a, b, c variables in javascript must take true/false values based on what's inside data-options... you can achieve invoking binary not operator. if( ~$.inarray('a', thearray) ) { } explained in detail here: typeofnan.blogspot.com/2011/04/did-you-know-episode-ii.html

math - 3D Affine transformation problem in raytracing -

Image
all, i writing rather non conventional ray tracer calculate heat transfer properties of various objects in scene. in ray tracer random rays shot surface of primitive objects scene check intersections. this particular algorithm requires each ray developed in primitive space affine transformed source object world space subsequently affine transformed primitive space of other objects in scene check intersection. all until anisotropic scale example scaling object [2 2 1] (isotropic scales fine). leads me believe not transforming directional component of ray correctly. transform ray direction primitive space world space multiplying directional component transpose of source objects inverse transformation matrix , transform ray world space each primitive space multiplying transpose of destination objects transformation matrix. i have tried multiplying source primitive's transformation matrix go primitive world space , multiplying the destinations inverse transformation go worl...

Create array of pointers from an array of double in C# -

i'm trying create array of pointer references double array. example; double[] mylist = new double[100]; fixed (double* p = mylist) { } now msdn documentation states, equivalent p = &mylist[0] taking first value, possible create array of pointers variables in array? or practice use 1 pointer? thanks help, in advance array elements located in contiguous memory, it's suffcient have pointer first element , pointer arithmetic others.

java - XStream - loading custom XML -

i'm trying load xml file of following format: <?xml version="1.0" encoding="iso-8859-1"?> <mycompany> <record> <surname> bird </surname> <given1> andrew </given1> <id> 225958 </id> <birthdate> 260391 </birthdate> <peeryear> 2009 </peeryear> <title> </title> <preferred> andrew </preferred> <given2> macarthur </given2> <countryofbirthcode> aus </countryofbirthcode> <nationalitycode> </nationalitycode> <occupcode> retired </occupcode> <suburb> metung </suburb> <state> ...

android - Service, Observer, and Loopers -

i trying create application contains content observers in remote service kept getting error: "can’t create handler inside thread has not called looper prepare" i have done reading on android developers site many google searches still not understanding problem. i've taken far content observer needs thread run on (for handler). after adding: looper.mylooper().prepare(); mobserver = new observer(new handler()); a looper call before creating new content observer makes application work correctly. better understanding of why - nothing have found online has me grasp why far. also, adding looper line of code correct , efficient thing do? , there cleanup need prevent memory leaks later down road? the simpler explanation better. still in first month of android development , making progress - stackoverflow has been tremendous help! thanks. update after playing around , doing more reading think have better grasp on how make work , how clean still missing 1 sma...

How to directly search string in PDF using any programming language -

is possible search particular string in pdf using programming language without converting text or doc file. want search string directly without converting it, tried convert text , search string gave me wrong result. thanks! kim docotic.pdf library can used task. please see answer similar question . disclaimer: work company develops docotic.pdf library.

wcf - .NET Client consuming AXIS 1.4 SSL Webservice all exceptions "INTERNAL SERVER ERROR" -

i need consume axis 1.4 web service on ssl .net client. implement system.net.webclient, hand create xml request , upload web service. works great getting valid results, if exception occurs (java.rmi.remoteexception) webexception of "interal server error". inspecting response yields no more detail. if add service in visual studio 2010 .net 2.0 web reference (soaphttpclientprotocol) receive desired java.rmi.remoteexception necessary details rectify problem. however, resulting responses valid request null. note: service being consumed other (competitors') .net clients (to not have source code). to reiterate: valid request via webclient receives valid response objects every exception "internal server error", valid request via web reference receives null responses accurately display desired java.rmi.remoteexception. the goal: valid responses along complete java.rmi.remoteexceptions (not vague internal server errors), if can soapexception thrown that...

c# 4.0 - How to guarantee exclusive access when modifying network adapter properties -

i using wmi's win32_networkadapterconfiguration class, enablestatic method set static ips of loopback network adapter testing. noticed os takes out lock when there's visible property sheet. when user dismisses sheet changes, things freeze until update has completed. how can ensure exclusive access between program in c# , windows ui? i think enablestatic method of win32_networkadapterconfiguration class acquires exclusive lock change network adapter settings. microsoft knowledge base article lead me conclusion microsoft kb . there com interface called inetcfglock use acquire exclusive lock changing network adapter settings. acquire lock use inetcfglock::acquirewritelock method. begin edit: here link project on codeproject shows use of inetcfglock com interface , inetcfglock::acquirewritelock in c#. end edit hope, helps.

XML to MS-Access 2007 using ASP.Net (Bulk Insert, Bulk Copy) -

i download xml file comprising thousands of records. want xml file convert ms-access 2007 database using asp.net (vb) , run further queries on it. worth mentioning conversion should done in bulk because heavy file , take longer insert 1 one record. tired of googling code fulfill requirements. new asp.net. xml file structure under: <?xml version="1.0" encoding="utf-8" ?> <root> <product item="8101"> <model>fy316a</model> <ean>5055071647109</ean> <name>enchanted twilight flower fairy 'amethyst'</name> <description> descriptio </description> <dimension> <![cdata[ height 31 - 32cm width 16 - 18.5cm depth 12 - 13.5cm </dimension> <price>16.63</price> <delivery>i</delivery> <options> <![cdata[ b - hand on dress|a - flower in hand|any ]]> </options> </product> </root> please write...

c++ - symbol not found AKA undefined symbol -

most of people work on unix face irritating error often. , times take less time solve , take hell lot of time. even faced regularly , need document or article regarding specific error in c/c++ what cases there might symbol not found/undefined symbol error. could me know cases? the error not related unix/windows/any other os, rather languages themselves. rather simple diagnose information compilers provide. tell symbol missing , being used. main reasons symbol missing are: you have declared never defined it you have defined it, did not add compiled symbol (object file/library) linker it external , forgot link library, or linking invalid version, or in wrong order. the first 1 little trickier if intended define symbol did not match declaration (declared void foo( int, double ); , defined void foo( double, int ) . other cases, compiler tell exact signature looking for, make sure have defined that symbol, , not close or similar, particular corner case can if u...

java - How to parse span title with jsoup? -

i trying parse title of content using jsoup.. <div class="article"> <div class="articlehead review"> <h1 class="item"><span class="fn">onlive</span> review</h1> <h2 class="subgrey"><span class=""></span>cloud gaming has arrived in uk, can our infrastructure make of it?</h2> i want parse span class onlive review. , sub header ive tried far.. try{ elements titleelements = jsdoc.getelementsbytag("div"); for(element titleelement : titleelements){ if(titleelement.attr("class").equals("articleheader review")){ element articleheader = jsdoc.select("#item").first(); string header = articleheader.text(); system.out.println(titleeleme...

java - Understanding the @ConnectionDefinitions annotation in jca 1.6 -

i cannot find example shows use case using plural @connectiondefinitions on managedconnectionfactory implementation. confuses me singular @connectiondefinition annotation not let provide @configproperty each definition. can use @configproperty set default properties instances of managedconnectionfactory, , every connection definition must use different connectionfactory interface. assuming did this: @connectiondefinitions(value = { @connectiondefinition( connection = com.company.product.connector.myconnection.class, connectionfactory = com.company.product.connector.connectionfactory1.class, connectionfactoryimpl = com.company.product.connector.connectionfactory1impl.class, connectionimpl = com.company.product.connector.myconnectionimpl.class ) @connectiondefinition( connection = com.company.product.connector.myconnection.class, connectionfactory = com.company.product.connector.connectionf...

heroku - How to serve S3 files from a Rails app? -

i trying allow users download s3 file left clicking link. normally, have right-clicking , save-as. i looked http://apidock.com/rails/actioncontroller/datastreaming/send_file not sure if want. this article http://www.jtricks.com/bits/content_disposition.html shows how can done configuring apache. however, using heroku. anyone used content-disposition before serve files s3? wondering if takes whole web process (dyno)? or if whole process happens on s3 server instead? i tried: send_file 'http://some_bucket_name.s3.amazonaws.com/uploads/users/28/songs/88/test.mp3', :type => 'audio/mp3', :disposition => 'attachment' and get: cannot read file http://some_bucket_name.s3.amazonaws.com/uploads/users/28/songs/88/test.mp3 the file exist. if manually navigate url. file plays fine. this works rails 3. in controller do: response.headers['content-disposition'] = "attachment; filename=#{original_filename}" self.response_b...

merge - How do you manage your release branch in SVN? -

we use subversion our source control system , our mainline work in trunk. when released our software created branch. when need upgrade our release merge revision trunk our branch, commit , make tag. approach has made possible cherry pick revision or 2 trunk, merge branch , deploy fix. however, because cherry picking revision numbers, becomes difficult know revision have made branch trunk. there anyway can see revisions have been merged trunk without recording outside of subversion? we using subversion 1.6 when merge branch svn merge merged revisions automatically recorded svn:mergeinfo property. thus, can cherry pick revisions branch cd branch svn merge -r rev1:rev2 trunk_url svn commit -m "cherry picked fix" and check revisions svn mergeinfo branch_url output: /trunk:rev1-rev2 check this

android - Toggle Fullscreen mode -

i need toggling fullscreen mode. have setting in preference screen go fullscreen. in main activity's onresume have: if(mfullscreen == true) { getwindow().addflags(windowmanager.layoutparams.flag_fullscreen); getwindow().clearflags(windowmanager.layoutparams.flag_force_not_fullscreen); } else { getwindow().addflags(windowmanager.layoutparams.flag_force_not_fullscreen); getwindow().clearflags(windowmanager.layoutparams.flag_fullscreen); } but doesn't seem work because needs called before setcontentview right? ... also, have requestwindowfeature(window.feature_no_title); before setcontentview , takes away title , status bar... can offer help? ---edit--- ok, had bug causing not work. does. now, need know how toggle title bar. private void setfullscreen(boolean fullscreen) { windowmanager.layoutparams attrs = getwindow().getattributes(); if (fullscree...

flex4 - Flex 4: Is it possible to show a Flex application on clicking a button in another flex app -

i remember launching jframe within japplet. wondering if same. requirement this i have screen estate enough flex button. on clicking button, want open flex app can of larger real estate. i dont want open new browser window. is remotely possible. your question unclear , referencing java applets more confusing. i'd suggest learn more flex; free tutorial videos on adobe website. viewstacks, navigation , loading modules.

ssas - Self-join in SQL Server Analysis Services -

i have table this: wordid set1 set2 related-wordid --------- ---- ----- -------- 101 c1 105 102 b c2 101 103 c1 102 then need getting association rules between word's set1 , related-word's set2. i've used self-referencing , define case/nested tables @ result of dependency graph there no difference between word's set1 or set2 , parent-word's set1 or set2! what best solution text-mining problem in sql server analysis services project? in analysis services templates can use self join query this to open template, right-click template name , select open, or drag template query window opened. after query window open, can use commands on toolbar or query menu build statements: to check syntax of query, click parse. to run query, click execute. to stop query running, click cancel executing query. view results of query in results tab @ bottom of screen. switch messages...

java ee - Local Link Not Opening from Internet -

i have created first web project in j2ee in local machine http://localhost:8080/sprinmvc/jsp/hello_world.jsp but when tried open link internet ,from other system saying ,not able conect web server. eg: suppose ip 49.67.10.150, have replace localhost ip .still not working please me ! check whether have firewall/security software might blocking inbound connection

Function and procedure behave differently with the same code in Mozart Oz? -

i try printing out fibonacci sequence in oz using 2 approach : function , procedure using emac editor. procedure goes here : declare fun {fibo n} case n of 1 1 [] 2 1 [] m {fibo (m-1)} + {fibo (m-2)} end end declare proc {loop k} if k ==1 {browse k} else {loop k-1} {browse {fibo k}} end end {loop 10} and function: declare fun {fibo n} case n of 1 1 [] 2 1 [] m {fibo (m-1)} + {fibo (m-2)} end end declare fun {loo l} if l ==1 {browse l} else {loo l-1} {browse {fibo l}} end end {loo 10} the problem procedure "loop" works. result is: 1 1 2 3 5 8 13 21 34 55 function "loo" doesn't , throws hard-to-understand errors: %********************** static analysis error ******************* %** %** illegal arity in application %** %** arity found: 1 %** expected: 2 %** application (names): {loo _} %** application (values): {<p/2> _<optimized...

c - Multidimensional array of gtkwidgets -

is possible create multidimensional array of gtkwidgets? this: mywidgetlist[2]["title"]; or should doing in different way? how this? basically have number of "widgets" (loaded gtkbuilder) composed of smaller widgets , want able change values, array setup seems preferable. is there way of doing (other coding complete widget using signals etc , placing them in simple array?) in c, cannot use string index array. or, strictly speaking can, it's never want do. for c solution using glib (handy if use gtk+), consider single-dimensional array of ghashtable pointers.

python - Defining function without the brackets? -

i understand question might sound stupid, , there might in language definition explicitly prohibits notion, since don't know prohibition, wondering whether shed light on it. in short, define python function call python shell, avoid brackets. there cases when function not require argument, , bracket seems indicate dealing function. such example be, if 1 wants print current working directory. can define function as def pwd(): print os.getcwd() and can call shell pwd() but if have function can call pwd is possible @ all? you can't without modifying language or shell. if want use python shell, should try ipython , allows define macros can use without typing many keys. lets !pwd , can assign variable x = !pwd . lets call single argument functions writing f x instead of f(x) . btw haskell language uses spaces list of arguments, i.e: f(1,2,3) in python f 1 2 3 in haskell, , in shell io action can executed typing action . i forgot there's hack ...

ipad - I want publish one free applicataion and with some features in lock mode after pay unlock the features iphone app? -

how can enable features in lock , features in unlock mode in iphone application. like enabled user in free mode , enabled after payment. thank you. google has answers ( example )

What is the equivalent of this code in PowerShell? -

what equivalent of code in powershell? @echo off set path=%path%;d:\oracle\frhome_1\dcm\bin\;d:\oracle\frhome_1\opmn\bin\;d:\oracle\frhome_1 \opmn\bin $env:path=$env:path+";d:\oracle\frhome_1\dcm\bin\;d:\oracle\frhome_1\opmn\bin\;d:\oracle\frhome_1" ps: should try learn powershell, rather asking equivalent lines of code.

c++ - How does this method of removing an element from a stack work? -

i started taking c++ class @ local college , instructor gave class assignment in must create vector , remove element middle of stack. she provided example: vect[3] = vect[vect.size()-1]; vect.pop_back(); now.. i've tested , works i'm unsure how works or why works. i'm sure provide simple explanation? you want delete element middle of vector, overwrite last element (with index size()-1 ) - since last element becomes redundant, can pop_back() it. have desired result - vector size decreased 1 , old value @ vect[3] gone. note doesn't preserve order of elements in vector, relatively efficient - erasing middle of vector may involve lot of memory copying since elements after element deleted need shifted 1 accommodate gap (remember: std::vector stores elements in continuous storage). erasing end costs nothing.

Android - setting layout params to TextView in millimeter -

i believe can set layout_width , layout_height textview element dynamically using like: layoutparams lparams = new layoutparams(layoutparams.wrap_content, layoutparams.fill_parent); centimeterlayout.addview(textview, lparams); but - how set layout width , height in other units - e.g. want set layout width of text view 20 mm. how do that? layoutparams either take 1 of constants ( fill_parent , wrap_content ) or pixel value. since want use millimeters, have convert millimeter dimension pixel dimension. doing pretty easy: resources r = getresources(); float px = typedvalue.applydimension(typedvalue.complex_unit_mm, 20, r.getdisplaymetrics()); in example, 20 mm converted pixel dimension can use in layoutparams . can use other dimensions too, such typedvalue.complex_unit_dip dp/dip¹. change constant in arguments. android doc has list of useable dimensions . ¹ density independend pixels, highly recommended dimension adjusts many...

include a java-me jar with a blackberry application -

i want use ksoap2-j2me-core-prev-2.1.2.jar file. on use time application create error module 'ksoap2-j2me-core-prev-2.1.2' not found any 3rd party jar has preverified using sdk's preverify tool. also, make sure in eclipse, select check box jar underneath "order , export" tab when setting build path (the same place add jar)

java - Faster math ops -

possible duplicate: fast algorithm polar -> cartesian conversion i running pathfinding code (which bit slow) through jvisualvm, found 80% time being spent in vector implementation more part convert cartesian polar, r = math.sqrt((x * x) + (y * y)); t = math.atan2(y,x); are there old school tricks me more performance? in experience in path finding algorithms, problem not lines. the main questions "how many times call these 2 lines?" you should investigate path finding algorithm. anyway, if want reduce delay of lines, possible make pre-calculated table sqrt , atan2 each x , y . or table maps each (x, y) (r, t) directly.

java - Unable to use Scala and Spring MVC 3 to return JSON -

i converting java spring controller classes scala. in java, controller method returned json defined this: @requestmapping(value = "/search", method = requestmethod.get) public @responsebody string[] searchfoods(@requestparam("term") string searchterm, principal principal) { ... } this works expected. same method in scala looks this: @requestmapping(value = array("/search"), method = array(requestmethod.get)) def searchfoods(@requestparam("term") searchterm: string, principal: principal): java.util.list[string] @responsebody = { ... } however, time path requested following exception: 2011-10-09 09:06:19.980:warn::/searchpath/search.html javax.servlet.servletexception: not resolve view name 'searchpath/search' in servlet name 'dispatcher' @ org.springframework.web.servlet.dispatcherservlet.render(dispatcherservlet.java:1029) and web server returns http 500 error. possible use scala , spring mvc 3 return json? ...

java.lang.IllegalStateException error in Android Sqlite3 "group by" clause -

this query in sqlite3 adb shell: sqlite> select round prizes group round; 100-7 however, got problem when translating java code: linkedlist<string> result = new linkedlist<string>(); cursor cursor = db.rawquery("select round prizes group round", null); if(cursor.movetofirst()) { { result.add(cursor.getstring(1)); } while (cursor.movetolast()); } if (cursor != null && !cursor.isclosed()) cursor.close(); return (string[]) result.toarray(); when run code, got error: error/androidruntime(10540): java.lang.illegalstateexception: field slot row 0 col 1 failed this because have 1 column returned form query ( round ) , index zero-based see doc getstring returns value of requested column string. result , whether method throws exception when column value null or column type not string type implementation-defined. parameters columnindex zero-based index of target column. the below should work: ...

sqlite - sqlite3 - how to list out database name using .databases command? -

i'm fresher of rails , sqlite. here scenario: had sqlite3 installed on windows vista machine. blog application code had been implemented @ c:\rails\blog . brought command prompt , went directly c:\rails\blog\db . ran command sqlite3 enter database console. when used .databases command, no database listed out? why? have done wrong? you didn't open database itself sqlite3 database.db remember, in sqlite database file. long don't open or attach one, there no open one. on other hand when open database .databases feels kind of useless, because know 1 opened.

iphone - iOS: Setting primary language for app when localizing -

i have built app swedish language only. have added multilanguage support (english uk/us, german, spanish) , submit app app stores in world. the problem have chosen swedish primary language in itunes connect when creating account. reading several threads have come conclusion if submit app now, default language swedish languages haven't localized. huge problem since there seems no way of changing primary language. anyone know can done? on upside: when using link in itunes connect "version summary" can see language in english when example choosing "slovenia" or other country hasn't been localized... can trust really? not according several forum threads, example: https://discussions.apple.com/thread/1678830?start=0&tstart=0 https://discussions.apple.com/thread/1657193?start=0&tstart=0 thanks i have released app , tried out several different app stores , seems take english default langauge, not swedish have primary. this goes aga...

c - Weird #define declaration, can't understand to what it expands -

i have #define statement in legacy code i'm inspecting in c . #define step(x) case x: step ## x : wpan_startup_step = x; this macro replace cases in big switch state machine. can't understand what's going on in macro. expand ? ## concatenation, means result this: step(1) case 1: step1: wpan_startup_step = 1; or example: step(v) case v: stepv: wpan_startup_step = v; this macro not make sense me, since generates x: stepx: maybe usage example clarify this. if want see expansion of macro use: gcc -e program.c also place learn macros: http://gcc.gnu.org/onlinedocs/cpp/macros.html

Can't execute commit to svn as root folder is forbidden -

i'm trying execute post build svn commit command in jenkins. i have access http://myrepo.com/myproject ... haven't http://myrepo.com/ (the access forbidden). result, when commit i'm getting following error: svn commit --message "build #xx" myfile --non-interactive svn: commit failed (details follow): svn: options of 'http://myrepo.com/myproject/myfile': authorization failed: not authenticate server: rejected basic challenge (http://myrepo.com) when run svn command line, not have access credentials stored in jenkins. the easiest way make svn work command line provide --username , --password parameters svn in build script. you can run svn jenkins user , let store authentication in jenkins user's home directory. you'll have set authentication on each node need perform commits. , it's tedious maintain if ssl certificate or password changes periodically. keep usernames, passwords out of build scripts. perhaps plugin svn...

php - Python data passing -

i need exchange data between python daemon (cluster nods send data daemon) , php script (apache) which, accessed webbrowsers. recommend technology establish connection between them. both, python daemon , apache/php on same machine. thank you. what wanting called ipc (inter process communication) . since these common linux applications going refer so question recommends unix domain sockets . for php here , python here .

javascript - How to switch from one to another tab using jQuery,java script? -

how switch 1 tab using jquery,java script??? if mean "switch among browser tabs", think not possible nor advisable: browsers not allow take control on them without intervention of user.

animation - CATiledLayer with animating content -

i've got uiview backed catiledlayer. setup works pretty smooth @ moment horror starts when want animate view objects on catiledlayer. i've read can force catiledlayer redraw using setneedsdisplay . redraws on screen. tiles loaded on again. how should update layer when animating? let's take following example: i've got 6 green rectangles on layer , when press uibutton i'd change color of rectangle number 4 red , reposition rectangle 1 2 , 3 on bezier curve. you can use catiledview:setneedsdisplayinrect: radraw portions of layer. in case should: redraw 4 new color redraw old positions of 1, 2 , 3 no rectangles redraw new positions on 1, 2 , 3

git - How do I delete a branch I created and revert everything back to the master branch's last commit? -

the last commit made master branch want to. made lot of changes , committed them new branch created called omniauth. delete branch entirely , restore last master commit. how do that? first can switch master branch with: git checkout master then can delete omniauth branch with: git branch -d omniauth note -d option (as opposed safer -d ) delete branch regardless of whether commits in branch have been merged current branch.

android - How can I make a TextView look like a Button? -

i have listactivity in android. each row item starts activity resource. default of course textview. i'd (and "i'd like", mean "the client insists") textview button. if make them buttons, default list click handler doesn't work anymore - if they're non-focusable - have write code manually inflate view containing button , set click handler. is there way instead can make textview button without of button's behaviors? you should able set style in layout xml file. see http://developer.android.com/reference/android/r.style.html list of built-in platform style. not sure how work, reasonably easy do. try this: <textview android:layout_height="wrap_content" style="@android:style/widget.button" android:layout_marginright="5sp" android:text="" android:layout_width="fill_parent"></textview> edit: issue default button style sets android:clickable attribute. try , add androi...

dependencies - How to make an Android app that depends on another app? -

if create app depends on app or apps (eg: facebook , twitter apps), yet not installed, there method of checking dependencies , installing them @ same time own app? i did in application requires zxing scanner app installed. want inside onclick or ontouch: try{ intent intent = new intent("com.google.zxing.client.android.scan"); intent.setpackage("com.google.zxing.client.android"); startactivityforresult(intent, 0); } catch (exception e) { createalert("barcode scanner not installed!", "this application uses " + "the open source barcode scanner zxing team, need install " + "this before can use software!", true); } which calls public void createalert(string title, string message, boolean button) { // http://androidideasblog.blogspot.com/2010/02/how-to-add-messagebox-in-android.html alertdialog alertdialog; alertdialog = new alertdialog.builder(this).create(); alertdialog.s...

how do I use rails helpers in resque jobs? -

i'm trying use helpers in resque job , running problems. here's i've tried: require 'json' class soulmateuserfollowing tried -> include rails.application.routes.url_helpers , -> include actionview::helpers:urlhelper , -> helper actionview::helpers::urlhelper @queue = :soulmate_user def self.perform(user_id) user = user.find(user_id) url = url_for(following_user) end end i need include helper image_path method , custom helper of mine located in module imagehelper. add named route in config/routes.rb file , call job class (no need include anything) rails.application.routes.url_helpers.following_user_url(following_user) you have set in environment default host since inside 'resque' , there no http parameters set. routes.default_url_options = {:host => "somehost.com"} alternatively can include url_helpers , in class class soulmateuserfollowing include rails.application.routes.url_helpers ...

lucene.net - Using Lucene when indexing I boost certain documents, but their score at search is still 1 -

i trying boost documents. dont boosted. please tell me missing. thanks! in index code have: if (mycondition) { mydocument.setboost(1.1f); } myindexwriter.adddocument(document); then in search code retrieve collection of documents scoredocs object mydocuments collection and: foreach (lucene.net.documents.document doc in mydocuments) { float tempboost = doc.getboost(); } and place breakpoint in foreach clause break if tempboost not 1. , breakpoint never hit. what did miss? many thanks! from javadoc of lucene (java version same behaviors apply): public float getboost() returns, at indexing time, boost factor set setboost(float). note once document indexed value no longer available index. @ search time, retrieved documents, method returns 1. not mean boost value set @ indexing time ignored - combined other indexing time factors , stored elsewhere, better indexing , search performance.

c# - How do i loop thorugh all double positions to save all frames to hard disk? -

i'm using framegrabber.cs , added dll reference: jockersoft.media.dll , interop.qedit. now in form1 code in constructor i'm trying retrieve frames in position , save each frame new bitmap file on hard disk can't figure out how it. i don't know how loop through frames/double[] position wanted see information how many frames there framerate 17.8.... i want list/array of frames , save each frame hard disk , manipulations on frames. this site got example from. tried there , on source code couldn't figure out how it. ** have trackbar1 in designer wanted able scroll through frames doesn't work good. this form1 code doesn't work can 1 frame. using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.windows.forms; using extractframes.properties; using extractframes; using jockersoft.media; using jockersoft; using interop.qedit; using inte...

iphone - Finding the correct width of a NSString -

on factors wrapping of text inside textview depends. width of textview 160 px , calculated width of incoming text using below mentioned code , comes out 157 px text wrapped in 3 lines... why so? cgsize size = [mytext sizewithfont:textviewfont constrainedtosize:textview.frame.size linebreakmode:uilinebreakmodewordwrap]; cgfloat textwidth = size.width; i thought of dividing width of text width of textview number of lines. calculation returns me 1 whereas can see 3 lines coming in textview on simulator. - (cgsize)sizewithfont:(uifont *)font constrainedtosize:(cgsize)size linebreakmode:(uilinebreakmode)linebreakmode calculates size string if drawn constrained size given argument, if string long given size constraint truncated fit. to width of string if it's drawn on single line no constraints use: - (cgsize)sizewithfont:(uifont *)font see: http://developer.apple.com/library/ios/#documentation/uikit/reference/nsstring_uik...

ios4 - Question about the Facebook SDK for iPhone -

today, have downloaded last version of facebook api iphone. have integrated project no problem. there things different older versions, example: there no log in dialog, on version when tap log in button, sdk takes me safari, log in , app. question is: ok? there way show log in dialog on older version? yes. absolutely okay. in provide proper credentials , confirm authorization application. once user clicks okay returned application. need change .plist file , provide application id in that. flow url types : item 0 : url identifier : url schemes : item 0 : fb **your application id of facebook** (without space fb) based on return application. hope helps.

javascript - confirmation popup message (ASP.NET/VB) -

i want have confirmation message box pop when user clicks cancel button on form. believe correct javascript code: function confirmation() { var answer = confirm("are sure want cancel? information have entered discarded.") if (answer) { window.location = "index.htm"; } } but, i'm not sure how can call function vb code behind page. on cancel button add markup attribute onclientclick="return confirmation();"

sql - Subquery automatically producing cross join -

i not why when follow example (from northwind datase in ms sql server) subquery on microsoft sql server management studio 2008 typing in code shown below, select orders.orderid, (select customers.companyname customers customers.customerid = orders.customerid) company name orders, customers this sql code subquery automatically gained cross join , become select orders.orderid, (select customers.companyname customers customers.customerid = orders.customerid) company name orders cross join customers customers_1 i have played around several variation of no luck in eliminating problem. known bug microsoft sql server management studio 2008? if so, has been patched, how find patched? otherwise, how can report microsoft , them fixed quickly? in actual query, need query/lookup name of particular table 50 times equating id , think dumb having join of sort because code crumpy, long, , performan...

linq - Simple Examples of joining 2 and 3 table using lambda expression -

can show me 2 simple examples of joining 2 , 3 tables using lambda expression( example using northwind tables (orders,customerid,employeeid)? code joining 3 tables is: var list = dc.orders. join(dc.order_details, o => o.orderid, od => od.orderid, (o, od) => new { orderid = o.orderid, orderdate = o.orderdate, shipname = o.shipname, quantity = od.quantity, unitprice = od.unitprice, productid = od.productid }).join(dc.products, => a.productid, p => p.productid, (a, p) => new { orderid = a.orderid, orderdate = a.orderdate, shipname = a.shipname, quantity = a.quantity, ...

asp.net mvc 3 - Looking for MVC 3 tutorial with jQuery -

i looking tutorial shows how invoke mvc action , pass parameters. have dynamic "comment box" need save database. want use jquery send comment data rest method handle it. i need refresh part of page data returned mvc action. data returned json. i have seen tutoral scott guthrie, uses postback. need asynchronous communication through jquery. very simple , small tutorial useful. thanks edit: using $.ajax() calls of jquery assuming have form on view allow user post comment: @using (html.beginform("save", "comment", formmethod.post, new { id = "commentform" })) { @html.textareafor(x => x.comment) <input type="submit" value="comment" /> } <div id="result"></div> you ajaxify using jquery: $(function() { $('#commentform').submit(function() { $.ajax({ url: this.action, type: this.method, data: $(this).serialize...

How do I order a string array ascending and descending alphabetically? C# .NET or Java -

well, have string array: string array[] = new string[5]; array[0]="abc"; array[1]="aab"; array[2]="aaacb sf"; array[3]=" ab"; array[4]="hello"; how order ascending , descending? using linq , do: array = array.orderby(d => d).toarray(); to sort ascending and array = array.orderbydescending(d => d).toarray(); to sort descending remember add using system.linq; .

Error after installing .apk in android device -

i have developed 1 android application. have installed .apk in samsung galaxy pop. has installed when i'm trying open it, gives me error "application unexpectedly close". application works fine on emulator. don't know problem. please give me proper suggestions regarding it. first of check screen sizes in manifest.. check permissions ur application need added in ur manifest? check versions supported application.. <uses-permission /> <permission /> <permission-tree /> <permission-group /> <instrumentation /> <uses-sdk /> <uses-configuration /> <uses-feature /> <supports-screens /> <compatible-screens />

scala - PartialFunction type -

in scala play framework seen code: abstract class analyserinfo case class columnc(typename:string,fieldname:string) extends analyserinfo case class tablec(typename:string) extends analyserinfo val asis :partialfunction[analyserinfo,string] = { case columnc(_,f) => f; case tablec(typename) => typename } what difference with: val asis: (analiserinfo)=>string = (info) => info match { case columnc(_,f) => f; case tablec(typename) => typename } there preferred style? , why in first case match keyword can omitted? thank support. double => double shorthand function[double, double] . partialfunction inherits function adds few methods. importantly, adds method isdefinedat allows query if function defined parameter. the case s without match special syntax define partial functions, generates isdefinedat returns true matching case s. say have function returns 1/x, positive values of x, define as: scala> val f: (dou...

sql - SELECT COL1+COL2 as CalcColumn,* FROM TABLE WITH (NOLOCK) WHERE 100<COL1+COL2 -

in select statement using condition based on calculated value, possible include calculated value without computing calculated value twice - once in selection , again in condition? i using sql server 2000. you put subquery , select that sql statement select * ( select col1 + col2 calccolumn table ) q 100 < calccolumn but performance, expect slower original query.

ruby on rails 3 - Problem with use of gems (mode devel vs. production) -

i use rails 3. in development mode installed gems testing (diff-lcs, nokogiri, rspec, webrat). since did that, if try cap-deploy production server, complains: "could not find diff-lcs in of sources (bundler::gemnotfound)" i don't want install them on server, because don't need testing purpose gems on production server. can put in gemfile maybe exclude them production mode? or else how can handle this? thank answering questiion struggling beginner... you can put gems in own group this: group :development, :test gem 'diff-lcs' end this page explains groups in more details: http://gembundler.com/groups.html

routes - Drupal-like routing system in Rails -

i trying find best-practice allow users define route pages in rails, writing them in text field when submitting posts, path module in drupal (yes, porting drupal site rails) so, need to define new, named route on article submission (eg http://www.domain.com/a-day-in-annas-life ) change existing route on article edit, if define new one, doing 301 redirect old route new 1 how can best achieve this? okay, found way, if it's best practice or not, cant say. i using custom restrictor's this: class charitiesrestrictor def self.matches?(request) slug = request.path_parameters[:path] !charity.find_by_name(slug).nil? end end constraints charitiesrestrictor match '*path' => 'charities#show_by_slug', :constraints => charitiesrestrictor.new end when create block each of model/controller pairs should able respond permalinks, can have them have chance act on permalink. however, means called in series, not ide...

r - Using "[[ ]]" notation for reference class methods -

while experimenting new reference classes in r noticed odd behaviour if use "[[ ]]" notation methods (x[["dosomething"]] instead of x$dosomething). notation works fields, thought wouldn't work methods until found if execute "class(x$dosomething)" can use "[[ ]]" afterwards. simple example below illustrates point. setrefclass("number", fields = list( value = "numeric" ), methods = list( addone = function() { value <<- value + 1 } ) ) x <- new("number", value = 1) x[['value']] # 1 x[["addone"]]() # error: attempt apply non-function class(x[["addone"]]) # null class(x$addone) # "refmethoddef" # following works! x[["addone"]]() # sets x$value = 2 class(x[["addone"]]) # "refmethoddef" the reason encountered because want group objects in list , create "applymethod" functi...

objective c - Modal View Controller transitions -

i'm trying fanciful transitions ipad application. i'm using presentmodalviewcontroller show view. but available transitions are: modelviewcontroller.modaltransitionstyle = uimodaltransitionstylecoververtical; modelviewcontroller.modaltransitionstyle = uimodaltransitionstylecrossdissolve; modelviewcontroller.modaltransitionstyle = uimodaltransitionstylefliphorizontal; modelviewcontroller.modaltransitionstyle = uimodaltransitionstylepartialcurl; are there ways can have cool or maybe 3d transitions? you can quartzcore framework or using animation blocks . first 1 hard way, second 1 easier limited.

iphone - push notifications: sounds and badges -

i'm working push notifications , have doubt: if in script (server-side) there badge , sound, user set sounds , badges off... happens? i mean: need register in database every setting every token, or send notification , iphone work? :) thanks! you don't need worry user settings. user receive alerts allowed. if doesn't want have sound , switch off. can still send , receive alert , or badge...

playframework - Caching of renderBinary responses -

i trying customize serving of static resources renderbinary(). serve these assets through controller optionaly checks authorization , serves appropriate file. cache file 1 year never change. the method in controller looks this: public static void item(string item) { // check authorization ... response.cachefor("365d"); renderbinary(play.getfile("static/" + item)); } the problem having play automatically adds etag , caches 1 hour when using renderbinary, net effect firefox re-issues request these files again when needed, 304 response play server. i know can achieve thing nginx frontend using play. this known bug in play, see https://play.lighthouseapp.com/projects/57987-play-framework/tickets/772-overwritten-of-cache-control-header-when-apply-renderbinary-to-a-file

ruby on rails - Why won't Sinatra work correctly? -

i trying set amazon ec2 instance run rails , sinatra apps. problem - sinatra won't start. when try run .rb file, throws this: $ ruby hello.rb /usr/local/rvm/gems/ruby-1.8.7-p334/gems/sinatra-1.2.5/lib/sinatra/base.rb:1144:in `define_method': tried create proc object without block (argumenterror) /usr/local/rvm/gems/ruby-1.8.7-p334/gems/sinatra-1.2.5/lib/sinatra/base.rb:1144:in `compile!' /usr/local/rvm/gems/ruby-1.8.7-p334/gems/sinatra-1.2.5/lib/sinatra/base.rb:1129:in `route' /usr/local/rvm/gems/ruby-1.8.7-p334/gems/sinatra-1.2.5/lib/sinatra/base.rb:1111:in `get' /usr/local/rvm/gems/ruby-1.8.7-p334/gems/sinatra-1.2.5/lib/sinatra/base.rb:1474:in `send' /usr/local/rvm/gems/ruby-1.8.7-p334/gems/sinatra-1.2.5/lib/sinatra/base.rb:1474:in `get' hello.rb:4 now, thought specific ec2. set rvm on mac , tried same - same result. thought might specific version of ruby being used (1.9.2). not - problem persists 1....

node.js - Using NPM and node Supervisor -

just installed nodejs , npm , nodesupervisor via terminal in os 10.5.8. i have server running with: var http = require("http"); function onrequest(request, response) { console.log("request received."); response.writehead(200, {"content-type": "text/plain"}); response.write("hello world!"); response.end(); } http.createserver(onrequest).listen(8888); console.log("server has started."); how restart server, without quitting terminal if following updated: response.write("hello world, nodejs!"); i've seen "^c" used in terminal, in nodejs video tut. also have node supervisor appears handle these changes, when attempt use watch "-w" command(supervisor -w server.js), on server.js, nothing ("file being watched" or something) returned, , supervisor screen reloads. npm: 1.0.96 nodejs: v0.4.11 ctrl-c way quit node without quitting terminal together, command...

ios - Objective C property vs ivar issues with Core Data -

i spent several hours trying figure out problem, , think comes down fundamental understanding of objective c, though manifested through working on core data. i'm not surprised - i've been working objective c , cocoa touch 2 months now. my situation have series of models connected fine in cd. app works fine until tried extending yesterday. have main model job in view controller class property in .h file. in viewwillappear method have relationship through object, like: /** project ivar **/ nsmanagedobject *project = [job valueforkey:@"project"]; nsarray *divisions = [[project valueforkey:@"divisions"] allobjects]; //do divisions --> crash ... /** project property **/ project = [job valueforkey:@"project"]; nsarray *divisions = [[project valueforkey:@"divisions"] allobjects]; //do someting, ---> a-ok! so, why app crash when try things results of [project valueforkey:] unless make project class property? edit it appear...