Posts

Showing posts from June, 2012

iphone - AudioUnit Input Samples -

so having trouble here audiounit taking in data microphone/line-in in ios. able set think okay , calling recordingcallback, data getting out of buffer not correct. returns same thing, zeros , random large numbers. know causing this. code follows. setting audio unit osstatus status; // describe audio component audiocomponentdescription desc; desc.componenttype = kaudiounittype_output; desc.componentsubtype = kaudiounitsubtype_remoteio; desc.componentflags = 0; desc.componentflagsmask = 0; desc.componentmanufacturer = kaudiounitmanufacturer_apple; // component audiocomponent inputcomponent = audiocomponentfindnext(null, &desc); status = audiocomponentinstancenew(inputcomponent, &audiounit); // enable io recording uint32 flag = 1; status = audiounitsetproperty(audiounit, kaudiooutputunitproperty_enableio, kaudiounitscope_input, kinputbusnumber, ...

"Computed Properties" in AngularJS -

i chose angularjs on ember.js project working on, , have been pleased far. 1 nice thing ember built in support "computed properties" automatic data binding. have been able accomplish similar in angular code below, not sure if best way so. // controller angular.module('mathskills.controller', []) .controller('nav', ['navigation', '$scope', function (navigation, $scope) { // "computed property" $scope.$watch(navigation.getcurrentpagenumber, function(newval, oldval, scope) { scope.currentpagenumber = newval; }); $scope.totalpages = navigation.gettotalpages(); }]); // 'navigation' service angular.module('mathskills.services', []) .factory('navigation', function() { var currentpage = 0, pages = []; return { getcurrentpagenumber: function() { return currentpage + 1; }, gettotalpages: function() { return pages.length; } }...

iphone - how can i tell when the phone is in a call when i return to my app without checking the status bar frame? -

i using uiapplicationwillchangestatusbarframenotification tell when status bar change, , me figure out when call in progress goes away, , behavior like. however, there 1 scene in app in take full screen, , includes hiding status bar … except not hide status bar when in call. my understanding way status-bar first show if (a) phone call, (b) return app. so … when return app upon receiving phone call … there no green status bar. (fwiw, green status bar appear when tap on app make status bar , nav bar , tab bar re-appear, it's not entirely gone; hidden because told hidden. in simulator, performing "hardware -> toggle in-call status bar" works like, don't think behavior ever occur way in real world.) i found answer how notified when user opens iphone app while in phone call? … but works if statusbar visible when app re-opened. i want know how tell i'm in call when return app can manually unhide green status bar while user looking @ scene otherwise h...

c# - Create DetailView for Telerik MVC Grid only on certain conditions -

i know there question conditional detailview, feel that's not i'm looking for. i've been messing around telerik grid mvc, , i've managed create detailview rows in grid. thing of now, detailview filled html-code, , want have new model inside. based on 1 columns value, want create detailview rows matching columns value. so, instance, if column "type" equals fruit, shall create detailview (with "+" sign). if "type" vegetable, should not create detailview (without "+" sign). my current code looks this: html.telerik().grid<searchviewmodel>(model) .name("search") .columns(columns => { columns.bound(o => o.type).width(60); //etc. }) //.prefixurlparameters(false) .detailview(detailview => detailview.clienttemplate( "<div>" + "<...

android - Spinner not getting populated with the given string array -

i have make android app. counting bunks college students. want make this: spinner 1 has select branch me ce it ee select semester 1st 2nd 3rd 4th etc. now if student selecting me , 3rd semester, 3rd semester subjects should come like: enter bunks of subject: abc1: edittext abc2: edittext abc3: edittext abc4: edittext abc4: edittext and input user should come logic of percentage of attendance, , answers should come on page same subject name. can me please? edit my main.xml : <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <textview android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello" /> <spinner android:id="@+id/spinner1...

html - CSS 100% height with header and footer -

i having difficulties achieving css 100% website can right in every web browser. followed tutorial found here no luck in getting working. have example contains footer. footer not in place. also, trying have surrounding black frame cover footer. there doing wrong? for better details please @ live example css <style> html,body { padding: 0px; margin: 0px; background: #333333; background-size: 100%; line-height: 130%; height: 100% font-family: trebuchet, 'trebuchet ms', 'tahoma', sans-serif; font-size: 90%; color: #5e5e5e; } /****** colorblock: orangey-yellow bar behind wrapper background. ******/ #colorblock { position: absolute; top: 60px; left: 0px; background: #c69a55; z-index: -1; height: 65px; width: 100%; padding: 0px; margin: 0px; } /****** wrapper: light gray box background of content. not edit. ******/ #container { z-index: 1; width: 850px; position: re...

Want to design country, currency, timezone table for mysql database? -

am working on international project, , want design 3 major tables structure required in project: country table (contains country_name , iso_code , calling_codes ) currency table (contains currency_name , currency_code ) timezone table (contains gmt_coordinates , gmt_fullname like: -10.0 (gmt-10:00)-hawaii ) am confused tables data-types structure. searched & google it, many confused answers , different structure. so, please suggest proper table structure appropriate fields data-types, appreciates suggestion , answers. advance mates! there surprises when working currencies , time zones every country in world. on geonames , data, idea of expect. from experience geonames data, need following fields: country info country name - varchar(50) iso code - char(2) calling code - integer(4) currency code - char(3) name - varchar(10) with data in geonames database, these data fields , respective sizes should cover ...

Will Web Deployment Projects still be available in Visual Studio 2012? -

it looks visual studio 2012 not include visual studio setup , deployment projects according msdn , i'm learning wix . will loss of functionality extend web deployment projects? web deployment projects not available in vs2012. instead focus on bringing first class publishing support website projects. can read more details @ http://blogs.msdn.com/b/webdev/archive/2012/08/06/plans-regarding-website-projects-and-web-deployment-projects.aspx . in nutshell, have same features wdp has, lot more well. thing have 1 experience both web app project website project. when make enhancements both project systems it. if had customizations in wdp, should able copy/paste new web publish profiles (they msbuild well). take @ blog above , please let me know if have concerns.

.net - C# queueing dependant tasks to be processed by a thread pool -

Image
i want queue dependant tasks across several flows need processed in order (in each flow). flows can processed in parallel. to specific, let's need 2 queues , want tasks in each queue processed in order. here sample pseudocode illustrate desired behavior: queue1_workitem wi1a=...; enqueue wi1a; ... time passes ... queue1_workitem wi1b=...; enqueue wi1b; // must processed after processing of item wi1a complete ... time passes ... queue2_workitem wi2a=...; enqueue wi2a; // can processed concurrently wi1a/wi1b ... time passes ... queue1_workitem wi1c=...; enqueue wi1c; // must processed after processing of item wi1b complete here diagram arrows illustrating dependencies between work items: the question how do using c# 4.0/.net 4.0? right have 2 worker threads, 1 per queue , use blockingcollection<> each queue. instead leverage .net thread pool , have worker threads process items concurrently (across flows), serially within flow. in other words able indica...

null - SQL input needed to get correct output -

select a.subscriberkey, a.eventdate,b.createddate _click join _listsubscribers b on a.subscriberkey = b.subscriberkey b.listid = '10630' , b.createddate > (select dateadd(day,-180,getdate())) , a.eventdate null group a.subscriberkey,b.createddate, a.eventdate at moment, nothing being returned. want return subscribers subscriberkey(which email), eventdate(the date click took place), , date added(createddate) when have not clicked on anything. can point me in right direction? everyone! i don't see purpose of group in case. aren't doing aggregation. i believe give result looking for. select subscriberkey, null eventdate, createddate _listsubscribers ls listid='10630' , createddate > dateadd( day, -180, getdate()) , not exists( select 1 _click c c.subscriberkey = b.subscriberkey ) the following query using outer join should give same results, , more similar original query. select ls.subscriberkey, c.eventdat...

php - Regular expression to search in html template -

i'm trying find strings in lot of files (cc. 2000 files). what need find id attribute in html file except id's. for example want find: <a id="certain_id">sdfsdf</a> but want exclude: <a id="manage">manage</a> i need regular expression since want use in eclipse search. if cannot can make php file too. something like: id="(?!manage)" or similar. don't want replace want list of elements in each file. thanks help this worked me : id="(?!(manage|something)").*?" ^ ^ ^ | | character (not greedy), followed quote | negative lookahead make sure there isn't manage|something , quote match id=" characters literally where manage , something 2 ids don't want match. you use make non-greedy: id="(?!(manage|something)")[^"]+"

c# - import text file(500 MB) data into SQL Server -

here code using importing text files larger 500 mb database. i want in batches if format related error occur in text file during execution @ least half of contents uploaded. if other suggestion uploading such large text file please specify. private datatable createdatatablefromfileloop() { string filename = ""; if (fileuploadexcel.hasfile) { try { filename = path.getfilename(futextloop.filename); futextloop.saveas(server.mappath("~/calltext") + filename); //statuslabel.text = "upload status: file uploaded!"; } catch (exception ex) { statuslabel.text = "upload status: file not uploaded. following error occured: " + ex.message; } } datatable dt = new datatable(); datacolumn dc; datarow dr; dc = new datacolumn(); dc.datatype = system.type.gettype("system.string"); dc.columnname = "sr no"; ...

iphone - How to change Audio CMSampleBuffer format(change the mSampleRate 44100.000000 to 8000.000000.) -

i using avcaptureaudiodataoutput audio output , getting result form - (void)captureoutput:(avcaptureoutput *)captureoutputdidoutputsamplebuffer:(cmsamplebufferref)samplebuffer fromconnection:(avcaptureconnection *)connection but want change samplebuffer audio format (cmsamplebuffergetformatdescription). please me if possible.want change msamplerate . currently getting mediaspecific: {asbd: {msamplerate: 44100.000000mformatid: 'lpcm'mformatflags: 0xcmbytesperpacket: 2mframesperpacket: 1mbytesperframe: 2mchannelsperframe: 1mbitsperchannel: 16 } but need change msamplerate 44100.000000 8000.000000. take here: http://developer.apple.com/library/ios/#documentation/avfoundation/reference/avfoundationaudiosettings_constants/reference/reference.html#//apple_ref/doc/uid/tp40009937 you have setup avaudiorecorder. hope, helps!

hibernate - How to handle Spring JPA repository SQL error when occur? -

in project using sring jpa repositories concept interact database. repository has many inbuild crud functions repository.save().. saves entity now during saves sql error below , save operation fails: sql error : 2012-06-28 10:28:43,217 [warn] [pool-1-thread-1] [org.hibernate.util.jdbcexceptionreporter] - sql error: 0, sqlstate: 22001 2012-06-28 10:28:43,217 [error] [pool-1-thread-1] [org.hibernate.util.jdbcexceptionreporter] - data truncation: data long column '<column name>' @ row 1 my concern how handle these kind on error in java code , because cannot see method throwing exception handle upon these kind of error. apart fact business classes or pojos check if length not big can find on hibernate forums hibernate logging this. see example persist object error : data long column (in mysql) , data truncation: data long column . it not spring data related @ all.

html - how to restrict div resize? -

i have menu bar , code follows <div style="background:#000; height: 25px;"> <div style="margin-left: 25%; margin-right: 20%; font:13px/27px arial,sans-serif;"> <a href="1.html" style="text-decoration:none; color:#333;"><div class="activemenu" name="menunew">1</div></a> <div class="activemenu" name="menunew"></div> <a href="#" ><div class="activemenu" name="menunew">2</div></a> <a href="#" ><div class="activemenu" name="menunew">3</div></a> <a href="#"><div class="activemenu" name="menunew">4</div></a> <a href="#">5</div></a> <a href="register.html" style="text-deco...

sql server - Check for signature on module before alter -

i have signed modules in sql server 2008 databases. in case alters signed modules (proc or trigger) want print information message, has re-sign procedure , print tsql code (there appropriate rights). how , best way that? ddl triggers seems no suitable need, inside trigger module altered , think can not find out if signed before. the whole idea of signature authorized has reviewed module (inspected code) , used authority sign module. altering module requires same authorized individual review module again, check conformance , re-sign. automating process pretty defeats purpose of code signing, make sysadmin , call day.

custom errortext on row delete jqGrid -

when deleting row in jqgrid, return custom error text when server returns 500 error. using jqgrid asp.net, , grid not seem have "loaderror" event has done this? jqgrid defined this <trirand:jqgrid runat="server" id="jqgrid" shrinktofit="true" width="900px" height="500" pagersettings-pagesize="20" pagersettings-pagesizeoptions="[20,50,100]" onsearching="jqgrid_searching" onsorting="jqgrid_sorting" onrowediting="jqgrid_rowediting" onrowdeleting="jqgrid_rowdeleting"> <columns> <trirand:jqgridcolumn datafield="id" primarykey="true" width="40" visible="false" /> <trirand:jqgridcolumn datafield="name" searchtype="dropdown" width="55" searchcontrolid="ddlnamefilter" heade...

windows - Access virtual host from another machine over LAN -

i using windows 7 wamp 2.2 server. i have setup 2 virtual hosts: www.project1.com , www.project2.com . i have modified " hosts ", httpd.conf , , httpd-vhosts.conf files, changes mentioned below. using browser, when type www.project1.com or www.project2.com , web pages opened on laptop has server installed on. changes in " hosts file ": i've appended followings end of file:- 127.0.0.1 localhost 127.0.0.1 www.project2.com 127.0.0.1 www.project1.com changes in httpd.conf file:- include conf/extra/httpd-vhosts.conf changes in httpd-vhosts file:- namevirtualhost *:80 <directory "d:/websites/"> allowoverride order deny,allow allow </directory> <virtualhost 127.0.0.1> documentroot "d:/websites/wamp/www/" servername localhost </virtualhost> <virtualhost 127.0.0.1> documentroot "d:/websites/project1/" servername www.project1.com ...

razor - how to add new proprties to new members in umbraco 5 -

i want add new properties added in registering new members in umbraco 5 address , phone , displaying in profile. thanks. as of mid-june umbraco 5 project has been cancelled. many of best features migrated umbraco 4 , main branch moving forward. read more here: http://umbraco.com/follow-us/blog-archive/2012/6/13/v5-rip.aspx/ there package helps bring mvc goodness umbraco 4 http://our.umbraco.org/projects/website-utilities/umbramvco

autoconf - Distributing autotool metafiles -

am_maintainer_mode has been criticized, , believe main objection leads incorrect builds if dependencies on meta-files not detected. also, argued generated files not belong in version control systems (i agree position). believe if configure not belong in vcs, configure.ac , makefile.am not belong in tarball. end, i've written simple script clean targets out of makefile.in , added following target top-level makefile.am: dist-hook: @rm $(distdir)/configure.ac @rm $(distdir)/aclocal.m4 @find $(distdir) -name makefile.am -exec rm {} \; @find $(distdir) -name makefile.in -exec $(top_srcdir)/clean-makefile {} \; this solution sidesteps problematic issues derive am_maintainer_mode because there no meta-files modified. it strikes me 1 of biggest failings of autoconf misperception every project built using has dependency on autoconf (this not autoconf failing, failing of marketing/education), , misperception largely result of tarballs containing meta-files. ...

asp.net - The configuration section 'appSettings' cannot be read because it is missing a section declaration -

i clearing asp.net temporary internet files , accidentally deleted .net framework files (i have 3.0, 3.5, 4.0 , 4.5) neither visual studio 10 or visual studio 2012 opening. repaired installation of .net framework , able open vs again. though every web application buildable, when trying run any, error in web.config appsettings, though appsettings working before deleting incident, appears. i don't know went wrong , how fix this. iis error: http error 500.19 - internal server error the requested page cannot accessed because related configuration data page invalid. error code 0x80070032 config error the configuration section 'appsettings' cannot read because missing section declaration the config file: <?xml version="1.0"?> <configuration> <configsections> <section name="cid.dal" type="cid.dal.bases.nettiersservicesection, cid.dal" allowdefinition="machinetoap...

typo3 - Get data from one table with foreign_table and update to another in TCA -

i'm modifying image upload extension , i'm working on feature images can placed in categories. right categories listed in select field uses foreign_table categories table (called tx_gallery_categories) , when saved category id (the value in option field) saved table called tx_gallery_items. but column no longer needed (i wrong first time). depending on category choose want tca update table called tx_gallery_itemscategory , set categoryid itemid equal saved images uid here tca (i have removed other columns beside categoryid) , categoryid 1 want move out this, think, , in it's own tca connected tx_gallery_itemscategory: $tca["tx_gallery_items"] = array ( "ctrl" => $tca["tx_gallery_items"]["ctrl"], "interface" => array ( "showrecordfieldlist" => "hidden,oid,filename, videoembedcode,caption" ), "feinterface" => $tca["tx_gallery_items"]["feinterface"], ...

html - Safari specific scroll bar issue in legacy code -

i trying debug issue occurring in safari. on few pages of web application, content larger frame , scroll bar appears on right when scroll bar moves or down content not scroll it. can "scroll" scroll bar content inaccessible though scroll bar mobile. the issue occurs in "multi-process windows" debug mode option not in "single-process windows" option. scroll bar works fine in firefox, ie, , chrome, not in safari. because there's lot of legacy code, i'm not quite sure actual content , specific html elements relevant. can tell there's iframe element, html element, body element, div element, iframe element html element, body element , divs. edit matter if of elements within <iframe> have attribute scrolling="no" ? see on few of elements within iframe coworker reassures me don't matter. have tried adding overflow-y: scroll; body css?

mysql - Having to insert a record, then update the same record warrants 1:1 relationship design? -

let's order has many line items , we're storing total cost of order (based on sum of prices on order lines) in orders table. -------------- orders -------------- id ref total_cost -------------- -------------- lines -------------- id order_id price -------------- in simple application, order , line created during same step of checkout process. means insert orders .... -- id of inserted order record insert lines values(null, order_id, ...), ... where order id after creating order record. the problem i'm having trying figure out best way store total cost of order. don't want have create order create lines on order calculate cost on order based on lines update record created in 1. in orders table this mean nullable total_cost field on orders starters... my solution far have order_totals table 1:1 relationship orders table. think it's redundant. ideally, since required calculate total costs (lines on order) in database, work out value eve...

sorting - C++ Scoreboard hard time -

hello once again stackoverflow folks, hard , it's been torturing brain. must is, multiplayer server-sided scoreboard. 10 clients connected server application, during event everytime player kill player kills increased, each player connected server have class pointer class cuser { (...) public: unsigned m_ueventkills; unsigned m_ueventdeaths; (...) }; m_uevenkills increased everytime kills , ofc, m_ueventdeaths increase dying player. imagine player a,b,c,d,e,f each 1 of them have random kills (a,b,c,d... pointer cuser) so: a->m_ueventkills 72 b->m_ueventkills 13 c->m_ueventkills 2 d->m_ueventkills 44 e->m_ueventkills 21 f->m_ueventkills 33 and random values deaths. i have this: int nmax[10]; void organizemax() { memset( &nmax, 0, sizeof( nmax )); (...) organize max must fill nmax, 0 9 (10 top users) reading connected users (all of them own pointer cuser) ->m_ueventkills, , set nmax[0] 1 kills, nmax[1] second kills, nmax[...

c - Conversion between char and wchar_t in NDK -

assume: char from[10]="abcd"; wchar_t to[10]=l""; in gcc under linux , msvc, can use: sscanf(from, "%s", to); wchar_t string l"abcd" in to . not work in ndk. i want know whether supported in ndk? there alternatives? i know can use copy loop accomplish this: for (int = 0; <= strlen(from); ++i) to[i] = from[i]; i'm using android-ndk-r7-crystax-5.beta2-linux-x86.tar.bz2 . string contains ascii characters, i'm don't want use iconv . google android ndk said:support wchar function。but wchar function provided empty. such as: wsclen() , return 1. can use http://www.crystax.net/ ndk,

version control - how public is a github public repo? -

i moving github source control. can use public repo project doing, how public public? safe assume if not publicize project @ all, no 1 find among 3 mil repos have? i cannot have people seeing source code of right now, 7/mo little steep needing 1 private repo. no. that's not safe assumption. github has search engine public repos, , people use (including myself). so, there's decent possibility see source-code. if want free private repo, suggest using bitbucket instead, or service offers free private repos. note bitbucket free if have 5 or fewer users working in repo.

JavaScript date calculation with months difference -

i want calculate new date adding number of months specific date. for example: i have date "06/30/2012" (30th june 2012), , number of months "2" or "3" months. now want function gets both values , returns date 2 months after specified date. please show me how can achieved. you can try putting code, has need date addition/subtraction date.prototype.add = function (sinterval, inum){ var dtemp = this; if (!sinterval || inum == 0) return dtemp; switch (sinterval.tolowercase()){ case "ms": dtemp.setmilliseconds(dtemp.getmilliseconds() + inum); break; case "s": dtemp.setseconds(dtemp.getseconds() + inum); break; case "mi": dtemp.setminutes(dtemp.getminutes() + inum); break; case "h": dtemp.sethours(dtemp.gethours() + inum); break; case "d": dte...

ios - xcode shortcut key import h file and add the Delegate methods -

i new ios development know android @ eclipse. example lack package, can use ctrl + shift + o import package,if there shortcut key @ xcode can import .h file. because not know methods .h file. know when add new delegate .h file,how use shortcut key me add need implement methods. you don't have in xcode, , honestly, @ least in perspective, never had need have (and coming android background). if know class using, have #import or @class it. prefer way because makes aware of dependencies between classes.

build - Install script for perl script -

i have simple perl script , want make install script install dependencies (perl modules) , copy file.perl /usr/share/path asking password if necessary. found there solutions installing perl modules (makefile.pl, build.pl etc.). script isn't module. how should attempt it? makefile.pl / extutils::makemaker support exe_files parm perl script, can see how app::ack this or check tutorial . set prefix directory , should work you.

c++ how to listen HTTP requests -

im new in c++. i need listen http requests. please advice me tutorials or examples thanks update: platform: windows language: c++ i explain more need when user clicks row on page: http://ucp-anticheat.org/monitor.html applications automatically starts on client machine. i want make same thing. i think on client side service listens http requests , if url starts steam:// service automatically runs application... do need listen http requests? what best solution problem? if question right, want able launch application when clicks link custom protocol, steam:// or telnet://. looking protocol handler . a simple way register such application using ftype program, described here .

c# - asp.net javascript message not showing up -

i have button , onclick set method should display simple js alert pop window: string message = "file open. <br>please close file , try again."; system.text.stringbuilder sb = new system.text.stringbuilder(); sb.append("<script type = 'text/javascript'>"); sb.append("window.onload=function(){"); sb.append("alert('"); sb.append(message); sb.append("')};"); sb.append("</script>"); clientscript.registerclientscriptblock(this.gettype(), "alert", sb.tostring()); i have used code above before , has worked not time. difference using master pages other site , not one, , 1 has timer going. is there js related load in <head> of aspx page? protected void btntocsv_click(object sender, eventargs e) { try { streamwriter writer = new streamwriter(@"\\server location\test.csv"); writer.write stuf...

javascript - jQuery: how to check to make sure all asynchronous actions have been completed -

i have web form bunch of checkboxes; when specific box clicked, shows/ hides specific div more data in it. when divs hidden/ shown, run formatting command organize , color them properly. some checkboxes dependent on others, , cascading scheme implemented, possible, likely, several checkboxes changing state @ 1 go. instead of writing code each checkbox, decided take shortcut , handle checkboxes same way. ended (using 2 checkboxes/ divs make point, there's bunch more): jquery(document).ready(function () { alternatedivs(); jquery('#accesscas, #cas_lelocspecific').on('click', function () { showhide(); }); }); function showhide() { var thechecks = [ { checkid: 'accesscas', divid: 'divcas' }, { checkid: 'cas_lelocspecific', divid: 'divleloc' } ]; var pendingchanges = 0; (i = 0; < thechecks.length; i++...

facebook - setAccessToken() isn't working in the FB's PHP SDK -

require 'facebook/facebook.php'; require 'config/fbconfig.php'; require 'config/functions.php'; include dirname(__file__) . "/includes/session.php"; $facebook = new facebook(array( 'appid' => ".....", 'secret' => ".....", )); //token variable "false" if there no access_token if($_post['token'] != "false") $facebook->setaccesstoken($_post['token']); i passing access_token using ajax. call setaccesstoken() functions seems valid shown in docs returns undefined method error. sure token valid checked in facebook's debugger. update : did var_dump() on $facebook , it's valid facebook object. error not here. download latest version of php sdk github & replace current 1 you're using.

c# - Glimpse of Background window shown when new Form is displayed -

i have main form.i invoke form2 mainform using form2.showdialog(application.openforms["mainform"]); invoke form form2 this.hide(); form3.showdialog(application.openforms["mainform"]); this.dispose(); everything works fine when form3 displayed glimpse of window displayed in background ie:if had opened ms paint put in background paint window come on top of window time less second , automatically go backgroud. why behavior.how can correct it? when call this.hide() , form2 hidden , window needs focused. however, opened form2 showdialog, means form2 window can focused in application. since hid form2, windows finds window focus (in case ms paint). one suggestion solution artificially give mainform focus before hiding form2: application.openforms["mainform"].activate(); this.hide(); form3.showdialog(application.openforms["mainform"]); this.dispose(); perhaps more beautiful solution first open form3, wait shown, , hide...

java - Most performant protocol for uploading binary data to a jax-rs (REST) service -

environment my application (war) has javascript frontend , java rest service. the files uploaded generated in frontend, not directly user interaction -- not use case user uploading files herself. reason, it's necessary initiate upload javascript code. i need able send metadata (generated other parts of application) binary data when i'm uploading -- why need sort of protocol instead of uploading file. question what haven't been able determine best practice uploading files, regards, primarily, protocol used. i've come across following protocols: json xml proctol-buffers (via protobuf.js ) however, internets has, usual, lots of different info hasn't been giving me coherent picture: with regards reliability, internets seems you're better off using multipart/mixed type transfer data, instead of pure application/octet-stream type. json doesn't natively doesn't support binary data, , apparently, base64 has high processing overh...

nginx - how can I combine two different gdb commands “info symbol” and “ptype” into single one? -

in other words,is there command can find symbol @ address meanwhile use ptype show symbol‘s detail info ? or if there not, how can write user-define command meet needs ? for example, can firstly data struct‘s name (ngx_errlog_module_ctx) in address use “info symbol” command, use ptype show data struct’s detail info this: (gdb) info symbol 0x80b4568 ngx_errlog_module_ctx in section .data of /usr/local/nginx/sbin/nginx (gdb) ptype ngx_errlog_module_ctx type = struct { ngx_str_t name; void *(*create_conf)(ngx_cycle_t *); char *(*init_conf)(ngx_cycle_t *, void *); } but now, how can write user-difined command (ptype_with_address) can use : ptype_with_address 0x80b4568 ngx_errlog_module_ctx in section .data of /usr/local/nginx/sbin/nginx type = struct { ngx_str_t name; void *(*create_conf)(ngx_cycle_t *); char *(*init_conf)(ngx_cycle_t *, void *); } i want because research nginx’s code,i want write user-defined command show ngx_modules's detail info, ...

java - How to write content before and after the output of a JSP -

i have jpss represent components. want have these component jsps write html before , after contents of jsp executed. component.jsp <@page session="false"> <%= "hello " + "world" %> when jsp/servlet rendered, want render: <div class="component"> hello world </div> i want able create various "wrappers", , depending on jsp, include wrap contents of jsp correct content. if want change/augment wrapper down road, want in 1 place (could 100s of components). can <@page extends="..."> possibly? thanks what want named: tag files . introduced on jsp 2.0 with approach can write jsp tags using jsp, therefore need create folder named web-inf/tags , , create 'normal' jsp within folder. the tag want create needs have following start instruction: <%@tag description="tag description" %> in order indicate tag. to use need reference tags want use following ins...

c# - Where's the wallpaper registry key in Windows 8? -

i'm working on tool needs current user's wallpaper path. on windows 7, can reading hkey_current_user\software\microsoft\internet explorer\desktop\general\wallpapersource . on windows 8 installation, key has value c:\users\peter\appdata\roaming\microsoft\windows photo viewer\windows photo viewer wallpaper.jpg which not wallpaper that's set. is there other key can rely on? the key mentioning isn't correct one. sounds me you've placed image desktop background internet explorer, , key opened register it. the correct key desktop background location is: confirmed on: xp, ce, vista, 7, 8 hkey_current_user\control panel\desktop\wallpaper details: main key: hkey_current_user sub key: control panel\desktop value name: wallpaper value type: reg_sz value data: full path image being used desktop background also, under hkey_current_user\control panel\desktop\ find other wallpaper related options apply different styles: center, tile, , ...

asp.net mvc - Bundling and minification is sending old styles -

i followed article setup bundling , minification, http://www.asp.net/mvc/tutorials/mvc-4/bundling-and-minification . i thought working great, until updated css, kept getting old style. working in firefox, have cleared cache, restarted browser, restarted iis, , restarted computer, , nothing working. when turn off bundling , minification bundletable.enableoptimizations = false; the new styles show , page looks should. turn bundling , minification on , old styles again. also, whenever rebuild or change 1 of css files, there is new chache busting token. think sending different content, still old stuff. added test class 1 of css files, downloaded minified css file, test class added not there. has else run problem? follow instructions under debugging bundled , minified javascript figure out you're doing wrong. rebuild or change 1 of css files, there is new chache busting token verify using rc , not beta. rebuilding not change cache busting token, cha...

reflection - Return all of the functions that are defined in a Javascript file -

for following script, how can write function returns of script's functions array? i'd return array of functions defined in script can print summary of every function defined in script. function getallfunctions(){ //this function i'm trying write //return functions defined in script //function defined. //in case, return array of functions [foo, bar, baz, //getallfunctions], since these functions defined in //script. } function foo(){ //method body goes here } function bar(){ //method body goes here } function baz(){ //method body goes here } declare in pseudo namespace, example this: var mynamespace = function(){ function getallfunctions(){ var myfunctions = []; (var l in this){ if (this.hasownproperty(l) && this[l] instanceof function && !/myfunctions/i.test(l)){ myfunctions.push(th...

objective c - perform segue to initial view from any view with Storyboards -

i developing application using storyboards. application requires user logged in. the storyboard has login view initial. when login ok, performs segue tabviewcontroller . on call api, check if server returns 401 (not-authorized). if happens, boolean set false (boolean islogged). appdelegate observes boolean. if value changed false, want return user login screen (remember, initial view on storyboard). here code: - (void)observevalueforkeypath:(nsstring *)keypath ofobject:(id)object change:(nsdictionary *)change context:(void *)context { if ([keypath isequaltostring:@"islogged"]) { bool logged = [[change objectforkey:nskeyvaluechangenewkey] boolvalue]; if (logged) { nslog(@"logged in succesfully!"); } else { nslog(@"logout performed"); [self.window makekeyandvisible]; [self.window layoutsubviews]; } } this works fine, when try login again loginok segue not performed. i have tried many other...

the little schemer - what is the difference between these two Scheme functions? -

(define self-add (let ((x 0)) (lambda () (set! x (+ x 1)) x))) (self-add) => 1 (self-add) => 2 (self-add) => 3 (self-add) => 4 2. (define self-add1 (lambda () (let ((x 0)) (set! x (+ x 1)) x))) (self-add1) => 1 (self-add1) => 1 (self-add1) => 1 please tell me how understand difference between above 2 functions? lot in advance! best regards. the first function defines local variable x initial value of 0 , afterwards binds lambda special form name self-add - x "enclosed" lambda (that's why lambda behaves closure ) , same invocations of self-add (you x "remembered" self-add ), , each time gets called value of x incremented one. the second function binds lambda procedure , afterwards defines local variable x inside lambda - here x redefined each time self-add1 gets called, , different invocations: x never "remembered" ...

java - JFrame appearance and style -

i know if there anyway create jframe windows 7 aero task-bar. mean want whole frame being transparent , blurring scene in background. as swing plaf (pluggable , feel), there few options , feel of windows uimanager class.... pls try link... give idea http://www.scribd.com/doc/44575030/13-basic-swing

python - How do I specify a single test in a file with nosetests? -

i have file called test_web.py containing class testweb , many methods named test_something(). i can run every test in class so: $ nosetests test_web.py ... ====================================================================== fail: checkout test ---------------------------------------------------------------------- traceback (most recent call last): file "/users/me/path/here/test_web.py", line 187, in test_checkout ... but can’t seem run individual tests. these give me “no such test” errors when run in same pwd: $ nosetests test_web.py:test_checkout $ nosetests testweb:test_checkout what wrong here? you must specify so: nosetests <file>:<test_case>.<test_method> , or nosetests test_web.py:testweb.test_checkout see the docs

r - Problems with source() command after loading XML package -

after loading xml package source() command quits following error: > require(xml) lade nötiges paket: xml > source ("test.r") error in source("test.r") : 7 arguments passed .internal(identical) requires 6 if execute source() before loading package works fine. idea how fix this? more information: > traceback() 2: source("test.html") 1: source("test.html") > sessioninfo() r version 2.15.0 (2012-03-30) platform: x86_64-pc-mingw32/x64 (64-bit) locale: [1] lc_collate=german_austria.1252 lc_ctype=german_austria.1252 lc_monetary=german_austria.1252 lc_numeric=c [5] lc_time=german_austria.1252 attached base packages: [1] stats graphics grdevices utils datasets methods base other attached packages: [1] xml_3.9-4.1 loaded via namespace (and not attached): [1] tools_2.15.0 thx, fabian edit: seems work r 2.15.1

C# Excel result comparation -

i have never learned aspect of programming, there way each separate result of excel query(using oledb) or likes. the way can think of doing use keyword in sql statement, not work me (select attribute variable table). an example use select statement retrieve id of clients, , compare these id's clientid's in client listarray, , if match, clienttotal orders should compared. could prove reading material and/or example code problem. thank you. this code fetches rows sql procedure. work modifications. using (var conn = new sqlconnection(connectstring)) { conn.open(); try { using (var cmd = new sqlcommand("theprocedurequery", conn)) { cmd.commandtype = commandtype.storedprocedure; sqldatareader reader = cmd.executereader(); // find id of column in query once @ start var col1idord = reader.ge...

jsp - Spring Roo Show ID in list.jspx -

i have following in list.jspx file. <table:table data="${tests}" id="l_com_mtc_test_test" path="/tests" typeidfieldname="testid" z="rvizjj8fppq5kok8/jrrk464fr8="> <table:column id="c_com_mtc_test_test_name" property="name" z="fdtztamjsb4/b16zrgrro8e2pt8="/> </table:table> i want show id table (specifically testid reference in typeidfieldname). haven't had luck inserting own table:column, perhaps i'm doing wrong, advice?

jQuery ui multi select drag -

i need below functionalities select items list mouse dragging , cntrl key similar jquery ui selectables. multiple items should draggable @ time. i need application similar operating system drag , drop functionality. my problem if select multiple items mouse pointer item dragging, how resolve it. i tried use code has defects on selecting multiple items. $(document).ready(function(){ var selectedclass = 'ui-state-highlight', clickdelay = 600, // click time (milliseconds) lastclick, diffclick; // timestamps $("#draggable li") // script deferentiate click mousedown drag event .bind('mousedown mouseup', function(e){ if (e.type=="mousedown") { lastclick = e.timestamp; // mousedown time } else { diffclick = e.timestamp - lastclick; if ( diffclick < clickdelay ) { // add selected class group draggable...