Posts

Showing posts from May, 2015

.net - Does C# allow double semicolon ; ; if so, are there any special ways? -

i writing statement , compiles, compiler [vs] never tells me put semicolon 2 times. this means in asp.net mvc 3 return json(mydata);; return json(mydata); both of them compile, first wrong in design pattern. why doesn't tell me 2 semicolons. if there no reason use 2 semicolons, why doesn't show error? if there special use of it, please show me 2 semicolons required write statement in c#. no, double semi-colon never required. i'm surprised compiler doesn't complain it's unreachable statement, apparently it's legal. won't harm, equally it's not idea.

how to place banner on the view at run time in iphone sdk 3.0 onwards -

i want display banner @ top of view know iad available works on 4.o onwards , want display sdk 3.0 onwards can 1 give me links or video give me proper steps create it. thanx & regards priyanka.. minimum requirement run iad ios4 or higher. many ios users switching ios4 can go ahead , cater that. cheers.

c - Xlib: draw a text input box and read text as it is typed -

i trying implement text box user can type, use arrow keys, backspace, delete, etc. able know in text box without user needing submit anything. suppose catch keypress events, find way display cursor, , build min-text-editor hand--but maybe reinventing wheel? what after rather scrabble-like. have several letters in top part of window , text box in bottom. each time type letter disappears top pane know when you've used them up. want able edit text arrow keys, 'cause rather 7 letters scrabble give me hope doing paragraphs. i have window displaying, , source file processed , displayed list of allowable letters... want update list of allowable letters while user types in sentence. can xlib this? there else might more suitable? thanks! can xlib this? why yes, xlib can lot of things. describe seems simple enough using x's event processing , drawing functions . xlib pretty crufty, though, , imo should use if need closeness x protocol. (even there newer...

php - array_walk_recursive return value -

i using array_walk_recursive callback function search within nested array specified key: array_walk_recursive($array, array($this, 'walk_array'), $key); here callback function: function walk_array($value, $key, $userdata = '') { if ($key === $userdata) { self::$items_array[$key] = $value; echo $value . "<br />\n"; } } the problem can not find way store/return found elements callback function though using static variable $items_array contains last item processed array_walk_recursive . on other hand, if echo found elements callback function: echo $value . "<br />\n"; all found elements echoed fine. how return or store found elements callback function? if $key going correspond multiple values in nested arrays walk through, $item_arrays should have own array key. otherwise, you're doing overwriting self::$items_array[$key] every value comes by. try this: self::$items_array[...

c# - Problem with DataTable.Select -

is there way find value in datatable use method select: items.select("number '%10%'"); but number type int, , code doesn`t work... look @ t-sql cast , convert functions, might here. basically, in query, use either cast or convert (not sure best suited you) change int string can perform like on.

php - Compare integers -

$a = somenumber; $b = somenumber; how know variable has biggest number? shorter way task. each number positive integer without residue. thanks. max returns largest value list of values: $biggest = max($a, $b); if care variable contains higher value, use > , other answers have said.

php - suddenly "my http Apache server stopped working" using xampp -

every thing fine server stopped working there nothing in error logs phpmyadmin working fine problem occurs when project first home.php page loaded when sign in entering email id , password server stopped working . (i have not changed thing in php.ini) (earlier working fine) pl so, if understand correctly, server stops working after log in? phpmyadmin still working? something's not right there. if phpmyadmin still running after problem, problem related apache config file. if cannot access phpmyadmin @ until restart of apache, apache server. however, since nothing showing in error logs, doubt somehow. could paste relevant parts of apache config, tell in more detail, urls using log in, software using (if case, e.g. wordpress) , perhaps explain more trying do? edit 1 if php related error, try reading php error log. log different apache log. servers never send error reports browser default , show white page. can find location of php log file in php.ini. keep loo...

Python- need fast algorithm that removes all words in a file that are derivatives in other words -

we have file named wordlist, contains 1,876 kb worth of alphabetized words, of longer 4 letters , contain 1 carriage return between each new two-letter construction (ab, ac, ad, etc., words contain returns between them): wfile = open("wordlist.txt", "r+") i want create new file contains words not derivatives of other, smaller words. example, wordlist contains following words ["abuser, abused, abusers, abuse, abuses, etc.] new file created should retain word "abuse" because "lowest common denominator" (if will) between words. similarly, word "rodeo" removed because contains word rode. i tried implementation: def root_words(wordlist): result = [] base = wordlist[1] word in wordlist: if not word.startswith(base): result.append(base) print base base=word result.append(base) return result; def main(): wordlist = [] wfile = open("wordlist.txt...

c++ - Writing on Hyper terminal using WinCE device -

ia m trying read/ write on hyper terminal using wince device. iam able write data on terminal device not able read data terminal device. afer writing on terminal , hyper terminal not accepting text keyboard. using basic communication api's reading , writing(readfile() , writefile().write file working not able write new line on terminal tried \r\n). please suggest poiner regarding perhaps post code? assume you're using windows api (since mention readfile() , mfc). there sorts of reasons why data not being read device.

datetime - Date and Time by Location C# -

i want try hand @ building simple date time app shows local time of computer on , add ability change date , time location via drop down box. i should mention complete beginner. i have managed accomplish first part app displays local time in label. know how can time , date location not country, specific states in city e.g los angeles in or moscow in russia. i've read cultureinfo.datetimeformat property i'm not sure if give me i'm looking for. any pointers good, i'm not looking write code me, i'd learn nothing way, example or maybe nudge in right direction. thanks. have @ timezone , timezoneinformation in msdn documentation.

c# - Create an application pool that uses .NET 4.0 -

i use following code create app pool: var metabasepath = string.format(@"iis://{0}/w3svc/apppools", servername); directoryentry newpool; directoryentry apppools = new directoryentry(metabasepath); newpool = apppools.children.add(apppoolname, "iisapplicationpool"); newpool.commitchanges(); how specify app pool should use .net framework 4.0? i see tags you're using iis7. unless absolutely have to, don't use iis6 compatibility components. preferred approach should use microsoft.web.administration managed api. to create application pool using , set .net framework version 4.0, this: using microsoft.web.administration; ... using(servermanager servermanager = new servermanager()) { applicationpool newpool = servermanager.applicationpools.add("mynewpool"); newpool.managedruntimeversion = "v4.0"; servermanager.commitchanges(); } you should add reference microsoft.web.administration.dll can found in: %systemroot...

PHP ,convert string to array? -

such : defghijklmn into array like: $diskvolume = array('d','e','f','g','h','i','j','k','l','m','n'); because explode() doesn't work kind of string. thank much!! use str_split() split string individual characters: $diskvolume = str_split($string);

java - InitilizationError when JunitTest with Maven -

i'm trying junit-test's maven3 initilizationerror(some testclass here) when executing test have junit-annotations (all other tests run fine). when run tests in eclipse fine. running tests maven break. testproject packaged eclipse-plugin. use maven-osgi-test-plugin. my testclass annotated by: @runwith(springjunit4classrunner.class) @contextconfiguration(locations="classpath:applicationcontext.xml") @transactionconfiguration public class artifactmanagertest extends abstracttransactionaljunit4springcontexttests {... for every testclass annotated @contextconfiguration there classname-test.xml file. in configuration-file import applicationcontext-test.xml "classpath:" my pom.xml of test-plugin looks like: <groupid>foo.bar</groupid> <artifactid>company.xyz</artifactid> <version>1.0.0-snapshot</version> <packaging>eclipse-test-plugin</packaging> <build> <plugins> <plugin> ...

Facebook connect logout using link -

customer can sign in web app via normal login , facebook connect. far good. <fb:login-button autologoutlink="true" perms="email,user_birthday,status_update,publish_stream"></fb:login-button> <div id="fb-root"></div> <script src="http://connect.facebook.net/en_us/all.js"></script> <script> fb.init({appid: '<xsl:value-of select="$facebook_app_id" />', status: true, cookie: true, xfbml: true}); fb.event.subscribe('auth.login', function(response) { window.location.reload(); }); </script> but when come logout, want customer click on logoff link @ website. how can programmatically logout facebook connect? possibly via json backend? i don't want customer click facebook button logoff. i did try out ways, example: reset facebook connect cookie created @ w...

Java packages vs. C++ libraries -

in java , there called package . library in c++ represent same meaning, in terms example of containg relative classes , use of protected members? thanks. there different dimensions of package means in java. container differentiates names of classes inside names of classes in other packages, equivalent c++ namespaces . as unit guarantees access non-private members classes in same block, there no equivalent in c++. access level granted class independent of namespace class defined. as way of ordering sources in disk, there no equivalent, c++ language has no requirements on how code stored in files. regarding c++ libraries, closer jar files in java. bundle different classes share relation. jar can contain more 1 package, , more 1 jar can contain classes same package. libraries, can contain classes different namespaces and/or different libraries can contain classes same namespace.

How to get data from other activity in android? -

i have 2 activities such activity , b , i'm trying pass 2 different strings b using bundle , startactivity(intent) . like that: intent intent = new intent(a.this, b.class); bundle bundle = new bundle(); bundle.putstring("vidoedetails", filedetails); //bundle.putstring("videoname", filename); intent.putextras(bundle); //intent.putextra("videofilename", filename); //intent.putextra("vidoefiledetails", filedetails); startactivity(intent); and in class b i'm using 2 textview s display strings class seperately. like that: intent = getintent(); bundle extras = i.getextras(); filedetails = extras.getstring("videodetails"); filename = extras.getstring("videoname"); the problem filedetils printed in class b not file name. any solution this? you have typo: bundle.putstring("vidoedetails", filedetails); should be bundle.putstring("videodetails", filedetails);

.net - Semaphores, Critical section, Mutex Examples in MFC & C# -

can 1 tell me or give me link saying detailed description of critical section, mutex,semaphores sample example of how use them in mfc & c# i might explain documentation on msdn pretty excellent. consider visiting following links. here link semaphores in c# example -- http://msdn.microsoft.com/en-us/library/system.threading.semaphore.aspx mutex , locks -- http://msdn.microsoft.com/en-us/library/aa645740%28v=vs.71%29.aspx cmutex synchronization in mfc -- http://msdn.microsoft.com/en-us/library/ms386471%28v=vs.71%29.aspx critical section mfc -- http://msdn.microsoft.com/en-us/library/ms682530%28v=vs.85%29.aspx hope these help

While writing the asp.net code it is showing error -

Image
i trying program upload document in 1 page , want navigate page document name. wrote code <%@ page title="home page" language="vb" %> <html> <head> <style type="text/css"> .style1 { width: 100%; } .style3 { width: 185px; } .style4 { width: 129px; } </style> <script language="javascript"> function doc_save() { document.forms[0].submit; action = "mynew_page.aspx"; } doc_save(); </script> <script language ="vbscript " runat ="server" > public sub page_load(byval sender system.object, byval e system.eventargs) handles mybase.load call save_click() end sub public sub save_click() response.write("saving...") end sub ...

how to validate a Text field to accept only Characters at run Time in iphone -

i want validate text field accept characters while typing in it..... i use following integers guess modify scan strings/chars (see nsscanner): - (bool)textfield:(uitextfield *)textfield shouldchangecharactersinrange:(nsrange)range replacementstring:(nsstring *)string { nsstring *resultingstring = [textfield.text stringbyreplacingcharactersinrange: range withstring: string]; // allows backspace if ([resultingstring length] == 0) { return true; } nsuinteger holder; nsscanner *scan = [nsscanner scannerwithstring: resultingstring]; return [scan scaninteger: &holder] && [scan isatend]; } don't forget set uitextfield delegate appropriately :)

LINQ to Dataset - equivalent of sql (where ... in...) -

i have list of customer id's, custlist(of string). i want use linq query dataset, customers in customer table, customerid "in" custlist(of string). is possible in linq? have searched online , not found answer. i'm new linq.. thanks var custlist = new hashset<string>() { "a", "b", "c"...}; record in table.toenumerable() custlist.contains(record.field<string>("customerid"))

How to create an Infinite Scroll using jQuery? -

$( "body").scroll( function() { $( "#mydiv").load( "test.html"); }); with syntax can load content div when user scrolls. before inserting div want make sure div in viewport area when user scrolls down. if yes load external content div . please me achieve goal. $( "body").scroll( function() { if (document.elementfrompoint(x,y) == $("#whatever")) { $( "#mydiv").load( "test.html"); } }

gis - Tilecache failing to generate tiles using Mapnik -

i downloaded australian osm extract , moved database called gis using osm2pgsql. i have changed generate_tiles.py generate tiles australia: bbox = (-180.0,-90.0, 180.0,90.0) render_tiles(bbox, mapfile, tile_dir, 0, 5, "world") minzoom = 10 maxzoom = 16 bbox = (101.1,-6.9,165.5,-45.9) render_tiles(bbox, mapfile, tile_dir, minzoom, maxzoom) when attempt generate tiles with: export mapnik_map_file="osm.xml" && export mapnik_tile_dir="/tmp/tilecache/" && ./z0generate_tiles.py lots of directories created in /tmp/tilecache png tiles. tiles have state boundaries , country names , there appear highways. but.. when navigate address: http://localhost/osm/tilecache-2.11/index.html see countries , states, no labels , no streets. figure permissions issue accessing postgis data. have gone psql , issued: grant privileges on database gis public in /etc/tilecache.cfg have: [cache] type=disk base=/tmp/tilecache [osm] type=mapnik m...

How to extract substring in SQL Server -

i have field okbogkbogkbokgbokgobkgobkofkgbokfgbo&name=fokdofkd&okfaos i'd extract name = value data. how can using sql server 2008 in efficient way? thank you try this ; mytable ( select 'okbogkbogkbokgbokgobkgobkofkgbokfgbo&name=fokdofkd&okfaos' fullstring union select 'fkgbokfgbo&name=fokdofkd&okfaos' fullstring union select 'okbogkbogkbokgbok' fullstring ), patternindex ( select fullstring + '&' fullstring, charindex ('&name=', fullstring) + 1 locationofequalsign, charindex ('&', fullstring, charindex ('&name=', fullstring)+1) nextbreak mytable ), splitnamevalue ( select fullstring, case when nextbreak <> 0 substring (fullstring, locationofequalsign, nextbreak-locationofequalsign) else '' end namevaluepair patternindex ) s...

javascript - Get value of selectbox with JsHelper in CakePHP -

i have select box, , want use ajax-update other content on page. have bound event handler using jshelper (jquery) so: <?php echo $this->form->select('car', $cars); $this->js->get("#car"); $this->js->event('change', $this->js->request(array( 'controller' => 'cars', 'action' => 'view', ???, array('async' => true, 'update' => '#car-view', 'evalscripts' => true), true )); ?> but how can value of select box send argument cars controller (at "???" in code above)? i in javascript, there way in cake? to honest, struggled while back. couldn't find worked, ended going straight javascript route.

php - Send data using curl -

trying send data server accepts data in following format verify_data=mer_id=xxx|mer_trnx_id=xxx| mer_trnx_amt=xxx following lines do? $datatopost="verify_data=mer_id=xxx|mer_trnx_id=xxx| mer_trnx_amt=xxx"; curl_setopt ($ch, curlopt_postfields,$datatopost);<br /> any appreciated,i new curl. you can use article see how properly. i used code on project of mine $data="from=$from&to=$to&body=".urlencode($body)."&url=$url"; //$urlx contains url want post. $data contains data posting //$resp contains response. $process = curl_init($urlx); curl_setopt($process, curlopt_header, 0); curl_setopt($process, curlopt_postfields, $data); curl_setopt($process, curlopt_post, 1); curl_setopt($process, curlopt_returntransfer,1); curl_setopt($process,curlopt_connecttimeout,1); $resp = curl_exec($process); curl_close($process);

php - How to do a pagination from array? -

i have array data want display pagination. $display_array = array ( [0] => "0602 xxx2", [1] => "0602 xxx3", [2] => 5 // total= 2+3 [3] => "0602 xxx3", [4] => "0602 saa4", [5] => 7 // total = 3+4 ) i have try thing this function pagination($display_array, $page) { global $show_per_page; $page = $page < 1 ? 1 : $page; $start = ($page - 1) * $show_per_page; $end = $page * $show_per_page; for($i = $start; $i < $end; $i++) { ////echo $display_array[$i] . "<p>"; // how manipulate this? // result described below. } } i want pagination expected result this: if define $show_per_page = 2; pagination($display_array, 1); outputs: 0602 xxx2 0602 xxxx3 total:5 and paganation($display_array, 2); outputs: 0602 xxx3 0602 saa4 total:7 if define $show_per_page = 3; , pagination($display_array, 1); outputs: 0602 xxx2 0...

Can Visual Studio remember a MD5 of my source files in order to avoid rebuilding them when the timestamp changed but not the content? -

most of time doing several distinct developments on same project and, in order have logical separation between them, use personal version control system on project (namely fossil mabye detail). this allows me commit work in different branches in order merge them afterwards. meanwhile maintain trunk branch in commit work coworkers. but when switch branch 1 (in order perform merge action instance) , go came from, visual studio detect timestamp modifications , rebuild files have not modified. is there way ask visual studio consider source file has changed when hash of contents has changed? as answer seems “no” here way of achieving like, starting bounty. still read above please. do know of simple way have snapshot of timestamps , md5 hashes of source files, , then, every file of timestamp changed, compare md5 , rollback timestamp modification if md5 has not changed? thank answers. i'm afraid not possible. the issue here not thing vs entire build system qui...

ruby on rails - How to display text without its css -

i'm working ruby on rails , in app there's text area tinymce in it, users can add styles text, , upload images , videos. when these displayed in listings on home page, don't want posts' styles shown, nor videos/images well. for example, let's write: how doing? (some image/video here) then, simple show in listings following: how doing? (no image/video shown) you have several options can use. stripping, scrubbing html comes useful when have render screen scrapped web content. case might simpler, don't "expect unexpected" content gathered web crawls. you can use strip_tags removes tags string: strip_tags("strip <i>these</i> tags!") # => strip these tags! strip_tags("<b>bold</b> no more! <a href='more.html'>see more here</a>...") # => bold no more! see more here... strip_tags("<div id='top-bar'>welcome website!</div>") ...

iphone - how to check if backgroundimage of UIbutton is added or not -

i want check how check if backgroundimage of uibutton present or not i have code, [button setbackgroundimage:[uiimage imagenamed:@"default_module.png"] forstate:uicontrolstatenormal]; i want check if there image named "default_module.png" present , included in project folder or not. thanks just this: if(![uiimage imagenamed:@"default_module"]){ //the image not present. act accordingly. }else{ //continue normal }

python - How to Customize the full text search function provided by postgresql -

i trying customize postgresql full text search functionality that for example, can enter "stouffers" , match on stouffer's frozen foods. if leave off 1 of "f"s , spell "stoufers" don't match. that's 1 of things customized text search supposed handle. converts text phonetic type code , searches on that. please me in how can achive that. found need write custom parser in c doing poor in c. or standalone search engine such solr or xapian stemming, spelling, phonetic etc. django-haystack brings both of them.

svn - Merging Subversion Branches -

just asking simple question. best way merge 2 subversion branches together? i wish merge branch name 3661 branch name 2011-01-17 3661 has revision code of 16658 2011-01-17 has revision code of 16613 this how (i use command line) (1) revision of 3661 when branch created this svn log --verbose --stop-on-copy http://url/to/branch/3661 take smallest revision output. let's it's 911 (2) checkout latest of branch 2011-01-17 , , run in main directory. show conflicts , updates won't anything. svn merge --dry-run -r 911:head http://url/to/branch/3661 (3) if ok changes actual merge svn merge -r 911:head http://url/to/branch/3661 nothing committed on server yet. it's local copy merged. may want fix conflicted file now. (4) if want persist merge on server commit changed files doing this svn commit -m "merged 3661 changes 2011-01-17" hopefully helps. may want see chapter of red book http://svnbook.red-bean.com/en/1.0/ch04s04....

jquery - HTML - Break line in a pre tag -

i trying copy (with jquery , js) text written in textarea pre tag. however, cannot introduce many line breaks want. instance, if press enter once, works , create line break, if press enter more once cannot more 1 line break. know why happens, or how can fix it? the code goes pretty this: <textarea id="area" rows="5" cols="30"> </textarea> <pre id="area2" > </pre> <br/> <script> newtext = $( '#area' ).val(); $( '#pre' ).text( newtext); </script>` the id of textarea #area , id of pre tag #pre i had problem ie7. doesn't display more 1 newline within pre tag.

c# - Why do I get an ExpectationViolationException when using a Stub? -

this test using nunit 2.5 , rhino.mocks 3.5: [testfixture] public class excelworksheetcolumntests { private const string _name = "f1"; private const int _index = 0; private mockrepository _repo; [setup] public void setup(){_repo = new mockrepository();} private excelworksheetcolumn createcolumnusingfixturefieldsbutwith(iexcelworksheet excelworksheet) { return new excelworksheetcolumn(_name, _index, excelworksheet); } [test] public void when_selectedshootcolumntype_is_changed_raises_selectedshootcolumntypechanged_event() { var stubworksheet = _repo.stub<iexcelworksheet>(); excelworksheetcolumn column = createcolumnusingfixturefieldsbutwith(stubworksheet); stubworksheet .stub(p => p.getselectedshootcolumntype(column)) .return(shootcolumntype.generic); _repo.replay...

c# - Format DropDownList.TextValue -

my stored procedure this select id, studentname xyz i have drop down list in asp.net, loading : ddla.datasource = // source ddla.datatextfield = "id" + " -" + "studentname"; ddla.datavaluefield = "id"; ddla.databind(); ddla.items.insert(0, new listitem(" select one", "0")); but @ databind() statement, getting error: system.web.httpexception: databinding: 'system.data.datarowview' not contain property name 'id-studentname'. in text part of dropdown list, want display concatenated value of id - studentname . how can it? dropdownlist1.datatextformatstring = "{0} - {1}"; dropdownlist1.datatextfield = "id,studentname"; it seems it's not achievable automatically, e.g. see this ms connect ticket . thus programmatically: foreach (var row in table.rows) { row.field<string>("text") = string.format(..); } or foreach (var item in data) ...

XML-Like Log File Parsing Tools -

has seen log file format before, or know name of it? <msg time='2010-01-10t17:41:31' type='info' attrbute3='value' ... >log message</msg> right parsing line line ruby script info need out, looking things microsoft log parser because has sql-ish query support. the problem since entries in log file above example many top level elements, tools won't parse it. complain error message "only 1 top level element allowed in xml document." i smash 1 file top level element, rather reuse existing before going down rabbit hole further. thanks, alex this arcgis server log file. file describes them @ help.arcgis.com . each dat file has companion xml file same name. defines root element xml file , references dat file. the log parser utility work if pass xml file input. example, following statement write errors arcgis server log csv file: logparser -i xml -o csv "select * errors.csv server-server-20120227-000000.xml#/l...

c# - How can I pass Collection to modal dialog window? -

i want know, if possible pass collection between pages. mean have client-side javascript modal dialog on want use collection. earlier using session[] share value, becoming evil me, displays first value. change in value in not updated. so whenever pop displayed want collection moved child dialog. there, extract collection, stuffs , again return parent page, preventing postbacks , session management. i think clear guys. if not clear, please add comment. you can try json or convert list comma-delimited string easy parse javascript's string split function . registerarraydeclaration(arrayname, arrayvalue) option. check out link. from link: if need create client-side javascript array object set values, use method add value specific array. to add values 1, 2, , 3 client-side array object named favoritenumbers, you'd use following server-side code: registerarraydeclaration("favoritenumbers", "1") registerarraydeclaration("...

objective c - Obj-C, Puzzled by this xcode warning, warning: 'BNColor' may not respond to '+beInit'? -

Image
i've getting warning warning: 'bncolor' may not respond '+beinit' i'm not sure why. any ideas ? have included/imported nsobject+be.h in bncolor.m ? also, methods names contain init , copy should return objects owned caller, i.e., don’t autorelease them.

Android Development - Using an ArrayList<String> vs an array of strings with ArrayAdapter -

i new android development, , had question excerpt read in commonsware's "the busy coder's guide android development". there example constructing class extending listactivity, , showing ability remove , delete list via context menus. prior setting arrayadapter source of strings list, text says convert string array arraylist type, because "we want able change contents of list on fly, , easier if use arraylist rather ordinary string array" i understand concept if using arraylist or string array manipulate list directly, why matter if we're using arrayadapter.add/insert/remove methods? once arrayadapter created (and understand .java file), turns source data list object whether coming array or arraylist. i tried using normal array when creating adapter , got error (as expected text said), not understand why. difference between creating arrayadapter string array vs arraylist...won't turn same list object anyway? there kind of tie original sour...

python - How can I send an SMS via AT command with Zoom 7.2m Tri-Band USB Modem? -

i trying make simple python 2.6 application on osx 10.6.6 can send , receive sms on zoom 7.2m (3g) usb modem. on plugging usb modem, no tty or cu sessions seem created. have run modem software initiate following sessions; cu.ljadeviceinterface2621 cu.ljadiagconnector2620 cu.ljamobileconnector2622 tty.ljadeviceinterface2621 tty.ljadiagconnector2620 tty.ljamobileconnector2622 after "fun", seems session can read , write "cu.ljadeviceinterface2621". on attempting connect tty instance of this, error - serial.serialutil.serialexception: not open port /dev/tty.ljadeviceinterface2621: [errno 16] resource busy: '/dev/tty.ljadeviceinterface2621' thats fine though - @ least have work with, cu equivalent. my script follows; ser = serial.serial("/dev/cu.ljadeviceinterface2621", 9600, timeout=1) print "setting dtr..." ser.setdtr(true) sleep(3) print "turning off dtr......

.net - "An internal certificate chaining error has occurred" error while signing email in C# -

i'm trying digitally sign content, including whole certificate chain in signature (so recipient can verify signature no problems). following error: "an internal certificate chaining error has occurred" when calling computesignature() method. both root ca , intermediate ca certificates installed in machine. i'm trying sign content verisign email certificate. intermediate ca certificate is: verisign class 1 individual subscriber ca - g3 root ca certificate is: verisign class 1 public primary certification authority - g3 here's code i'm using: public static byte[] getsignature( string message, x509certificate2 signingcertificate) { byte[] messagebytes = encoding.ascii.getbytes(message); signedcms signedcms = new signedcms(new contentinfo(messagebytes), true); cmssigner cmssigner = new cmssigner(subjectidentifiertype.issuerandserialnumber, signingcertificate); cmssigner.includeoption = x509includeoption.wholechain; ...

asp.net mvc 2 - Possible to use ASPNET MVC2 without IIS? -

i know of servicehost class, lets me write custom host wcf service. means there's no requirement iis. (i know advantages of using iis - no need rehash me.). is there similar allow me host aspnet mvc2, without iis? conversely, iis hard requirement aspnet mvc2? has used ultldev cassini , , if so, experiences? run aspnet mvc2? (i using .net 3.5) you can run on cassini, mono, iis or host whole asp.net runtime in own application. (actually pretty easy)

.net - Storing NULL instead of blank string columns -

while saving collection changes, how can ensure blank strings should go nulls? using linq, wpf, wcf. i don't want iterate each record , each property of record put null if blank. you implement [onserializing] event in wcf datacontract check string.empty , change null. eg: [datacontract] class mydatastructure { [datamember] string foo { get; set; } [onserializing] void onserializing(streamingcontext context) { if (foo == string.empty) foo = null; } } and if have lot of string properties , don't want write code test each, use reflection loop through class's properties.

iphone - Extract iPod Library raw PCM samples and play with sound effects -

i trying extract raw pcm samples mp3 in ipod library can play song , manipulate pitch, tempo, , apply sound effects (such filters). have gone down route of avplayer , avaudioplayer both not allow control on playback @ all. the code below far have gotten this. @ point not know cmsamplebufferref's in while loop because not know framework use in order playback audio , apply such effects. any idea best approach achieve this? have looked @ cases file converted using avassetwriter not going cut me because process time consuming. surely can read pcm samples memory playback without having write them disk first? nb: know code below references mp3 within project aware approach work same if pulling nsurl mpmediapropertyasseturl -(ibaction)loadtrack:(id)sender { nsstring *songpath = [[nsbundle mainbundle] pathforresource:@"smooth_sub focus_192" oftype:@"mp3"]; nsurl *asseturl = [[nsurl alloc] initfileurlwithpath:songpath]; avurlasset *songasset = [avurlas...

sharepoint - Detect a change in a rich text field's value in SPItemEventReceiver? -

i have event receiver attached custom list . current requirement implement column level security rich text field (multiple lines of text enhanced rich text). according post , can field's before , after values so: object obefore = properties.listitem[f.internalname]; object oafter = properties.afterproperties[f.internalname]; the problem i'm running issues comparing these 2 values, lead false positives (code detecting change when there wasn't one). exhibit a: using tostring on both objects obefore.tostring() <div class=externalclass271e860c95ff42c6902be21043f01572> <p class=msonormal style="margin:0in 0in 0pt">text. </div> oafter.tostring() <div class=externalclass271e860c95ff42c6902be21043f01572> <p class=msonormal style="margin: 0in 0in 0pt">text. </div> problems? html tags capitalized random spaces (see additional space after margin: ) using getfieldvalueforedit or getfieldvalueashtml ...

c# - Are there standard naming conventions for this example of The Template Method Pattern? -

i want create abstract class common exception handling pattern: public abstract class widget { public ifoo createfoo() { try { createfoounsafe(); } catch(exception ex) { throw new widgetexception(ex, moredata, evenmoar); } } protected abstract ifoo createfoounsafe(); } the intention have standard exception handling pattern across deriving objects. abstract createfoounsafe() method should not expected contain exception handling. implementations single line of return new foo(...) what want know whether there standard naming conventions associated pattern, particularly exception-throwing code expected? the names above seem appropriate, not entirely without smell . the short answer no. there no convention in template pattern designate type , when exception thrown. kind of information included in section of documentation per msdn. using c# , xml comments can generate such documen...

windows phone 7 - Rendering bug in Bing Maps MapPolyline on WP7 if zoomed out? -

i'm having trouble mappolyline . somehow renders gps trace incorrectly if zoomed out. at low mapcontrol.zoomlevel (eg 9) lines/edges still drawn shouldn't. here screenshots demonstrate odd behavior. http://img403.imageshack.us/g/capture4jz.png/ image description: the first image zoomed out (zoomlevel = 9) (pay attention blue mappolyline) second image zoomed in little (the mappolyline still same same -> incorrect) third image again zoomed in further (however mappolyline looks still similar) last image: actual gps trace looks like. so mappolyline drawing gps trace incorrectly if map zoomed out. seems stops scaling @ point , stays same @ lower zoomlevels (9 - 15 == zooming out) maybe did wrong? can tell me how fix this? workaround? here simple test app demonstrate odd behavior (this behavior same on device , simulator): mainpage.xaml <!--contentpanel - place additional content here--> <grid x:name="contentpanel" grid.row=...

Powershell & Sharepoint export list items via view to csv -

i attempting export items sharepoint list via specific view. i have items returning stuck trying export csv file correctly here have far: $web = get-spweb $url $splist = $web.lists[$listname] $view = $splist.views["current month"] $items = $splist.getitems($view) $items | select-object "check number", "purchaser" | export-csv -path f:\test.csv $web.dispose() thank in advance! for sharepoint 2007 [reflection.assembly]::loadwithpartialname("microsoft.sharepoint") | out-null $site = new-object microsoft.sharepoint.spsite("http://yoursite") $web = $site.rootweb $list = $web.lists[$listname] $view = $list.views["current month"] $items = $list.getitems($view) $items | %{ select-object -input $_ -prop @{name='title';expression={$_.title;}}, @{name='check number';expression={$_["check number"];}}; } | export-csv -path c:\test.csv you have build select object sp...