Posts

Showing posts from February, 2014

odbc sql server driver communication link failure -

i have access 2003 front-end sql 2005 back-end. occasionally, users error below , front-end crashes. pointers how can resolve this? [odbc sql server driver] communication link failure from googling , reading have done on topic, seems me might bug in ms access they've never bothered fix, ie: there is no resolution. the symptoms seeing , others seem have connection access has sql server becomes "bad", , once reaches state, nothing fix except restarting access, period. although blows person's mind, entirely possible - if code related connection management (either in ms access itself, or within odbc provider) doesn't check validity of connection state , assumes fine, see symptoms are seeing. you'd think, surely microsoft fix this, wouldn't first time. update i'm seeing same behavior when using microsoft access project (*.adp) problem appears within ms access (as opposed odbc).

actionscript 3 - Style callout in Flex PieChart? -

is possible style string returned labelfunction can change color , font of callout (inside)? or other way? (it seems big limitation have return string unstylable.) thanks! david i suppose there properties of pie series, called color, fontfamily, can job u mite. further reference: http://help.adobe.com/en_us/flashplatform/reference/actionscript/3/mx/charts/series/pieseries.html

Reading and writing an Excel sheet with form elements using PHP on Linux -

one of our clients trying find way automate filling out form supplied 1 of vendors. excel spreadsheet contains dropdowns , checkboxes. catch must submit form on daily/weekly basis using exact spreadsheet "form" , trying remove human processing loop. i have tried using phpexcel read files, cannot life of me figure out how set value of dropdowns -or- check 1 of checkboxes. as secondary note, if load , rewrite file new file, dropdowns , checkboxes disappear file. thanks, dan assuming form doesn't change, bind values separate data source, change that.

ruby on rails - JRuby and jQuery don't play well together -

hello using: * mac os x 10.6.5 * netbeans 6.9.1 (with embedded jruby 1.5.1) * jdk6u17 * glassfish gem 1.0.2 * rails 3.0.3 i want use jquery , ckeditor in project. after install jquery-rails gem , ran command rails g jquery:install somethings go wrong. output: remove public/javascripts/controls.js remove public/javascripts/dragdrop.js remove public/javascripts/effects.js remove public/javascripts/prototype.js fetching jquery (1.4.3) identical public/javascripts/jquery.js identical public/javascripts/jquery.min.js fetching jquery ujs adapter (github head) /applications/netbeans/netbeans 6.9.1.app/contents/resources/netbeans/ruby/jruby-1.5.1/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require': load error: rails/commands/generate -- java.lang.nosuchmethoderror: org.jruby.ruby.getselectorpool()lorg/jruby/util/io/selectorpool; (loaderror) /applications/netbeans/netbeans 6.9.1.ap...

broadcastreceiver - preventing a crash when someone mounts an Android SD card -

i have file open on sd card. when mounts sd card, winds crashing application. trying register action_media_eject broadcast event, , receive that, seems i'm getting late. time that, it's crashed application. there way notified before crashing application? added simple sample code. when this, winds crashing service when turn on usb (msc mode). test.java /** called when activity first created. */ @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); try { startservice(new intent(this, testservice.class)); bindservice(new intent(this, testservice.class), serviceconnection, context.bind_auto_create); } catch (exception e) { } } protected testservice testservice; private serviceconnection serviceconnection = new serviceconnection() { @override public void onserviceconnected(componentname name, ibinder service) { testservice.localbinder binder...

java - Implementing servlet lifecycle methods in a Spring web application? -

i implementing web application using spring. using spring's contextloaderlistener, load application contexts, , spring's dispatcherservlet, load relevant beans {name}-servlet.xml, refer beans in main application context. want able integration test these spring configurations outside of container validate wired correctly before deploy tomcat. application requires scheduled background processing when running in container. in regular httpservlet implement init() , destroy(). suggestions have read suggest using initializingbean kind of initialization. however, if use initializingbean, afterpropertiesset() gets called whether inside container or in integration tests - , outside container, don't have access resources background task needs. there better way perform tasks perform in init() , destroy() run when deployed webapp? have considered using test spring config file overrides bean implementing background process? this way else in spring configuration work exc...

cocoa - UIKit's [NSString sizeWithFont:constrainedToSize:] in AppKit -

is there equivalent method in appkit (for cocoa on mac os x) same thing uikit's [nsstring sizewithfont:constrainedtosize:] ? if not, how go getting amount of space needed render particular string constrained width/height? update: below snippet of code i'm using expect produce results i'm after. nsdictionary *attributes = [nsdictionary dictionarywithobjectsandkeys: [nsfont systemfontofsize: [nsfont smallsystemfontsize]], nsfontattributename, [nsparagraphstyle defaultparagraphstyle], nsparagraphstyleattributename, nil]; nssize size = nsmakesize(200.0, maxfloat); nsrect bounds; bounds = [@"this really really really long string won't fit on 1 line" boundingrectwithsize: size options: nsstringdrawingusesfontleading attributes: attributes]; nslog(@"height: %02f, width: %02f", bounds.size.height, bounds.size.width); i ex...

How do I pass large numpy arrays between python subprocesses without saving to disk? -

is there way pass large chunk of data between 2 python subprocesses without using disk? here's cartoon example of i'm hoping accomplish: import sys, subprocess, numpy cmdstring = """ import sys, numpy done = false while not done: cmd = raw_input() if cmd == 'done': done = true elif cmd == 'data': ##fake data. in real life, data hardware. data = numpy.zeros(1000000, dtype=numpy.uint8) data.dump('data.pkl') sys.stdout.write('data.pkl' + '\\n') sys.stdout.flush()""" proc = subprocess.popen( #python vs. pythonw on windows? [sys.executable, '-c %s'%cmdstring], stdin=subprocess.pipe, stdout=subprocess.pipe, stderr=subprocess.pipe) in range(3): proc.stdin.write('data\n') print proc.stdout.readline().rstrip() = numpy.load('data.pkl') print a.shape proc.stdin.write('done\n') this cre...

tsql - Generate ASP.Net Membership password hash in pure T-SQL -

i'm attempting create pure t-sql representation of default sha-1 password hashing in asp.net membership system. ideally, this: username password generatedpassword cbehrens 34098kw4d+fkj== 34098kw4d+fkj== note: that's bogus base-64 text there. i've got base64_encode , decode functions round-trip correctly. here's attempt, doesn't work: select username, password, dbo.base64_encode(hashbytes('sha1', dbo.base64_decode(passwordsalt) + 'test')) testpassword aspnet_users u join aspnet_membership m on u.userid = m.userid i've tried number of variations on theme, no avail. need in pure t-sql; involving console app or double work. so if can supply precisely syntax should duplicate password asp.net membership stuff, appreciate it. if running 2005 or higher, can create clr (.net) udf: [sqlfunction( isdeterministic = true, isprecise = true, dataaccess = dataaccesskind.none, systemdataacce...

Project structuring and file implementation in Python -

i having bit of troubles getting grasp on how structure python projects. have read jcalderone: filesystem structure of python project , been looking @ source code of couchapp , i'm still feeling puzzled. i understand how files should structured, don't understand why . love if hook me detailed walk-through of this, or explain me. how set basic python project, , how files interact each other. i think people coming other languages c, c++, erlang ... or people have never been programming before, benefit from. name directory related project. when releases, should include version number suffix: twisted-2.5. not sure why unclear. seems obvious. has in 1 directory. why things have in 1 directory? because says so, that's why. create directory twisted/bin , put executables there. this way linux works. executables in bin directory. makes easy put specific directory in path environment variable. if project expressable single python source ...

acceptverbs httpverbs.get? -

what use of it???? acceptverbs(httpverbs.get) , explain httpverbs.post too.. thanks when applied action, restricts action requests made particular http verb, i.e., get or post . if different type of request specified comes in match based on name , signature, won't match because request type not allowed.

sql - PHP: Compare Date -

i'm encountering following problem: i'd compare today's date against dates in database, if isn't expired yet, show something... if dates in table expired, show 'no lecture scheduled @ time, return again'. as first thing it's no problem, can't show text there aren't future dates... here's code, table: id, dateposted, date_course, title, body $sql = "select * l order l.dateposted desc;"; $result = mysql_query($sql) or die(mysql_error()); while($row = mysql_fetch_assoc($result)) { $exp_date = $row['date_course']; $todays_date = date("y-m-d"); $today = strtotime($todays_date); $expiration_date = strtotime($exp_date); if ($expiration_date >= $today) { echo "<a href='courses.php'>" . $row['title']. "</a>"; echo ...

c++ - CloseHandle on a Mutex, before ReleaseMutex - What happens? -

if call closehandle on mutex before thread has finished mutex, , hence, hasn't yet called releasemutex, expected behaviour? the serious consequence thread that's waiting mutex getting unblocked. waitxxx call returns wait_abandoned. @ point idea call terminateprocess because have no idea hell happened.

xml serialization - How to conditionally serialize a field (attribute) using XStream -

i using xstream serializing , de-serializing object. example, class named rating defined follows: public class rating { string id; int score; int confidence; // constructors here... } however, in class, variable confidence optional. so, when confidence value known (not 0), xml representation of rating object should like: <rating> <id>0123</id> <score>5</score> <confidence>10</confidence> </rating> however, when confidence unknown (the default value 0), confidence attribute should omitted xml representation: <rating> <id>0123</id> <score>5</score> </rating> could tell me how conditionally serialize field using xstream? one option write converter . here's 1 wrote you: import com.thoughtworks.xstream.converters.converter; import com.thoughtworks.xstream.converters.marshallingcontext; import com.thoughtworks.xstream.converters.unmarshallingcontext; import com...

c++ - Does returning a standard container incur a copy of the contents of the container? -

if have function returns stl container incurring copy of entire contents of standard container? e.g. this: void foo( std::vector< std::string >* string_list ); better this: std::vector< std::string > foo(); does matter what's in container? instance returning container this: struct buzz { int a; char b; float c; } std::map< int, buzz > foo(); be more costly operation this: std::map< int, int > foo(); thanks, paulh edit: c++03. c++0x solution is, unfortunately, not acceptable. edit2: using microsoft visual studio 2008 compiler. c++03 (named) return value optimization (google rvo , nrvo). if optimization not applicable, c++0x move semantics .

elisp - Emacs: pop-up bottom window for temporary buffers -

i have pop-up bottom window temporary buffers compilation , completions , etc. should split-vertically whole frame if root window split horizontally. example: before m-x compile: +------+------+ | | | | | | | | | +------+------+ after: +------+------+ | | | +------+------+ | | +------+------+ i'm absolutely satisfied ecb-compilation-window , don't want use ecb , cedet. see 2 ways make described behavior both have drawbacks. use split-root.el module. drawback: uses delete-other-windows function , rebuilds previous windows tree after root window split required. invalidates references existed earlier windows in code(or code of module). set window-min-height variable minimal possible value(1) , call split-window-vertically during emacs startup minimizing window height after it's created. use window temporary buffers setting height required. drawbacks: small annoying window annoying modeline on bottom...

Custom Edit for Sharepoint document library -

i have document library 2 different content types. need create custom edit form editing document properties, need different custom edit forms content types.. followed instructions spd support site create edit form using sharepoint designer. have done of several lists , works perfectly. for document library when try attach custom form library don't see "content type specific forms" drop down choose content type attach custom edit form. how can done? i'm using moss 2007 if using 3rd party components option, can use powerforms customize edit forms each content type without using sp designer

Changing Container Height -

i going through minor issues here. using standard container height , css code pages. pages there enough content fill , content may take 10-20% of page. idea pages use different min-height? below code: #wrapper { background-color: #999999; margin:0 auto; min-height: 600px; width:770px; font-family: "lucida grande", verdana, "lucida sans unicode", arial, helvetica, sans-serif; font-size:15px; color: #222222; margin-left:60px; margin-bottom:60px; } it might better declare lesser min-height in separate class. then, <div id="wrapper" class="smallercontent"> . #wrapper.smallercontent { min-height: 300px }

Web Colors - Light Grays on PC not showing -

i off wanted see if there on subject: i'm developing site @ moment includes few divs use different shades of light greys background , border colors. on both mac (laptop , desktop) colors can seen quite easily. however, on pc (both firefox , ie) colors not there @ all. the current colors have #e9e9e9 , #e1e1e1 . the weird thing when change colors darker #cccccc color seen on pcs , assume put few more shades lighter. when move next color #dddddd color gone. just on limb there weird thing pc's not rendering color codes or trying make out of nothing here? there shouldn't problem pc displaying colors. problem pc's video settings or monitor. have tried multiple pcs , monitors?

open source - Can I get a reference to a public domain share-this javascript snippet? -

i'm looking javascript/css snippet generates share-this button, , takes argument url share. there 1 available? i'd rather use can host myself, it's not strong preference, long can pass in argument url shared. there bunch of options. here's few started: sharethis.com addtoany.com addthis.com hope helps.

data modeling - Two tables: order and order_status. Relationship or enum type? What kind of relationshi -

i have 2 tables: order , order_status . in first 1 store orders of shop , in second 1 different possible statuses order can have (in progress, paid, ...). should there relationship (1:1??) between these 2 tables or should create enum type status values? go ahead , create table. need more statuses on time (trust me, work on 20,000 online stores every day, , orderstatus not simple sounds). let add flags statuses: answers may count form of "shipped", if descriptions vary.

How can I make a function to run on all of the controllers in ASP.NET MVC 2? -

i have function : gets information model ( done ) gets information cookie ( done ), , set new informations on viewdata ( on views ) on every controller also, function need run on every controller when controller calling (i don`t know how this). i have write function on basecontroller error: object reference not set instance of object. and, think not right way. i'm using asp.net mvc 2 , .net 3.5. thx help. create custom action filter : public class myactionfilter : actionfilterattribute { public override void onactionexecuted(actionexecutedcontext filtercontext) { // if actionresult not viewresult (e.g jsonresult, contentresult), // there no viewdata don't anything. var viewresult = filtercontext.result viewresult; if (viewresult != null) { // call function, whatever want result, e.g: viewresult.viewdata["somekey"] = somedata; } } } slap bad boy on ba...

java - match the label and get value from Labelvaluebean -

i'm getting list of organization type , code stored labelvaluebean below: [labelvaluebean[org1, xx], [org2, aa]] - in array. later these values stored in session variable. question is, there way can search thru array match name , code ? (for ex: match org1 , xx). if user enter org1, should send xx back-end. this sounds want using map instead of array. map store...mappings...between keys , values - think of table 2 columns, first column organization type , second column code. take organization code, in table @ values in first column until find match, on @ second column code, , return it. obviously, handled map implementation used, need declare objects should used keys , values. in case, maybe you'll have map<string, string> . for example, map<string, string> map = new hashmap<string, string>(); map.put("org1", "xx"); map.put("org2", "aa"); map.get("org1") // returns "xx" map.ge...

actionscript 3 - flex 3.4 compile error when using FileReference object -

when using flex filereference, in flex 3.4, met problem. follows code: public function save_click():void { var systemfilereference:filereference = new filereference(); systemfilereference.save("test","testfile.txt"); } but compile fails" invoke undefined method save in filereference), not know why in flex3.4 filereference not support save() method? you need target flash player 10.

c# - WPF TraceLevel problem -

i'm applying tracelevel datagrid this <datagrid horizontalalignment="stretch" margin="12,12,12,12" verticalalignment="stretch" itemssource="{binding vals, presentationtracesources.tracelevel=high}" /> but doesn't produce trace output. what's wrong? tools -> options -> debugging -> output window -> wpf trace settings -> data binding set warning or whatnot, think default off

Adding 'default text' to Joomla's extension 'Simple Email Form' -

i want add 'default text' fields... efforts edit php have not worked @ !! i'm guessing file edit ' mod_simpleemailform.php ' cant seem find "echo's" spit out form... am on right track...? thanks!! based on research not module comes installed joomla! answer question when comes formated modules. to find form go folder module. in case should /modules/mod_simpleemailform . this "system" module resides. find files such as: mod_simpleemailform.xml configuration file module. index.html prevents listing of module's folder contents. helper.php module's functions , brains located. mod_simpleemailform.php calls functions in helper.php in order content , information. once has of data call template file module located in /tmpl of module's directory. in here find: index.html same thing previous index.html default.php default template file module. file contain form , html code see on screen. the def...

css - Webkit gradient background-gradient in html5 progress bar? -

in attempt color inside of progress bar use below code: progress::-webkit-progress-bar-value { background-color:-webkit-gradient(linear,left bottom ,left top,from(#c6e6e6),to(#d1e4e6)) ; } however gradients not work, simple colors. try progress::-webkit-progress-bar-value { background:-webkit-gradient(linear,left bottom ,left top,from(#c6e6e6),to(#d1e4e6)) ; } background instead of background-color , webkit instead of weblit .

javascript - Does someone run YUI3 uploader with Django successfully? -

i'm trying use yui3 uploader django backend. however, after write simple uploader in frontend, found function in views.py has never been invoke in django. and, didn't see error message or warning in browser , backend log.. did return corresponding crossdomain.xml when uploader requires. have successful experience yui3 uploader , django? problem of program? thanks! html fragment: <head> <link rel="stylesheet" type="text/css" href="{{ media_url }}photos/css/upload.css" /> <script type="text/javascript" src="{{ media_url }}js/lib/yui.min.js"></script> <script type="text/javascript" src="{{ media_url }}photos/js/upload.js"></script> <script type="text/javascript"> $(document).ready(function() { var pu = new photosuploader(); pu.render(); }); </script> </head> <body> <h3>upload photos</h3> ...

stl - Destructing the Vector contents in C++ -

i have std::vector of element* . when destructor called. how different if vector of element std::vector<element*> vect; .. struct element { record *elm; element(record *rec) { elm = new record(); //...copy rec } ~element() { delete elm; } }; i using vector follows: element *copyelm = new element(record); vect.push_back(copyelm); in above code, how can ensure there's no leak. vector call release memory of object holding (i.e. pointers) not release memory of object pointing to . need release memory of element object yourself. if vector<element> whenever push_back copy of element inserted vector. vector guarntess release memory allocated copied object . aware current definition of element seg fault have not defined copy ctor , assignment operator. edit if reason don't want use smart pointers, option write release function goes through entire vector , calls delete on stored ...

php - I want to fetch data -

i want fetch data data base don't know how fetch data in smarty. please me. you fetch normally. "send" smarty using $smarty->assign(). like this: $name = 'john'; $smarty = new smarty(); $smarty->assign('firstname', $name); in smarty template can use {$firstname} access data in $name: <p>hello, {$firstname}!</p>

how can i use google map api in iphone -

i need show driving directions, , walking directions in map view. there availability in iphone map kit. how can use google map api in web view. can interact google map api iphone check out google maps api .

GCC hidden/little-known features -

this attempt start collection of gcc special features not encounter. comes after @jlebedev in question mentioned "effective c++" option g++, -weffc++ option warns c++ code breaks of programming guidelines given in books "effective c++" , "more effective c++" scott meyers. example, warning given if class uses dynamically allocated memory not define copy constructor , assignment operator. note standard library header files not follow these guidelines, may wish use option occasional test possible problems in own code rather compiling time. what other cool features there? from time time go through current gcc/g++ command line parameter documentation , update compiler script more paranoid kind of coding error. here is if interested. unfortunately didn't document them forgot most, -pedantic, -wall, -wextra, -weffc++, -wshadow, -wnon-virtual-dtor, -wold-style-cast, -woverloaded-virtual, , few others useful, warning me of potent...

iframe - in IE browser page properties window shows size : not Available? -

in fiddler can see content length page in ie browser page properties window shows size : not available. can me why happening? thanks krishna internet explorer gets information in fundamentally different way fiddler does-- it's looking @ size of cache file. if cache file isn't available (e.g. file wasn't cacheable) information isn't available. generally, fiddler shows want anyway.

plot - Tupper's self referential formulae - in MATLAB? -

Image
i trying plot tupper's formulae in matlab. apparently seems since 'k' such large value, matlab may not accept it. any suggestions ? you can use symbolic toolbox compute big integers. here code whipped plot tupper expression, inspired in part this discussion on @ metafilter : % use symbolic toolbox represent big integer k k = sym(['960939379918958884971672962127852754715004339660129306651505519271702802395266424689642842174350' ... '718121267153782770623355993237280874144307891325963941337723487857735749823926629715517173716995' ... '165232890538221612403238855866184013235585136048828693337902491454229288667081096184496091705183' ... '454067827731551705405381627380967602565625016981482083418783163849115590225610003652351370343874' ... '461848378737238198224849863465033159410054974700593138339226497249461751545728366702369745461014' ... '6559979337985374831437868418065934222278983887229800007...

c++ - Why Casting feature? -

i new c++. beginner. while learning casting feature provided c++, wondering why casting feature specially static cast. when know type of variable required why casting?. if understand question correctly, asking why there static_cast operator in c++ . typecasting helps move pointer in class hierarchy. , static_cast can downcast pointer in class hierarchial relationships. though, such conversions aren't safe, should careful while dealing it.

performance - Oracle error explanation -

just accident found out have performance monitoring tool oracle-db tried out performance issues. software gives me following alerts: sql library cache miss rate (somewhere arround 80%) latch waits (somewhere between 4-5%) of non-idle wait time datafile random read avg time 200ms can explain me means database , me? sql library cache miss rate means when execute query of time (80%) not in cache, i.e. has not been seen before recently. result, 80% of queries need evaluated , compiled scratch. indicates not using bind variables (so every single sql little different).

Jquery, get columname when cell clicked -

how can column name jquery when cell clicked? you can obtaining index of cell, , getting text header same index. i have uploaded demo here: http://jsfiddle.net/sohnee/dnxtz/23/ the jquery looks this: $("td").click(function(){ var $this = $(this); var col = $this.parent().children().index($(this)); var title = $this.closest("table").find("th").eq(col).text(); alert(title); }); and relies on proper table structure.... <table> <thead> <tr> <th>name</th> <th>address</th> </tr> </thead> <tbody> <tr> <td>steve</td> <td>uk somewhere</td> </tr> <tr> <td>scott</td> <td>usa somewhere</td> </tr> </tbody> </table> note: caption, tfoot et al, omitted o...

c++ - Will the memory in the heap be released when I do pthread_cancel on iOS? -

lets have allocated memory in background thread, is, thread stack holding pointer memory. want terminate background thread execution calling pthread_cancel on it. memory released or not? (my platform ios, compiler gcc 4.2) each thread necessity requires own stack; there typically 1 heap per process. when thread destroyed, there no automatic mechanism free memory allocated on heap. end memory leak. as general rule, avoid using pthread_cancel since hard ensure pthread_cancel run safely. rather build in mechanism can pass message thread destroy (after freeing resources owns).

c# - Where to put the equality function for a class in a third party library? -

i'm using third party library containing class lacks both operator==() , equals(). i'd implement 1 myself, i'm not sure how name , put it. i've tried add both operators extension method, both failed. i've written isequalto() function, results in rather confusing client code. know more elegant solution? would option inherit or wrap third party class?

iphone - Mixing NSThreads and NSTimer to update a view -

i want make app make appear , disappear circles on screen. circles enlarged on touchesbegan , smaller on touchesend. i'm able on 1 circle want everywhere user touch screen. know have work nsthreads, example don't work. this piece of code: - (void)touchesbegan:(nsset *)touches withevent:(uievent *)event { uitouch *touch = [touches anyobject]; lastpoint = [touch locationinview:self.view]; zoomin = true; rayoncercle = 25; //creation d'un thread timerthread = [[nsthread alloc] initwithtarget:self selector:@selector(cycle) object:nil]; [timerthread start]; if ([touch tapcount] == 1) { nslog(@"une touche"); } if ([touch tapcount] == 2) { drawimage.image = nil; return; } } - (void) cycle { nslog(@"cycle"); nsautoreleasepool* pool = [[nsautoreleasepool alloc] init]; nsrunloop* runloop = [nsrunloop currentrunloop]; time = [nsti...

android - how to cancel scheduled task -

hello have set 1 alarm every appointment(which insert appointment details) , show list of appointments on date alarm. if cancel particular appointment list must not alarm appointments being alarm . how cancel specific alarm appointment. calendar = calendar.getinstance(); calendar.set(calendar.year, _year); calendar.set(calendar.month, _month - 1); calendar.set(calendar.date, _date); calendar.set(calendar.hour_of_day, _hour1); calendar.set(calendar.minute, _min1); calendar.set(calendar.second, 0); date specifiedtime = calendar.gettime(); timer timer = new timer(); timer.schedule(new timertask() { public void run() { shownotification(); } }, specifiedtime); i have use timer.cancel(); won't work properly. please help... in advance use indexing each appointment avoid problem through loop between appointments.

https - SSL Error in Connection to Server through iPhone -

i trying establish https connection server using app. connection fails due following error error domain=nsurlerrordomain code=-1200 "an ssl error has occurred , secure connection server cannot made." userinfo=0x612eb30 {nserrorfailingurlstringkey=https:myurl.com/signup, nslocalizedrecoverysuggestion=would connect server anyway?, nserrorfailingurlkey=https:myurl.com/signup, nslocalizeddescription=an ssl error has occurred , secure connection server cannot made., nsunderlyingerror=0x612eb70 "an ssl error has occurred , secure connection server cannot made."} the code connect server is -(ibaction) handleevents:(id)sender { if ((uibutton*)sender == submit) { [uiapplication sharedapplication].networkactivityindicatorvisible = yes; nslog(@"begin"); nsdata *urldata; nsurlresponse *response; nserror *error; nsstring *url =[[nsstring alloc]initwithformat:@"%@signup",baseurl]; nsurl *theurl =[nsurl urlwith...

iphone - Simple issue with floats and ints -

a simple question best asked 2 lines of code: cgfloat answer = (abs(-27.460757f) - 9.0f) * (800.0f / (46.0f - 9.0f)); nslog(@"according calculator, answer should 399.15, instead is: %f", answer); when run in xcode (specifically, in iphone simulator), get: according calculator, answer should 399.15, instead is: 389.189209 is due lack of understanding of how floats rounded? thanks! stewart the abs() function operates on integers, abs(-27.460757f) returns 27. since you’re using floats, use fabsf() instead.

ASP.NET config data -

i'm working asp.net , c#. don't know store configuration setting web app. every time page loads app reads master page. on master page, everytime need following data: meta tags site users have able change data in cms, think best store in database. every time user request page web app going query database. some configuration master page using (we use several several templates), , other config. think can store in web.config since users can't modify these values. in past used xml file read meta tags, ythink better use database. also, cost lot web app access web.config in every page? mean, "configurationmanager.appsettings["variable"];" thanks lot !!! configurationmanager.appsettings["variable"] value remained , picked cache, until web.config changes. you can store application setting in xml file in app_data folder, , mentioned in web.config like: <appsettings configsource="app_data\config\siteconfig.xml...

asp.net mvc - Mvc 3 Razor : Using Sections for Partial View? -

i defined section in partial view , want specify content of section view. can't figure out way. in asp.net user controls, can define asp:placeholders, , specify content aspx user control lies. i'll glad suggestion. thanks [edit] here asp.net user control , want convert razor partial view user control: <%@ control language="c#" autoeventwireup="true" codefile="sprylistview.ascx.cs" inherits="sprylistview" %> <div spry:region="<%=this.sprydatasetname%>" id="region<%=this.id%>" style="overflow:auto;<%=this.divstyle%>" > <table class="searchlist" cellspacing="0" style="text-align:left" width="100%"> <thead> <tr> <asp:placeholder id="headercolumns" runat="server"></asp:placeholder> </tr> </thead> </table> user control code: pub...

java - How to define general/fall-back error page in web.xml -

my java web app maps error codes error servlet (spring web flow, actually, should besides point), doing in web.xml: <error-page> <error-code>500</error-code> <location>/spring/error?error=500</location> </error-page> <error-page> <error-code>404</error-code> <location>/spring/error?error=404</location> </error-page> however, in cases server still crash , give stack trace dump of exceptions user. (running on ibm websphere btw). question is; possible define fall-back error page used if other errors don't match? we're guaranteed not end stack trace under circumstance. use following: <error-page> <exception-type>java.lang.throwable</exception-type> <location>/error.jsp</location> </error-page> see http://www.oracle.com/technology/sample_code/tech/java/codesnippet/servlets/handlingservletexceptions/handlingservletexceptions.html ...

gnuradio - GNU Radio File Format for the recorded samples -

do know format in gnu radio ( file sink in gnu radio companion) stores samples in binary file? i need read these samples in matlab, problem file big read in matlab. i writing program in c++ read binary file. the file sink dump of data stream. if data stream content simple bytes content of file straightforward. if data stream contained complex numbers file contain list of complex numbers each complex number given 2 floats , each float (usually) 4 bytes. see files gnuradio/gnuradio-core/src/lib/io/gr_file_sink.cc , gr_file_source.cc implementations of gnuradio file reading , writing blocks. you use python , gnuradio convert files other format. from gnuradio import gr # assuming data stream complex numbers. src = gr.file_source(gr.sizeof_gr_complex, "the_file_name") snk = gr.vector_sink_c() tb = gr.top_block() tb.connect(src, snk) tb.run() # complex numbers accessible python list. data = snk.data()

tortoisesvn - subversion svn: subdirectory deleted from working copy but update doesn't bring it back -

i had problem tree conflict in subversion/tortoisesvn. after lot of faffing about, reverting , clean ups, got state 1 existing subtree shown "added" (there no _svn directory inside it), though subtree identical repository. deleted subtree thinking update bring again however, surprise, update doesn't bring directory , commit , check changes windows both imply date. of course can checkout new working copy i'm not worried rescuing it, concern more have working copy know has big chunk missing tool seems think fine. doesn't seem version control system, , i'm worried consequences if happened again in future without noticing it. is there tool can use force complete re-scan of working copy, or spot these kind of inconsistencies? thanks andy try using "update revision" command, set update depth "fully recursive" in dialog.

XMPP/facebook chat connection for android -

public class clientjabberactivity extends activity { private final static string server_host = "chat.facebook.com"; private final static int server_port = 5222; private final static string service_name = "chat.facebook.com"; private final static string login = "xxxxx@chat.facebook.com"; private final static string password = "xxxxxx"; private list<string> m_discussionthread; private arrayadapter<string> m_discussionthreadadapter; private xmppconnection m_connection; private handler m_handler; /** called when activity first created. */ @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); m_handler = new handler(); try { initconnection(); } catch (xmppexception e) { e.printstacktrace(); } final edittext recipient = (edittext) this.findviewbyid(r.id.recipient); final edittext message = (edittext) this.findvi...

inheritance - C#:What should be the content of the Dispose method when implementing IDisposable interface -

i created class implements idisposable interface , visualstudio ide brought dispose method me. wondering code should write inside dispose method take care of memory management or whatever stuff should do. public class esnverification : idisposable { public bool save(string a,string b) { //save data table return true; } public void dispose() { throw new notimplementedexception(); // should here ? } } i recommend three simple rules how implement idisposable; simplified here: rule 1: don't (unless need to). there 2 situations when idisposable need implemented: the class owns unmanaged resource or the class owns managed ( idisposable ) resources . rule 2: class owning managed resources, implement idisposable (but not finalizer). implementation of idisposable should call dispose each owned resource. class should not have finalizer. rule 3: class owning single unmanaged resource, implement both idisposable , finalizer. ...

hyperlink - Linkify in android TextView -

i have text view text" product developed xyz. more queries, mail @ info@abc.com. , have linkified "info@abc.com". problem is, whenever touch area below textview, gets linked email. how make sure, link has happen on clicking info@....i used patterns, linkify.email_address..nothing seem work...kindly suggest answers i had problems automatic links, turned off , instead using html formating of text plus code: textview textview = (textview) findviewbyid(r.id.textbox); textview.setmovementmethod(linkmovementmethod.getinstance()); textview.settext(html.fromhtml(strtext)); an email link goes <a href="mailto:my@email.com">my@email.com</a>

msysgit - Git can't find .ssh -

problem using msysgit on windows; can't find .ssh/id_rsa, though present should be. i verified that's problem ssh -v git@github.com; command works when , when use -i option explicitly point @ correct id_rsa file far can tell, git doesn't have such option; , can't find either on google or in supplied documentation. the peculiar thing is, worked fine last time used git few months ago, , haven't changed since seems cause. i've tried following, no effect: generating new id_rsa putting .ssh in current directory putting .ssh in root directory uninstalling msysgit , reinstalling latest version setting home environment variable installing tortoisegit , trying instead (didn't work @ all) any ideas else try? found it! the problem there 2 different git commands, git.exe (the actual program) , git.cmd (which sets necessary stuff work on windows). depending on options set @ install time, can end scenario former rather latter 1 ends in path...

iphone - UIModalTransitionStyleFlipHorizontal flipSideView always at top -

i want flipsideview takes middle part of screen. when this, flips entire iphone screen , forth. thought if created smaller container view , made flipside that, flip size of view. (kinda in itunes app when choose listen sample of song , little button on left flips over). the problem i'm having though have container smaller 320x480, when flip still uses entire screen. i'm using method default 'utility' application. i've tried moving view place when flips, doesnt help figured out. need change center of each view in these spots // called when flipside dismissed button - (void)flipsideviewcontrollerdidfinish:(flipsideviewcontroller *)controller { [self dismissmodalviewcontrolleranimated:yes]; self.view.center=cgpointmake(self.view.center.x, self.view.frame.size.height/2+44); } // called when button pressed flip - (ibaction)showflipside:(id)sender { [self presentmodalviewcontroller:listview animated:yes]; listview.view.cente...

c - Library function for reversing the string -

is there alternative strrev() in c? interested in function same must included in standard library. i aware operation can implemented user defined function looking library alternative.precisely there few functions take example rindex (identical strrchr() ) more common in perl still works in gcc-4.3.4,i inquisitive know if there strrev() since common reversing function in perl i.e reverse<> not working in c. compiler specification: [c (gcc-4.3.4)] thanks, ps:i aware of c++'s stl reverse question strictly c. as far know, there no such function in c standard libraries. if don't mind using c++, there reverse template function in algorithms .

iphone - implemeting a text field input like an atm machines input -

i have text field in iphone app , implement input similar atms input have enter digits (no decimal character input required). want able use numberpad text field. example, text field displays: 0.00 if user enters sequence 1234 text field this: 12.34 it have update if user pushes delete button. for formatting, think you'll happy details in this other post describing how use nsnumberformatter display leading , trailing zeros. pulled , tweaked post: nsnumberformatter *formatter = [[nsnumberformatter alloc] init]; [formatter setnumberstyle:nsnumberformatterdecimalstyle]; [formatter setformat:@"##0.00"]; nsnumber* input; // hook in input nsstring* output = [nsstring stringwithformat:@"%@", [formatter stringfromnumber:input]]; // hook text field in order convert input of 1234 12.34 (and presumably input of 12 0.12), consider shifting decimal of input 2 places. // int storedinput has been set 1234 int input = 5; // next button pressed stor...

Entropy Rate of a source of information with memory -

i have english written text , calculated entropy of it. realized compression algorithms based on lz methods compress under limit given entropy. that's due fact source of information models english text has memory. boundary compression given entropy rate , not entropy of source. i saw definition of entropy rate of source memory wondering how possible calculate entropy rate algorithm or pseudo code text written in english. any ideas? thanks help. in general, estimating entropy rate of source memory hard problem, , when there lots of long-distance dependencies (as there in natural language) it's difficult. need construct grammar of language based on sample, , calculate entropy rate of grammar. particular assumptions make when extracting grammar going make big difference in entropy rate end with, best you'll able estimate weak bounds on entropy rate of actual source. a common practice estimate entropy rate compressing large sample using standard compres...

php - How can I make a new CTP (CakePHP) file in NetBeans? -

i have found lot of info adding ctp file support netbeans, talking code highlighting , treating ctp file php file. can done at: tools -> options -> miscellaneous -> files i have done this. however, when try create new ctp file. not have option. i tried going tools -> templates add ctp template. there no "new" button "add" button looks file. i created file on desktop called cake_template.ctp on desktop. added php templates in template manager. called template "php cake template". still when go create new file, option not there. restarted netbeans, still same. i want create new .ctp file, shouldn't difficult. know how? i using version 6.9.1 just right click on folder in project view, , new php file. type file_name.ctp in field. if have .ctp not add .php

geometry - Check if a point is on a 3d line? -

i know how check if point on 2d line or not, i'd in 3d. ideas? // slope point 1 point 3 var p13:number = (math.atan2 (end.x - start.x, end.y - start.y)) * todegrees; // slope point 1 point 2 -- matches? var p12:number = (math.atan2 (point.x - start.x, point.y - start.y)) * todegrees; return math.round(p12) == math.round(p13); normalize vectors. check if normals match. find greatest value, divide of other values value vector normal. any point on line should have same vector normal.

c# - Suggestions for developing a TCP/IP based message client -

i've got server side protocol controls telephony system, i've implemented client library communicates in production now, there problems system have @ moment, considering re-writing it. my client library written in java thinking of re-writing in both c# , java allow different clients have access same end. the messages start keyword have number of bytes of meta data , data. messages terminated end of message character. communication duplex between client , server taking form of request client provokes several responses server, can notifications. messages marked being on of: c: command p: pending (server still handling request) d: data data response r: response b: busy (server busy handle response @ moment) n: notification my current architecture has each message being parsed , thread spawned handle it, i'm finding of notifications processed out of order causing me trouble have handled in same order arrive. the duplex messages tend take following me...

visual studio 2010 - configuration file to output dir when testing -

when execute tests visual studio 2010, app.config used in test not being copied folder testresults/out. icant set deployment test settings because there more 1 test project have same filename what can solve this? there other way achieve content file deployment when running tests? thanks in advance it's relative simple use custom configuration file in tests. example: /// <summary> /// summary description relatoriotest /// </summary> [testclass] [deploymentitem("dependency.config")] <- put here configuration file path. public class relatoriotest { ... }

Integrate Weld CDI into a JSF 1.2 EJB Application on jboss 6 AS -

since 2 evenings, trying integrate weld cdi ejb 3.1 application jsf 1.2. tried call @named annotated controller in jsf page. problem is, no exception thrown, when deploy project , no exception thrown when call page. the simple example contains only: the controller: import javax.inject.named; @named public class helloworldcontroller { public helloworldcontroller(){ system.out.println("hello world!"); } public string getmessage() { return "hello weld world"; } } and it's call: <h1><h:outputtext value="#{helloworldcontroller.message}" /></h1> thx did add required empty beans.xml file meta-inf web-inf? main cause of cdi mysteriously not working. see http://seamframework.org/documentation/whatisbeansxmlandwhydoineedit

xml - relaxng: invalid schema definition? -

i'm trying write schema xml documents using relax-ng, , when use jing, error message don't understand: c:\tmp\xml>java -jar jing.jar -c list-test2.rnc list-test.xml c:\tmp\xml\list-test2.rnc:6:10: error: repeat of "string" or "data" element can explain why , me workaround? here sample document (contrived simplicity): list-test.xml: <?xml version="1.0" encoding="utf-8"?> <list-test> <list name="list1"> foo.bar.baz quux be.bop.a.loo.bop <hole name="somename" /> tutti.frutti abc678.foobar </list> <list name="list2"> test1 test2 test3 <hole name="hole1" /> <hole name="hole2" /> test4 <hole name="hole3" /> </list> </list-test> here schema works ok: list-test.rnc: grammar { start...

c++ - Reading data into a queue -

using following (incomplete) code, attempting insert 10 strings string queue (declared , defined further down), read contents out 1 @ time, output queue doe snot correspond expected output int main() { ifstream file; (int count = 1; count <= 10; count ++) { string filename; stringstream ss; ss << "personlists/pl" << count << ".txt"; filename = ss.str(); waitinglistlist.add(filename); waitinglistlist.remove(filename); cout << filename << endl; waitinglistlist.add(filename); } } the following expect code, , have verified filename objects being constructed correctly using stringstream seen in int main() inserting output stream directly after line filename = ss.str() . personlists/pl1.txt personlists/pl2.txt personlists/pl3.txt personlists/pl4.txt personlists/pl5.txt personlists/pl6.txt personlists/pl7.txt personlists/pl8....