Posts

Showing posts from August, 2014

include - How can i find/stop if the file is already included in nant while including a build file -

i have 4 files say: a.build, b.build, c.build & common.build. b.build & c.build includes common.build. i suppose call file a.build internally calls b.build & c.build. when try running file give me error common.build file included. is there way can stop including build file if it's included.... nant should ok same file being included more once, although can have problems if use use different cases in name (such 'hello.include' , 'hello.include' example). have @ this answer more details.

javascript - Disable jQuery-defined styles when printing -

i have page number of features , styles defined through jquery on document-ready , window-scroll, , made sure degraded nicely javascript disabled. however, throwing "print" stylesheet scraps of stylizations, , when tested realized jquery methods kicking in when printing , adding in background images. possible disable javascript or jquery, or particular function, when printing? the biggest problem piece, generates random background image based on number generated earlier...it overriding print stylesheet's call background-image:none, when using !important tag: $(document).ready(function() { $("body").css({backgroundimage: 'url(images/body_bg_'+background+'.jpg)'}); }); thanks! define styles in stylesheet. use javascript change dom cause styles applied element, instead of modifying style property. this lets keep control of different media, , maintain separation of concerns (semantics, presentation , logic). @media screen {...

c# - How to play dynamic sounds in XNA? -

is possible dynanmically generate sounds xna c# code? i looked time ago when xna first released. @ time possible playback sound resources included in compiled code. have there been changes or new features added since xna 1.0 allow xna application generate , playback audio on fly? yes. xna 4.0 added support dynamic audio allows to: create regular immutable sound effect raw buffer using soundeffect.fromstream method. create dynamicsoundeffectinstance object modify audio data of new streaming sound effect object dynamically. read more in blog entry what’s “dynamic” soundeffectinstance? , in apphub article dynamic audio .

MySQL & PHP: Send emails to the members who fall into last 3 active threads -

my query below last 3 active threads blog's commnets, select id, approved, recipientid, recipientscreenname, recipientemail ( select root_strings.str_id id, root_strings.str_approved approved, root_strings.mem_id recipientid, root_members_cfm.mem_screenname recipientscreenname, root_members_cfm.mem_firstname recipientfirstname, root_members_cfm.mem_email recipientemail root_strings left join root_members_cfm on root_members_cfm.mem_id = root_strings.mem_id root_strings.parent_id = '1' , root_strings.mem_id not null union select root_strings.str_id id, root_strings.str_approved approved, root_strings.mem_id recipientid, root_users.usr_screenname recipientscreenname, root_users.usr_firstname recipientfirstname, root_users.usr_email recipientemail root_strings left join root_users on root_users.usr_id = root_strings.usr_id root_strings.parent_id = '1' , root_strings.usr_id not null ) sq order id desc limit 0,3 it returns result this, id appro...

REST Windows Phone Photo upload -

i'm trying upload photo rest api in windows phone 7 application using restsharp gets/posts. post parameters follows: photo : photo, encoded multipart/form-data photo_album_id : identifier of existing photo album, may event or group album i've created request, every time "{\"details\":\"missing photo parameter\",\"problem\":\"the api request malformed\"}\n my photo parameter looks this: "---------------------------8cd9bfbafb3ca00\r\ncontent-disposition: form-data; name=\"filename\"; filename=\"somefile.jpg\"\r\ncontent-type: image/jpg\r\n\r\n(some binary junk listed here)\r\n-----------------------------8cd9bfbafb3ca00--" i'm not quite sure if it's problem how i'm presenting binary data image (currently in phototaskcompleted event, read contents of e.chosenphoto byte[] , pass helper method create form data) or if don't create form correctly. i...

objective c - How can I monitor a folder with Cocoa? -

i want create cocoa application monitor folder new files on mac os x. know can using applescript , folder actions, how can use objc , cocoa that? have @ file system events although, fine-grained monitoring documentation points using kqueues

Transforming SOAP WS output to an .xsd complaint XML in Java -

i have soap based web service returns xml response. need convert xml xml should compatible provided xsd file. is there opensource java framework can me in achieving xml transformation per xsd file? appreciate or pointers on this. thanks in advance! i have recommendation, if more comfortable java xsd/xml: assume first soap response xml compliant first.xsd , second 1 second.xsd. generate java types each using xjc , comes jdk1.6. now exercise convert instance of 1 type other , serizalize. basically, first.xml -> first java type -> second java type -> second.xml if absolutely needed, can use dozer framework convert across java bean types

Django: saving multiple modelforms simultaneously (complex case) -

well, may simple case i'm having tough time figuring out. i have 2 user registration funnels (corporate & else). when corporate user creates user instance through registration form, them input secondary forms create related instances (based on website , organization_contact models). i know how solve making additional synchronous or asynchronous requests, i'd user fill out 3 forms , submit 1 click. my issue here other 2 forms rely on user foreign key field. i've made field "null=true, blank=true" can validate , save forms without foreign key, want add key both model instances. i thought validate 3 forms, save userform, , use model queryset return new user.id (all in 1 view). add user_id value other 2 form dictionaries (websiteform , organization_contactform). it work so: def register_company(request): if request.method=='post' uform=usercreationform(request.post, prefix='user') sform=siteform(request.post, ...

How to ask mathematica to compute higher order derivatives evaluated at 0 -

i have function, let's example, d[x^2*exp[x^2], {x, 6}] /. x -> 0 and want replace 6 general integer n , or cases following: limit[limit[d[d[x /((-1 + x) (1 - y) (-1 + x + x y)), {x, 3}], {y, 5}], {x -> 0}], {y -> 0}] and want replace 3 , 5 general integer m , n respectively. how solve these 2 kinds of problems in general in mma? many thanks. can use seriescoefficient, sometimes. inputform[n! * seriescoefficient[x^2*exp[x^2], {x,0,n}]] out[21]//inputform= n!*piecewise[{{gamma[n/2]^(-1), mod[n, 2] == 0 && n >= 2}}, 0] inputform[mncoeff = m!*n! * seriescoefficient[x/((-1+x)*(1-y)*(-1+x+x*y)), {x,0,m}, {y,0,n}]] out[22]//inputform= m!*n!*piecewise[{{-1 + binomial[m, 1 + n]*hypergeometric2f1[1, -1 - n, m - n, -1], m >= 1 && n > -1}}, 0] good luck extracting limits m, n integer, in second case. daniel lichtblau wolfram research

zlib uncompress returns -5 on Ubuntu 10.10 x64 (g++ -m64) -

i use python , zlib compress buffer, , uncompress in c++ program. if build program g++ -m32, can uncompress buffer. if build g++ -m64 (and link same option), returns -5 (z_buf_error). can fix ? should change size of buffer ? i allocate output buffer exact size, should align on 64 bits or ? thanks. i ran kind of problems. had software running fine when compiled in 32bits (even if run on 64bits system) returning same z_buf_error uncompress() when compiling 64bits environment (using -m64) the compressed data checked: read compressed file software dumped in file again , compared, no differences. so conclusion problem coming zlib itself. ubuntu 10.4 repositories seem provide zlib version 1.2.3. zlib home page provides version 1.2.5 (with notes better portability). hope helps. edit: moved using uncompress() inflate() , fixed our problem 64bits architecture. still don't know if uncompress() working 64bits systems newer (>1.2.3) version of zlib thus. worka...

bash - Creating cron entry on server using ssh login within shell script -

i need upload file (bash script) remote sever. use scp command. after file has been copied remote server want create cron entry in crontab file on remote server. however, file upload , writing cron entry need occur within bash shell script need execute script on local machine , script copied remote host , cron entry written crontab. is there way can use ssh command, within script, logs me remote server, opens crontab file , writes cron entry. any welcome i would: extract user's crontab crontab -l > somefile modify file desired job import new crontab crontab somefile

Replace dots and commas in a field and then use that value to auto populate another field using jquery -

i'm using google maps calculate distance between cities. need use distance value basic calculations. distance has in "angloamerican" format (1,234.00) in metric system. so, google maps answer madrid - berlin query 1 of these two: a) <span jscontent="distance['text']" jsdisplay="distance" jstcache="7">2.320,1 km</span> b) <span jscontent="distance.text" jstcache="23">2.320,1 km</span> please notice differences in span "classes" (jstcache 7 or 23) , lack of "id" or "name" attributes. what want accomplish is: 1) convert these google maps distance values "angloamerican" format (2,320 km) or (even better) format without thousands separator use dots decimal separator (2320.1 km) 2) use filtered value populate text field called distance i searched on web, didn't find exact answer. post helpful: populate hidden form element value value of...

Delphi XE – Datasnap Filter problems -

i have tcp/ip datasnap -xe server uses pc1 , zlib filter on client both of these filters defined in datasnap tsqlconnection when client connects server "connection closed gracefully” error message if use pc1 filter on own - there no problem if use zlib filter on own - there no problem any ideas on how can both filters working @ same time? you need deploy libeay32.dll , ssleay32.dll client application well. a quote delphi xe datasnap development courseware manual: "if deploy datasnap standalone server, using tcp/ip , rsa , pc1 filters, must deploy 2 indy specific ssl dlls: libeay32.dll , ssleay32.dll – or make sure exist @ server machine. these dlls needed rsa filter (which encrypts password used pc1 filter). without these 2 dlls, client wants connect server “connection closed gracefully” message, because server unable load 2 dlls start rsa filter encrypt pc1 keys, etc. by way, same 2 dlls required datasnap client, whether connected tcp/ip...

jar - Why won't signed java applet connect to external server? -

i have java applet trying create vnc connection host (note host running applet , vnc host not same). more info on code i'm working can found here i got code compile xenserverconsole.jar put in root of webserver along folder structure com/citrix/xenserver/console/ . (the console folder has .java, .class , .png files). i signed xenserverconsole.jar file this: keytool -genkey -validity 3650 -keystore pkeystore -alias keyname keytool -selfcert -keystore pkeystore -alias keyname -validity 3650 jarsigner -keystore pkeystore xenserverconsole.jar keyname and i'm loading applet in html code: <applet code="com/citrix/xenserver/console/initialize.class" archive="/xenserverconsole.jar" width="800" height="600"> <param name="session" value="<%= @console_session %>"> <param name="url" value="<%= @console_url %>"> <param name="useurl" v...

css - How to show scroll after certain height but height should not be fixed? -

i have div following style: height:250px;scroll:auto;. want scroll after 250 px should have height according content in it. for example, if content in 100px, then, height of div should 100 without scroll. but, if height exceeds 250px, should show scroll. how can it? is after? demo css: .dyn-height { width:100px; max-height:250px; overflow-y:scroll; } height: optional - demo.

mocking - Testing aspx.cs classes? Should I do it? -

we using vs2010 4.0 framework ms test. question should create unit tests call aspx.cs page? using ef 4.0 , aspx.cs pages call down our repositories ( classes create / setup , remove objects context ). know need these tests but, should tests call aspx.cs pages or should separate calls repository file can tested self. i've never tried like: mypage1 pg1 = new mypage1(); // test methods.. thanks no. testing aspx pages hard , horrible. sounds app highly coupled if need test views in manner. test repository in isolation, won't able test in view keep logic simple enough , should ok. in other words make pages invoke repository , return results. alternatively check out adopting mvc paradigm.

java - Gson - attempting to convert json string to custom object -

here json returned server {"errorcode":1005,"message":"username not exist"} here class error public class errormodel { public int errorcode; public string message; } and here conversion code. public static errormodel geterror(string json) { gson gson = new gson(); try { errormodel err = gson.fromjson(json, errormodel.class); return err; } catch(jsonsyntaxexception ex) { return null; } } it throwing jsonsyntaxexception. ideas problem here? edit : requested, here further elaboration. my backend asp.net mvc 2 application acting rest api. backend isn't problem here, actions (and server errors) return json (using built in jsonresult ). here's sample. [httppost] public jsonresult authenticate(authenticaterequest request) { var authresult = mobileservice.authenticate(request.username, request.password, request.adminpassword); switch (authresult.result) { ...

java - Using Lucene MultiFieldQueryParser for multiple required fields -

i'm trying use multifieldqueryparser execute following search: contents:hello world priority:high i.e., only want see documents returned contain words 'hello' , 'world' , have priority of 'high'. default behaviour multifieldqueryparser appears return either contains contents:hello world or priority:high - can't figure out how change this. any advice? multifieldquery used when want search term across multiple fields. looking simple boolean query 2 clauses. query follows should work. +(+contents:hello +contents:world) +priority:high here have 1 boolean query occur.must clauses 1 is, in turn, boolean query 2 clauses , term query.

entity framework - EF Inserting Duplicate Parent Objects -

i have 2 classes: public class foo { public int fooid {get;set;} public virtual icollection<bar> bars {get;set;} } public class bar { public int barid {get;set;} public virtual foo {get;set;} } if run following code, foreign key conflict on fooid. var foo = f in context.foos f.fooid == 1 select f; var bar = new bar(); bar.foo = foo; context.bars.add(bar); context.savechanges(); if disable key checks in sql, end duplicate foo in database. loading foo same context adding new bar related foo won't cause duplication. guess real code uses 2 different contexts. the thing change in code (which won't compile because foo iqueryable<foo> , not foo ) materialize foo , example: var foo = (from f in context.foos f.fooid == 1 select f).single(); other code snippet fine.

javascript - PHP regular retrieval of JS-generated content for SEO purposes? -

i thought read in tutorial on yql chris heilmann if you're generating content client-side json, should include server-side function generate content @ regular intervals search engines find. (i wish find reference back.) true, , if so, php way run json function once week search bots? $.getjson('http://query.yahooapis.com/v1/public/yql?q=this%20*%20is%20query&format=json&callback=', function (data) { $.each(data.query.results.row, function (i, item) { $("table#results") .append('<tr><td class="color">' + item.color + '</td><td class="size">' + item.size + '</td><td class="brand">' + item.brand + '</td></tr>'); }); i found the reference (last line) a commenter provides php, html got stripped in comment: <?php $scsvfile = 'https://spreadsheets.google.com/pub?key=12345678&hl=en&output=cs...

Android New Intent New Screen -

i still not sure of opening new screen new intent. have 2 problems. 1 getting work , second more theory. firstly have 2 packages com.quiz.max , com.reason.max both have activities names accordingly eg quiz , reason respectively. here on click code trying execute @ moment in quiz go reason. intent intent = new intent(); intent.setclassname("com.reason.max", "com.reason.max.reason"); this.startactivityforresult(intent, requestcode); secondly heard if start intent everytime click button new intent created. mean if user goes reason page , navigates , clicks button again create new intent instead of going active one. dozens opened via method. therefore should close each reason intent once navigated or redundant point? max i think want intent intent = new intent(this, reason.class); startactivityforresult(intent, requestcode); secondly, don't "start intent". use intent ask activity start, in case reason act...

WPF Animation Package -

is there website sells pre-made animations wpf use or start incorporate in our on application? found this one it's limited , lot of icons / animations "coming 2010. it's i'm looking for. if happen know of websites please let me know. thanks! pixellab provide open source bag of tricks contains set of transitions can use animate changing content of control, eg when switching between views.

python - Django static files when locally developing - how to serve absolutely? -

this should super simple, somehow has had me stuck morning. i'm developing locally, using django debug server, , filestructure: /project/ (django project) /static/ (static files) in settings.py media_root , media_url both set '/static/' , i'm using in urls.py url(r'^(?p<path>.*)$', 'django.views.static.serve', {'document_root': '../static'}), in templates, files need server static directory configured such: <link rel="stylesheet" href="{{ static_url }}css/style.css"> that works should - javascript/css/images served hompage. however, when go subdirectory, such http://127.0.0.1:8000/news/ links broken. i've tried using variety of os.import options relative links properly, havent had luck. there way force relative base url, or perhaps hardcode filesystem? any amazing! in line in urls.py file, '../static' should changed absolute directory. try changing , see happens. ...

ios - UIButton animation not working properly -

see commented code below. why uibutton act differently uiview? //button creation uibutton *mybtn = [uibutton buttonwithtype:uibuttontypecustom]; [mybtn setimage:[uiimage imagenamed:@"someimage"] forstate:uicontrolstatenormal]; self.mybutton = mybtn; ... ///in button target method: uiview* test = [[uiview alloc] initwithframe:self.mybutton.frame]; test.backgroundcolor = [uicolor redcolor]; [buttoncontainer addsubview:test]; [uiview beginanimations:@"someanimation" context:nil]; [uiview setanimationduration:5]; [uiview setanimationdelegate:self]; self.mybutton.frame = cgrectmake(100,100,200,200); //the position animates smoothly, size snaps 200,200 //test.frame = cgrectmake(100,100,200,200); //this works perfectly. position , size both animate smoothly on 5 seconds. [uiview commitanimations]; @implementation uibutton(fixresizeanimation) - (void)setframe:(cgrect)_frame { [super setframe:_frame]; for(uiview* v in self.subviews) { if([v iskindo...

Imagemagick convert from PHP, to draw 2 borders on image -

i take simple image file (500px width example) folder, in php , exec('/usr/bin/convert -etc.') image , achieve this: http://imm.io/media/3o/3o7j.jpg . basically, want draw 2 colored borders/rectangles around image @ specific positions. can compose such command, or possible ? thank you. this may easier using gd extension in php. specifically, imagesetstyle() function set line dashes, , imageline() draw lines. this example loads image , draws dashed line on it. should able adapt needs. <?php $im = imagecreatefromjpeg('/your/file.jpg'); $w = imagecolorallocate($im, 255, 255, 255); $red = imagecolorallocate($im, 255, 0, 0); /* draw dashed line, 5 red pixels, 5 white pixels */ $style = array($red, $red, $red, $red, $red, $w, $w, $w, $w, $w); imagesetstyle($im, $style); imageline($im, 0, 0, 100, 100, img_color_styled); imagejpeg($im, '/path/to/save.jpg'); imagedestroy($im); ?>

iphone - How to get height of a line in UITextView -

Image
as shown in above diagram ... lineheight height of orange box. how can height of blue box (i.e. lineheight + line spacing height)? thanks! update: found the lineheight behaves differently depends on characters in content. if content in english, lineheight corrent (21, example, in default uitextview). however, when content mixed chinese characters, uifont lineheight still reported 21 while self.textview.contentsize.height increased differently: english - adding 21 points each line chinese - adding 24 points each line update ( sizewithfont: ) cgsize constrainedrect = cgsizemake(1000, 1000); cgsize rectenglish = [@"hello\nworld" sizewithfont:self.textview.font constrainedtosize:constrainedrect linebreakmode:uilinebreakmodewordwrap]; nslog(@"width: %.2f height: %.2f", rectenglish.width, rectenglish.height); cgsize rectchinese = [@"你\n好嗎" sizewithfont:self.textview.font constrainedtosize:constrainedrect linebreakmode:uilinebreakmodewordwrap]...

javascript - How to destroy YUI Panel on close? -

i want able destroy yui panel when user clicks close button. i have tried using hideevent not work. i'm assuming since object still active , therefore cannot destroyed: panel.hideevent.subscribe(function(o) { panel.destroy(); }); is there way can destroy panel when user clicks close? close button not assigned id although assigned class: <a class="container-close" href="#">close</a> ending having use settimeout() function: panel.hideevent.subscribe(function(o) { settimeout(function() {panel.destroy();}, 0); });

multithreading - Proper use of yieldIfContendedSafely() in an Android Multithreaded Application -

in application, using asynctask write data database in transaction. database accessed ui thread. while looking through available database methods, came across yieldifcontendedsafely() . seems method should used cases transaction being made separate thread. there hardly documentation on method other following: temporarily end transaction let other threads run. transaction assumed successful far. not call settransactionsuccessful before calling this. when returns new transaction have been created not marked successful. assumes there no nested transactions ( begintransaction has been called once) , throw exception if not case. here how assume use method thread: try { db.begintransaction(); //insert stuff database here ... // how use method? boolean yielded = db.yieldifcontendedsafely(); if (yielded) { try { thread.sleep(500); } catch (interruptedexception e) { ...

java - method declaration gives an error. What gives? -

so i'm still plugging away @ big assignment (thanks helping me figure out problem loop). have moved on start making checkdigit() method used validate whether check digit on isbn # valid (which have started screwing around with). here's problem: tried compile it, compiler tells me there expected @ method call. here snippet of beginner's code: private string validateisbn(string booknum)throws isbnexception { boolean check=false; booknum.replaceall("-",""); if (booknum.length()!=isbn_num) throw new isbnexception ("isbn "+ booknum + " must 10 characters"); (int i=0;i<booknum.length()-1;i++) { if (character.isdigit(booknum.charat(i))) check=true; } if (booknum.charat(9)=='x') check=true; if (character.isdigit(booknum.charat(9))) check=true; if (check=false) throw new isbnexception ("isbn " + booknum + " must contain digits" + ...

php splitting large numbers (like explode) -

i need functionality of php explode(), without separators. for example, turning variable "12345" array, holding each number seperately. is possible? i've googled found explode(), doesn't seem work. thanks! with string in php: $foo="12345"; echo $foo[0];//1 echo $foo[1];//2 //etc or (from preg_split()) page in manual $str = 'string'; $chars = preg_split('//', $str, -1, preg_split_no_empty); print_r($chars); even better: $str = 'string'; $chars=str_split($str, 1) print_r($chars); benchmark of preg_split() vs str_split() function microtime_float() { list($usec, $sec) = explode(" ", microtime()); return ((float)$usec + (float)$sec); } $str = '12345'; $time_start = microtime_float(); ($i = 0; $i <100000; $i++) { $chars = preg_split('//', $str, -1, preg_split_no_empty); //$chars=str_split($str, 1); } $time_end = microtime_float(); $time = $time_end - $time_start; echo...

c - Use __wrap_malloc in a shared library -

i created shared library in linux calls malloc wrapper __wrap_malloc. void * __wrap_malloc( size_t size ) { printf("test\n"); return __real_malloc( size ); } then shared library generated successfully. but when use shared library , build application. linker gives me "undefined" error message, undefined reference `__wrap_malloc' is possible call __wrap_malloc() function in shared library? please advice. many thanks. you not using --wrap option ld correctly. without more information command line using impossible determine going wrong.

java - Why do I need Maven if I use Eclipse? -

i have seen if right click on project in eclipse , choose run on server, can see output means project running. if working fine without maven, what's point of using it. how different running via eclipse? maven build tool (build manager, in fact), similar ant. main job of build tool configure project, compile using required projects , final packaging. build script in project gives blue-print of project's deliverable structure. frees configurable dependencies on specific ide eclipse. need know standard command perform build , can build code anywhere. now, question, why wouldn't in eclipse? for simple project , small team maven overkill. can communicate configuration, ide use, , instruct special steps taken. in big projects, however, there exits lots of loosely coupled dependencies. start with, there different settings developer machine build, test build , production build. there requirements run automated test, integration tests, store build package (artifa...

Message box in C in Linux -

i want pop message "successful" after execution program in c in linux? the thing , should run on both kde , gnome. how can message box here? for gnome may use zenity . example: $ your_program && zenity --info --text="successful" for kde use kdialog

forms - Rails - Using form_for and fields_for, how do you access the sub-object while in the fields_for block? -

in first rails app i'm trying use form_for , fields_for create nested object form. far good, can't figure out how access sub-object while in fields_for block. i've pre-populated field in sub-object data want show in user instructions. models garage: has_many :cars, :dependent => :destroy accepts_nested_attributes_for :cars car: belongs_to :garage garage controller def new @garage = garage.new in 1..5 @garage.cars.build :stall_number => end end _form.html.erb <%= form_for @garage |f| %> <%= f.label :title, "garage name" %><br /> <%= f.text_field :title %> <% f.fields_for :cars |builder| %> <p>enter license car parked in stall: <%= car.stall_number %></p> <%= f.label :license, "license #:" %><br /> <%= f.text_field :license %> <%= end %> <%= end %> as can see, inside builder block :cars, want show, in u...

mysql - SQL QUERY NOT IN -

select count(accessed_time) total user_db application_id '1%' , accessed_time between '" + date1 +"' , '"+daten+"' this query fetch application id begin 1...i need exclude 101....from result...how can modify query simply add and . select count(accessed_time) total user_db application_id '1%' , application_id <> 101 , accessed_time between '" + date1 +"' , '"+daten+"'

How to Impement Cascading in CakePHP -

i have following tables in database people{id,name,email} delegates{id,people_id,company} , have 2 model classes person delegate i want establish relation between person , delegate ,means how cascade save operation when call on delegate. and want write controller should display form add delegate. how please explain me syntax? http://book.cakephp.org/view/1036/delete notice second param

.net - C# Windows Forms Application Update on Application Startup -

my application has been updating ages, , i've been making changes, releasing new builds etc every day past few months, now, when application starts (it checks updates on startup), begins downloading updated version server, , fails 3-quarters of way through following message: platform version info windows : 6.1.7600.0 (win32nt) common language runtime : 4.0.30319.1 system.deployment.dll : 4.0.30319.1 (rtmrel.030319-0100) clr.dll : 4.0.30319.1 (rtmrel.030319-0100) dfdll.dll : 4.0.30319.1 (rtmrel.030319-0100) dfshim.dll : 4.0.31106.0 (main.031106-0000) sources deployment url : file:///c:/users/jason/desktop/oom.appref-ms%7c server : microsoft-iis/7.0 x-powered-by : asp.net deployment provider url : http://www.website.net.au/software/updates/something/oom.application application url : http://www.website.net...

Visual Studio 2010 - Service Pack 1 Beta rollback? -

i installed visual studio 2010 premium @ work computer. i'm evaluating installation of vs2010 sp1 beta adjust many little problems i've noted in using vs2010. but don't know if sp1 beta rollbackable or if if'll have reinstall vs2010 when final sp1 arrive us. could advise me opportunity this? thanks lot rob this copy readme file @ http://go.microsoft.com/fwlink/?linkid=207141 : 2.2. uninstalling 2.2.1. on computers have earlier versions of visual studio 2.2.1.1. uninstalling visual studio 2010 sp1 beta removes features in visual studio tools office , visual studio tools sharepoint uninstalling visual studio 2010 sp1 beta removes visual studio tools office (vsto) design time , features of visual studio tools sharepoint. office , sharepoint features in visual studio 2010 sp1 beta major upgrades , have different product guids in visual studio 2010 original release. therefore, when sp1 beta removed, featur...

.net application architecture guidance -

i in confusion . please guide me. see, have .net application (say web application). n-trier . 3-tier. usual. having presentation layer , business layer,data access layer. fetching records in data layer in dataset , data tables found sophisticated. when passing data data layer business layer have use there . because per thinking use of system.data in business layer not proper. may harms performance in case. should media transfer data between these 2 layers? another question in same scenario , let have stored procedure in database having user information insertion functionality. want pass data presentation layer data later through business layer. correct way pass data vise versa between layers. may use user object. in architecture level if used user object pass data, need access user object in layers. should user object place in layers in application ? question one: classes. create user class , return ilist<user> data layer business layer when reading users tabl...

java - Difference between an application server and a servlet container? -

i trying understand difference between full fledged application server (e.g. weblogic, jboss etc.) , servlet container (tomcat, jetty etc.). how differ , when use which? thanks, a servlet-container supports servlet api (including jsp, jstl). an application server supports whole javaee - ejb, jms, cdi, jta, servlet api (including jsp, jstl), etc. it possible run of javaee technologies on servlet-container, have install standalone implementation of particular technology.

asp.net ajax - xmlhttp request -

i have created button on web browser when clicked should execute asp file.how create this!! dont know why xmlhttp request not being sent.i tried on localhost,but still nothing seems work!! code goes button onclick i.e javascript goes this!! custombutton = { 1: function () { var xmlhttp; if (window.xmlhttprequest) {// code ie7+, firefox, chrome, opera, safari xmlhttp=new xmlhttprequest(); } else {// code ie6, ie5 xmlhttp=new activexobject("microsoft.xmlhttp"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readystate==4 && xmlhttp.status==200) { document.getelementbyid("mydiv").innerhtml=xmlhttp.responsetext; } } xmlhttp.open("get","http://localhost/default.asp",true); xmlhttp.send(); } } i using htdocs folder wherein default.asp file located.the code of default.asp is <%@ page language="c#" autoeventwireup="true" codebehind="default.aspx.cs" inherits=...

sql server 2005 - Select 100K+ records quickly -

i need select 100k+ records sql table , processing , bulk insert table. using sqlbulkcopy to bulk insert runs quickly. getting 100k+ records, using datareader. problem: getting timeout error in datareader. have increased timeout managable number. is there sqlbulkcopy selecting records in bulk batch? thanks! bala it sound should processing inside sql server. or split data chunks.

SQL Server 2005 view & subquery performance issues -

i have following 2 tables: person - approx 7000 rows perosnid - 9 characters persontype - char (one of 'f' / 'c' / 'm') personstatuses - approx 90k rows (roughly 13 rows each person row) id - identity personid - 9 character statuscode - integer lastupdatedate - datetime i'm using view return latest row personstatuses realting unique person row: latestpersonstatuses select personid, statuscode personstatuses ps1 lastupdatedate = (select max(lastupdatedate) personstatuses ps2 ps2.personid = ps1.personid) the following query: select distinct person.id person person.id in (select personid latestpersonstatuses statuscode = 12) , person.persontype='f' plan 1 http://i56.tinypic.com/n4tc9u.jpg takes minute perfrom, timing-out, while following: select distinct person.id person per...

sql - DBMS Query Log, is it possible? -

we want record db query log table, possible? from sql server perspective...... as others have suggested, sql server profiler 1 way go you're going incur resource hit doing so. should choose method absolutely must implement server side trace rather via gui. you may have success monitoring, recording contents of dynamic management views (dmv) things such query execution statistics. you'll want @ dmv's such as: sys.dm_exec_query_stats sys.dm_exec_sql_text sys.dm_exec_query_plan for example, here query can used identify poorest performing top 20 sql queries cpu consumption. not after demonstrate how use dmv's interested in. select top 20 qs.sql_handle, qs.execution_count, qs.total_worker_time total_cpu, total_cpu_inseconds = --converted microseconds qs.total_worker_time/1000000, average_cpu_inseconds = --converted microseconds (qs.total_worker_time/1000000) / qs.execution_count, qs.total_elapsed_time, ...

tfs2010 - Team Foundation Server 2010 Framework -

can work framework 1.1 while using team foundation server 2010? there's nothing linking use of tfs specific version of framework, exception of development environment you're using. if using visual studio 2010, should able target framework 1.1 development (though on windows 7 machine, may require additional download , installation.). if using visual studio 2005 or 2008, you'll need appropriate forward compatability update: vs 2005: http://www.microsoft.com/downloads/en/details.aspx?familyid=22215e4c-af6f-4e2f-96df-20e94d762689&displaylang=en vs 2008: http://www.microsoft.com/downloads/en/details.aspx?familyid=cf13ea45-d17b-4edc-8e6c-6c5b208ec54d if talking developing applications can integrate tfs 2010, aren't going successful using framework version 1.1.

jQuery - Parse Json then Display Data -

i'm having problem parsing valid json twitter list displaying list on page. here code; var url = "http://api.twitter.com/1/aplusk/lists/5676047/statuses.json&callback=?"; $.getjson(url, function(data) { var results = ''; $(data.results).each(function() { results += "<p class='tweet_result' id='tweet" + this.id_str + "'><a href='http://twitter.com/" + this.user.screen_name + "' title='' class='tweet_user'></p>"; }); $(results).prependto("#twitter_results"); }); if put url in www.jslint.com can view structure of json i'm new json doing stupid here. thanks in advance , advice. the url has be: http://api.twitter.com/1/aplusk/lists/5676047/statuses.json?callback=? (note question mark instead of ampersand) also see returned object, does'nt have member "results", it's native javascript-array. you'll have itera...

web services - WSE3.0 usage via PHP scripts -

is possible have php communicate wse3.0 (microsoft). i know runs rbo/lbo system communicating between current software , server. i'm trying integrate web based version via php. wse obsolete. john saunders.

uuid custom typehandler mybatis -

i want manage table varchar primary key, in mapped java object should uuid. i have sql-map-config.xml : <?xml version="1.0" encoding="utf-8" ?> <!doctype configuration public "-//mybatis.org//dtd config 3.0//en" "http://mybatis.org/dtd/mybatis-3-config.dtd"> <configuration> <properties resource="database.properties"/> <typehandlers> <typehandler handler="[...].persistence.typehandlers.uuidtypehandler" javatype="java.util.uuid" jdbctype="varchar"/> </typehandlers> <environments default="development"> <environment id="development"> <transactionmanager type="jdbc" /> <datasource type="pooled"> <property name="driver" value...

Creating Build.FINGERPRINT on Android -

android documentation refers build.fingerprint way uniquely identify build. i'd know how property generated. i'm compiling whole framework on board , it's set default unknown . question if market uses identifier kind of validation? see here overview of build.fingerprint: android.os.build.fingerprint: string uniquely identifies build. should reasonably human-readable. must follow template: $(brand)/$(product)/$(device)/$(board):$(version.release)/$(id)/$(version.incremental):$(type)/$(tags) for example: acme/mydevice/generic/generic:2.1-update1/erc77/3359:userdebug/test-keys the fingerprint must not include spaces. if other fields included in template above have spaces, should replaced ascii underscore ("_") character in fingerprint. i know need have platform certified (which yes, includes providing fingerprint market can display apps device able run) before being licensed use market.

iphone - Ensuring correct date/time -

we creating location-enabled app users use app record events in field. the important part of event data when event happened. no issue when user online, support situations when user offline (by remembering & later syncing events). there situations when users offline , change time on phone, event times wrongly recorded. so, best way ensure correct time, independent of user actions, given device offline. ideas: gps time. possible acquire it? tracking system time changes made user? any other idea? note: time need second accuracy, approximately minute accuracy ok. note2: creating mobile apps android , iphone, i'm interested generic solutions , solutions specific of 2 platforms. i, personally, wouldn't worry scenario. liklihood of intentionally changing time on android (which periodically throughout day syncs time server automatically) while offline seems low me. being said, way see compensating keep service running in background keeps running tally ...

c# - Sharepoint 2010. Api. How to get field history? -

i have splistitem , text field. need in code versions of field ex: version 1 "hello rorld" version 2 "hello world" version 3 "new application" any examples how that? try this: foreach (splistitemversion version in item.versions) { console.writeline(string.format( "{0}. version {0} \"{1}\"", version.versionid, version["this field"])); }

segmentation fault - Why does Matlab crash when I use delete[]? -

i'm writing 2 matlab mex file handle persistent memory. want this a *a = new a[n]; and free memory when i'm done using delete[] a; this done using 2 separate mex function calls. problem delete[] statement crashes matlab segmentation fault. however, if reserve memory using malloc works fine: a *a = (a *) malloc(n*sizeof(a)); = new(a) [n]; and when i'm done free(a); any ideas why happens? proper way deal situation? edit: looking @ code realize wasn't telling truth above. doing like a *a = new b[n]; and then delete[] a; where b derived a. have found out results in undefined behaviour...

panel viewport missing scrollbar in ie extjs -

i've following extjs code works fine in ff in ie vertical scrollbar not appear when overflow happens in west region. whats wrong? ext.onready(function(){ var viewport = new ext.viewport({ layout:'border', items:[{ region:'west', id:'west-panel', split:true, width: 250, minsize: 175, maxsize: 400, collapsible: false, margins:'5 0 5 5', cmargins:'5 5 5 5', border: false, autoscroll:true, layout:'fit', layoutconfig:{ autowidth:false }, contentel:layers },{ region:'center', margins:'5 5 5 0', layout:'column', autoscroll:false, border: false, contentel:main }] }); }); i did try above code , here seems no problem @ ie8,ff&...

tabbar - iPhone - tab bar kind of functionality -

i want have colored images (not gray ones) in uitabbar view. not possible. each tab, can associate 1 view controller. view controller can view or navigation view or table view. (its simple handle) so, decided place 3 different buttons @ bottom of view. on click of each button, want show different view controllers (in space above 3 buttons). don't want use like [self.view addsubview:viewcontroller.view]; do want me create 3 different view-controllers or views or else , achieve functionality of tab bar. thanks in advance. instead of creating tab bar functionality easy handle creating custom tab bar class images. read so post in set image background color using ([[uicolor alloc] initwithpatternimage:[uiimage imagenamed:@"defaultad.png"]])

Javascript touch events in a UIWebview that is embedded in a UIScrollview -

i have question regard javascript , touch events in uiwebview, when uiwebview embedded inside uiscrollview. the uiscrollview has number of views (i'll call them "subviews" simplicity) side side within it. each subview size of ipad screen , swiping left/right should move on next/previous subview. 1 of these subviews uiwebview in running small javascript app uses touch events , additionally iscroll component in cases. unfortunately fact uiwebview embedded inside uiscrollview (a practise apple not recommend: http://developer.apple.com/library/ios/#documentation/uikit/reference/uiwebview_class/reference/reference.html - see box labelled 'important') out of hands. the problem have regard touch events when swiping in uiwebview subview. if load google homepage example swipe works fine , next subview moves view. when load 1 of js apps swipe not work. i assuming uiwebview component gets touch events , passes them on javascript inside can respond accordingly. p...

iphone - Can't Add Localization in iTunes Connect -

i have question itunes connect: when click "manage localizations" on page of iphone app (which online, not in review or something), not able add new language. does know whether can add localizations when creating new version of app? or did overlook something? does this? you cannot add new language page because app has either already been approved or is in review . add new language, must submit new version of app. so if online means "in app store" yes, new localization possible when submit next version.

.net - Does x64 mono require x64 class library? -

i compiled x64 mono (version 2.11 ) on windows. i noticed every program use class library (system.net, system.io, ...) crash systematically. downloaded latest version of class library , works ok on x86 not on x64. does x64 mono require x64 class library ? the x64 compatibity issue on windows prevented using mono on many projects. decided give try, hope works fine time. currently, 64-bit mono runtime not require different set of class libraries 32-bit mono runtime. you need ensure version of class libraries matches version runtime expecting. if didn't match error message console on startup. a coworker , did port of mono runtime windows x64. not tested 32-bit runtime, , errors may in fact bugs. please file issues here: http://www.mono-project.com/bugs

c# - How to create this kind of XML? -

i want create via c# code xml this: <title> <a> <aaaaaaaaaaaaa/> </a> <b> <bbbbbbbbbbbbb/> </b> </title> with code should create tree thist? well, if can use linq xml it's insanely easy: xelement root = new xelement( "title", new xelement("a", new xelement("aaaaaaaaaaaaa")), new xelement("b", new xelement("bbbbbbbbbbbbb")) ); additionally, if need build dynamically data (which will), can include queries within constructor calls, , work. linq xml impressively easy-to-use api. of course, require .net 3.5 or higher.

objective c - How to implement the color wheel inside the UIView? -

i searched web site, , found how draw color wheel... math behind colour wheel but implement drawing on uiview. how can using quartz technology? should draw dots or lines? thank you maybe use you. cgcontext*** functions draw dots or lines, , uigraphicsgetimagefromcurrentimagecontext uiimage item. -(void) drawpoint:(cgpoint)point { cgcontextbeginpath(uigraphicsgetcurrentcontext()); cgcontextmovetopoint(uigraphicsgetcurrentcontext(), point.x, point.y); cgcontextaddlinetopoint(uigraphicsgetcurrentcontext(), point.x, point.y); cgcontextstrokepath(uigraphicsgetcurrentcontext()); } -(void) drawlinefrom:(cgpoint)start to:(cgpoint)end { cgcontextbeginpath(uigraphicsgetcurrentcontext()); cgcontextmovetopoint(uigraphicsgetcurrentcontext(), start.x, start.y); cgcontextaddlinetopoint(uigraphicsgetcurrentcontext(), end.x, end.y); cgcontextstrokepath(uigraphicsgetcurrentcontext()); } draw uiimage uiview. uicolor* backcolor = ...

php - How to create digital signature that can not be used to reproduce the message twice -

i creating client-server application , i'd send data server client securely. using public/private key algorithms makes sense , in php can use openssl_sign , openssl_verify functions check data came has private key. now imagine 1 of actions sent server client destructive in nature. if uses http sniffer catch command (which signed properly) how can make sure command executed when our server sent , not hacker reproducing same command? ok while writing figured out using auto-increment id number every sent message simple solution problem. client have check incoming message id never smaller current id have stored. include nonce (random value, unique each message) message, , on client keep track of used nonces. i.e. if attacker takes signed message , resends later, nonce used client, client won't handle message second time.

php - MYSQL Error, server has gone away? -

i useing query below, when run query once per page there no problem, needs called around 30+ times different values on single page, runs ok, page never loads, , "server has gone away" error, http://dev.mysql.com/doc/refman/5.0/en/gone-away.html is performance problem, need break down query smaller ones (will have effect), or there else can ? select normalmtm.id, normalmtm.amt, normalmtm.lockexpire, ptassumptions.id, ptassumptions.zero, ptassumptions.beta, ptdata.id, ptdata.date normalmtm inner join ptdata on ptdata.date = normalmtm.lockdate inner join program on program.clientcode = '1' , program.clientprogram = normalmtm.program , program.normalprogram = 'program' inner join ptassumptions on ptassumptions.clientcode = '1' , ptassumptions.program = program.normalprogram inner join purpose on purpose.clientcode = '1' , purpose.clientpurpose = normalmtm.purpose , purpose.normalpurpose = ptassumptions.purpose inner join status on status.cl...

html - Onclick Submit form Javascript with image buttons -

hey, have form <form method="post" action=''> <input type="hidden" name="op" value="download1"> <input type="hidden" name="usr_login" value="<tmpl_var usr_login>"> <input type="hidden" name="id" value="<tmpl_var file_code>"> <input type="hidden" name="fname" value="<tmpl_var file_name>"> <input type="hidden" name="referer" value="<tmpl_var referer>"> <div class="premium-download"><input name="method_premium" value="<tmpl_var lang_premium_download>" type="image" src="images/premium-download.png" alt="<tmpl_var lang_premium_download>" border="0" /></div> <div class="free-download"><input name="method_free" value="<tmpl_...

java - Do I need to flush the servlet outputstream? -

do need "flush" outputstream httpservletresponse? i saw should close servlet outputstream? don't need close it, it's not clear if need flush it. should expect container well? protected void doget(httpservletrequest request, httpservletresponse response) throws servletexception, ioexception { byte[] response = getresponse(); string responsetype = getresponsetype(); response.setcontentlength(response.length); response.setcontenttype(responsetype); response.getoutputstream().write(response); response.getoutputstream().flush(); // yes/no/why? } you don't need to. servletcontainer flush , close you. close way implicitly calls flush. see chapter 5.6 of servlet 3.1 specification : 5.6 closure of response object when response closed, container must flush remaining content in response buffer client. following events indicate servlet has satisfied request , response object closed: the termination of service m...