Posts

Showing posts from June, 2015

php - work with PHP_SELF -

php - work with PHP_SELF - it give me error : undefined index: action in line : $act=$_post['action']; <?php function_2() { ?> <form name="poll" method="post" action="<?php echo $_server['php_self']; ?>"> <input type="hidden" name="action" value="insert"> . . . </form> <?php } $act=$_post['action']; switch($act) { case "insert": function_1(); break; default: fuction_2(); break; } ?> please help me it. that error saying $_post['action'] doesn't exist. so, need conditional statement set value of $act. // set default $act = ''; if ( isset($_post['action'])) ) { $act = $_post['action']; } switch($act) { case "insert": function_1(); break...

aptana - How to add white spaces inside parenthesis when editing a PHP Formatter Profile? -

aptana - How to add white spaces inside parenthesis when editing a PHP Formatter Profile? - i know how add together white spaces within parenthesis, when editing php formatter profile on aptana studio 3. i enjoy using style: if ( $var == 3 ). but, while editing profile, wasn't able find alternative that. this 1 have ticket deal - see http://jira.appcelerator.org/browse/apstud-1712 1 time implemented, able command spaces before , after parenthesis (and type of parenthesis). cheers php aptana code-formatting

SQL Server: Select minimum between two values in a SUM -

SQL Server: Select minimum between two values in a SUM - i'd appreciate if help me sql statement. have this: select sum(datediff(second, [date1], [date2])) [mytable] <condition> but need refine selection, i.e. if difference between dates greater @maxdiffsecs @maxdiffsecs should used addition instead. tried looking min operator has 1 parameter, i'd expect @ to the lowest degree 2 minimum of. well, anyway, in advance. (i guess can tell i'm not efficient @ sql :) select sum( case when datediff(second, [date1], [date2]) > @maxdiffsecs @maxdiffsecs else datediff(second, [date1], [date2]) end) [mytable] <condition> this off top of head, not sure if case works within sum if syntax not work utilize cte with valuestosum ( select case when datediff(second, [date1], [date2]) > @maxdiffsecs @maxdiffsecs else datediff(second, [date1], [date2]) end thevalue [mytable] <condition> ) select sum(thevalue) ...

c - thread stack pointer -

c - thread stack pointer - in linux 2.6.32-32, there way find next info thread programmatically in pthreads program? need: run count, stack pointer, stack start/end, stack size, stack usage. threadx, guess, within program. thanks. pthread_getattr_np() should give pthread attributes of thread pthread_attr_getstack() returns stack address , size i don't know mean run count. for stack pointer of thread different current 1 might need utilize ptrace. 1 time have it, can utilize maths determining how much of stack used. for obtaining own stack pointer can along lines of: mword sp; asm volatile ("mov %esp, $0" : "=r"(sp)); c pthreads threadx

c# - Using TryParse with a double shows an overload error? -

c# - Using TryParse with a double shows an overload error? - i writing programme , using double.try parse check if string numeric. class game{ // declares class private static string[,] board = new string[3, 3]{ {" ", " ", " "}, // top row {" ", " ", " "}, // middle row {" ", " ", " "} // bottom row }; private static void print(){ system.console.writeline("\n {0} | {1} | {2} ", board[2, 0], board[2, 1], board[2, 2]); system.console.writeline("------------"); system.console.writeline(" {0} | {1} | {2} ", board[1, 0], board[1, 1], board[1, 2]); system.console.writeline("------------"); system.console.writeline(" {0} | {1} | {2} \n", board[0, 0], board[0,...

matlab warning conflict name -

matlab warning conflict name - % name of excel file filename = 'directory\output.xls'; % name of sheet wan delete sname='corner'; % open excel com automation server excel = actxserver('excel.application'); % open excel workbook workbook = excel.workbooks.open(filename); %get handle sheet hsheet=excel.sheets.item(sname); hsheet.delete % save/close/quit/delete workbook.save; excel.workbook.close; invoke(excel, 'quit'); delete(excel) above code work on other filename not file wish delete...why? warning below: warning: function directory\norm.m has same name matlab builtin. suggest rename function avoid potential name conflict. however, norm.m not function, script , result of norm.m output.xls...how can solve it? there's matlab function called norm comes matlab. if rename file else, stop complaining. on other hand, shouldn't brake programme either. should still work, warning. has nil file you're try...

m2eclipse - Include older m2e plugins with m2e 1.0+ using life-cycle mapping? -

m2eclipse - Include older m2e plugins with m2e 1.0+ using life-cycle mapping? - i want enable older plug ins not available in m2e v 1.0 i have added pom not work if there multiple items. <pluginmanagement> <plugins> <plugin> <groupid>org.eclipse.m2e</groupid> <artifactid>lifecycle-mapping</artifactid> <version>1.0.0</version> <configuration> <lifecyclemappingmetadata> <pluginexecutions> <pluginexecution> <pluginexecutionfilter> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-dependency-plugin</artifactid> <version>[0.0.0,)</version> ...

Multiple search parameters in PHP -

Multiple search parameters in PHP - i have form allows several different search alternative inputs. such text boxs , drop downs. of search waiting search request , seeing if there character input in various text boxes or drop downwards alternative selected. basically branches of conditional logic using if statements modifying sql statement depending chosen. how can create supports single options or several linked together? example of current condititional logic $sql = "select "; if(strlen($_request['option1']) > 0) { $sql .= "* table option1 = {$_request['option1']} "; } if(strlen($_request['option 2']) > 0) { $sql .= "* table option2 >= {$_request['option2']}"; i understand need utilize , in sql query. tried arrays of options looping through depending on boolean state didn't work put clauses in array implode or or and: $sql .= implode(...

gnu - How to open a .bat (batch file) in gcc (ex cygwin)? -

gnu - How to open a .bat (batch file) in gcc (ex cygwin)? - how open batch file .bat file in gcc compiler ? command open ? utilize gcc c programs compile. command open .bat file ? can open if how? just run system("example.bat"); hope resolve problem cygwin gnu

python - Printing Request debug information on a Java Servlet -

python - Printing Request debug information on a Java Servlet - i find extremely useful when doing django/python web development inspect http request this: logger = logging.getlogger(__name__) def index(request): logger.info(request) is there similar java servlet? public void doget(httpservletrequest request, httpservletresponse response) throws servletexception, ioexception { // debuginfo should print similar in django debuginfo(request); } since got no answers, i wrote little helper class help me issue. hope else finds interesting , useful. java python django java-ee servlets

objective c - How to remove previous ViewController? -

objective c - How to remove previous ViewController? - seeking help. my project: create book children. every page custom viewcontroller. on every page have button next , previous page. when nextpage-button pressed "switch"/add viewcontroller in appdelegate this: - (void)gotonextpage2 { self.view2 = [[viewcontroller2 alloc] init]; view2.view.frame = cgrectmake(769, 0, 768, 1024); [window addsubview:view2.view]; [uiview beginanimations:nil context:null]; [uiview setanimationcurve:uiviewanimationcurveeaseinout]; [uiview setanimationduration:0.5]; view2.view.frame = cgrectmake(0, 0, 768, 1024); [uiview commitanimations]; } how , remove previous viewcontroller? in case viewcontroller1. idea? thanks in advance planky you didn't provide much information... anyway, might help. in animation code: [uiview setanimationdelegate:self]; [uiview setanimationdidstopselector:@selector(animationdidstop:finished:context:)]; and add together remove viewcontro...

silverlight - Force reevalution of guard methods in Caliburn Micro -

silverlight - Force reevalution of guard methods in Caliburn Micro - i have itemscontrol has move up, move down, , delete button in each item (via template). itemscontrol source binds collection of items model datacontracts/pocos (not vms). i've attached caliburn message handler in main page's view model. <button cal:message.attach="moveup($datacontext)" >up</button> <button cal:message.attach="movedown($datacontext)" >down</button> i believe had explicit cal:message.attach , not rely on convention because within itemtemplate. view model: observablecollection<item> mycollection = new observablecollection<item>(); //item class simple -- has string name property public bool canmoveup(item item) { var index = mycollection.indexof(item); homecoming index > 0; } public void moveup(item item) { var index = mycollection.indexof(item); if (i...

web applications - Generating a XAP file -

web applications - Generating a XAP file - i'm developing sl4 project, , seem have made bobo. working on project , realized deleted shouldn't have, got specific alter set knew had right code set, that's problems started. went through whole mess of fixing error after error popped coming newest version, , think i'm close finished come realize there no .xap file, nor clientbin folder, , within of bin folder there no release or debug subfolder. i'm sorta new , i've been googling while have come no results on how create one, , don't think want go , older alter set re-create because i'm sure i'll have go through errors coming before. anyone know do? web-applications silverlight-4.0 xap

sqlite - setting up server for an iphone app -

sqlite - setting up server for an iphone app - super basic question - building iphone app need set computer server app can send info computer. first steps need take? thanks! if writing iphone app on macbook can enable apache in scheme preferences, click sharing, enable web sharing show computers ip address can nail on web browser. that set web server on machine. since emulator , web server on same wifi network , if deploy device can have on wifi network should able post info mac's web server. if passing info you'll need read 'web services', rest web services. suggest reading php and/or ruby or python programming language interpret posting web service. hope helps on way. if not on mac can't develop iphone app anyways ;) above strategy should work you. iphone sqlite

php - JavaScript regular expression to replace HTML anchors -

php - JavaScript regular expression to replace HTML anchors - i got html string , want convert special tags else. need tinymce plugin. tried alter wordpress wpgallery plugin. for example: these in html string <a href="http://www.yahoo.com">yahoo</a> <a href="http://www.google.com">google</a> <a href="#" rel='special' title='link cat_id="4" content_id="5" content_slug="slug 1"'>some else</a> here have find special link 1 , convert else it's title value like: {link cat_id="4" content_id="5" content_slug="slug 1"} i need homecoming value insert mysql <a href="http://www.yahoo.com">yahoo</a> <a href="http://www.google.com">google</a> {link cat_id="4" content_id="5" content_slug="slug 1"} i tried function getattr(s, n) { n = new r...

jsp - URL rewrite in tomcat web.xml -

jsp - URL rewrite in tomcat web.xml - i automatically redirect requests http://mysite.com http://mysite.com/somepage i able apache next rule: rewriterule ^/$ /somepage [r] however, of servers not run on top of apache, tomcat. how implement equivalent in web.xml? somepage struts2 action. if using tomcat lone instead of apache modrewrite, best approach install rewrite filter , reference web.xml. 1 filter have used in past urlrewritefilter tuckey.org (http://www.tuckey.org/). it on google code @ http://code.google.com/p/urlrewritefilter/source/browse/trunk/src/test-web/web-inf/urlrewrite.xml. last update in oct 2010, remember working fine. config files xmlish, not nice 1 liners utilize in modrewrite. jsp tomcat servlets url-rewriting friendly-url

math - Add after a certain number in PHP -

math - Add after a certain number in PHP - i have project has set cost amount of hours, need add together more money overall total each hr after 5. my script calculated time counting hours: which outputs like, "15" or "9.5" or "3.5" or "7" etc. let's 5 hours £50, how add together additional £15 every hr on 5 hr limit. this includes if user going on ".5" (so 5.5 hours £65 , 6 £65) any help great, thanks! subtract 5 number of hours, ceil() / round() number , multiply 15? ceil() if want any part of hr charged, whereas round() if want charge if fraction of hr .5 or higher. $hours = 5.5; $amount = 50 + ceil(max(0,$hours-5)) * 15; # 65 php math

android - my layout won't layout right -

android - my layout won't layout right - i have tablelayout won't behave , i'm not sure i'm doing wrong or not doing right here layout file <tablelayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/wall_paper" xmlns:android="http://schemas.android.com/apk/res/android"> <tablerow android:layout_weight="1" android:paddingtop="25dp"> <linearlayout android:orientation="horizontal"> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/name" android:textcolor="@color/nb_text" android:layout_marginleft="20dip"/> <edittext android:id="@+id/name" android:layout_width="150dp" android:layout_height="wrap_conten...

navigation - javascript noob... document write -

navigation - javascript noob... document write - i'm trying utilize javascript load more links in my nav bar. this tried; wanted 1 link in nav load more beneath it. <a href="" onclick="show()"/>collections</a> <script type="text/javascript"> function show() { document.write("collection 1 <br /> collection 2 <br /> etc... <br />"); } </script> can suggest relevant tutorial or give me hint? document.write should used while document loading. calling after document loaded clear current document , write new content. add together new content page, need create new dom objects , add together them page or modify existing dom objects. here's little illustration of modifying page can see in action here: http://jsfiddle.net/jfriend00/zvs39/ html: <a href="#" onclick="show()">collections</a> <span id="moretext"></span> ...

jquery - Hiding a div with two styles classes added to it -

jquery - Hiding a div with two styles classes added to it - i have div 2 classes added , want hide div(and div doesn't have id). for e.g. <div class="class1 class2"> hello!! </div> can please suggest how can achieved? thanks that's pretty easy: $('div.class1.class2').hide(); note select all matching divs. if want select single 1 need utilize more specific selector or id. jquery

memory - Managing caches within your android application -

memory - Managing caches within your android application - i new android , wondering right way manage , set maximum limit application's info storage. instance, have image cache , database file information. not want potentially become extremely big. there built in way android provides can manage size of how much info stored? again i don't think so. have manually that. image cache have database , cache folder. so, there no custom method or class utilize set limits db or folder. android memory memcached

python - creating folders with correct permissions django uploads -

python - creating folders with correct permissions django uploads - when uploading files, setting upload_to function creates path doesn't exist, , django creating folders (with permissions don't like). for example, def photo_upload_path(instance, filename): homecoming os.path.join('photos', str(instance.id), filename) however, permissions of folder not like. should create folder , set permissions? or there setting this? i found post controlling permissions of uploaded files (django / file uploads permissions), not created directories. thanks help! you alter default directory permission in settings file. available after django 1.7, , described in the django documentation. note impact directories created django, including staticfiles, utilize caution. class="lang-py prettyprint-override"> file_upload_directory_permissions = 0755 change illustration code utilize permission desire. didn't utilize requested per...

jsp - in struts how do you set the id property for html:hidden -

jsp - in struts how do you set the id property for html:hidden - i want set hidden input onto html form , doing next struts tag: <html:hidden property="currentpage" value="page1"></html:hidden> which renders html: <input type="hidden" value="page1" name="currentpage"> how set id property on html element? want html rendered like: <input type="hidden" value="page1" name="currentpage" id="currentpage"> try this: <html:hidden property="currentpage" value="page1" styleid="currentpage"></html:hidden> jsp struts

.net - Entity Framework Code-First: How to manually update the database? -

.net - Entity Framework Code-First: How to manually update the database? - i've build little wpf demo app uses ef code-first save info in sql ce 4.0 db. works fine unless remove property model object. example, if remove "hosteby" class..... public class dinner { public int dinnerid { get; set; } public string title { get; set; } public datetime eventdate { get; set; } public string address { get; set; } public string hostedby { get; set; } public virtual icollection<rsvp> rsvps { get; set; } } ...it throws exception: the model backing 'nerddinners' context has changed since database created. either manually delete/update database, or phone call database.setinitializer idatabaseinitializer instance. example, dropcreatedatabaseifmodelchanges strategy automatically delete , recreate database, , optionally seed new data. the error persists after removing field "hosteby" manually database. missing here? ...

Javascript/Jquery commenting causing errors in IE -

Javascript/Jquery commenting causing errors in IE - so post not much of "please help me prepare it" post much "why changing create work?". had javascript/jquery written working in firefox , chrome, ie threw errors. i not figure out helpful posts users here @ stackoverflow. stumbled upon reply (as seem find myself doing lot coding). i doing rigorous style of commenting taught me 1 of computer science professors function have commenting such this: //@ describe function //@ params: param1 - function, param2 - function //@ etc.... so foolishly threw javascript find out ie did not care much @ all. when removed @ symbols code worked perfectly. so question why caused errors in ie? shouldn't whatever follows '//' comments not matter? you might thinking of docblock commenting, want wrap in block comment syntax: /** * function * @param <string> $str string * @param <array> $arr array * @return <bool> true if st...

Android Emulator disconnects shortly after launching -

Android Emulator disconnects shortly after launching - when launch emulator or seek run android project error -emulator: ../../src/xcb_io.c:249: process_responses: assertion `(((long) (dpy->last_request_read) - (long) (dpy->request)) <= 0)' failed. emulator visible few seconds.the sdk , eclipse correctly installed. i have faced problem & after lot of trying found solution... this simple need give permission both emulator & ddms. they located in /tools directory of android-sdk first go directory, run next command : $sudo chmod 755 emulator $sudo chmod 755 ddms then : $emulator -avd <name of avd> hope work :) android-emulator

asp.net - Is there anything wrong with modifying the web.config file dynamically -

asp.net - Is there anything wrong with modifying the web.config file dynamically - i read this article. planning on creating setup page runs , allows user alter sql connection strings stored in web.config file. changes may help in deployment or development. question is possible alter connection string in web.config file based on user input , advisable. n.b connection string must contained in web.config thank you you may find helpful this blogpost on topic. asp.net asp.net-mvc-3 c#-4.0

android - HttpClient execute keeps giving ConnectTimeoutException -

android - HttpClient execute keeps giving ConnectTimeoutException - i have big bug in application can't seem solve. whenever create rest phone call via next code: httpget request = new httpget(url + getparams()); httpparams httpparameters = new basichttpparams(); httpconnectionparams.setconnectiontimeout(httpparameters, 5000); httpconnectionparams.setsotimeout(httpparameters, 10000); defaulthttpclient httpclient = new defaulthttpclient(httpparameters); httpclient.execute(request); i error in ddms: 07-15 11:22:47.448: warn/system.err(973): org.apache.http.conn.connecttimeoutexception: connect (some ip-address) timed out but code works perfect , receive info should. tested rest server phone call via normal webbrowser on computer , gives info within 100ms. doing wrong? tested on device, gives me same problem. glad if solve problem :) the problem defaulthttpclient . using asynchronously? since defaulthttpclient not thread-safe, using in a...

gridview - Ajax grid view in update pannel select button not working -

gridview - Ajax grid view in update pannel select button not working - i using grid view in update pannel , set autogenerate select button property true when run web site select button not working can body help me??? gridview

c# - How to handle async file upload in uploadify? -

c# - How to handle async file upload in uploadify? - i have uploadify plugin on page , below have description field , textbox it. have submit button below it. problem uploadify start async file upload select file. want uploadify start upload on click of submit button , description field's value available on server. aware there alternative can inquire uploadify start upload on click of button. if submit button click event fired , upload lost. should utilize script manager , update panel (uploadify should not within update panel) when submit button click event fired page doesn't reset , uploadify can go on work. how typically handle this? thanks in advance :) to disable auto start of file upload, add together setting config of uploadify: 'auto' : false to submit values of form server along file need create separate link or button gets info form , send using uploadifysettings function , phone call uploadifyupload(). here illustration se...

embedded - Korg Nanokey MIDI Controller for Arduino? -

embedded - Korg Nanokey MIDI Controller for Arduino? - i have korg nanokey i'd utilize command simple synthesizer i've designed on arduino platform. (i have arduino uno.) basically, don't care midi, want read note keyboard has pressed down, if midi way can that, it's okay me. big question is, how do this? haven't been able find else on net has done this. but more specifically, see 2 challenges: first, i'd plug nanokey straight arduino's usb port, i'm wondering if arduino provide necessary powerfulness nanokey. second, i'm not sure protocol reading. can read midi signals described in this tutorial? i don't want curb enthusiasm you're attempting might bit hard basket. usb scheme consists of host controller , 1 or more peripheral devices. it's host controls traffic flow devices means devices can't transmit info on bus without explicit request host controller. i'm not familiar either nanokey or arduino platform...

How can I detect USB gamepad input in Mono/C#? -

How can I detect USB gamepad input in Mono/C#? - i've used directinput gamepad input in past when coding windows (microsoft visual studio c#), i'm trying code ubuntu using mono, , it's little more difficult. can't see how grab such input. if asking detecting hot plugged or scanning plugged devices obtain, example, device path , doing whatever need it, 1 time did using halsharp project. seemed dead, nevertheless worked. now, hal deprecated, may interested in this project. c# input mono

Send shortcut to Eclipse console -

Send shortcut to Eclipse console - i got project finish eclipse's cdt. project intend hear various shortcuts while running (normally terminal or command promt). while running under eclipse, these shortcuts programm listening to(e.g. ctrl+c, ...) won't work, because eclipse receives shortcuts on own. so, question is, possible send shortcut application while running in eclipse console? greetings, ben there aptana plugin eclipse. plugin has terminal view. can utilize view run project , able send keyboard shortcuts within eclipse. eclipse console shortcut cdt

ruby on rails - git://github.com/odorcicd/authlogic.git (at rails3) is not checked out. Please run `bundle install` -

ruby on rails - git://github.com/odorcicd/authlogic.git (at rails3) is not checked out. Please run `bundle install` - i getting error:-- git://github.com/odorcicd/authlogic.git (at rails3) not checked out. please run `bundle install` even after running bundle install. tried still no luck cd vendor/plugins git clone git://github.com/odorcicd/authlogic.git cd authlogic git checkout --track -b rails3 origin/rails3 here solution:- relace gem 'authlogic', :git => 'git://github.com/odorcicd/authlogic.git', :branch => 'rails3' by gem 'authlogic' make sure do:-- cd vendor/plugins git clone git://github.com/odorcicd/authlogic.git cd authlogic git checkout --track -b rails3 origin/rails3 ruby-on-rails ruby-on-rails-3 authlogic

Format statements in Fortran modules -

Format statements in Fortran modules - i have module number of subroutines utilize same set of formats output. right now, have declare formats in every subroutine. there way declare them in module subroutines have access them? you can store format character @ module level. e.g. module foo implicit none character(len=20), parameter :: form = "(1x,a)" contains subroutine bar ... write(my_unit, form) "hello, world" end subroutine bar end module foo module fortran fortran90 fortran95 formats

php - Can I echo a variable with single quotes? -

php - Can I echo a variable with single quotes? - can echo in single quotes variable? example echo 'i love $variable.'; i need because have lots of html echo too. you must either use: echo 'i love ' . $variable . '.'; this method appends variable string. or use: echo "i love $variable."; notice double quotes used here! php echo

windows phone 7 - how to get scroll up/down or left/right event for scrollviewer/listbox in wp7 -

windows phone 7 - how to get scroll up/down or left/right event for scrollviewer/listbox in wp7 - how scroll up/down or left/right event scrollviewer/listbox? have next xaml. notification when user scroll. <scrollviewer horizontalscrollbarvisibility="auto" margin="0,6,-196,0" height="auto" name="imagescroll"> <listbox x:name="mylistbox" margin="12,0,0,0"> <listbox.itemspanel> <itemspaneltemplate> <stackpanel orientation ="horizontal" > <stackpanel.rendertransform> <translatetransform x="0" /> </stackpanel.rendertransform> </stackpanel> </itemspaneltemplate> </listbox.itemspanel> <listbox.itemtemplate> <datatemplate> <stackpanel orientation=...

Android recording Video -

Android recording Video - is possible recording videos additional layer recording? if yes,how can that? maybe android.view.surface ? thx try following: mediarecorder api android video video-recording

Problem on mysql INNER JOIN -

Problem on mysql INNER JOIN - i trying next query show of user @ user page... select u.id, u.username, u.email, u.active, u.admin, u.team_id, t.name team_name, sum( s.score ) total_score users u inner bring together teams t on u.team_id = t.id inner bring together stats s on u.id = s.user_id i have 4 users in users table , want list if utilize inner join, returning 1 row. check info construction following... | id | game | user_id | rank | score | dnt | +----+------+---------+-------+------+-----+ | 1 | test | 5 | 2 | 2200 | +--------+----------+----------+-----+-----+ | 2 | test | 3 | 1 | 2500 | +--------+----------+----------+-----+-----+ teams | id | name | dnt | +----+-------+-----+ | 1 | team1 | | +----+-------+-----+ | 2 | team2 | | +----+-------+-----+ users | id | username | email | team_id | +----+----------+-------+---------+ | 1 | user1 | | 1 | +----+----------+-------+---------+ | 1 | user2 ...

Overscroll effect in gallery class android? -

Overscroll effect in gallery class android? - how implement overscroll effect in gallery class android? setoverscrollmode(over_scroll_if_content_scrolls); i seek override @override protected void onoverscrolled(int scrollx, int scrolly, boolean clampedx, boolean clampedy) { system.out.printf("onoverscrolled\n"); } but no output system.out.printf() nil on android, believe. output that, utilize log.i() , in eclipse in ddms view. utilize log.e() because isn't beingness printed , d, since it's not technically error, it's bad form. android gallery

Using C# with C DLL for callback, can't get better than 16FPS framegrab rate, why? -

Using C# with C DLL for callback, can't get better than 16FPS framegrab rate, why? - i have application in c# interfaces usb camera. it's been working fine except fact have not been able accomplish improve 16 frames-per-second. i'm using vfw, , 'c' callback (the callback part of dll) per wm_cap_grab_frame_nostop message, , i've found if nil in callback, unable decent frame rate (16fps max). i thought using interface give me improve performance other alternatives (directshow example) because of simplicity , low-level connection driver; i'm origin wonder if that's true. have insight on this? let me hazard guess... are using system.timers.timer chance? or, c portion of programme using windows timer? if do, limited resolution might cause of problem. c# dll camera

javascript - download video link for iPad/iPhone -

javascript - download video link for iPad/iPhone - how create download video link ipad/iphone, using this <a id="wellcome-video-strem" href="iphone.m4v"><img src="imgbuttondownloadvideo.png" alt="download video" /></a> but clicking on link start play video file in ipad. mobile safari provides no means save file device's video library. you might able store info using local storage, uncertainty allowed store plenty info create saving video feasible (and limit access saved info web site). if took approach have resort generated data: scheme uri in <video> element play back. javascript html5 video

BlackBerry Messages in notification bar issue -

BlackBerry Messages in notification bar issue - i tried utilize example, //register applicationmessagefolder //readablelistimpl source available in messagelistdemo. applicationmessagefolder folder = applicationmessagefolderregistry.getinstance().registerfolder( 0x33c7ce29883abe5fl, "test folder", new readablelistimpl()); //demomessage source available in messagelistdemo. demomessage msg = new demomessage("me@here.com", "pizza toppings", "what on pizza?", system.currenttimemillis()); folder.fireelementadded(msg); //display application indicator icon. applicationindicatorregistry reg = applicationindicatorregistry.getinstance(); encodedimage image = encodedimage.getencodedimageresource("indicator.png"); applicationicon icon = new applicationicon(image); applicationindicator indicator = reg.register(icon, false, true); indicator.seticon(icon); indicator.setvisible(true); i able see indicatoe icon,...

jax ws - WCF Web Service, Java Web Client, MustUnderstand headers not understood? -

jax ws - WCF Web Service, Java Web Client, MustUnderstand headers not understood? - i'm hosting wcf web service next wsdl (a simple service using wshttpbinding , ssl transport security): <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:tns="http://tempuri.org/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsaw="http:...

localization - Localizing strings in code in WPF -

localization - Localizing strings in code in WPF - basically, have localize this: messagebox.show("hello"); so depending on civilization should show "ciao", "hola", "bonjour", has done in code, can't move gui. i know how localize gui (with locbaml), doesn't work need, can imagine similar locbaml (expect part generates assembly maybe). need pinpoint in right direction. thanks! if strings localized using resource dictionaries, can utilize just messagebox.show((string)application.current.resources["ids_hello"]); this approach has little disadvantage text won't alter automatically if application's language changed during messagebox.show . (mind dynamic localization requires anyway additional effort side.) wpf localization

sql - Max Lat, Min Lat, Max Long, Min Long from Geometry field -

sql - Max Lat, Min Lat, Max Long, Min Long from Geometry field - i'm trying figure out how max , min values lat , long points geometry info field. i'm guessing have first convert string stastext i'm not sure. allow me know if have improve idea? you want utilize sql server extension methods "lat" , "long" combined max , min. at first read getting min/max lat/long pair, , answer: suspect determine figuring out point has largest, , smallest distance (0, 0), or whatever location concerned about. sql sql-server-2008 gis

java - how to handle different language in file/folder path -

java - how to handle different language in file/folder path - i have written application takes folder path , perform operation. if folder path contains characters of language other english language not working. back upwards english language characters. how handle problem? theoretically should work. practically in cases problem of passing parameters shell java application. seek verify works correctly: run application command prompt doing remote debugging. create breakpoint in code reading parameter , see value. believe value corrupted @ phase. typical problem if on windows. in case have configure scheme back upwards unicode characters in command prompt correctly. if path read correctly command line seek go on debugging , see broken. check separator using. avoid using both / , \, utilize file.separator instead. java special-characters non-english

iphone - How to use the Facebook API, and how can I post a link with status on the users wall via my app? -

iphone - How to use the Facebook API, and how can I post a link with status on the users wall via my app? - i'm trying post link + status through app, using "popup" facebook window user asked log in, asked allow app profile. want him able write status, link specify attached. facebook popup triggered button, not @ start of app (in documentation found want me implement in appdidfinish launching method...) don't want that, want popup facebook window triggered per button tap. i'm trying figure out few days now, finding tutorials out-dated , facebook developer documentation weak- atleast for me. downloaded facebook-ios-sdk api , json included github. did few attempts, furthest got user asked log in, not through app, instead safari opened , log in field there, not in app. could please post code, basic tutorial might find helpful, or point me online tutorial? tried post iphone dev sdk forums, other people asked this, never got help. out here please set help out...

asp.net mvc - Client Side Validation fails when moving to viewmodel -

asp.net mvc - Client Side Validation fails when moving to viewmodel - this seems mutual question lots of reasons not seem apply situation. have create page using asp.net mvc 2 , using typed view class generated dataenities framework. <%@ page title="" language="c#" masterpagefile="~/views/shared/site.master" inherits="system.web.mvc.viewpage<mvc_edi.models.wyscustomerendpoint>"" %> i made validation class bound the info class. [metadatatype(typeof(endpointvalidation))] public partial class wyscustomerendpoint { } [bind()] public class endpointvalidation { [required(errormessage = "please come in end point name")] public string custname { get; set; } and able utilize client side validation on create page. had requirement add together dropdown list box on create page, switched view utilize viewmodel instead of info class using. public class createeditcustomerendpoints...

custom fields - Wordpress update_post_meta does not update dynamic values -

custom fields - Wordpress update_post_meta does not update dynamic values - this little strange, using "update_post_meta" update custom fields in wordpress. when run update_post_meta($post_id, 'test_field', 'test value'); custom field updates without problem when utilize string value not update: $test_value = "test"; echo $test_value; // no problem here echo $post_id; // no problem here update_post_meta($post_id, 'test_field', $test_value); thanks much in advance help stu try cast variables types. seek this: update_post_meta( (int) $post_id, 'test_field', (string) $test_value ); wordpress custom-fields

How can I implement a input TextField with expression icons supported on iPhone application? -

How can I implement a input TextField with expression icons supported on iPhone application? - how can implement input textfield look icons or highlighted string supported on iphone application? there open source library can refered? seek this. self.mytextfield.datadetectortypes = uidatadetectortypephonenumber uidatadetectortypephonenumber uidatadetectortypelink uidatadetectortypeaddress uidatadetectortypecalendarevent uidatadetectortypenone uidatadetectortypeall iphone

SQL Express Database size limit via query -

SQL Express Database size limit via query - we know max size of sql info files allowed in sql express editions 2 gb, 4 gb , 10 gb sql 2000, 2005, 2008 express respectively. is there way see max size of database allowed via sql query? the max size that. i'm not aware of query can run info directly. you sql server version: select @@version and infer that. sql

c# - change wav file ( to 16KHz and 8bit ) with using NAudio -

c# - change wav file ( to 16KHz and 8bit ) with using NAudio - i want alter wav file 8khz , 8bit using naudio. waveformat format1 = new waveformat(8000, 8, 1); byte[] wavebyte = helperclass.readfully(file.openread(wavfile)); wave using (wavefilewriter author = new wavefilewriter(outputfile, format1)) { writer.writedata(wavebyte, 0, wavebyte.length); } but when play output file, sound sizzle. code right or wrong? if set waveformat waveformat(44100, 16, 1), works fine. thanks. a few pointers: you need utilize waveformatconversionstream convert 1 sample rate / bit depth - putting original sound new file wrong wave format. you may need convert in 2 steps - first changing sample rate, changing bit depth / channel count. because underlying acm codecs can't conversion want in single step. you should utilize wavefilereader read input file - want actual sound info part o...

models - google datastore many to one references -

models - google datastore many to one references - so have 2 model classes: class dog(db.model): dogname = stringproperty() dogbreed = stringproperty() class cat(db.model): catname = stringproperty() catbreed = stringproperty() and have 3rd model class hold pictures class images(db.model): imagereference = referenceproperty(*animal*, collection_name = 'allimages') imageurl = stringproperty() animal either dog or cat. not compile. now question is: there way can set cat pictures in dog pictures? or need create more models this: class dogimages(db.model): imagereference = referenceproperty(dog, collection_name = 'allimages') imageurl = stringproperty() class catimages(db.model): imagereference = referenceproperty(cat, collection_name = 'allimages') imageurl = stringproperty() you utilize polymodel: class animal(polymodel.polymodel): name = db.stringproperty() breed = db.stringproperty() class dog(...

asp.net - How can I load a byte array into excel? -

asp.net - How can I load a byte array into excel? - i have btye array load excel. this in vb.net visual studio 2008. how can load byte array excel via memory or code? here code, can try: dim bytes() byte = ctype(dt.rows(0)("data"), byte()) response.buffer = true response.charset = "" response.cache.setcacheability(httpcacheability.nocache) response.contenttype = dt.rows(0)("contenttype").tostring() response.addheader("content-disposition", "attachment;filename=" & dt.rows(0)("name").tostring()) response.binarywrite(bytes) response.flush() response.end() take @ article explaining every step. @ end of article find code byte array , file save , retrieve files sql server database using asp.net asp.net vb.net visual-studio-2008 excel ms-office

iphone - How to check what's kind of an iOS Application? -

iphone - How to check what's kind of an iOS Application? - i new on ios programming. download samples apple website. how know what's kind of sample? view-based, window-based, navigation-based etc. to add together @steve said ( editing reply time ... set improve had :)), template not create indicator allows find kind of project. of course of study sdk setting , run setting can help understand if iphone or mac. but if project created standard template, possible understand of template used. navigate .xcodeproj file corresponding project. cmd + click ( or right click) , take open bundle contents. open .pbxproj file. default open in xcode, search term "template". point right direction. iphone objective-c ios templates

android - ListView Force Close -

android - ListView Force Close - i writing class gets file's in folder, , displays contents in list view. application forcefulness closes when run activity... debugged while, , searched through logcat, , cannot find problem... public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); file root = new file(environment.getexternalstoragedirectory(), "notes"); if(!root.exists()){ root.mkdirs(); } setlistadapter(new arrayadapter<string>(this, r.layout.folders, builddirarray(root))); listview lv = getlistview(); lv.settextfilterenabled(true); lv.setonitemclicklistener(new onitemclicklistener() { public void onitemclick(adapterview<?> parent, view view, int position, long id) { // when clicked, show toast textview text toast.maketext(getapplicationcontext(), ((textview) view).gettext(), toast.length_short).show(); } ...

escaping - How to differentiate between Escape and Up/Down/Left/Right with termios? -

escaping - How to differentiate between Escape and Up/Down/Left/Right with termios? - github this best can come handle ncurses-style key presses (i'm writing alternative ncurses various reasons). an illustration app built code advises user "quit pressing escape". in truth, requires escape + escape or escape + arrow key. i'd prepare this. #include <sys/ioctl.h> #include <termios.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <string.h> char *get_key() { char c = getchar(); switch(c) { case 'a': homecoming "a"; case 'b': homecoming "b"; case 'c': homecoming "c"; ... case '\x1b': c = getchar(); switch(c) { case '[': c = getchar(); switch(c) { case 'a': homecoming ...

visual studio - Class Library project for Asp.Net deploying other files than dll -

visual studio - Class Library project for Asp.Net deploying other files than dll - i've made class library project asp.net applications, consisting in classes plus back upwards js, css, , image files need deployed in hosting web application. the problem back upwards files copied in bin\ directory of application, becomes unavailable on iis (http 403 errors), infact bin folder dll files. any thought on how publish these back upwards files create them available main app? thanks. you need embed resources class library. js, css , image files contained within dll , accessible other projects. here walkthrough. asp.net visual-studio visual-studio-2010 deployment class-library

How to load and remove a few Linear Layouts in one screen - Android? -

How to load and remove a few Linear Layouts in one screen - Android? - this app. http://i304.photobucket.com/albums/nn170/damcrew/capture-1.png i want load different linear layouts in white space..and when i'm loading them don't want custom tab bar @ bottom , custom action bar @ top change. i'm not sure if can that. any help? you can seek adding layouts wish toggle between , setting visibility either view.visible or view.gone. android layout tabs

PHP not displaying correctly in HTML -

PHP not displaying correctly in HTML - i'm trying create drop downwards box populated array. when view code browser displays pieces of php code. here browser displays: '; foreach ($array $value) { $html .= ' $value '; } $html .= ''; homecoming $html; } ?> here code: <html> <head> <title>test</title> <?php $cities = array( 'san francisco', 'san diego', 'los angeles'); function createdropdown($name, $array) { $html = '<select name=$name>'; foreach ($array $value) { $html .= '<option value="$value">$value</option>'; } $html .= '</select>'; homecoming $html; } ?> </head> <body> <form> <?php createdropdown("cities", $cities); ?> </form> </body> </html> most server isn't configured treat .php files php scripts, , serving them html/plaintext. if view-so...

Does LinqPad support latest Odata libraries? -

Does LinqPad support latest Odata libraries? - does linqpad utilize odata (wcf info services) client library generate proxy that'll phone call info service or utilize plain http/rest? since getting typed context, can used queries, assume using proxy? if former, there way update odata client library used linqpad? linqpad uses entityclassgenerator in system.data.services.design generate client proxy classes. class standard part of .net framework - i'm not aware of updated odata client library... there one? edit: linqpad supports odata 5 (from version 4.42.06). odata linqpad

asp.net - aspstate nesting transaction error ms sql error -

asp.net - aspstate nesting transaction error ms sql error - i have next error: invalid object name 'aspstate.dbo.aspstatetempsessions'. transaction count after execute indicates mismatching number of begin , commit statements. previous count = 238, current count = 239. description: unhandled exception occurred during execution of current web request. please review stack trace more info error , originated in code. does have thought how prepare this? i found cause of exception: http://msmvps.com/blogs/greglow/archive/2007/02/04/improving-asp-net-session-state-database-performance-by-reducing-blocking.aspx you have unclosed begin statments looks of it. needs closed commit statment or end statement. seems occusring on other side of webservice phone call you're making asp.net sql state

deployment - Building custom Java library -

deployment - Building custom Java library - i've noticed lot of javascript/jquery libraries allow developers customize .js file, including bare minimum functionality save bandwidth/page load times. now when i'm distributing java library clients, there way same? don't forcing clients have include big library in application if they're going using few classes. ideally packaged nice jar file. edit: similar this: http://flowplayer.org/tools/download/index.html most obfuscators (including popular proguard) can (and default will) eliminate unused methods , classes jar. nice job of checking apparently unused classes not used indirectly main program. java deployment jar

gcc - Ignore invalid directives in cpp -

gcc - Ignore invalid directives in cpp - we had been using directives in our code invalid in today's standards. eg. #comment1 this used work in old version of gcc (2.x). i'm trying move off new gcc (4.x) i'm getting errors such : "error: invalid preprocessing directive #comment1" easy prepare alter # // in directives, cannot due other dependencies. question is, there way tell cpp ignore these invalid directives ? however should interpret valid directives should eg #ifndef #define etc thank you! you didn't why cannot alter # // in directives i guess have tools or scripts depending on them. should update these follow current standard. maybe more unique or improbable suffix might help you, eg utilize //#comment instead of #comment but essentially, asking more or less standard conforming compiler understand non-standard , deprecated language feature, , hopeless. alternatively, patch recent gcc source code (e.g. gcc 4.6 one...

regex - Unambiguous Grammar for Regular Expressions -

regex - Unambiguous Grammar for Regular Expressions - i'm trying develop recursive decent parser regular expressions homework assignment. wanted inquire community if grammar i've developed right or if i'm on right track: -= regex grammar (ebnf) =- <start> -> <expr> '\n' <expr> -> <expr> { '|' <term> } // union | <expr> { <expr> } // concatenation | <expr> '*' // closure | <term> <term> -> '(' <expr> ')' | <char> // grouping | <char> <char> -> a|b|c| ... |z a few guidelines: 1. precedence: in order listed (highest lowest) closure, concatenation, union 2. associativity: closure right-associative; concatenation/union left-associative 3. must back upwards grouping parens my question: grammar (above) meet guidel...

How to connect to https server with Mule 2 -

How to connect to https server with Mule 2 - i used command convert .pem file .jks 1 (source): keytool -importcert -alias debian -file cert.pem -keystore cert.jks -storepass passwd here's mule file: class="lang-xml prettyprint-override"> <?xml version="1.0" encoding="utf-8"?> <mule xmlns="http://www.mulesource.org/schema/mule/core/2.2" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:http="http://www.mulesource.org/schema/mule/http/2.2" xmlns:https="http://www.mulesource.org/schema/mule/https/2.2" xsi:schemalocation=" http://www.mulesource.org/schema/mule/http/2.2 http://www.mulesource.org/schema/mule/http/2.2/mule-http.xsd http://www.mulesource.org/schema/mule/https/2.2 http://www.mulesource.org/schema/mule/https/2.2/mule-https.xsd http://www.mulesource.org/schema/mule/core/2.2 http://www.mulesource.org/schema/mule/core/2.2/mule...

windows phone 7 - How to create custom pin Start Button to my app? -

windows phone 7 - How to create custom pin Start Button to my app? - i want create custom pin start button win phone 7. for illustration in windows phone 7 have button of marketplace pinned. when receive update pin button shows number of updates received. illustration calendar, when create appointment, these appears in pin button. i want create similar. want big pin button information. direction? the reply depend on whether targeting mango or not. if targeting v 7, need notifications. this msdn article give info starting point. in mango (7.1) can accomplish lot more manipulation of tiles within app. this msdn article great start point that. please note, however, user need have application tile pinned in order behaviour describing. windows-phone-7