Posts

Showing posts from August, 2012

twitter - the user is forced to authorize my app each time -

twitter - the user is forced to authorize my app each time - i using tweepy api oauth: http://packages.python.org/tweepy/html/auth_tutorial.html#oauth-authentication the first time, user inquire authorize app. sec time, dont want user asked authorize app again. the tutorial says it thought save access token later use. not need re-fetch each time. twitter not expire tokens, time ever go invalid if user revokes our application access. store access token depends on application. need store 2 string values: key , secret: auth.access_token.key auth.access_token.secret i plan store access_token key , secret session. when user utilize app sec time, utilize access_token, user not forced authorize app again. however, problem happen when many twitter users utilize app, how can know access_token belong user. i hope question clear. stop twitter forcefulness user authorize app sec time. if need store access_token solve (1), how can know access_token belong user. ...

r - Subset a dataframe by time -

r - Subset a dataframe by time - i working on dataframe have intergrated time , date 1 column (called timestamp): a <-c(1:21) d <- c("2012/12/14", "2012/12/14", "2012/12/14", "2012/12/14", "2012/12/14", "2012/12/14", "2012/12/14", "2012/12/14", "2012/12/14", "2012/12/14", "2012/12/14", "2012/12/14", "2012/12/14", "2012/12/14", "2012/12/14", "2012/12/14", "2012/12/14", "2012/12/14", "2012/12/14", "2012/12/14", "2012/12/14") time <- c("18:40:37", "18:40:48", "18:40:58", "18:41:08","18:41:18","18:41:28","18:41:38","18:41:48","18:41:58","18:42:08","18:42:18","18:42:28","18:42:38","18:42:48","18:42:58","18:43:08...

ios - How to upload a picture/image from iPhone to App in ActionScript 3? -

ios - How to upload a picture/image from iPhone to App in ActionScript 3? - i'm building app actionscript 3.0 in flash builder. i'm having problem finding code utilize upload image in phone app? can link me/or post sample code accomplish task? thanks! ~myy i believe looking cameraroll class. allows user select image device's "camera roll" iphone ios actionscript-3 flash-builder

python - How to print the string "\n" -

python - How to print the string "\n" - i want print actual next string: \n , tried reads in takes new line operator.. how print following: \n ? use print "\\n" or raw string print r"\n" have @ tutorial concerning strings. python

Pointer notation for insertion sorting using C -

Pointer notation for insertion sorting using C - objective: i'm working pointers , i'm running quite few problems. lastly week assignment write insertion sort function sort ragged array in descending order. week professor wants me alter out indices , utilize pointers. void insert(int **table, int row) { // local declaration int **ptr = table; int **walkplus, *walk, temp; // statement for(ptr = (table + 1); *ptr != null; ptr++) { temp = **ptr; walk = *(ptr - 1); while(*walk >= diff && temp > *walk) { walkplus = ptr; **walkplus = *walk; *walk--; } **walkplus = temp; printf("\n"); } return; } i sense *walk--; cause problem. when utilize printf statement check it's value, i'm getting weird address. know pointers of import , want create sure understand concept, help appreciated. give thanks you. #includ...

Programmatically check for compilation errors java file -

Programmatically check for compilation errors java file - i want programmatically check if java class has compilation errors. can please allow me know how can done? you can utilize javacompiler api compile class , allow know if there compile errors. contrived illustration (using string input, can read file instead): string classname = "somepackage.yourclass"; string body = "package somepackage; " + "public class yourclass { " + "} "; compile(classname, body, temp_path); //temp_path: .class file saved where compile this: private static void compile(string classname, string body, path path) throws exception { list<javasourcefromstring> sourcecode = arrays.aslist(new javasourcefromstring(classname, body)); javacompiler compiler = toolprovider.getsystemjavacompiler(); standardjavafilemanager filemanager = compiler.getstandardfilemanag...

.net - Can a file get corrupted during IO.Stream.Write() -

.net - Can a file get corrupted during IO.Stream.Write() - we have unusual problem happens on our end users side. utilize devexpress xtragrid in our desktop app , need maintain layout settings in xml file on users hard drive(column width, order, filters etc.). from time time settings not saved correctly (a file gets damaged during save) without throwing exception. i've digged source files , not find might cause such issue. seems stream interrupts , file gets closed. here's corrupted file: <xtraserializer version="1.0" application="view"> <property name="#layoutversion">0.0.0.0</property> <property name="activefilterenabled">false</property> <property name="columns" iskey="true" value="68"> <property name="item1" isnull="true" iskey="true"> <property name="visible">true</property> ...

How can I pass oauth token or oauthaccesstokeid to javascript from Mule cloud connector -

How can I pass oauth token or oauthaccesstokeid to javascript from Mule cloud connector - i using cloud connectors in mule utilize oauth , authorize connector using authorizre message processor. afte rlogging in service provider can access token future invocations using oauthaccesstokenid. i interacting via javascript. have login button runs authorize flow in mule. , have seperate flow invoking api methods. how can pass oauthaccesstokenid javascript app in auth flow can pass mule invoke api? after authorize processor doing 302 redirect javascript app , storing oauthaccesstokenid in cookie. best way? thoughts on security also? note: assuming you're talking oauth2. what you're describing typical scenario oauth2 implicit grant useful: grant type, access token provided web browser (thus javascript code hosts) via request fragment. i'm not sure cloud connectors back upwards natively though. if not, going cookie work too. as far security concerned, proble...

asp.net - The FTP I'm using for school is not working with ANY given .aspx web pages -

asp.net - The FTP I'm using for school is not working with ANY given .aspx web pages - i tried uploading simple .html webpage .php webpage. both worked fine. when using visual studio asp.net , making websites visual basic, webform.aspx pages created when publish projects don't work. error: server error in '/' application. parser error description: error occurred during parsing of resource required service request. please review next specific parse error details , modify source file appropriately. parser error message: not load type 'assignment_1_mattandrzejczuk.webform1'. source error: line 1: <%@ page language="vb" autoeventwireup="false" codebehind="webform1.aspx.vb" inherits="assignment_1_mattandrzejczuk.webform1" %> this school assignment, know fact web server works , i've tested .html , .php pages on web server, work fine. don't know why can't same .aspx pages. have set root...

android - Adding the imagebutton to the spinner row makes it unselectable? -

android - Adding the imagebutton to the spinner row makes it unselectable? - i'd have spinner ability select item , click on button. this listener works spinner.setonitemselectedlistener(new onitemselectedlistener() { @override public void onitemselected(adapterview<?> arg0, view arg1, int position, long arg3) { } @override public void onnothingselected(adapterview<?> arg0) { } }); but when add together button custom row of spinner row becomes unselectable , button clickable. how create selectable again? android listener android-spinner

css - Background color not showing for a DIV -

css - Background color not showing for a DIV - i'm not sure i'm doing wrong having problem applying background color #content. works fine if set height value allow 800px. want either auto or 100% template used throughout site. advice appreciated. <div class="content_bg"> <div id="content"> <div id="contentleft"> </div> <div id="contentright"> <div id="contentpane" runat="server" /> </div> </div> </div> <div class="footer_bg"> <div id="footer"> <div id="footerleft"> </div> <div id="footerright"> </div> </div> </div> /* ==================================================================== content area ===========================================...

css - Why is an svg:text just not displaying? -

css - Why is an svg:text just not displaying? - i must missing obvious, can't <text> show up. see http://jsfiddle.net/ydalh/ html + css <svg style="width: 320px; height: 200px; top: 0px; left: 0px; position: relative;"> <g class="depth"> <g class="children"> <rect class="child" x="99" y="0" width="47" height="30"> <text dy=".75em" x="105" y="6">primary</text> </rect> <rect class="child" x="90" y="0" width="8" height="30"> <text dy=".75em" x="96" y="6">master</text> </rect> <rect class="parent" x="90" y="0" width="56" height="30"></rect> </g...

php - Cron job / connection timed out issue -

php - Cron job / connection timed out issue - i using wget in cron job command run bot this: /usr/bin/wget -o /dev/null http://www.website.com/bot/update?botkey=wpdalasd12laa but not working. failure emails contain repetitive error: > resolving www.website.com... 55.55.55.55 > connecting www.website.com|55.55.55.55|:80... connected. > http request sent, awaiting response... read error (connection timed out) in headers. > retrying. runtime of bot more 15 minutes. think because of this, connection become timed out. probably, running bot via php makes more sense. because scheme running on framework, not easy apply. there can done running bot via wget or curl avoiding connection timed out? php linux curl cron wget

flex - How to set value of label of one module from another module? -

flex - How to set value of label of one module from another module? - i have 1 module called mdl1.mxml , has pne label called lbl1. want set value of lbl1 sec module called mdl2.mxml. any help? flex flex3

ASP.NET client with node.js / socket.io server -

ASP.NET client with node.js / socket.io server - is possible communicate asp.net application node.js server? to start with, i'd able see connections. assumed work: server (node.js): var io = require('socket.io').listen(1234); io.sockets.on('connection', function (socket) { console.log('connected'); socket.on('disconnect', function () { console.log('disconnected'); }); }); client (asp.net): var tcpclient = new system.net.sockets.tcpclient(); tcpclient.connect("localhost", 1234); system.threading.thread.sleep(1000); tcpclient.close(); ...but i'm not having much joy. client doesn't complain @ all, never see 'connected' or 'disconnected' printed in node.js. has got working? asp.net node.js socket.io

video - jwplayer not working in Internet Explorer -

video - jwplayer not working in Internet Explorer - having issues jwplayer in net explorer jw player version: 6.1.2972 <div id="mediaplayer_1294">jw player goes here</div> <script type="text/javascript"> jwplayer("mediaplayer_1294").setup({ flashplayer: "jwplayer/jwplayer.flash.swf", file: "media.php?file=encoded_2012-10-19_17.13.24_1360841686.mp4&folder=shareddocs&user=9759", image: "media.php?file=encoded_2012-10-19_17.13.24_1360841686.jpg&folder=thumb&user=9759", controlbar: "bottom", width: "380", height: "200", primary: "html5", type: "mp4", controls: true, allowscriptaccess: 'always', bufferlength: 5 }); </script> ie7: loads , plays fine on console log: not add together internal listener ie8: error loading player: not load player configuration ie9: error loading media: file not played and o...

device - Android Activity height too long, how to swipe to bottom? -

device - Android Activity height too long, how to swipe to bottom? - i have activity (single) , if flip device can see half of activity. have 2 edittext , button , can't reach them because can't swipe bottom. if flip device ok. is there method must phone call can swipe? use scrollview niek said. 2.set fixed orientation if haven't designed landscape mode,(i.e either potrait or landscape) can set fixed orientation in manifest file android:screenorientation="portrait" (you can apply activity application whole) android device swipe flip

asp.net mvc 3 - Entity Framework: M-to-n: Read a linked entity from a list -

asp.net mvc 3 - Entity Framework: M-to-n: Read a linked entity from a list - i know title isn't quite specific , i'm sure question has been asked somewhere don't know how search it. i'm using asp.net mvc entity framework , have next model: public class receipt { public int receiptid { get; set; } public bool deleted { get; set; } public int useraccountid { get; set; } public int messageid { get; set; } public virtual useraccount useraccount { get; set; } public virtual message message { get; set; } }//end receipt a user has several receipts. messages specific user. this how i'm doing far: //get receipts of logged in user list<receipt> receipts = unitofwork.receiptrepository.get( u => u.useraccountid == loggedinuser.useraccountid).tolist<receipt>(); //get messages of receipts list<message> messages = new list<message>(); foreach (receipt receipt in receipts) { messages.add(r...

android - Access external xml file using jquery/javascript in html5 app without hosting the file -

android - Access external xml file using jquery/javascript in html5 app without hosting the file - i new jquery/java script/html 5. creating app reading xml file sdcard folder in mobile , parsing it;after info populated on page accordingly. how can access external xml file mobile app without hosting xml file? need access local drive.i have specific path. need pick xml info through application. currently creating application html page in microsoft visual studio , trying access xml file placed in folder in 'd drive'. thanks in advance. no help yet...can suggest ideas please???? javascript android jquery html5 jquery-mobile

wso2 - Authentication and Autherization using ESB and IS -

wso2 - Authentication and Autherization using ESB and IS - i trying follow samples mentioned in: http://blog.facilelogin.com/2012/05/authentication-and-authorization-with.html after next everystep, when seek test using tryit, identity server throws next error: access denied. please login first. the servers running @ default configuration, except ports - esb on 9443 , on 9445. esb version: 4.5.1 version: 3.2.3 kindly allow me know configuration missing. thanks, praveen refer this understand more on authentication , autherization using esb , patterns. furthermore, this slide set has interesting security patterns esb wso2 wso2esb wso2is

Monogame OpenGL Game crashes on some Windows 7 computers -

Monogame OpenGL Game crashes on some Windows 7 computers - i'am learning gamedevelopment using monogame. i started windows opengl project , works fine on win8 machine. i have compiled project , sent 2 people, both using win7 x64 , 1 of them can't open game. after that, tested on other computer (also win7 x64) , same problem, game process starts, screen flashes (aero seems deactivate), gets normal , process of game crashes without message. i'm sure, there no problem code, maybe missing dlls of them copied game lidgren.network.dll monogame.framework.dll opentk.dll sdl.dll tao.sdl.dll sincerely carnvanbeck if it's taking downwards windows aero, might graphics issue. compare graphical capability of win7 machine can run one(s) can't. working 1 have graphics card? seem remember monogame having odd behaviour reach graphics profile. windows windows-7 crash monogame

events - Backbone.js view img onload -

events - Backbone.js view img onload - i'm struggling backbone.js. i'm pretty new js , used as3 more object orientated i seek create simple image gallery backbone. load 100 images , want them fade in if loaded. i have in appview. every image url create 1 photoview var view = new photoview({model: photo, list:this.imagelist}); this.imagelist.append(view.render().el); in photoview utilize code attach onload() on img tag (found here): render: function() { var self = this; this.$el.append(some_html_with_img_elements); this.$el.find('img').on('load', function() { self.img_loaded() }); homecoming this; } the problem in img_loaded() same view on , on (the lastly view). know how maintain reference right view pass this argument img_loaded , you'll reference image loaded, , manipulate want. since didn't post code img_loaded function i'm not sure if you're trying fade them in 1 @ time each loaded (a simp...

Supress logging of embedded youtube iFrame -

Supress logging of embedded youtube iFrame - when playing video embedded iframe youtube player, lot of logs in console. there way disable this? i found issue posted on the google forum isn't solved yet. some examples of logs: sdk loader major version = 3 sdk version = 3.0.48 loading xlb file locale - en loaded xlb file locale - en succeed en_us not supported. attempting trim locale. loading xlb file locale - en loaded xlb file locale - en succeed it not matter of enabling or disabling case of extensive logging. it's fixed now: this inadvertent logging bit of border case, , should fixed later tonight. (feb 13, 2013) see posted issue youtube-api

ruby on rails - Work with two separate redis instances with sidekiq? -

ruby on rails - Work with two separate redis instances with sidekiq? - good afternoon, i have 2 separate, related apps. should both have own background queues (read: separate sidekiq & redis processes). however, i'd able force jobs onto app2 's queue app1 . from simple queue/push perspective, easy if app1 did not have existing sidekiq/redis stack: # in process, far far away # configure client sidekiq.configure_client |config| config.redis = { :url => 'redis://redis.example.com:7372/12', :namespace => 'mynamespace' } end # force jobs without class definition sidekiq::client.push('class' => 'example::workers::trace', 'args' => ['hello!']) # force jobs overriding default's sidekiq::client.push('queue' => 'example', 'retry' => 3, 'class' => 'example::workers::trace', 'args' => ['hello!']) however given have called ...

ruby on rails - How do you loop through a field on a custom engine in refinery cms -

ruby on rails - How do you loop through a field on a custom engine in refinery cms - i'm creating custom engine in refinery cms , have field called "pdf" refinery resource field type. some entries in engine have 1 pdf, while others have multiple pdf's. there way without creating bunch of fields don't need? i'd prefer loop through 1 pdf field rather code fields engine - pdf_1:resource, pdf_2:resource, pdf_3:resource, pdf_4:resource, pdf_5:resource, etc. how this? to best of knowledge there isn't built-in refinery process this. has_many way approach problem. ruby-on-rails refinerycms refinery

c++ - The output window closes after entering the input in C -

c++ - The output window closes after entering the input in C - i wrote programme in c , after compiling , running output console not remain on after come in anything. programme requires come in distance , time. my code here: #include <stdio.h> int spd(int x , int y); int main() { int x,y; printf("enter distance first time in si units :\n"); scanf("%d",&x); scanf("%d",&y); printf("the speed required ",spd(x,y)); getch(); homecoming 0; } int spd(int x , int y) { homecoming x/y; } try including header file : - #include conio.h c++ c

php - facebook page id -

php - facebook page id - how facebook fan page id using php sdk? currently, i'm using php sdk , can retrieve user info can't retrieve fan page information. please help me explain. thanks you lookup url retrieve id... https://graph.facebook.com/?id=http://www.facebook.com/cocacola php sdk facebook-page

How to write a copy constructor for Template Class - C++ -

How to write a copy constructor for Template Class - C++ - in header file have template <typename t> class vector { public: // constructor , other things const vector& operator=(const vector &rhs); }; and here 1 declaration i've tried far template <typename t> vector& vector< t >::operator=( const vector &rhs ) { if( != &rhs ) { delete [ ] array; thesize = rhs.size(); thecapacity = rhs.capacity(); array = new t[ capacity() ]; for( int = 0; < size(); i++ ){ array[ ] = rhs.array[ ]; } } homecoming *this; } this compiler telling me in file included vector.h:96, main.cpp:2: vector.cpp:18: error: expected constructor, destructor, or type conversion before ‘&’ token make: *** [project1] error 1 how declare re-create constructor? note: project , cannot alter header declaration, suggestions this, whi...

ruby on rails - RoR - Project that exclusively uses another systems API? -

ruby on rails - RoR - Project that exclusively uses another systems API? - absolute beginner ruby , rails. first total blown project interface existing scheme through rest api. so doesn't employ normal activerecord model , hoping examples of projects replace normal utilize of models api calls. entire crud set require app create corresponding api calls. i'd right way, don't know looks yet. thanks! :) helpful links googlers: http://yetimedia.tumblr.com/post/35233051627/activeresource-is-dead-long-live-activeresource https://github.com/rails/activeresource i don't know of projects open source this, i'd recommend looking active resource. part of rails through 3.2, has been moved separate repo rails 4. thought lets replace database persistance restful apis, sounds you're trying do. there documentation here should give plenty info off ground. there's pretty old railscast on it, i'm sure concepts haven't changed much. here's ...

java - Exception handling in Struts 2 and Hibernate -

java - Exception handling in Struts 2 and Hibernate - suppose have developed website in struts2, hibernate, mysql , have added few try/catch blocks here there encloses database calls via hibernate. question is inside grab block sending appropriate message logger. here can't utilize system.out.println webpage, else can done alert user exception? as part of testing changed hibernate.cfg.xml , input wrong database password simulate database crash scenario. as expected threw error javax.servlet.servletexception: filter execution threw exception java.lang.noclassdeffounderror: com_cenqua_clover/coveragerecorder my.com.employee.<init>(employee.java:29) com.action.employeeaction.<init>(employeeaction.java:23) sun.reflect.nativeconstructoraccessorimpl.newinstance0(native method) sun.reflect.nativeconstructoraccessorimpl.newinstance(nativeconstructoraccessorimpl.java:39) sun.reflect.delegatingconstructoraccessorimpl.newinstance(de...

How can I see Javascript errors in WebView in an Android app? -

How can I see Javascript errors in WebView in an Android app? - i'm trying run javascript in webview in app. i'm developing on nexus 7. the html / javascript works fine on chromium, actions aren't happening on tablet. there way of seeing if of javascript failing on tablet? kind of console view? you might able utilize firebug lite. it's bookmarklet can open on page. also, please search there many other similar questions: is there way enable javascript error/debug console safari within android? debugging javascript on android tablets/phones? javascript android webview

c# - Jquery Drag and Drop - Not able to drag back -

c# - Jquery Drag and Drop - Not able to drag back - i want able set item original location list, drag or remove button im destiny list. until have been able drag final list , remove final list, can't find way set original list. here code have (testable version here: http://jsfiddle.net/pmvhd/): <style> h1 { padding: .2em; margin: 0; } #products { float:left; width: 500px; margin-right: 2em; cursor: move } #cart { width: 300px; float: left; margin-top: 1em; cursor: move } #cart ol { margin: 0; padding: 1em 0 1em 3em; } </style> <script> $(function () { $("#catalog").accordion(); $("#catalog li").draggable({ helper: "clone" }); $("#catalog ul").droppable({ drop: function (event, ui) { $(ui.draggable).remove(); $("<li></li>").text(ui.draggable.text()).appendto(this); } }); $("#cart ol").dr...

Writing a Rails cancan ability using an association, that works with accessible_by -

Writing a Rails cancan ability using an association, that works with accessible_by - working on app user belongs_to organization . organization has_and_belongs_to_many products, though organizations_products table. i want user particular role able manage products organization . in ability.rb : def initialize(user) # ...snip unrelated stuff elsif user.is_manager? can :manage, product, |product| user.organization.products.include?(product) end this describes want raises exception in products controller: def index @products = product.accessible_by(current_ability) end because acessible_by can't used blocks in ability definitions. how can write ability in way compatible accessible_by ? can :manage, product, user.organization.products |product| user.organization.products.include?(product) end to clarify: cancan added 3rd parameter, can understand scope used accessible_by, in version 1.6. block used evaluating can :manage, @a_s...

html - how to make a navigation 100% width within an header wrapper -

html - how to make a navigation 100% width within an header wrapper - i'm trying create navigation bar 100% width, distributes as within header has width of 100%. each a element has 2 words each, perfectlly center aligned under each other. the html i'm working below: <div class="nav"> <ul> <li><a href="#"><span style="font-family:sacramento; text-align: center;">our</span><br> home</a></li> <li><a href="#"><span style="font-family:sacramento;text-align: center;">about</span><br> us</a></li> <li><a href="#"><span style="font-family:sacramento;text-align: center;">client</span><br> works</a></li> <li><a href="#"><span style="font-family:sacramento;text-align: center;">contact</span><br> us</a></li...

java - How to parse wsdl url using easywsdl2.1 api -

java - How to parse wsdl url using easywsdl2.1 api - i have parse wsdl 1.1 , wsdl2.0 url. found 1 api supports both 1.1 , 2.0 got problem in understading api. can give me examples of api. thanks java wsdl

visual studio - "git checkout" Doesn't Update Files -

visual studio - "git checkout" Doesn't Update Files - my workflow git this: 1. pull --rebase origin/master 2. create new branch specific issue , create changes on branch 3. switch head master , merge new branch i've created to master from documentation page, git checkout suppose to updates files in working tree match version in index or specified tree however after made changes new branch , checkout master , check status using 'git status', changed files still present. worst of all, have used 'undo file changes' alternative in git extension visual studio, if switch branch created using 'checkout' command, no longer see changes. there anyway can redo changes? before "checkout master", sure committing files in branch working on? make sure commit files in branch working on. otherwise, if git discards changed files, you'll have lost them ever. if not want commit files yet, seek looking @ git stash. git s...

c - Defining floating point values by base and exponent explicitly -

c - Defining floating point values by base and exponent explicitly - i stumbled upon http://sourceware.org/ml/glibc-cvs/2013-q1/msg00115.html, includes line #define two5 0x1.0p5 /* 2^5 */ apparently, two5 defined double explicit value 1<<5 . however, first time see notation. how has format been in use, , advantage on writing 2.5 ? this notation introduced in c99. advantage value expressed in hexadecimal form, not subject rounding etc. occurs when convert floating-point value between underlying representation , decimal form. there plenty of pages describe notation, example: http://www.exploringbinary.com/hexadecimal-floating-point-constants/ c floating-point notation

Not an ARRAY reference when using Perl's XML::Simple -

Not an ARRAY reference when using Perl's XML::Simple - i getting xml::simple , have had problem xml::simple module choking when parsing 1 record. perl code below..... #!/usr/bin/perl # utilize module utilize warnings; utilize strict; utilize xml::simple; utilize data::dumper; # create object $xml = new xml::simple; # read xml file $data = $xml->xmlin("owners.xml"); foreach $e (@{$data->{owner}}) { print $e->{ownerid}->{ownercik}."\n"; print $e->{ownerid}->{ownername}."\n"; print "\n"; } when utilize xml, works beautifully... <?xml version="1.0"?> <ownershipdocument> <owner> <ownerid> <ownercik>0001234878</ownercik> <ownername>public john q</ownername> </ownerid> </owner> <owner> <ownerid> <ownercik>0001234877</ownercik> ...

java - Get values from JSP with Spring MVC -

java - Get values from JSP with Spring MVC - i have spring project generated maven , jsp insert.jsp in /target/m2e-wtp/web-resources , looks this: <%@ page language="java" contenttype="text/html; charset=iso-8859-1" pageencoding="iso-8859-1"%> <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>library</title> </head> <body> <h1>insert record</h1> <form action="insertbook" method="post"> title: <input type="text" name="title"/><br> author: <input type="text" name="author"/><br> category: <select name="category"> <c:foreach var="cat" items=...

Player API issues after YouTube watch page displas a pre-roll ad -

Player API issues after YouTube watch page displas a pre-roll ad - when surfing youtube page (for instance http://www.youtube.com/watch?feature=endscreen&nr=1&v=bfodwsiywoc) , got pre-roll advertisment (a video advertisement displayed before clip itself) entire player api screwed in regard original video. for instance, player.getcurrenttime() & player.getduration() homecoming advertisement info when advertisement beingness displayed after video beingness switched desired video maintain returning 0 (the video beingness played correctly , video player show how much time played , how long clip). btw, behaviour not happen if there wasn't ad. also, if during desired video phone call player.getvideourl() advertisement url , not video url (only if there pre-roll advertisement of course). i tried reset in various ways (stop , load desired video, clone player , reset it, etc...) couldnt find working solution, got idea? based on question, sounds you...

.net - Retrieving the COM class factory for component with CLSID {xxxx} failed due to the following error: 80040154 -

.net - Retrieving the COM class factory for component with CLSID {xxxx} failed due to the following error: 80040154 - i'm upgrading vb6 app vb.net. used "adobe acrobat 10.0 type library". however, when using .net project i'm getting error in title. created little test project. exception thrown when seek instantiate acropddoc, on next line: dim acroapp acrobat.acropddoc = new acrobat.acropddoc() the adobe library resides @ c:\program files (x86)\adobe\reader 10.0\reader\acrord32.dll . when added, puts dll called "interop.acrobat.dll" project's obj folder. i've tried running regsvr32.exe on both dlls, saw advised somewhere, recieved error along lines of dll loaded phone call dllregisterserver failed error code 0x80004005 i haven't been able find great deal on error code. i've tried chainging platform target x86 'any cpu'. edit - i've experienced same problem on both 32 , 64 bit editions of windows 7. i...

how embed pdf document in html with out copy and print -

how embed pdf document in html with out copy and print - i beginner of web programming, question how embed pdf document in html 1 partition tag, , pdf can avoid copy, print , download options. this next code. <html> <head> <title>pdf document </title> </head> <body> hello world! <br> <div width="500px" height="500px"> <embed src="myfile.pdf#toolbar=0&navpanes=0&scrollbar=0" width="425" height="425"> </div> <div width="1px"> hello</div> </body> </html> some alternative may help you: first: if stick pdf embedded option, pdf files don't great on webpage. anyway, sure strict coding. hence: <iframe src="path/to/pdf" width=500 height = 500> should be <iframe src="path/to/pdf" width=...

"java.lang.Error: Unresolved compilation problems" during execution Selenium tests with TestNG using Maven -

"java.lang.Error: Unresolved compilation problems" during execution Selenium tests with TestNG using Maven - i using selenium testng automated testing. using maven software project management , comprehension tool. have maven dependencies in class path. still got caused by: java.lang.error: unresolved compilation problems: the import org.openqa.selenium.firefox.firefoxdriver cannot resolved.selenium.firefox.driver jar nowadays in class path same problem other dependencies. how resolve error? try these steps: right click project goto maven menu click update project configuration java maven selenium testng selenium-firefoxdriver

javascript - jQuery Mobile dual footer -

javascript - jQuery Mobile dual footer - i have simple jquery mobile page , show copyright message @ bottom of page above footer. in page footer, have several buttons , copyright message should appear in small plain text on right cornenr exaclty above footer... see kind of dual footer . when add together copyright message footer, inherit footer data-theme not desired. when add together content of site, not show copyright @ bottom of page. hints on inject copyright message highly appreciated. easy css magic create 'copyright' css class: .copyright { font-size: 0.75em; margin-top: -20px; float:right; padding-right: 5px; } notes: a. 'margin-top' makes render above footer b. 'float:right' puts in on right of screen. utilize 'float:left' or 'float:center' if desired. in footer, utilize copyright class. < div data-role="footer"> < span class='copyright'>&...

json - Passing in String to jQuery function as Object -

json - Passing in String to jQuery function as Object - this might stupid question, i'm trying pass in string of settings i've constructed in next format: "setting1" : "value", "setting2" : "value", "setting3" : "value" the above saved string named args. nil special, i'm wanting pass in argument function. $('#element').functionname({ args }); i'm not sure i'm missed here.... thanks! if have string such this: '"setting1" : "value", "setting2" : "value", "setting3" : "value"' you can parse using json.parse , object out of so: var args = json.parse( "{" + str + "}" ); $('#element').functionname(o); but in reality want create such object instead of string start, e.g.: var args = {"setting1" : "value", "setting2" : "value", ...

google plus - window.googleapis is undefined -

google plus - window.googleapis is undefined - i trying add together g+ +1 button on web page. next steps provided on google developers page, next error window.googleapis undefined. same error appears on google developers page (viewed in firebug). why error appear? , how can solved? i reproduce bug on firefox 18.0.2 + firebug 1.11.1, though said before not on firefox 19.0 (with same profile). fixed in firefox 19.0. if still sees issue firefox version, please comment @ issue 6280. google-plus google-plus-one

tuple pairs, finding minimum, python -

tuple pairs, finding minimum, python - i have info comes tuple pairs within python, e.g. data = [ (1, 7.57), (2, 2.1), (3, 1.2), (4, 2.1), (5, 0.01), (6, 0.5), (7, 0.2), (8, 0.6)] how may find min of dataset comparing of sec number only? i.e. data[0][1] = 7.57, data[1][1] = 2.1.. min( info ) = (5, 0.01) i see min( info ) returns (1, 7.57), take right minimum within pair, though not of dataset. in [2]: min(data, key = lambda t: t[1]) out[2]: (5, 0.01) or: in [3]: import operator in [4]: min(data, key=operator.itemgetter(1)) out[4]: (5, 0.01) python tuples min

android - Avoid duplicates in list -

android - Avoid duplicates in list - i trying avoid duplicate values in list it's not working. can help me this? did lot of work on it, i'm new android , coding. can help me have made mistake? import java.util.arraylist; public class dynamic extends activity { button bt, bt2, ent, clr; edittext et, et2; string input, input1; public static arraylist<string> k_listitems = new arraylist<string>(); public static arraylist<string> p_listitems = new arraylist<string>(); @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); bt = (button) findviewbyid(r.id.nameok); et = (edittext) findviewbyid(r.id.name); input = et.gettext().tostring(); bt.setonclicklistener(new view.onclicklistener() { public void onclick(view v) { if (et.gettext().length() == 0) { ...

ruby - Rails application is not running on default 80 port. But runs on every port other than 80 -

ruby - Rails application is not running on default 80 port. But runs on every port other than 80 - i have issue apache vhost. running rails 2.0.2 app on centos6 . app running on webrick server. have set virtual host in apache issue application not working on port 80. running on every other port 80. what should reason? following code in app.conf file- /etc/httpd/sites-enabled/app.conf listen 80 <virtualhost *:80> documentroot /var/www/app/public servername www.domainname.com serveralias domainname.com errorlog /var/log/httpd/app/error.log customlog /var/log/httpd/app/access.log mutual <directory /var/www/app/public> allow options -multiviews </directory> </virtualhost> i have included app.conf file httpd.conf file next statement. include sites-enabled/*.conf please suggest if missing in both app.conf , httpd.conf files. urgent. thanks in advance! find out process running on port 80. use - netstat ...

iphone - BAD_ACCESS when trying to free data when UIView to UIImage -

iphone - BAD_ACCESS when trying to free data when UIView to UIImage - i intended take snapshot of uiview drawed opengl es uiimage , here code used: if(context){ [eaglcontext setcurrentcontext:context]; glbindframebuffer(gl_framebuffer, defaultframebuffer); nsinteger datalength = framebufferwidth * framebufferheight * 4; glubyte* info = (glubyte*)malloc(datalength) ; // malloc(mydatalength); glreadpixels(0, 0, framebufferwidth, framebufferheight, gl_rgba, gl_unsigned_byte, data); // create info provider data. cgdataproviderref provider = cgdataprovidercreatewithdata(null, data, datalength, null); // prep ingredients int bitspercomponent = 8; int bitsperpixel = 32; int bytesperrow = 4 * framebufferwidth; cgcolorspaceref colorspaceref = cgcolorspacecreatedevicergb(); cgbitmapinfo bitmapinfo = kcgbitmapbyteorderdefault; cgcolorrenderingintent renderingintent = kcgrenderingintentdefault; // create cgimage c...

Emacs shortcut to switch from a horizontal split to a vertical split in one move? -

Emacs shortcut to switch from a horizontal split to a vertical split in one move? - i find myself switching horizontal view of 2 windows in emacs vertical view. requires me first c-x 1 , c-x 3 , c-x o followed c-x b <ret> switch other buffer or that. have type c-x | (analogous how, in ediff, nail | toggle split view). i found in emacs wiki site: http://www.emacswiki.org/emacs/togglewindowsplit but how map key combo want? or whether there simpler way (taking less .emacs space). the lastly line key combo defined. should (global-set-key (kbd "c-x |") 'toggle-window-split) emacs

python - Django Rest Framework / Django performance issue -

python - Django Rest Framework / Django performance issue - i deploying django w/ django-rest-framework on ec2 little instance server provide set of apis couple of android apps. the problem facing serious performance issue had profile. found out of time single request spent within drf's core. sorry making long post think have show can proper reply whats going on. allow me go ahead: my setup nginx / uwsgi. here's how running uwsgi using upstart: description "pycms" start on [2345] stop on [06] respawn # start virtualenv path chdir /www/python/apps/pycms/ exec uwsgi -b 25000 --chdir=/www/python/apps/pycms --module=wsgi:application --env django_settings_module=settings --socket=127.0.0.1:8081 --processes=5 --harakiri=20 --max-requests=5000 --vacuum --master --pidfile=/tmp/pycms-master.pid assuming request next api: http://ip_address/api/nodes/mostviewed/9/ which matches next rule: url(r'^nodes/mostviewed/(?p<category>\d+)/...