Posts

Showing posts from March, 2012

java - Linked List not reading file correctly -

so have linked list class has of constructor data necessary read file have , convert linked list. when reads in file data adding lines , spaces incorrectly. using system.out.println check , coming out incorrectly. don't think tostring method because have messed , nothing changes. need because cant figure out. thanks! file information(basically of data on separate lines): tobi tobi tobi@hotmail.com tobi mixed breed male 3-4 virginia walking lily lily lily@hotmail.com lily yorkshire terrier female 3-4 hawaii jumping peppy peppy peppy@hotmail.com peppy chihuahua male 7-8 alaska sleeping fluffy fluffy fluffy@hotmail.com fluffy mixedbreed female 3-4 virginia walking flower flower flower@hotmail.com flower chihuahua female 7-8 alaska sleeping linked list: import java.io.serializable; import java.util.*; public class linkedaccountlist implements serializable{ private string username; private string password; private string email; private string n

python - NoseGAE not able to import .py files in application root -

i'm trying automatic pydev/nosetests/gae setup going in eclipse, verifying command-line tinkering. far, have looks following: preferences -> pydev -> pyunit nose test runner parameters: --with-gae -w "/my/app/root" --without-sandbox -p directory structure (normal gae stuff omitted) ./src/ *module hierarchy* ./tests/ __init__.py sometests.py ./main.py ./urls.py at moment, when use same parameters on command-line in app root, python modules within src/ import 'main' or 'urls' cause: error: failure: importerror (no module named main) note: similar problem another post related nose . solution isn't applicable in case, there no __init__.py in application root. for work, you'd need have structure 2 pythonpath entries, 1 adding 'src' , other adding project root... i.e.: have: /project <- add pythonpath (i.e. set source folder in pydev) /project/src <- add pythonpath (also set source folder i

c# - Adding Header and Footer Images to PDF: Header image doesn't show, Footer is scaled up -

i attempting create simple .pdf using libary itextsharp. making .pdf header & footer have images in them , header margin 300px & footer margin 664px. my problem: code doesn't insert header image reason , footer image blown up/scaled in size reason. can tell me whats wrong code. header image should extend whole width of a4 page & 300px in height. footer image should extend whole width of page & 664px in height. both images dont need resized whole width of page & correct heights. public class itseventshandler : pdfpageeventhelper { pdftemplate total; basefont helv; // following tutorial & said if want create headers/footers when each page created // should override onendpage() not onstartpage() correct? public override void onendpage(pdfwriter writer, document document) { // post: when each new page created, add header & footer image page. , set top margin 370px // , bottom margin 664px. /

c# - ITextSharp Defining a Pages Background Image: Whats the correct way? -

is possible set background image pdf page in itextsharp? whats correct way define background image pdf page? there property of document set? or creating image(my image has dimensions of a4 page)? if add background image normal image able place paragraphs on top of background image? var document = new document(pagesize.a4, 50, 50, 25, 25); // create new pdfwrite object, writing output memorystream var output = new memorystream(); var writer = pdfwriter.getinstance(document, output); var logo = itextsharp.text.image.getinstance(server.mappath("~/images/test.jpg")); logo.setabsoluteposition(0,0); document.add(logo); // following paragraph on top or below background image? // aiming on top document.add( new paragraph("sjfkkjdsfk") ); document.close(); the logo fine - it's regular image content on page, not backgound img (like in html). put content on top of that, need use direct content: pdfcontentbyte on = writer.directcontent; over.savestat

SPARQL - Restricting Result Resource to Certain Namespace(s) -

is there standard way of restricting results of sparql query belong specific namespace. short answer - no there no standard direct way this long answer - yes can limited form of string functions , filter clause. function use depends on version of sparql engine supports. sparql 1.1 solution almost implementations these days support sparql 1.1 , can use strstarts() function so: filter(strstarts(str(?var), "http://example.org/ns#")) this preferred approach , should relatively efficient because simple string matching. sparql 1.0 solution if stuck using implementation supports sparql 1.0 can still uses regular expressions via regex() function slower: filter(regex(str(?var), "^http://example\\.org/ns#")) regular expressions , meta-characters note regular expression have escape meta-character . otherwise match character e.g. http://examplexorg/ns#foo considered valid match. as \ escape character both regular expressions , sparql

Running the lynx text web browser inside emacs -

lynx pretty cool text browser. how launch emacs? my current approach mx shell , lynx . prompts me terminal type (which don't know - use terminal , gui emacs on gnome). default option makes output barely readable. see this page on emacswiki. use emacs-w3m works w3m , can configured use lynx bindings. there emacs-xwidgets , it's not stable works. however if want use lynx can try m-x term ret .

javascript - particle brownian motion with directions -

i'm trying use brownian motion create group of random moving particles. http://jsfiddle.net/j75em/16/ so far i've got particles moving randomly i'm not sure how set forward direction make more natural. i've tried use change in x , y axis calculate rotation using atan, can see uncommenting rotate doesn't seem perform well. is right approach type of movement? thanks; this pretty neat! you sort of going right way should use atan2 function. removes need 0 checks. the atan2 function gives angle anticlockwise positive x vector (1, 0) ---> the bees 90 degrees off starting angle must subtract 90 degrees direction. (depending on way round dy , dx calculation, might need add) you find direction changes rapidly, consider limiting next change set of changes cause angle change below threshold. make movement little smoother. i go generating angle between -pi/8 , pi/8 radians, , random length. using polar coordinates. add new random polar offset

c# - Why are my dynamically added user controls showing having their ascx controls as null? -

i created new control testcontrol . on front-end gave it <asp:label id="lbltest" runat="server" /> on backend: public partial class testcontrol : system.web.ui.usercontrol { protected void page_load(object sender, eventargs e) { lbltest.text = "blah"; } } when load control via: var control1 = loadcontrol(typeof(testcontrol), null); controls.add(control1); i exception lbltest null. why occurring? use relative path overload of loadcontrol method instead, noted here. http://msdn.microsoft.com/en-us/library/ewtd66a0.aspx edit: changed answer after research.

asp.net - ssrs reportviewer loading to infinity without error message -

when run report with parameter in asp.net application see loading div infinity without indication of error (so dont know how search issue in google) note1: can run same report directly report server note2: if removed parameter run asp.net page report server protected void page_load(object sender, eventargs e) { oid = (int64)session["oid"]; viewreport(); } public void viewreport() { string reportserverurl = configurationmanager.appsettings.get("reportserverpath"); reportviewer.serverreport.reportserverurl = new system.uri(reportserverurl); reportviewer.serverreport.reportpath = @"/storeports/myreport"; reportviewer.serverreport.setparameters(new reportparameter("oid", oid.tostring())); reportviewer.serverreport.refresh(); } in function called sys$webforms$pagerequestmanager$_endpostback(error, executor, data) tools sql server denali ,

c - OpenSSL certificate revocation check in client program using OCSP stapling -

i have embedded c client program securely connects server using openssl. server provides certificate during handshake , client has check revocation status of certificate. using ocsp. all of works, need re-implement client's revocation check using ocsp stapling (assuming server start providing this). currently server certificate using x509 *cert = ssl_get_peer_certificate(ssl) check subjectaltname against server's domain , authorityinfoaccess (for ocsp uri). assuming have ssl * ssl; , set , connected via ssl_connect(ssl); , do @ point @ ocsp stapling information , verify certificate received? can't find sample code how implement using openssl library. there couple steps: have client send status_request extension via ssl_set_tlsext_status_type(ssl, tlsext_statustype_ocsp) . register callback (and argument) examine ocsp response via ssl_ctx_set_tlsext_status_cb(ctx, ocsp_resp_cb) , ssl_ctx_set_tlsext_status_arg(ctx, arg) write callback function.

java - Eclipse wont start after computer restart -

my eclipse not starting because computer kinda froze , had force restart it. eclipse open when had restart , believe cause. not know how fix this. whenever try opening it, tells me check .log file inside workspace , says: http://paste.strictfp.com/26579 and don't know how fix it. please help? you missing classes line 125 chances have reinstall fix this.

php - Adding downloadable links on success page -

possible duplicate: how downloadable product links after successfull order i wonder if it's possible add multiple download links on magento success page after ordering. i able 1 working link downloadable file code: $incrementid = $this->getorderid(); $linkpurchased = mage::getmodel('downloadable/link_purchased')->load($incrementid, 'order_increment_id'); $downloadableitems = mage::getresourcemodel('downloadable/link_purchased_item_collection')->addfieldtofilter('purchased_id', $linkpurchased->getpurchasedid()); foreach ($downloadableitems $item) { $links = mage::getmodel('core/url')->geturl('downloadable/download/link', array('id' => $item->getlinkhash(), '_secure' => true)); echo $this->__('download').' le <a href="'.$links.'" target="_blank">file</a>'; it gives me 1 perfect link on success page if order had mu

html - jquery - output array result in 10x10 div format -

i have array in jquery contains 100 elements. want output data in 10 rows, each 10 columns, in html format inside html container div. my frame similar this: <div id="row1"> <div id="col1" style="float:left">data1</div> <div id="col2" style="float:left">data2</div> <div id="col3" style="float:left">data3</div> ... </div> <div id="row2"> <div id="col1" style="float:left">data1</div> <div id="col2" style="float:left">data2</div> <div id="col3" style="float:left">data3</div> ... </div> i thinking of nested 'for' loop, think there must better way. jquery .map function suitable this? suggestion? tia

Iesi.Collections (nuget package) is not supported for .NET 2.0 ? Huh? -

Image
i've tried adding iesi.collections .net 2.0 project , failed :- pm> install-package iesi.collections installed 'iesi.collections 3.2.0.4000'. uninstalled 'iesi.collections 3.2.0.4000'. install failed. rolling back... install-package : not install package 'iesi.collections 3.2.0.4000'. trying install package project target s '.netframework,version=v2.0', package not contain assembly references compatible framework. more nformation, contact package author. @ line:1 char:16 + install-package <<<< iesi.collections + categoryinfo : notspecified: (:) [install-package], invalidoperationexception + fullyqualifiederrorid : nugetcmdletunhandledexception,nuget.powershell.commands.installpackagecommand um, huh??? i thought whole idea of iesi.collections support collections existed in .net 3.5+++ not in .net 2.0 .. package -made- .net 2.0 project? waaa?? update i have target .net 2.0 project can't update 3.5 pr

algorithm - random placement of rectangles with no overlaps -

i looking sound algorithm randomly place given number of rectangles of same size bigger rectangle (canvas). i see 2 ways it: create empty array contain rectangles placed on canvas. start empty canvas. in loop, pick position @ random new rectangle placed. check if array has rectangle overlaps new rectangle. if not, put new rectangle in array , repeat loop. otherwise, pick new position, , rerun check again. , on. might never terminate (theoretically) think. not it. use grid , place rectangles cells randomly. might still grid placement. not either. any better ways it? "better" meaning more efficient, or more visually "random" grid approach. better in respect. here simple heuristic. non-overlapping , random. place rectangle randomly. then, calculate intersections of extensions of the 2 parallel edges of first rectangle edges of canvas. obtain 4 convex empty regions. place other rectangles in these empty regions one-by-one independently , calculat

ios - tools on Linux to read/dump MachO files? -

are there tools available on linux read/dump/analyze macho files? somethings readelf or objdump , macho format? must run on linux. i provided previous answer describing how use binutils (objdump , friends) mach-o format. hope helps - since mention ios, may have change --target parameter arm target.

ios - Error 0xE803FFE while installing app on iPhone through iTunes -

i trying install app on iphone. dragged certificates itunes libraries. dragged .ipa file libraries. after syncing , installing, shows following error: the app "xxx" not installed on iphone ... because unknown error has occured (0xe803ffe) please me. urgent. try explain procedure of installing app, if possible. in advance if member of apple developer program, go members area , @ provision portal. tells need know app building device. https://developer.apple.com/ios/manage/overview/index.action

sql server - sql query : double record for joins ... can;t figure it out -

i have tables : i. parent table : id_client id_group package start_date end_date id_contract is_parent 1223 88 1234 2012-01-01 2050-01-01 156447 1 1223 89 34342 2011-04-01 2050-01-01 156447 1 ii. share table : id package id_share 1 1234 ss4433 - parent 2 564679 ss4433 --- child 3 564522 ss4433 -- child 4 34342 ss2345 - parent 5 665456 ss2345 -- child 6 7789997 ss2345 -- child iii. child table : package start_date end_date id_contract 564679 2011-01-01 2012-02-01 156447 564522 2011-01-01 2011-05-07 156447 665456 2011-01-01 2012-02-04 156447 7789997 2011-01-01 2011-07-03 156447 the question how select 1 query parent , it's children in same select (based on id_share in share table), con

iOS provisioning and keychain generation -

i'm using xcode 4.3.1 on mac os x 10.7.3 trying provision ios 5.1 phone. first used development provisioning assistant create provisioning profile. after dragging/installing profile in organizer, says "valid signing identity not found". continued development provisioning assistant, got new development certificate, installed it. didn't help. it's still "valid signing identity not found". after reading topic on google , other people's solutions, deleted keys in keychain access, walked through development provisioning assistant again, did said, still didn't fix problem. thought needed fresh start again. deleted provisioning profiles, certificates, keys. redid everything, no use. tried "add portal" in organizer, generated 4 certificates still no keys. should restart machine? kidding. i've been there couple of times right now. tried understan going on , documented here (understanding ios code signing) (warning: tl;dr).

visual studio 2010 - How to see stack just before stack overflow occurs? -

i have stackoverflowexception occurring deep inside linq datacontext upon call submitchanges . after lot of time wasted trying pinpoint overflow occurring, can't seem figure out. how can see stack looked before stack overflow shown? you cannot catch stackoverflowexception unless it's thrown user code. (more info) in visual studio, "debug" menu, choose "new breakpoint > break @ function..." in "function" field of "new breakpoint" dialog, enter stackoverflowexception.stackoverflowexception run program in debugger. once stack overflow, debugger stop @ breakpoint.

jQuery slider doesn't show if called in a div using Ajax ( creating a xmlhttprequest, onreadystatechange etc.) -

i working on college project in ajax , jsp, using jquery snippets available on internet (galleria, dropdown menus etc.), quite confident in javascript, knowledge of jquery extremely limited. in index page, call main content div using ajax methods ( not jquery ajax, complete javascript, onreadystatechange() , responsetext). have jquery image slider , jquery menu in content. these don't work after ajax callback. have read problem need re-bind events after callback don't understand how to. to re-bind events after callback $.ajax({ type: 'post', //default here 'get' url: '/path/to/my/file.jsp data: mydatavariable // alternatively can use data: { $("jqueryselector").val)(); } success: function(data){ if(data){ $("body").on("bind", "elementidorclass", function(){ //these functions bound on callback. stuff }); $("someelement").html(data); //place data returne

google app engine - NTLM Authentication not possible in AppEngine -

i'm writing app engine application interfaces corporate sharepoint server needs authenticate using ntlm authentication (no support basic,digest or kerberos auth) i'm using apache httpclient 4.1.3 because supports ntlm authentication out of box. you need implement custom clientconnectionmanager , managedclientconnection because of classes used internally not in appengine jre class white list , found couple of implementations in internet no probs there ( esxx server implements one). i have working on local appengine development server surprise won't work on production appengine server. after many investigations, found ntlm authentication needs persistent connection in order make handshake consisting in exchanging 3 messages in 2 consecutive http requests. 2 http requests must done using same connection (persistent connection), if not server refuse authenticate. it seems urlfetchservice uses different connections each request , there no way of keeping con

json - jQuery set selected option from data on page load -

i have page uses jquery load option dropdown on page load. part works fine. want set selected option in dropdown baised on querystring if there 1 - , default if there not one. querystring being recovered fine can not setting of selected option work. in code below when stop @ "debugger" line , examine select0 undefined (after haveing been loaded successfully) if allow code keep running dropdown populated data ajax call. guessing why selected item not being set - can't figure out how resolve it. $(document).ready(function () { $.ajax({ type: "post", url: "mypage.aspx/mywebmethod", contenttype: "application/json; charset=utf-8", data: "{}", datatype: "json", success: function (states) { var jsoncodes = json.parse(states.d); (var in jsoncodes) { $("#select0").append(new option(jsoncodes[i].

php - SELECT users who have downvoted but never upvoted -

so, thought getting pretty @ mysql until ran idea: i have table logging "votes" (aptly named votes ) these fields: id : vote's unique id. user : unique user id of person voted item : id of item they're voting on vote : vote cast set('up','down') now, i'm trying come sql way find users votes downvotes. know of way write procedurally in php after querying of data out of table seems really, inefficient way when few queries find out. ideally want result list of users have 0 upvotes (as being in table means have voted, downvote) , maybe number of downvotes they've cast. any ideas on how should approach this? select user, sum(if(vote='down',1,0)) numdownvotes votes group user having sum(if(vote='up',1,0))=0 -- 0 upvotes , sum(if(vote='down',1,0))>0 -- @ least 1 downvotes i can't feel there's neat group user, vote way though.

math - 2D Continuous Collision Detection -

i'm trying implement simple continuous collision detection pong game i'm not sure i'm implementing or understand right. afair continuous collision detection used fast moving objects may pass through object circumventing normal collision detection. so tried because fast moving object have ball need position of ball, move speed, , position of object comparing to. from figured best example if ball's move speed indicated moving left, compare it's left-most bound right-most bound of other object. step through adding move speed left-most bound of ball , compare make sure it's greater other objects right bound. show there no left right collision. i have working, unfortunately, ball starts bouncing while acts if hits paddle when nothing there. i'm bit lost, appreciated! static bool checkcontinuouscollision(pactor ball, prect ballrect, pactor other, prect otherrect) { pvector ballmovespeed; int ballxlimit; int ballylimit; ballmovespeed

android - could not get updated location in -

in application setting timer of 10 sec current location calling locationmanager.requestlocationupdates(); problem couldnt updated location instead gives same latitude , longitude application has started.. below code written in service.. , suggestions appreciated public class demoservice extends service{ locationmanager locationmanager; public timer timer; public static int i; private string file_name = "location.txt"; @override public ibinder onbind(intent intent) { // todo auto-generated method stub return null; } @override public void onstart(intent intent, int startid) { // todo auto-generated method stub super.onstart(intent, startid); locationmanager = (locationmanager) this.getsystemservice(context.location_service); toast.maketext(getapplicationcontext(), "onstart()....", toast.length_short).show(); timer = new timer(); timer.schedule(new maintask

Quoting and escaping in Maven Exec plugin -

how quoting , escaping work parameters passed maven plugins? for example want pass multiple filenames arguments application run maven exec plugin: mvndebug exec:java -dexec.mainclass="main" -dexec.args="/path/to/file1 /path/to/file2" but if paths have spaces? i've tried using \": -dexec.args="\"/path/to/a file\" /path/to/file2" and "": -dexec.args="""/path/to/a file"" /path/to/file2" neither works :-(. neither moving first quote before -d. the source code maven exec plugin doesn't me either, receives string[] somewhere, where? note must work command line, without changes pom file. you try single quotes ( ' ) doubt work, either. the problem can have several argument elements inside pom (hence array in plugin's source) have single property command line. options: patch plugin and/or open feature request support several arguments (maybe exec.args.0,

Hosting a WCF service in Mono console application on Mac Os X -

when try host wcf service, works in windows, in mono console application following error (*): an element same key exists in dictionary. i don't @ why happening or need fix this. has experienced or can point me in right direction? i using mono 2.10.8 on mac running os x 10.6.8. *stacktrace: @ system.collections.objectmodel.keyedcollection`2[system.type,system.servicemodel.description.ioperationbehavior].insertitem (int32 index, ioperationbehavior item) [0x0003a] in /private/tmp/monobuild/build/build/mono-2.10.8/mcs/class/corlib/system.collections.objectmodel/keyedcollection.cs:168 @ system.collections.generic.keyedbytypecollection`1[system.servicemodel.description.ioperationbehavior].insertitem (int32 index, ioperationbehavior kind) [0x00000] in /private/tmp/monobuild/build/build/mono-2.10.8/mcs/class/system.servicemodel/system.collections.generic/keyedbytypecollection.cs:70 @ system.collections.objectmodel.collection`1[system.servicemodel.description.iopera

windows phone 7 - how to show a youtube video into WP7 application? -

i want develop wp7 application. in one, video youtube. example, videos of channel. so, know, need youtube api, don't find simple example subscribe channel , receive latest video... is possible ? thanks in advance , have nice day ! i think there simple rss feeds each channel... if there no rss feeds, parse html feed (e.g. http://www.youtube.com/user/nokia/feed ) to play youtube videos, see http://mytoolkit.codeplex.com/wikipage?title=youtube

parsing - How to load specific files for different countries in Android -

possible duplicate: change language programatically in android i develop android app offer specific information based on user selection of country. user choose country , app update fields country. information text. each country information 2-3 pages, different main fields. my first thought add text files application in "res/raw" folder , load them after getting user preference. best way it? idea add xml files in res/xml ( easier parse? ). and if go prepackaged text files, best way parse text file adding information in specific fields of application? i think put them in " res/raw ". may consider using xml files instead of plain text files. easier parse , better organized.

android - How to do visible EditText Data on Activity change -

hello friends having edit text in program , if writing thing on there , if clciking on other option move anothe activity , when coming same page data of edit text clearing dont want clear data if move on page can body tell me how ..i doing writing below code.. if(presetquestion.value=="true") { string note1=note.gettext().tostring(); note.settext(note1); } but not woring thing not doing correctly ... use onsaveinstancestate(bundle outstate) , onrestoreinstancestate(bundle outstate) : @override public void onsaveinstancestate(bundle outstate) { edittext edttext=(edittext) findviewbyid(r.id.textone); outstate.putstring("textone", edttext.tostring()); } @override public void onrestoreinstancestate(bundle outstate) { string strval=outstate.getstring("textone"); edittext bddb=(edittext) findviewbyid(r.id.textone); bddb.settext("prvva

Jackson Deserialize custom boolean json property -

i want deserialize boolean values in json. problem values can null, true, false, "true", false, "y" or "n". i've created own boolean deserializer public class custombooleandeserializer extends jsondeserializer<boolean> { final protected class<?> _valueclass = boolean.class; @override public boolean deserialize(jsonparser jp, deserializationcontext ctxt) throws ioexception, jsonprocessingexception { return _parsebooleanprimitive2(jp, ctxt); } protected final boolean _parsebooleanprimitive2(jsonparser jp, deserializationcontext ctxt) throws ioexception, jsonprocessingexception { logutils.d("parse boolean"); jsontoken t = jp.getcurrenttoken(); if (t == jsontoken.value_true) { return true; } if (t == jsontoken.value_false) { return false; } if (t == jsontoken.value_null) { return fa

configuration - Building FFMPEG with librtmp for android -

i'm trying build all-in-one static binary of ffmpeg ndk r7b , works fine untill try build rtmp support. i'm usind sources https://github.com/guardianproject/android-ffmpeg librtmp2.4 , custom config this .configure \ --target-os=linux \ --cross-prefix=arm-linux-androideabi- \ --arch=arm \ --sysroot=/home/andrey/android-ndk-r7b/platforms/android-3/arch-arm \ --enable-static \ --disable-shared \ --disable-symver \ --enable-small \ --disable-devices \ --disable-avdevice \ --enable-gpl \ --enable-librtmp \ --prefix=../build/ffmpeg/armeabi \ --extra-cflags=-i../rtmpdump/librtmp \ --extra-ldflags=-l../rtmpdump/librtmp \ and rtmpdump directory lays on same level ffmpeg. understand last 2 strings in config says compiler may find sources of librtmp. error: librtmp not found i'm not expereienced ndk , obviosly missing important part can't find myself. this challenging, think have solution. problem @ configure-time ffmpeg wants detect proper librtmp installat

Flash: understanding program flow -

after reading tutorial of flash, still not sure program flow in general: specifically, have demo of flash game (sort of super mario style). in have 2 types of weapon - simple fire , big fireball. reviewed code in order learn flash better [i new - since around monday week]. i saw program has variable keeps track of number of uses have left in each weapon. tried review places variable used couldn't find affects drawing onto screen. i tried removing variable declaration , testing - may find references variable -- way convinient way of finding references variable/method/class [i using adobe flash cs5.5]? also, tried changing variables starting value "12" , noticed when test game, weapon has 12 uses indeed. so problem: 1. seems variable somehow affecting drawing. yet, don't know how since code have found uses variable has nothing drawing. all, logic, like if(var <= 0){ var--; } else{ return false; } where influence coming from? any way referen

url rewriting - Remove .php extensions with .htaccess without breaking DirectoryIndex -

i have following rewrite in .htaccess file removes .php extension files, converting example so.com/question.php so.com/question . rewriteengine on rewritecond %{request_filename} !-f rewriterule ^([^\.]+)$ $1.php [nc,l] however breaks default directoryindex behaviour, in typing directory redirect index file in folder, e.g. so.com/answer displays so.com/answer/index.php simply combining above code directoryindex index.php not achieve both results. can me combine these 2 functions, or rewrite code exclude index.php files, achieve same result? i'm thinking need verify file exists prior doing rewrite, way you'll leave 404 , directoryindex behaviours intact: rewriteengine on rewritecond %{request_filename} !-f rewritecond %{request_filename}.php -f rewriterule ^(.*)$ $1.php [nc,l] (not tested)

Apache Camel : "direct:start" endpoint - what does it mean ? -

i'm new apache camel. can explain "direct:start" means in camel. please see http://camel.apache.org/http from("direct:start") .to("http://myhost/mypath"); thanks. the "direct:start" above saying route starts direct component named "start". the direct endpoint provides synchronous invocation of route. if want send exchange direct:start endpoint create producertemplate , use various send methods. producertemplate template = context.createproducertemplate(); template.sendbody("direct:start", "this test message"); there nothing special name start . name going use when referring endpoint , have been direct:foo .

Is there a C library that converts integers to hexadecimal or binary? -

is there library function takes in integer , converts single-byte hexadecimal or binary number? for example, if passed input of 64 , output 0x40 . for hex numbers, can use sprintf : char buff[80]; sprintf(buff, "0x%02x", 64);

Unity3d character body length -

i having trouble using unity3d (js). add gameobjects behind character (a bit snake game guess). dont know how set different position each time. ps: character in constant movemement. here script: var lenght : int = 0; var lenghtcharacter: rigidbody; var character:rigidbody; function addlenght(amount : int) { lenght += amount; (var i=0; <= lenght; i++) { var onelenght = instantiate( lenghtcharacter, character.transform.position - character.transform.forward * (0.3 * i), character.transform.rotation); } } i call function when character collides 'asteroid' =] thanks help. a springjoint perfect component fluidly achieve exact functionality describing: http://unity3d.com/support/documentation/components/class-springjoint.html

visual studio 2010 - Report watermark disappears when reportviewer used -

i using crystal reports in vs 2010. have report watermark added. when use 'main report preview' watermark shows fine. when use code show report gone. initializecomponent() reportviewer.owner = me dim durocreport new duroc durocreport.setparametervalue("registration", reg) durocreport.setdatabaselogon("", "") reportviewer.viewercore.reportsource = durocreport the report shows except watermark/background missing, of data correct. i fixed cutting resolution of image 300 85. seems file size issue. image missing anytime reloaded visual studio. works, have mess around image quality until looks enough use.

java - How do you calculate the angle between one object and another? -

how calculate angle between 1 object , assuming first object origin , vector is, up? struggled problem in android , java 6 hours , there wasn't questions or answers gave correct way calculate it. if question not super clear: have object on screen , want know angle object being y axis (or 90 degrees) object on screen. if first object @ 1,1 , second object @ 2,2, angle should 315. because 0 degrees right, 90 degrees (y axis), 180 degrees left, , 270 degrees down. there might more elegant solutions, found works well: float angle = (float)math.todegrees(math.atan2((double)(y1 - y2),(double)(x1 - x2))); angle = (angle + 180.0f) % 360.0f; angle = 360.0f - angle; this gives angle starting 0 right, 90 up, 180 left, , 270 down. answered own question because took me on day find , wasn't on internet. hope helps someone. i'll leave question unanswered day or two, see if can find more elegant solution or better way of expressing answer. answer in java , has been teste

html - Get Frame src URL in address bar -

i'm working on making mobile version of website hosted on godaddy windows server. way godaddy apparently handles mobile subdomain having webpage inside frame. example: <head> </head> <frameset rows="100%,*" border="0"> <frame src="myurl.com" frameborder="0" /> <frame frameborder="0" noresize /> </frameset> <!-- pageok --> <!-- 02 --> <!-- --> </html> the problem link open in page opens within frame , url in address bar never changes. question how can frame url show in browser's address bar. far know, godaddy doesn't give me access file above html in allow me alter that. each page has initial php script ran check if needs redirect mobile browser, if there way php, can implement it. thanks guys can offer. you can accomplish using javascript on page: top.location.href = document.location.href; this "breaks" out of

.htaccess - Redirect only one folder to HTTPS, all others to HTTP -

i apologize in advance asking that's been answered several times on so, haven't been able modify of answers work case. i have /secure/ folder need redirect https. outside of folder should redirected http. i plan on using absolute links navigation through site, need guarantee pages in /secure/ folder viewable on https. other pages doesn't matter, i'd prefer them viewable on http because i'm on shared hosting , server slow is. thank much! adapted example on page this page . see if following works you. rewriteengine on rewritecond %{server_port} 80 rewritecond %{request_uri} secure rewriterule ^(.*)$ https://www.example.com/secure/$1 [r,l]

objective c - Using Open SSL with Xcode 4.3 -

recently upgraded xcode 3.2 4.3 my application using openssl 1.0.0 , working fine xcode 3.2 , xyz.app making use of open ssl , built on xcode 3.2 working fine osx lion 10.7 but when built same application on xcode 4.2 , log says , couldn't certificates authority , in-tunrs seems open-ssl library has not integrated xcode 4.3 application development environment, i tried re-built openssl no luck, suspecting following, 1 -- in xcode 4.3 see 2 compiler llvm 4.3 , apple lvm , believe open ssl built using gcc 4.2 , on xcode 3.2 using same working , 2 -- on lion should kind of cross compilation open - ssl apple llvm compiler , should working on xcode 4.3 application please throw lights on it. i fixed it the problem is, ssl_ctx_load_verify_locations , ssl_ctx_set_default_verify_paths , input parameter not correct, in 10.6 compiling , running, might ssl have ignored it, in 10.7 didn't work, giving proper input working. thanks reading it.

php - All possible combinations from sets -

i have set of numbers: 1,22 1,46 32,1 1,9 32,22 1,14 1,45 1,33 33,22 45,22 32,46 32,9 3,1 3,9 3,22 3,32 3,46 9,22 46,22 46,45 46,33 15,1 15,46 15,6 15,22 15,3 15,9 15,45 15,33 15,32 15,14 i need combinations them rule each new pair can appended if latter number same first in pair. for example if have pair {15,1}, next on can {1,46} , next {46,45}, , final pair must end first number of whole set. in case example {45,1}. so end result of sets 4 set limit {15,1,1,46,46,45,45,1} i can basic power sets , generate possible combinations set of numbers seems advanced me. i can c, javascript or php or solutions highly appreciated. , clarification, not homework, learn , understand. this looks if graph data structure, , graph algorithms, appropriate. graph comprise nodes (each of number) , edges (each of represents 1 of pairs). write appropriate routine walking round graph. it's not entirely clear question rules walk are, guess know. edit of course, should po

jquery - Ajax bugs with internet explorer cached -

Image
recently working on company i'm realize start having troubles methods return html based on partial views. problem changes not loaded internet explorer because browsers has configures remains in cache information , cannot see changes base on partial view. changes not affected in other browsers firefox , chrome. the problem solved modifying options of internet explorer , checking options on browsers client so. have couple of questions is there configuration or meta tag can used in javascript, html or jquery handle kind of error without modified browser configuration. where can find documentation troubles if issue ajax related...try setting cache:false in ajax options. if using convenience methods get() or load() can globally using $.ajaxsetup() http://api.jquery.com/jquery.ajax/ http://api.jquery.com/jquery.ajaxsetup/

jquery - Recognize when writing in between two $$ signs -

i have textfield in i'm writing text. for sake of simplicity, want alert('boom!') jumps out every time start writing in between 2 $$. for example have blank textfield , start typing (cursor "|" sign) today nice day| nothing happens, start typing today nice day, $|$ still nothing, when start typing today nice day, $sometext|$ alert box should jump out each letter in between dollar signs. why need kind of feature? want live-equation-preview (mathjax rendering) every time user starts typing his/her equation, , can recognize it's equation $$ signs (everything in between rendered). edit: multiple $$'s possible in textfield. script must recognize 1 active (cursor position between it's $$'s). you can use jquery caret plugin http://examplet.buss.hk/download/download.php?plugin=caret.1.01 note: edit , delete these characters Ôªø line 8 and replace funcition. ( not replace use index of matched pattern ) $("#m

Turning on internet connection programmatically (Android) -

i developing software android want turn on user's internet connection automatically. these internet on/off widgets does. private void setmobiledataenabled(context context, boolean enabled) throws exception{ final connectivitymanager conman = (connectivitymanager) context.getsystemservice(context.connectivity_service); class conmanclass = null; try { conmanclass = class.forname(conman.getclass().getname()); } catch (classnotfoundexception e) { // todo auto-generated catch block e.printstacktrace(); } final field iconnectivitymanagerfield = conmanclass.getdeclaredfield("mservice"); iconnectivitymanagerfield.setaccessible(true); final object iconnectivitymanager = iconnectivitymanagerfield.get(conman); final class iconnectivitymanagerclass = class.forname(iconnectivitymanager.getclass().getname()); final method setmobiledataenabledmethod = iconnectivitymanagerclass.getdeclaredmethod("setmobiled

arrays - Java: Access class -

i'm loading players database class player , happens in class db . // class db arraylist<player> player= new arraylist(); public void loadplayers() { try { stmt = conn.createstatement(); rs = stmt.executequery("select * players"); while (rs.next()) { player.add(new player(rs.getint("id"), rs.getstring("name"), rs.getint("score")); } rs.close(); stmt.close(); } catch (sqlexception ex) { system.out.println("error selecting"); system.err.println(ex); } } // class player int id, score; string name; public customer(int id, string name, int score) { this.id = id; this.name = name; this.score = score; } public string getname(int id) { return name; } // view // need here "arraylist<player> player"? db.instance.loadplayers(); // use singleton pattern system

php - Mass editing SQL fields? -

possible duplicate: replace in mysql i have fields in sql database, text. how can edit text fields? example have same word in fields, , want change else or delete completely. i think have brute force this. have call update statement every column want have changed. (if have lot of columns can access metadata of database gather names of tables , gather names of columns in tables , create update scripts automatically.

javascript - redirecting/reloading page in js.erb instead of controller -

my index.js.erb refreshing page partially: $("#view").html("<%= escape_javascript render 'view' %>"); i able refresh in controller line: format.js { render :js => "window.location.replace('#{url_for(:controller => :view, :action => :index, :some_parameter => value)}');" } is possible refresh page in js.erb? edit: call index.js.erb command in controller: format.js { redirect_to(:action => :index, :format => :js, :some_parameter => value)}, it refreshes page content some_parameter, refreshes partially. window.location works better, read in 1 of stack overflow posts better use erb controller javascript. really? for second way, you're refreshing whole page( made http request ) , if want this, why not use redirect_to ?

perl5 - Deactivate and Remove Perl Local::Lib -

i deactivate environment variables , remove appended /home/myusername/perl5.. directories @inc result of local::lib. can advise? state of perl env vars , @inc folders before local::lib. on fedora 16. did read the instructions ? in shell, eval $(perl -mlocal::lib=--deactivate-all)

android - setting up drawable.invalidate to continuously draw on canvas -

i trying incrementally change alpha value of ovalshape().. need call invalidate , keeps calling , render increased alpha value.. but setup wrong, dont have idea this.. public class xml_anim_testing_sub_class extends view { private shapedrawable mdrawable; int x = 10; int y = 10; int width = 300; int height = 50; int my_alpha = 255,add_to_my_alpha = 0; public xml_anim_testing_sub_class(context context) { super(context); } protected void ondraw(canvas canvas) { x++; mdrawable = new shapedrawable(new ovalshape()); mdrawable.getpaint().setcolor(0xff74ac23); mdrawable.setalpha(my_alpha += add_to_my_alpha ); mdrawable.setbounds(x, y, x + width, y + height); if (my_alpha == 0) add_to_my_alpha = 1; if (my_alpha == 255) add_to_my_alpha = -1; mdrawable.draw(canvas); mdrawable.invalidateself(); } } ok, found out solution, invalidate() , diff

forms - SQL/PHP make an array with column name / value for specific unique id -

i have sql table named clients each client stored in row, unique (auto increment) id , column names are: clientname, clientlastname, clientmobile , on. i want make array retrieve contents of specific client (row) , : clientname => lalala, clientlasthname=>lalalala... , on. then want display results in html form (non submitable, display) each cell in form has unique id , name same column names of sql db. i new @ , cant seem it. here's i've done far: <?php header("content-type:text/html; charset=utf-8"); if ($_post) { $link = mysql_connect("localhost","userid","pw"); if (!$link) { die("database connection failed". mysql_error()); } mysql_set_charset('utf8',$link); $db_select = mysql_select_db("form2",$link); if(!$db_select){ die("database selection failed " . mysql_error()); } } else { echo "search:"; } ?> <html> &l

android - getSize() giving me errors -

when implement windowmanager wm = ((windowmanager)context.getsystemservice(context.window_service)); display display = wm.getdefaultdisplay(); m_ndisplaywidth = display.getwidth(); m_ndisplayheight = display.getheight(); i can run fine, when implement getsize runtimeerror point size = new point(); display.getsize(size); //error right here m_ndisplaywidth = size.x; m_ndisplayheight = size.y; logcat: 03-11 01:45:25.865: e/androidruntime(18835): fatal exception: main 03-11 01:45:25.865: e/androidruntime(18835): android.view.inflateexception: binary xml file line #7: error inflating class com.brain.development.gamerun 03-11 01:45:25.865: e/androidruntime(18835): @ android.view.layoutinflater.createview(layoutinflater.java:518) 03-11 01:45:25.865: e/androidruntime(18835): @ android.view.layoutinflater.createviewfromtag(layoutinflater.java:570) 03-11 01:45:25.865: e/androidruntime(18835): @ android.view.layoutinflater.rinflate(layoutinflater.java:623) 03-11 01:45:2

c++ - Why cvPutText doesn't work in this case? -

i using opencv function cvputtext, seems won't execute or overwritten. here block of code: ... if(showresult==1){ cvnamedwindow("znak", cv_window_autosize); cvshowimage("znak", znak); if(result == 0){ ascii_result = "a"; cvset(znak, cvscalar(26,26,26)); cvputtext(znak, "a", cvpoint(13, 185), &font, cvscalar(255, 166, 44, 0)); printf("a working"); } if(result == 1){ ascii_result = "b"; cvset(znak, cvscalar(26,26,26)); cvputtext(znak, "b", cvpoint(13, 185), &font, cvscalar(255, 166, 44, 0)); printf("b working"); } ... it isn't in loop. problem is, window "znak" created, cvset() , cvputtext won't execute or overwritten...so see blank window deafult gray color cvshowimage should put every time made c