Posts

Showing posts from January, 2013

load testing - use csv parameters in jmeter httprequest path -

load testing - use csv parameters in jmeter httprequest path - i want utilize csv info set config modify path of http request. my csv file: 120,120 121,121 my csv variable names: paraa, parab . my http request path: /my/path/with/?{paraa}/?{parab}/ . i tried , failed. is there anyway work around? seems incorrectly refer jmeter variables. try /my/path/with/${paraa}/${parab}/ instead, ${paraa}, ${parab} refer corresponding values extracted in csv info set config: jmeter load-testing

javascript - Getting Position in jQuery Animate -

javascript - Getting Position in jQuery Animate - i animating 1 image(i.e)scaling image like $('#img').animate({height:'300px','width':'20px'},2000); i need current height of image during animation. tried step property. printing many points unrelated animation. any idea there's step alternative in animate function allows callbacks during animation. in callback can request position , want it. http://jsfiddle.net/ayvue/ javascript jquery html css jquery-animate

command - Which would be better for the syntax for an array? -

command - Which would be better for the syntax for an array? - i making scripting language, need help on deciding syntax. having issues deciding 2 things. first, syntax calling parts in array. thinking 1 of 2 options, give me suggestions if want. let's have array in javascript represented as var people = [ ["joe",34], ["bill",29], ["steve",36] ]; the options are option 1 people[2][1] returns 36 alternative 2 people[2,1] returns 36 second, syntax calling function. thinking 1 of 2 options, give me suggestions if want. let's have function in javascript represented as function foo(bar,hi) { homecoming bar; } the options are option 1 same javascript example: function foo(bar,hi) { homecoming bar } alternative 2 same javascript, - separating each private variable it's own set of parentheses - no need state "function" in front end ...

c++ - Open source project that uses cmake -

c++ - Open source project that uses cmake - can allow me know open source c/c++ project uses cmake build code base? thanks. see success stories page of cmake project. notable projects (imo of course) kde , mysql. c++ c cmake

Online beer & drinks database / service API? -

Online beer & drinks database / service API? - is there well-kept database of beer & drinks accesible via api somewhere? (preferably uk) programmable web has matches in beer tag. database api service social

python - Search image for color. Return X, Y -

python - Search image for color. Return X, Y - i've been looking on way find specific color in image (screen capture), , homecoming the position of of color (x,y). i've had tries, not managed proper search. result should first pixel found color. i tought maybe pil help. tried this, problem returns every position, found color: fixed: def findcolor(r,g,b): image = imagegrab.grab() x in range(1, 400): y in range(1,400): px = image.getpixel((x, y)) if px[0] == r , px[1] == g , px[2] == b: return(x,y) and, need replace loops range, pictures width/height. return result @ first match, instead of continuing loop. python image colors find python-imaging-library

c++ - Structure memory layout In C -

c++ - Structure memory layout In C - struct fraction { int num; int denum; } pi; pi.num=22; pi.denum=7; ((fraction*)&(pi.denum))->num=12; cout << endl; cout << pi.denum <<endl; cout << pi.num <<endl; i can understand memory diagram till point have confusion is next code ((fraction*)&pi.denum)->denum=33; is there legal way 33 printed out ?? command value stored not in view of object? a struct fraction layed out in memory 2 consecutive ints . code looks @ look &pi.denum , address of sec integer: ----------------------- | int num | int denum | ----------------------- ^ ^ | | &pi &(pi.denum) but cast &pi.denum fraction * , seek access ((fraction*)&(pi.denum))->num . since num first fellow member of struct fraction , c standard guarantees address same struct itself. &(((fraction*)&(pi.denum))->num) == (fraction*)&(pi...

UIPageViewController - load it with epub context -

UIPageViewController - load it with epub context - i writing kind of book reader (epub) in ipad app , going utilize uipageviewcontroller. know how read epub question command should utilize display singe page (viewcotroller). thinking webview not sure how gonna fit whole page. truncate should manage display 'unfit' context on next page or automatically scroll page context downwards weird in term of ux. pattern? how generate epub page @your viewcontroller in readers? kind of component needs used? help appreciated maybe can check sample https://github.com/fedefrappi/aepubreader epub uipageviewcontroller

c# - Access Queue from two delegate.BeginInvoke Async Methods Simultaneously -

c# - Access Queue<T> from two delegate.BeginInvoke Async Methods Simultaneously - i'm inexperienced threading , asynchronous processing i'm not sure if i'm doing safe. update: restricted .net 3.5 unfortunately no concurrentqueue (unless someone's implemented .net 3.5 or knows alternative implementation?) update 2: found this approach using source mono implementation of concurrentqueue (which compatible code .net 3.5). i have 1 object who's job manage queue<myobject> internally. class needs operations asynchronously (it running continuously between onstart , onstop events of windows service). anyway, i'll allow code talking: public class myobjectqueuemanager : imyobjectqueuemanager { private bool shouldcontinueenqueuing; private readonly queue<myobject> queue; private readonly imyobjectidentifier myobjectidentifier; public myobjectqueuemanager( imyobjectidentifier myobjectidentifier ) { this.myobjecti...

Android - Layout with images -

Android - Layout with images - i've been working on few days couldn't layout need. have layout similar image below. can guide me ? kind of layout , view should utilize ? thanks :) ive added code generated drawing want in layout editor in eclipse. looks this <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <linearlayout android:id="@+id/linearlayout1" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <linearlayout android:id="@+id/linearlayout2" android:layout_width="fill_parent" android:layout_height="wrap_content" and...

jsf - Why can't I use two date picker components on a dialog? -

jsf - Why can't I use two date picker components on a dialog? - here illustration xpage: i trying set multiple date pickers on dialog box extension library, error... problem submitting area of page when open dialog... tried register widget id==_container id registered i'm not sure why can't done, had luck it. thanks <xp:button id="button1" value="show dialog"> <xp:eventhandler event="onclick" submit="true" refreshmode="complete"> <xp:this.action><![cdata[#{javascript:getcomponent("dialog1").show();}]]></xp:this.action> </xp:eventhandler></xp:button> <xp:button id="button2" value="hide dialog"> <xp:eventhandler event="onclick" submit="true" refreshmode="complete"> <xp:this.action><![cdata[#{javascript:getcomponent(...

ios - Adwhirl iPad Support -

ios - Adwhirl iPad Support - i trying add together adwhirl universal application. there not figure out. while integrating adwhirl universal application, have add together both adwhirl sdk keys app. (as said on tutorials.) there no alternative ipad on adwhirls new application interface. there android , iphone. any suggestions? thanks. assume ipad works same iphone unless otherwise stated. ios ipad adwhirl

Using char for small integer (C++) -

Using char for small integer (C++) - i read 1 can utilize "char" little integers. however, when try, unsigned char = 4; std::cout << << std::endl; it gives character, not 4. what experiencing effects of operator overloading. << operator assumes want print character when hand variable of type char , hence behaves differently expect integral variables. as suggested vivek goel can forcefulness compiler select overload want: unsigned char = 4; std::cout << static_cast<unsigned int>(a) << std::endl; addendum: unless working on environment severely constrained resources (esp. tiny memory), optimising on wrong end. operations on unsigned int typically faster on unsigned char , because processor cannot fetch single bytes has @ to the lowest degree multiple of 4 , mask out other 3 bytes. c++ integer char

android - Periodically pointing api to refresh data. Battery? -

android - Periodically pointing api to refresh data. Battery? - my app periodically refresh info pointing api. right know process every 3 minutes. thats mean every 3 minutes app, points api requests , calculating data. best time value between refreshing points? somewhere ready every 30 minutes. i focusing right on battery life , looking best solution. thanks. exact reply question depends exclusively on how of import "refresh" app work stably. haven't checked c2dm approach. few steps can followed improve performance , battery 1) stop periodic refresh when application in background 2) follow design tips thats been given here. 3) improve give user selection regarding refresh timer 10, 20 , 30 minutes selection in app settings (optional). android api battery

c# - XML Nodes - Searching 1 Node Getting its child nodes -

c# - XML Nodes - Searching 1 Node Getting its child nodes - i tried larn more xml. in application have 1 button, 1 textbox searching head nodes , 1 kid nodes of head node. example: <root> <werk> <titel>so what?</titel> <gattung>pop</gattung> <interpret>pink</interpret> <komponist>max martin</komponist> <entstehungsjahr>2008</entstehungsjahr> </werk> </root> now if searching in first textbox after title -> so what? , how can kid nodes of so what? ? the kid nodes be: pop pinkish max martin 2008 thx trying help me. i think you're bit confused xml. element-node titel has 1 kid node, text-node value of "so what?". element nodes of gattung etc. siblings of titel , not children! c# xml nodes

javascript - Synchonise 2 input fields, can it be done using jQuery? -

javascript - Synchonise 2 input fields, can it be done using jQuery? - can jquery synchronise or re-create text of 1 input field when input modified? example: <input id="input_a" type="text" /> ...if type here <input id="input_b" type="text" /> ... copied here can jquery this? try this: $("#input_a").bind("keyup paste", function() { $("#input_b").val($(this).val()); }); for jquery 1.7+ utilize on : $("#input_a").on("keyup paste", function() { $("#input_b").val($(this).val()); }); example fiddle javascript jquery

How to send data through actionlink in asp.net? -

How to send data through actionlink in asp.net? - in application trying make, have menu in view below: <ul id="menu"> <li>@html.actionlink("create project", "display", "createdisplay")</li> <li>@html.actionlink("open", "about", "home")</li> </ul> where createdisplay name of controller , display method in controller phone call view. but, want display method take parameters username of person. in current view, have obtained username @viewdata["username"] but not able pass these values using actionlink. tried passing parameters <li>@html.actionlink("create project", "display?username="+@viewdata["username"], "createdisplay")</li> but received exception. please suggest ways of doing this. thank much in advance. you need utilize overload accepts parameters route values. see overload...

embedded linux - Using interprocess semaphores in a forked process -

embedded linux - Using interprocess semaphores in a forked process - i testing custom inter-process semaphore implementation semaphore called function, ie, 1 function create semaphore, function take semaphore , on. i forking process , found out utilize same semaphore across parent , kid process, u should create semaphore in shared memory ie: (sem_t *sem = mmap address) but cannot pass sem_t *sem value custom function (it has 1 argument, semaphore name). what can create function run in shared memory space? help welcome. thx. example (from comments): semcreate_custom(char* sem_name) { sem_t sem; struct.semaph_name = sem_name; sem_id = sem_create(sem,1,1); struct.semaph_id = sem_id; //more similar code } semaphore embedded-linux

networking - Disable a network interface in Arch Linux -

networking - Disable a network interface in Arch Linux - i have next problem. pc old , has built in ethernet port doesn't work, not due misconfiguration, think it's physically damaged. didn't work in either ubuntu or on windows. have ethernet pci card 1 use. problem is, odd reason, card works changes eth0 eth1 , have run dhcpd don't ip via dhcp. now, actual question is, there way disable card doesn't work using mac address or something? can't disable either eth0 or eth1 i'm sure it's not "pointing" same card. are same kind of chipset or different ones? if differnt simplest solution blacklist modules ethernet chipset. you first need find module name (this eth0): dmesg | grep eth0 see if have following: [ 2.209295] r8169 0000:05:00.0: eth0: rtl8168d/8111d @ 0xffffc90000c6e000, 00:24:1d:11:b6:64, xid 081000c0 irq 44 in case 'r8169' module name. can see list of loaded modules 'lsmod' check appear...

Android xml listview -

Android xml listview - i retrieving xml info of current info web server , sax parsing listview in application. if number of rows generated small. if list grows big scrolling starts choke. trying understand best method of putting potentially big subset of info listview loads rows required. in fact approach take or need @ method? look lazy , efficient adapter. android xml android-listview scroll

ggplot2 - R boxplot ggplot issues -

ggplot2 - R boxplot ggplot issues - i new in r , trying graphics using ggplot , bit of reverse engineering. have info frame as: > info experiments percentages 1 72.11538 2 90.62500 3 91.52542 4 b 94.81132 5 b 96.95122 6 b 98.95833 7 c 83.75000 8 c 84.84848 9 c 91.12903 because , b similar experiments following data$experiments[data$experiments == "b"] = "a" if now ggplot(data, aes(x = experiments, y = percentages)) + geom_boxplot() i 1 box a, 1 c still label b! is there way of getting rid of b on x axis? thanks lot help i'm guessing experiments in data factor. if run str(data) , imagine experiments factor 3 levels: a, b, , c. default, strings turned factors when info frame created. the thought of factors represent set of possible values, if not possibilities in actual data....

css - Styling a form where the input fields have implicit labels (wrapped in labels) -

css - Styling a form where the input fields have implicit labels (wrapped in labels) - given html form this: <form action='/example/' id='example_form' method='post' name='example_form'> <fieldset> <legend>example form</legend> <label for='age'> age <input id='age' name='age' tabindex='1' type='text' /> </label> <label for='gender'> gender <select id='gender' name='gender' tabindex='2'> <option disabled='disabled' id='gender' name='gender' value=''>choose one:</option> <option id='gender_female' name='gender' value='female'>female</option> <option id='gender_male' name='gender' value='male'>male</option> </select> </label>...

Queue implementation program in C -

Queue implementation program in C - ive started c , i'm trying queue implementation programme book isn't working. giving error function qfull , qempty undefined. after declaring function still giving more errors. #include <stdio.h> #include <process.h> #include <conio.h> #define queue_size 5 void main() { void insert_rear(int, int *, int *); void delete_front(int *, int *, int *); void display(int *, int, int); int choice, item, f, r, q[10]; /* queue empty */ f = 0; /* front end end of queue*/ r = -1; /* rear end of queue*/ (;;) { clrscr(); printf("\t\t\t ordinary queue operation\n\n"); printf("\t\t\t 1 …. force / insert\n"); printf("\t\t\t 2 …. pop / delete\n"); printf("\t\t\t 3 …. view / display\n"); printf("\t\t\t 4 …. exit\n\n\n"); printf("\t\t\t come in selection : "); scanf("%d", ...

json - How to handle RPCs in client-server PlayN game? -

json - How to handle RPCs in client-server PlayN game? - i'd utilize playn create client/server card game, e.g. hearts. while i'm focusing on html5 output, i'd ideally output-platform-agnostic in case decide create android client in future. how should approach rpc mechanism? these options i've thought of: use json rpcs get()/post() methods - write servlet accepts/returns json, , create versions of client code utilize that. seems doable, i'm concerned json's verbosity. 1 time hearts working i'd move on more complex games, , i'm worried json result in lot of much-larger-than-necessary messages beingness passed , forth between client , server. don't know how work json in java, assume doable. assumptions in-line? how java work json? continue using gwt-rpc. can taking asynchronous service interface in core (platform-agnostic) constructor, , in html main() pass in gwt async interface generated gwt.create(myservice.class) (or @ to ...

windows phone 7 - Why can't I find the MessageBox class in XNA? -

windows phone 7 - Why can't I find the MessageBox class in XNA? - i maintain reading tutorials of how utilize in silverlight apps, need in xna. tutorials refer bundle microsoft.xna.framework.gamerservices, there no such class... what getting wrong? you're not going want show message box class via xna unless displaying type of scheme type message. if you're planning on communicating via game player, you'll want roll own can theme appropriately match game. otherwise, above reply using gamerservices correct, that's how display messagebox via xna again, should restrict usage of class purely scheme type messages (e.g. "you must signed in purchase game.") windows-phone-7 xna

iphone - Getting all resources with a name starting with 001XXX.jpg -

iphone - Getting all resources with a name starting with 001XXX.jpg - i'm developing iphone , ipad application latest sdk , xcode 4.2. i want retrieve path resources name start 001. name 001xxx.jpg (xxx unknown). don't know how many resources are. for example, have bundle in app next files: 001001.jpg 001002.jpg 001003.jpg i want nsarray path each of 3 files. you can in 2 steps: use nsbundle pathsforresourcesoftype:indirectory: method retrieve png files. use nsarray filteredarrayusingpredicate: method filter out pattern want. the code (not tested) like: nsarray *files = [[nsbundle mainbundle] pathsforresourcesoftype:@"png" indirectory:@"."]; nspredicate *pred = [nspredicate predicatewithformat:@"self beginswith[c] '001'"]; nsarray *images = [files filteredarrayusingpredicate:pred]; iphone objective-c ios filepath

Tree traversal in Java -

Tree traversal in Java - i studying job interview , reviewing trees, have no problem when traversing them got question haven't been able figure right reply to: write function returns node in tree given 2 parameters: pointer root node , inorder traversal number of node want return. info stored in tree number of children each node. so far, haven't been able figure why care of info stored in tree (the number of children). other if assume there's tree such: 5 4 7 3 1 4 then inorder traversal 341547 but can't figure out code homecoming node want (for sake of argument i'm assuming inorder traversal number 2 - meaning want node of value 1). i tried doing recursive traversal end screwing inner counter had tried different approach , tried set on stack can't figure how correctly so. far have: public int findnode(root, position){ stack<integer> s = new stack<integer>(); cnode = root; //cnode = current node ...

uitableview - iOS tableview: Grouping rows into sections -

uitableview - iOS tableview: Grouping rows into sections - i'm displaying dynamic list of names in table view, , i'm trying split them sections according first letter of name... i've created array alphabetical list of letters charindex = [[nsmutablearray alloc] init]; for(int i=0; i<[appdelegate.children count]-1; i++) { // person kid *achild = [appdelegate.children objectatindex:i]; // first letter of first name nsstring *firstletter = [achild.firstname substringtoindex:1]; nslog(@"first letter: %@", firstletter); // if index doesn't contain letter if(![charindex containsobject:firstletter]) { // add together index nslog(@"adding: %@", firstletter); [charindex addobject:firstletter]; } } and i've set number of sections , title - (nsinteger)numberofsectionsintableview:(uitableview *)tableview { // set number of sections in table match number of first letters ...

java - Subtract a date by 1 or 2 in groovy -

java - Subtract a date by 1 or 2 in groovy - i need date subtracting number current date in mm/dd/yyyy format i got current date using new date().format("mm/dd/yyyy") please help me function subtracts 1,2 above date , produces date in mm/dd/yyyy format i have tried def today = new date().format("mm/dd/yyyy") def yesterday = today -1 println today println yesterday which gives me 01/11/2012 0/11/2012 you subtracting string try: def today = new date() def yesterday = today - 1 println today.format("mm/dd/yyyy") println yesterday.format("mm/dd/yyyy") java groovy

Rendering layouts/partials includes HTML tags in text after transitioning from Rails 3.0.x to 3.1 -

Rendering layouts/partials includes HTML tags in text after transitioning from Rails 3.0.x to 3.1 - i'm trying transition application 3.0.7 3.1. i've moved around assets app/assets directory , thought have configured correctly. my problem layout file won't correctly render partials , other layout files. if have within layout <%= yield %> correctly renders view files. but if seek render layout file within layouts/omega/application.html.erb like: <%= render "layouts/omega/head" %> <%= yield %> then dumps html onto page of elements , html tags included in text: <div id="top-pane"> <div class="center-content">..... "some text correctly displayed view file called through yield" if seek render file, in home/index.html.erb: <p> home/index </p> <%= render 'omega/test' %> then output be: "this home/index <p> test layout </p> ...

ruby on rails 3 - RoR 3.0.9 - Passing a variable from routes.rb to application_controller.rb or viceversa -

ruby on rails 3 - RoR 3.0.9 - Passing a variable from routes.rb to application_controller.rb or viceversa - i have multi site project changes 1 changing 2 variables, 1 within routes.rb , other in application_controller.rb. possible pass variables between these files have alter parameter accomplish alter required? on routes.rb file utilize variable assign right controller routes should use. example: def showsite "mysite1" end root :to => "#{showsite}#index" and on application_controller.rb utilize same parameter domain of site, layouts should utilize , things. example: before_filter :set_defaults def showsite "mysite1" end def set_defaults if "#{showsite}" == "mysite1" @domain = 'mysite1.com' elsif "#{showsite}" == "mysite2" @domain = 'mysite2.com' else @domain.nil? end end def special_layout "#{showsite}" end every time want show differ...

chrome javascript dom remove iframe backgroundimage -

chrome javascript dom remove iframe backgroundimage - i've been messing iframe chrome extensions , seem running lot of issues iframes. anyways, have iframe injected website(cross-domain). i'd iframes background image inherit parents page background(so blends in). trying: //setup iframe attributes iframe.setattribute("id","injected_frame"); iframe.setattribute("src", 'google.com'); iframe.setattribute("width","100%"); iframe.setattribute("height","425"); iframe.setattribute("frameborder","0"); iframe.setattribute("scrolling","auto"); iframe.setattribute("style","backgroundimage: inherit"); <-- undefined error basically doesn't work, background stays same , undefined error when trying this. you alter "backgroundimage: inherit" "background-image: inherit" , other inline styles on iframe may lost be...

Switching from C# to C++. What's wrong with my code? do I NEED headers for what I'm trying to do? Class definitions within one file issue -

Switching from C# to C++. What's wrong with my code? do I NEED headers for what I'm trying to do? Class definitions within one file issue - i've been programming in c# few years now, first language. i'm trying brush on c++ because working on coded in that. what wrong code: (i know there might lot of things wrong. c++ different c# in needs). told me don't know how declare classes correctly in c++, , need define classes using headers. need headers? little programme test , know if can accomplished without it. , missing headers issue here? had error not beingness able access parse in company, when add together public in front end of company class name, throws more errors. augh! frustrating. #include "std_lib_facilities.h" using namespace std; class employee { public: string screen_name; string real_name; string current_job; int employee_number; employee(int no, string name1, string name2, string current_jobin) { ...

.net 4.0 - Why potentially dangerous request error even ValidateRequest = false -

.net 4.0 - Why potentially dangerous request error even ValidateRequest = false - here default.aspx <%@ page language="c#" autoeventwireup="true" codefile="default.aspx.cs" inherits="_default" validaterequest="false" %> <html> <head runat="server"> <title>xss demonstration</title> </head> <body> <form id="form1" runat="server"> <div> looking feedback. <asp:textbox id="txtfeedback" runat="server" textmode="multiline" /> <br /> <asp:button id="submit" runat="server" text="submit" onclick="submit_click" /> <br /> comment: <br /> <asp:literal id="ltlfeedback" runat="server" /> </div...

unpack war file after maven clean package -

unpack war file after maven clean package - i utilize maven-assembly-plugin create war file under [app-root]/target/my-project-war. how unpack war file becomes folder under application root [app-root]/war? the reason want war folder instead of target/**.war can utilize mvn gae:deploy deploy straight app engine. gae:deploy maven-gae-plugin , confirguration allows me specify appdir, not war file. pom.xml <plugin> <groupid>net.kindleit</groupid> <artifactid>maven-gae-plugin</artifactid> <version>${gae.plugin.version}</version> <configuration> <unpackversion>${gae.version}</unpackversion> <serverid>appengine.google.com</serverid> <sdkdir>${gae.home}</sdkdir> <appdir>${basedir}/war</appdir> <splitjars>true</splitjars> </configuration> </plugin> <plugin> <gr...

asp.net mvc 3 - IE9 bug with Html.DropDownListFor -

asp.net mvc 3 - IE9 bug with Html.DropDownListFor - hello need help bug in net explorer 9. developing crud screens in asp.net 4 mvc 3 razor. in multiple screen utilize @html.dropdowlistfor create easy links foreign keys. but when few these in ie9 (and ie9) dropdownlist rendered smaller usual size, text displayed few pixels lower normal, , if word displayed larger little amount of characters(not sure number, think it's 10) not rendered. weird part when click on dropdownlist prepare itself. the view code: @html.dropdownlistfor(model => model.asset.fkassettypeid, new selectlist(model.assettypes, "assettypeid", "name")) @html.validationmessagefor(model => model.asset.fkassettypeid) the model code: [display(resourcetype = typeof(i18n_asset), name = "label_asset_fkassettypeid")] public int fkassettypeid { get; set; } anybody have experience issue, , know way prepare this? give thanks help. i have found problem was, usi...

java - Mockito - verifying a stub -

java - Mockito - verifying a stub - i have stub used across different test cases , need verify methods not called in of these test cases. the problem i'm having mocks through mockito.mock() calling methods have no effect. so, can somehow mock stub method calls executed should , @ same time logged can verified? i think looking spies. see here: http://mockito.googlecode.com/svn/branches/1.7/javadoc/org/mockito/mockito.html (#13 in list). java unit-testing mockito

c# - Why windows media player is not closing with player.Close() method? -

c# - Why windows media player is not closing with player.Close() method? - i creating media player object in simple console application, play file. though media player getting launched successfully, when using close() method, process still runs , media player window not close. needs done? here code wrote.. windowsmediaplayer player= new windowsmediaplayer(); player.openplayer("c:\\abc.wmv"); thread.sleep(2000); player.controls.stop(); player.close(); here process doesn't exit , file still keeps running. how can close application? the automation interface doesn't have way forcefulness player exit. less ideal approach kill it: var prc = process.getprocessesbyname("wmplayer"); if (prc.length > 0) prc[prc.length - 1].kill(); the improve mouse trap embed player own gui, easy winforms. c# windows-media-player wmplib

xcode4 - Can you add a build product from a different project as a bundle resource in XCode? -

xcode4 - Can you add a build product from a different project as a bundle resource in XCode? - i have 2 projects in xcode workspace. add together build product of project b bundle resource in project a. have configured scheme of project build project b first. there proper way besides adding build product of project b file system? the same question answered here: http://stackoverflow.com/a/7118177/470225. isn't perfect solution, working me. can add together 'run script' build phase re-create resources bundle app binary. here script: cp -r -f $built_products_dir/mybundle.bundle $built_products_dir/$contents_folder_path/ xcode xcode4

sql - Can STWithin or STContains be used to update columns based on point within polygon relationship? -

sql - Can STWithin or STContains be used to update columns based on point within polygon relationship? - given next tables: create table #usgs_24k_topomap_boundaries( [objectid] [int] not null, [area] [numeric](38, 8) null, [perimeter] [numeric](38, 8) null, [qd24k_grsm] [numeric](38, 8) null, [qd24k_gr_1] [numeric](38, 8) null, [quadid] [numeric](38, 8) null, [centlat] [numeric](38, 8) null, [centlong] [numeric](38, 8) null, [name] [nvarchar](35) null, [state] [nvarchar](2) null, [latlong] [nvarchar](9) null, [ohio_index] [nvarchar](8) null, [grid60] [nvarchar](5) null, [reviewed] [int] null, [corrected] [int] null, [verified] [int] null, [globalid] [uniqueidentifier] not null, [shape] [geometry] null) and create table #tbl_locations( [objectid] [int] not null, [fcategory] [varchar](16) null, [mapmethod] [varchar](4) null, [herror] [varchar](50) null, [mapsource] [varchar](255) null, [sourcedate] [...

ruby on rails - Reprocessing images in Carrierwave -

ruby on rails - Reprocessing images in Carrierwave - let's model has image :thumb , client wants :tiny , :nano thumbnails. how reprocess existing images using rake task? i've found rask thought https://gist.github.com/777788 it's giving me errors. according carrerwave documentation can utilize next commands: model.all.each |model| model.image.recreate_versions! end ruby-on-rails ruby-on-rails-3.1 rake carrierwave

ruby - Why does the puts method behave strangely when used in a thread? -

ruby - Why does the puts method behave strangely when used in a thread? - solution: in .irbc file, put: irb.conf[:use_readline] = false i running ruby code: thread.new loop = @queue.pop puts "1" puts "2" end end when run in irb, , queue pops, print "1", doesn't print "2" right away. have press come in couple of times before spits out "2". why that? here's irb log: >> thread.new ?> loop ?> = @queue.pop >> puts "1" >> puts "2" >> end >> end => #<thread:0x10ae6d1a0 sleep> >> @queue << "something random" 1=> #<queue:0x10aed6420> >> ?> ?> ?> 2?> here's get: >> require "thread" => true >> ?> @queue = queue.new => #<queue:0x101bc9a60> >> ?> thread.new ?> loop ?> = @queue.pop >> puts "1 printed @ #...

How to display yesterDay (with respect to Date, but not time interval of 24 hours) visited items in iPhone objective c -

How to display yesterDay (with respect to Date, but not time interval of 24 hours) visited items in iPhone objective c - i have table view contacts. in when select contact contact has added in table:recentstable. visited items. purposs have used code this, it's working but. in case of yesterday cosidered 24 hours. iwant display yesterday items when ever date changed automatically added in yesterday's list. please guide me. nsdate *date = self.lastviewed; double time = [date timeintervalsincenow]; nsstring *tmpvalue = nil; time *= -1; if(time < 3600*24) { tmpvalue = @"today"; } else { int div = round(time / 60 / 60 / 24); // want solution wth respect yesterday's date date not follows if(div == 1) tmpvalue = @ "yester day"; i...

debugging - Does Qt offer a (guaranteed) debug definition? -

debugging - Does Qt offer a (guaranteed) debug definition? - does know officially supported way include debug-build code in qt? example: #ifdef qt_debug // #endif basically q_assert more complex tests. i can't seem find documentation says qt framework guarantees define debug macro. if there isn't, sensible unofficial way implement feature project wide? qt defines qt_no_debug release builds. otherwise qt_debug defined. of course of study free specify defines in .pro files , scope them either debug or release . debugging qt definition

IBM Websphere Portal Page Caching -

IBM Websphere Portal Page Caching - i using websphere portal server 7. want disable caching of portlet, how can ? can 1 guide me ? there no way disable portlet caching in ibm websphere portal 7. feature of ibm portal server. however, can utilize portlet events override cached data. (note : reached solution after getting pmr response ibm). websphere websphere-portal

sql - What is the task of this oracle operator -

sql - What is the task of this oracle operator - create or replace view v_dim_prcprojectsppmse select 'project' parent, 'prjcate_' || listitemid child, ... myview what operator '||' above mean , how named? || string concatenation. in c# + in vb & . 'aaa' || 'bbb' ==> 'aaabbb' sql oracle

ruby - Is there a way to use Bundler for production gems? -

ruby - Is there a way to use Bundler for production gems? - i tried searching several times, if question has been answered didn't find it. so, let's i've developed plain old gem (not rails app). know how utilize bundler development, have gemfile , in repository. however, want gem utilize bundler dependency resolution when install it, not when work on it. is there way so, or have resort running commands git checkout bundle exec? bundler resolves dependencies not development. run bundle install on production server after deployment , install needed gems there too. if need install gems several repositories, add together row in gemfile: source 'http://you_repository.com ruby bundler

java - Tomcat request.getParameter("_xmldata") takes 25second for 30MB data -

java - Tomcat request.getParameter("_xmldata") takes 25second for 30MB data - i have clients need post 30mb of xml data. info in binary form , heavily encrypted. client nail servlet running on tomcat, info via servlet request.getparameter("_xmldata"); the problem is, takes around 25seconds move 30mb info string variable. in head, there 2 questions: 1) why case? 2) there anyway can improve this? (apart getting user send via ftp / ssh) server environment:- cpu: quad core xeon 5540 server memory: 4gb tomcat heap: 2gb harddisk : 500gb i'm going wager guess getparameter method still waiting on necessary info within request received. confirm monitoring server wireshark. all required http request headers have been received, plenty server start processing request. 1 time phone call getparameter , still waiting entire "field" received. check bandwidth between client , server. highly uncertainty it's cpu issue (n...

javascript - Can I rely on attach order while handling events? -

javascript - Can I rely on attach order while handling events? - as far remember, in pure w3c event model (that means, using addeventlistener), there no guarantee event handlers invoked in order have been attached. what jquery event model. can rely on order of attaching events? careful while answering, since there can 3 options here, not two: you can not rely on order of attaching events, can see jquery code. you can rely on order of attaching events in current implementation, but, actually, nobody promiss supported in future, since order preserving unintentional. you can rely on order of attaching events - implemented willingly , remain forever, since intuitive , helps utilize mutual patterns, resource preinitialization , on. if attach handlers through jquery, fired in order in attached. documented on bind method: when event reaches element, handlers bound event type element fired. if there multiple handlers registered, execute in order in bound. after handl...

c# - Handling LinkClicked event for the richtextbox; the code runs twice inside the event handler -

c# - Handling LinkClicked event for the richtextbox; the code runs twice inside the event handler - i've windows form richtextbox in it.there link when clicked triggers linkclicked event handler like, private void textsampleresults_linkclicked(object sender, linkclickedeventargs e) { callsomemethod1; callsomemethod2; } when started debugging, expecting code within event handler run 1 time started calling callesomethod1 , callsomemethod2 again.in summary, every click, code under event handler executed twice. expected? how create behave code under event handler gets executed once? c#

asp.net mvc and routing -

asp.net mvc and routing - i have next actions in controller public actionresult index(int? pagenumber) public actionresult details(string seofriendlyname) and want have next routes: ~/article/ -> action = index, pagenumber = 1 ~/article/page-5 -> action = index, pagenumber = 5 ~/article/page-1 -> ~/article/ ~/article/foo -> action = details, seofriendlyname = foo i've tried define next routes, doesn't work: routes.maproute( null, "article/page-{pagenumber}", new { controller = "mycontroller", action = "index", pagenumber = 1 }, new[] { "mynamespace" } ); routes.maproute( null, "article", new { controller = "mycontroller", action = "index", }, new[] { "mynamespace" } ); routes.maproute( null, "article/...

noclassdeffounderror - ClassNoDefFoundError while running a junit test which is instrumented using TPTP probekit agent -

noclassdeffounderror - ClassNoDefFoundError while running a junit test which is instrumented using TPTP probekit agent - i've been dealing error message while , nobody has been able help me... i trying probe java application using standalone tptp probekit agent next linux command: java '-agentlib:jpibootloader=jpiagent:server=standalone;probekitagent:ext-pk-bcilibraryname=bciengprobe,ext-pk-probescript=ome/anis/qf-t/core/probe/testprobe.probescript' junit.textui.testrunner quickfix.test.acceptance.acceptancetestsuite my application junit testcase quickfixj bundle (quickfixj.org)... running above command, probing starts , able see runtime traces. however, @ point during execution getting runtime exception: java.lang.noclassdeffounderror: testprobe_probe$probe_0 25-jan-2012 10:25:11 quickfix.test.acceptance.atserver run severe: error in @ server java.lang.noclassdeffounderror: testprobe_probe$probe_0 @ com.sun.org.apache.xerces.internal.jaxp.do...

iOS: Memory Leak -

iOS: Memory Leak - in utilities class, have next method: + (division *) getnationaldivision { partition *defaultdivision = [[[division alloc] init] autorelease]; defaultdivision.id = 0; defaultdivision.name = @"national"; homecoming defaultdivision; } i have partition allocted in app delegate store partition throughout app, in 1 of view controllers have: appdel.currentdivision = [[utilities getnationaldivision] retain]; in app delegate .h have: @property (nonatomic, retain) partition *currentdivision; in app delegate .m have: currentdivision = [[division alloc] init]; when analyze, potential leak of object points above line. ideas? if dont retain national division, doesnt work. also, note, works fine. want create sure not leaking something. check how declare property currentdivision in app delegate. if assign (which suppose, since retaining before assigning through property) original value assigned it: curr...

osx - os x lion: git can't find libcrypto.so.0.9.7 -

osx - os x lion: git can't find libcrypto.so.0.9.7 - background: i've replaced hard drive, , done fresh install of lion. installed git source , make test seemed fine. ssh keys loaded , can ssh remote box without problem. problem: i next error when trying pull on ssh when using scp style syntax: $ git pull origin master git-upload-pack: error while loading shared libraries: libcrypto.so.0.9.7: cannot open shared object file: no such file or directory my .git/config origin looks this: [remote "origin"] url = me@example.com:some_repo.git fetch = +refs/heads/*:refs/remotes/origin/* if alter url ssh://me@example.com/path/to/some/repo.git works fine. i recognize alter urls format, i'd rather have scheme works correctly without having work around setup issues every time. i able force , pull repo fine before reinstalling lion, , still can different syntax. suspect symlinked work around on old hard drive way in snow-leopard days, i...

search - Java calling Active Directory using Apache Directory's LDAP API -

search - Java calling Active Directory using Apache Directory's LDAP API - i'm trying connect active directory activiti, using apache directory's ldap api. think i've managed authenticate user, subsequent queries users finds nothing. here's java code: package com.abc.activiti.ldap; import org.activiti.engine.activitiexception; import org.activiti.engine.identity.user; import org.activiti.engine.impl.page; import org.activiti.engine.impl.userqueryimpl; import org.activiti.engine.impl.persistence.entity.userentity; import org.activiti.engine.impl.persistence.entity.usermanager; import org.apache.directory.ldap.client.api.ldapconnection; import org.apache.directory.ldap.client.api.exception.ldapexception; import org.apache.directory.ldap.client.api.message.bindresponse; import org.apache.directory.ldap.client.api.message.searchresponse; import org.apache.directory.ldap.client.api.message.searchresultentry; import org.apache.directory.shared.ldap.cursor.curso...