Posts

Showing posts from May, 2012

php - Unable to download file using codeignitor -

Image
this down loader controller. first time works properly. opens save popup , able download required file, next time shows direct directory listing. <?php class download extends controller { function download(){ parent::controller(); $this->load->helper('download'); echo "i in constructor"; } function index(){ $file = realpath("download")."\\profile.doc"; echo "i in index."; exit; if (file_exists($file)) { header('content-description: file transfer'); header('content-type: application/octet-stream'); header('content-disposition: attachment; filename=' . basename($file)); header('content-transfer-encoding: binary'); header('expires: 0'); header('cache-control: must-revalidate, post-check=0, pre-check=0'); header('pragma: public'); header('content-le...

gae eclipse plugin - GWT+GAE error :failed org.mortbay.jetty.nio.SelectChannelConnector by running GWTTestCase-JUnit -

i use eclipse ide gae+gwt project. environment:gwt2.1.1, gae 1.4.0 in gwt project(without gae), using gwttestcase in project,,, →no problem. run well. in gwt+gae project, using gwttestcase in project gwt,,, →when running test extends gwttestcase, error comes. error below: java.lang.nosuchmethoderror: org.mortbay.thread.timeout.(ljava/lang/object;)v @ org.mortbay.io.nio.selectormanager$selectset.(selectormanager.java:306) @ org.mortbay.io.nio.selectormanager.dostart(selectormanager.java:223) @ org.mortbay.component.abstractlifecycle.start(abstractlifecycle.java:39) @ org.mortbay.jetty.nio.selectchannelconnector.dostart(selectchannelconnector.java:303) @ org.mortbay.component.abstractlifecycle.start(abstractlifecycle.java:39) @ org.mortbay.jetty.server.dostart(server.java:233) @ org.mortbay.component.abstractlifecycle.start(abstractlifecycle.java:39) @ com.google.gwt.dev.shell.jetty.jettylauncher.start(jettylauncher.java:542) @ com.goog...

Javascript: I found this small bit of code, does it copy text to the clipboard? -

i found in js source here: http://www.clae.com/jscripts/common.js i don't know does, copy text clipboard? thought impossible js copy text clipboard? // copies passed text clipboard function copytoclipboard(text) { var range = document.body.createtextrange(); range.findtext(text); range.select(); document.execcommand("copy"); document.execcommand("unselect"); } it's not cross-browser. check out: http://www.quirksmode.org/dom/execcommand.html

android - How to get data from custom dialog? -

i have created custom dialog class(extended dialog) 3 buttons, , each button must call different activity. seem having problems calling activity onclick. private class oklistener implements android.view.view.onclicklistener { @override public void onclick(view v) { dismiss(); intent myintent = new intent(myapp.this,nextact.class) startactivity(myintent); } } } what missing? can give me specific examples on how call activity custom dialog class? appreciate much! desperate after going through whole night without sleep. i followed tutorial way: how display custom dialog in android ~ciao in onclick have check,which button click , load intent according button click. dismiss(); if (v== firstbutton) { intent = new intent(getbasecontext(),buttonone.class); startactivity(i); } if (v == cancelbutton) { intent = new intent(getbasecontext(),buttontwo.class); startactivity(i); } ...

c - Integer reduces to string when accessing via tostring/checkstring? -

do integral values reduce down strings in lua? i've tried track down bug full hour, when realized numbers same strings, given following code: main.c: #include <stdio.h> #include "lua.h" #include "lauxlib.h" #include "lualib.h" int ex_dummyfunc(lua_state* l) { const char* first = lual_checkstring(l, 1); int second = lual_checkinteger(l, 2); printf("first = %s, second = %d\n", first, second); return 0; } int main(int argc, char *argv[]) { lua_state *l = lual_newstate(); lual_openlibs(l); lua_register(l, "dummyfunc", ex_dummyfunc); if(argc > 1) { if(lual_dofile(l, argv[1]) == 1) { fprintf(stderr, "error: %s\n", lua_tostring(l, 1)); } } lua_close(l); return 0; } test.lua: dummyfunc("stuff", 42) dummyfunc(42, 8) dummyfunc(82, "stuff") output: first = stuff, second = 42 first = 42, second = 8 error: ...

rest - Is it possible to use MTOM in reponse of CXF RESTful Web Service -

i'm using cxf 2.2.12 library web services. is possible use mtom ( message transmission optimization mechanism ) in restful response? would appreciate links docs/tutorials regarding this. thanx! mtom specific soap argue incompatible restful architecture. however, http supports multi-part content naturally, can mtom in http directly. if wanted use xop packaging multi-part content mtom does, isn't necessary. mtom solving problem http solved.

jquery - Is a hatched jqueryui slider range/background possible? -

is possible have range/background of jqueryui slider hatched or filled colour gradient (see http://upload.wikimedia.org/wikipedia/commons/5/5d/unintuitive-rgb.png ) it's not changing colour, rather make ranging red->green depending on variables -- of course may vary @ runtime... any appreciated! yes possible. you need set background of slider div. <div id="slider" style="background:black"></div> this cause slider have black background. that easy part. question how create gradient? for css implementation @ http://www.webdesignerwall.com/tutorials/cross-browser-css-gradient/ might want csshooks option in jquery streamline it. see https://github.com/brandonaaron/jquery-csshooks examples (there gradient.js csshook, far checked didn't support ie). for best result, might want set background image instead, example: <div id="slider" style="background:url(creategradient.aspx?from=000&to=fff&h...

Converting Timespan to DateTime in C# -

i reading excel worksheet data using c# , microsoft.office.interop. sheet contains date values. when trying read value giving number (probably timespan). having problem converting number datetime. below code: timespan ts = timespan.parse(((range)ws.cells[4, 1]).value2.tostring()); where ws excel.worksheet . can explain how should convert number ( timespan ) datetime ? thanks sharing valuable time. you following double d = double.parse(((range)ws.cells[4, 1]).value2.tostring()); datetime conv = datetime.fromoadate(d);

Include min and max date in jquery calendar -

i having following code, how can add min , max date well? $("#datepicker").datepicker({ dateformat: 'dd-m-yy', altfield: 'dd-m-yy', altformat: 'd/m/y'}); $("#datepicker").datepicker({ dateformat: 'dd-m-yy', altfield: 'dd-m-yy', altformat: 'd/m/y', mindate: new date(2007, 1 - 1, 1), maxdate: '+1m +1w' });

call jquery fom php script -

<script type="text/javascript"> <!--// // on dom ready $(document).ready(function (){ $("#current_rev").html("v"+$.jnotify.version); $("a.example").bind("click", function (e){ // prevent default behavior e.preventdefault(); var $ex = $($(this).attr("href")), code = $.trim($ex.text()); // execute sample code $.globaleval(code); }); // style switcher $("button.css_switcher").click(function (){ switchcss(this.title); }); }); //--> </script> instead of using click events <a href="#example-1" class="example">[run]</a> , <a href="#example-2" class="example">[run]</a> how can call events if condition true or false? <?php if (true){ <a href="#example-1" class="exampl...

c# - How to delete post from wall? -

i have problem deleting posts facebook wall. use facebook c# sdk v4.2.1. example of posting message: dictionary<string, object> parameters = new dictionary<string, object>(); //init parameters return _app.post("me/feed", parameters); and ok, method posts returns id of post. but when try delete post same id dictionary<string, object> parameters = new dictionary<string, object>(); if(settings.id!=null) parameters.add("id", settings.id); return _app.delete("me/feed",parameters); //id - facebook.jsonobject key = new facebook.jsonobject(); //key.add(new keyvaluepair<string,object>("id",id)); an error has been occurred: (oauthexception) invalid token: "me". id has been specified. stack trace: @ facebook.facebookapp.makerequest(httpmethod httpmethod, uri requesturl, byte[] postdata, string contenttype, type resulttype, boolean re...

Connecting Android Application with any Database -

how go on connecting android application local database? probably easiest way use php middle layer, send http requests android application it. take @ this more information also read this: how-to-connect-android-to-a-database-server hope helps.

lua - Love2d and radial gravity -

i've found interesting article on adding radial gravity box2d. http://www.vellios.com/2010/06/06/box2d-and-radial-gravity-code/ to port lua though need calculate distance squared , normalize distance. love2d doesn't seem have functions extract appropriate vector, shame. unless math lacking , me out. i can alway switch box2d love2d seemed neat solution. i've found how using hump library. like this. ship = bodies[1] shipvec = vector(ship:getx(),ship:gety()) planet = bodies[2] planetvec = vector(planet:getx(),planet:gety()) distance = planetvec – shipvec force = 250 / distance:len2() normforce = force*distance bodies[1]:applyimpulse(normforce.x, normforce.y,ship:getx(),ship:gety())

multithreading - Python: how can I get a thread to kill itself after a timeout? -

i'm writing multi threaded python app makes many tcp connections servers. each connection done on separate thread. thread hangs long time don't want. how can thread kill after given time period? main thread how can determine child thread killed itself? if possible appreciate snippet of code showing how this. thanks. update system ubuntu 9:10 short answer: make def run() end. so, if waiting data socket, timeout, if timeout occur break while should have, , thread killed. you can check main thread if thread alive isalive() method.

sql - Finding blind_SQL vulnerability in php site code -

hi i'm beginner in web domain , wondering if guide me in should blind sql injection vulnerability in code of whole forum example if exploit of vulnerability index.php?m=content&c=rss&catid=[valid catid] should in code portion validates user form & url input; i'm beginner in php , how should fix it. if worried sql injection have bad design. should using parametrized queries library adodb or pdo. there no question, 100% protected against sql injection. for testing blind sql can somthing like: index.php?m=content&c=rss&catid=sleep(30) . this request should take 30 seconds page load. if need quote mark payload ' , sleep(30) or 1=' . to patch vulnerability know catid should int. @ top of page can add line: $_get['catid']=intval($_get['catid']);

xml - restricting an attribute in XSD without custom types -

i looking way have attribute of type xs:string minimum length. i have found way here , solution involves introducing new type. as using xml mapping/binding, results in shiny new class (cluttering code presence additional method calls) totally useless - still plain old string . is there way avoid introducing custom type? you shouldn't need declare new (named) type - put restriction inside attribute definition: <xs:element name="foo"> <xs:complextype> <xs:attribute name="bar"> <xs:simpletype> <xs:restriction base="xs:string"> <xs:minlength value="5" /> </xs:restriction> </xs:simpletype> </xs:attribute> </xs:complextype> </xs:element>

c# - From Windows Forms to WPF -

i long time experienced windows forms developer, it's time move wpf because new wpf project comming me , have short lead time prepare myself learn wpf. what best way experienced winforms devleoper? can give me hints , recommendations learn wpf in short time! are there simple sample wpf solutions , short (video) tutorials ? books recommend? www.windowsclient.net starting point? there alternatives official microsoft site? thanks in advance help! i tutorial: http://reedcopsey.com/series/windows-forms-to-mvvm/ also, dont afraid forgeting learned. wpf designed totaly different technology winforms. in aspects results in completly different techniques reach goal.

java - Reading Multiple Resultset using JPA -

i using jpa(eclipselink) execute sql server stored procedure returns multiple resultsets. as per knowledge, easiest way call sp is: entitymanager.createnativequery("exec sp_name").getresultlist(); after executing sp can read single (or first) resultset . can 1 please suggest how retrieve next resultsets (or resultlists())? i can't answer eclipselink specifically, , i'm not sure jpa spec says, features of jpa took cue hibernate, , hibernate's limitations on stored procedures are: the procedure must return result set. note since these servers can return multiple result sets , update counts, hibernate iterate results , take first result result set return value. else discarded. my guess jpa defines same limitation.

sharepoint - Promoted InfoPath Fields into WSS 3.0 -

i have 2 infopath forms (created in infopath 2007) in wss 3.0 site , these setup sontent types. both forms have promoted field 'field a' , both bound same field in wss (so data 'field a' display in 1 column when both content types used in same forms library. recently re-published 1 of forms using infopath 2010 (and checked promoted fields bound correct corresponding fields in content type nothing should change). new forms of 1 of content types 'field a' not displaying when form saved , fields promoted. field has problem, other promoted fields fine , has not created seperate field data, field still looking @ correct place in content type. can me promoted field working again? thanks in advance, luke i found problem one. when had re-published form content type field talking linked content type (for reason cannot put finger on) needed pulled content type fields in content type settings library linked to. i don't know if find useful, th...

ReCaptcha for .Net 2.0 conflicting with other forms on site -

i've read , re-read multiple posts on site , others seem touch on similar topic none of suggested fixes work me. asp.net 2.0 site, has master pages , multiple user controls. have login user control allows user login / register on site. i've entirely separate control form user can fill out pay money. added recaptcha (the version compatible .net 2.0) form , works. however, once add anywhere on site can no longer login, login form submits refreshes no action taken, login details correct. i thought validation groups added (via custom validator) validation group recaptcha (a thread on site suggested solution) - didn't work, same problem. i changed login control template set it's validation group manually saw suggested here - again didn't work - same refresh issue. i'm @ loss, add usercontrol contains recaptcha anywhere on site, login ceases work. i can't upgrade .net 3.5 + site built , functional already. can suggest might make these 2 play nic...

ASP.net Ajax Enabled WCF Service - Security issue -

i've got problem ajax enabled wcf service. the service configured follows: <system.servicemodel> <bindings> <webhttpbinding> <binding name="securewebhttpbinding"> <security mode="transportcredentialonly"> <transport clientcredentialtype="ntlm"></transport> </security> </binding> </webhttpbinding> </bindings> <behaviors> <endpointbehaviors> <behavior name="shared.services.ajaxserviceaspnetajaxbehavior"> <enablewebscript/> </behavior> </endpointbehaviors> <servicebehaviors> <behavior name="shared.services.ajaxserviceservicebehaviour"> <servicedebug includeexceptiondetailinfaults="true"/> </behavior> </servicebehaviors> </behaviors> <service...

Steps for Upgrading Ruby Installer for Windows from 1.8.6 to 1.8.7 -

i need upgrade ruby 1.8.6 1.8.7 on windows , use 1 click installer. don't use scite (i use rubymine don't think makes difference). if has done appreciate knowing steps took. example did uninstall 1.8.6 first? assume afterwards need manually install gems not plugins? , there pitfalls watch out for? thanks if installed ruby using one-click installer, suggest leave installation alone , install newer rubyinstaller in new directory. rubyinstaller , one-click differ lot in technical aspects, affect upgrade path (override or install on top of it) also, old one-click installer had bad habit of removing gems , customizations, make pull hair. my recommendation be: get list of installed gems ( gem list ) in case want install them again install rubyinstaller in different directory (by default c:\ruby187 ) install missing gems if use rails , bundler, gem installation beyond gem install bundler not necessary. hope helps.

sql server - Dropping and reindexing has a huge performance boost -

i have db 17gb of data , max size @ 45gb. inserts done once every 24hours (import clients' system). indexes disabled @ time of import. i seeing performance issue between reorganizing , rebuilding versus dropping , rebuilding every index. reorg/rebuild takes ~1-3mins complete. dropping , rebuild takes 10+min complete. i have implemented reorg procedure, had drop , rebuild - taking 10mins each client every night. my problem seems reorg not enough maintain performance , have run full rebuild @ time. no dba, mere .net dev - seems odd me of performance hangs in indexes , them being rebuild , fresh. i found reorganise index vs rebuild index in sql server maintenance plan - explains of concepts behind reorganizing vs rebuilding indexes. my reorg/rebuild script can found here http://www.sqlservercentral.com/forums/topic1010651-146-1.aspx#bm1010715 (posted by: pavan_srirangam) (i'm not sure thats copy found in days, looks it. i've made changes logging start/stop)....

Solr query - Is there a way to limit the size of a text field in the response -

is there way limit amount of text in text field query? here's quick scenario.... i have 2 fields: docid - int text - string. i query docid field , want "preview" text text field of 200 chars. on average, text field has 600-2000 chars need preview. eg. [mysolrcore]/select?q=docid:123&fl=text is there way since don't see point of bringing entire text field if need small preview? i'm not looking @ hit highlighting since i'm not searching specific text within text field if there similar functionaly of hl.fragsize parameter great! hope can point me in right direction! cheers! you have test performance of work-around versus returning entire field, might work situation. basically, turn on highlighting on field won't match, , use alternate field return limited number of characters want. http://solr:8080/solr/select/?q=*:*&rows=10&fl=author,title&hl=true&hl.snippets=0&hl.fl=sku&hl.fragsize=0&h...

web applications - How to implement a Web-Shop with a Shared Nothing architecture -

some people argue possible , necessary implement every webapp shared nothing architecture. how possible implement webshop shopping cart using architectural style? normally webshop can implemented using sessions. in case i'd have implement in way, no information cart stored on server. necessary include cart contents hidden fields, passed server along every single request. solution webshop using shared nothing architecture? do have ideas on how achieve shared nothing architecture webapps? although have never explicitly gone out build shared nothing (sn) based system, suggest says it's necessary architect webapps using "pure" sn are: have budget massive can utilize million clusters every tier. are academics never implement anything. if have cluster of web-servers, , load-balancing traffic in way means can't guarantee same web-server handle every call given session - yes, tenets of sn apply: can't afford introduce server affinity. but str...

linq - Calculate Max and Min Dates with LINQ2XML -

maybe litte issue, don't understand what's running wrong here. the code below targeting xml file (sample below) , trys calculate absolute min date , absolute max date same events on descendants of element 'eventblocks'. (earliest/latest date of 'eventc' elements, ...) as can see 1 of enddates 'elementc' (for eaxample) has enddate '1/14/2011'. should maxdateto value. result shows calculated maxenddate of '1/6/2011'and ignores right value. i asume comparer takes string or int , provides wrong result. what (and how) have correct max , min dates calculated? thanks in advance marcus var xmldoc = xdocument.load(@"c:\temp\mergedcalendar2011.xml"); var result = vb in xmldoc.descendants("eventblock") group vb vb.attribute("eventname").value blocks orderby blocks.key ascending select new { blockname = blocks.k...

c++ - How can i delete data store in a file? -

delete specific data present in file.what ever user want delete deleted file in c++ suppose file contain 5 6 9 10 numbers i want delete 9 number present in file please give code if 1 know. first read file, , overwrite data read. while overwriting, make sure don't write "specific" data want delete. way you'll have file wouldn't contain "specific" data anymore!

php - Reporting spam or abuse -

how allow users in sites such forum/blog comments .etc mark content spam or abusive? know can use services such askimet , create bayesian spam filter classes, best way implement system allows users report content? would add field item table called spam and/or flagged , how differentiate betweeen two? how set such system, database structure? is there in php? database you'd want keep detailed track of flagged each post, you'd want allow multiple people flag post well. if 1 person flags post, judgment questionable, if 20 people flag it, know there's issue. i'd create table looks this: flag_seq | post_id | flagger_username | timestamp | user_notes | active ============================================================================================ 1 | 1431 | joebob1 | 2010-01-25 13:41:12 | it's spam | true 2 | 1431 | i_hate_spam | 2010-01-25 14:01:23 | know hate spam. | true ...

asp.net - Gridview column color doesnt fill entire box -

Image
i have gridview boxes highlighted in green. these boxes should fill entire box, can't seem trash 1px border around edges. i'm using ie7, ff too. rendered html <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><title> </title><link href="style/stylesheet.css" rel="stylesheet" type="text/css" /><link href="app_themes/contoso/style.css" type="text/css" rel="stylesheet" /></head> <body> <form name="form1" method="post" action="gridviewcoloring.aspx" id="form1"> <div> <input type="hidden" name="__viewstate" id="__viewstate" value="/wepdwujodiymtgxmzqxzbgbbqh0zxn0r3jpza88kwamaqgcawr6qz5buxeoalr4hjstfyqqkprdwd2icixpen...

Pass variable to subprocess call in python -

i trying pass variables raw_input subprocess command. new python. appreciated. #!/usr/bin/python import subprocess print "\nwhat user name" username = str(raw_input('username: ')) print "\nwhat user id" userid = int(raw_input('enter user id: ')) print "\nwhat user\'s primary group?" primarygroup = int(raw_input('enter group: ')) print "\nwhat user\'s secondary group?" secondarygroup = int(raw_input('enter group: ')) subprocess.call(['useradd' '-m' '-g' _primarygroup '-g' _secondarygroup '-u' _userid _username]) print"\nthe user has been added" try separating values commas: subprocess.call(['useradd', '-m', '-g', _primarygroup, '-g', _secondarygroup, '-u', _userid, _username]) see http://docs.python.org/library/subprocess.html#subprocess.call - takes array first argument program , other arguments...

mysql - Selecting data from two tables -

hello question sql commands... if have 2 tables same number of columns , same fieldnames (e.g: a(n,name,date) , b(n,name,date)) in website, want retrieve data both tables , display them in order date descendent. (the use of 2 tables due difference in tables database or server,or use of every table.. there's need display both tables in 1 order) exemple table sport_news(n_event,title,texte,date) table international_news(n_event,title,texte,date) display: christiano ronaldo ... 2011/25/01 christiano ronaldo 1 of famous... barack obama president of usa... 2011/24/01 barak obama........ arsenal has... 2011/23/01 chamakh, player of arsenal anger..... i hope idea clear : , thank you! you want union select a.name,a.date table1 ... union select b.name,b.date table2 b ... order 2 desc when use union, specify order column numbers instead of names.

unix - Extract part of file name using KornShell -

i have file name, example: xxdatafile_20110120123030_12342.dat . want extract "xxdatafile_" file name. how do using ksh on unix? $ file=xxdatafile_20110120123030_12342.dat $ echo ${file%%_*} xxdatafile

mod rewrite - Mod_rewrite Help -

this have, not working. rewriterule ^location/([a-za-z0-9_-]+)/reviews$ location.php?purl=$1&page=reviews [l] rewriterule ^location/([a-za-z0-9_-]+)/reviews/$ location.php?purl=$1&page=reviews [l] can show me doing wrong? http://www.example.com/this-location-1234/reviews/ http://www.example.com/location.php?purl=this-location-1234&page=review you should combine 2 (nearly identical) rules, , make sure have rewriteengine on , rule being run (either .htaccess getting picked up, or have in active vhost definition). rewriteengine on rewriterule ^location/([a-za-z0-9_-]+)/reviews/?$ location.php?purl=$1&page=reviews [l]

sinatra rest-client etag -

my goal address "lost update problem" (see http://www.w3.org/1999/04/editing/ ) in put operations. using sinatra, , client use rest_client. how can check if works? client return 200 code. using arguments of calling correctly? (put works) sinatra code: put '/players/:id' |id| etag 'something' if player[id].nil? halt 404 end begin data = json.parse(params[:data]) pl = player[id] pl.name = data['name'] pl.position = data['position'] if pl.save "resource modified." else status 412 redirect '/players' end rescue sequel::databaseerror 409 #conflict - request unsuccessful due conflict in state of resource. rescue exception => e 400 puts e.message end end client invocation: player = {"name" => "john smith", "position" => ...

asp.net - How to pass client id of Item in repeater to javascript -

i need pass div client id javascript of repeater i have 3 divs inside repeater have onmouseover event want grab client id of div element there way can pass exact client of div element can u guys me out thanks something (if understood correctly): markup: <asp:repeater id="myrepeater" onitemdatabound="myrepeater_itemdatabound" runat="server"> <itemtemplate> <div id="mydiv" runat="server">......</div> </itemtemplate> </asp:repeater> code-behind: protected void myrepeater_itemdatabound(object sender, repeateritemeventargs e) { if(e.item.itemtype == listitemtype.item || e.item.itemtype == listitemtype.alternatingitem) { htmlgenericcontrol mydiv = e.item.findcontrol("mydiv") htmlgenericcontrol; // can pass "this" instead of "mydiv.clientid" , id dom element mydiv.attributes.add("onmouseover", ...

jquery - Add keyboard support to website dropdown navigation -

i know suckerfish well, don't javascript in suckerfish , figured there must easier way using jquery. i've done following page: <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html lang="en"> <head> <title>test nav page</title> <style type="text/css"> html {margin:0;padding:0;text-align:center;font-size:62.5%} body {margin:0 auto;padding:0;width:600px;text-align:left;} ul#nav {display:inline-block;width:260px;border:0;float:right;list-style:none;position:relative;} ul#nav li {display:inline-block;float:left;width:130px;font-family:arial;color:#444;font-size:1.2em;font-weight:bold;text-align:center;position:relative;} ul#nav li.t1, ul#nav li.t1 ul li {background-color:#aad;} ul#nav li.t2, ul#nav li.t2 ul li {background-color:#daa;} ul#nav li...

java - Jogl Applet with JNLP runs in eclipse but not in the browser -

i developing applet opengl es stuff using jogl. in eclipse can start applet in browser have trouble because java console prints nosuchmethoderror in line create instance of glcanvas. glprofile glp = glprofile.get(glprofile.gl2es2); glcapabilities caps = new glcapabilities(glp); caps.setsamplebuffers(true); caps.setnumsamples(8); glcanvas = new glcanvas(caps); // throws nosuchmethoderror the exception: exception in thread "thread applet-de.beuthhochschule.bachelor.martin.benchmark-1" java.lang.nosuchmethoderror: javax.media.opengl.awt.glcanvas.<init>(ljavax/media/opengl/glcapabilities;)v @ de.beuthhochschule.bachelor.martin.benchmark.initcomponents(benchmark.java:60) @ de.beuthhochschule.bachelor.martin.benchmark.init(benchmark.java:42) @ sun.plugin2.applet.plugin2manager$appletexecutionrunnable.run(plugin2manager.java:1620) @ java.lang.thread.run(thread.java:662) i created jar , without jogl libs (jogl, gluegen, nativewindow , newt) didn't work. ha...

java - NoClassDefFoundError -

i have issue noclasdeffounderror being thrown. puzzles me since using interfaces, , no class definition should available. have read through posts point classpath, don't believe issue here (although may wrong). using netbeans 6.9.1 ide. i have created sample setup reproduce issue. 4 projects: interfaces, objects, locator , consumer. below find implementations. at runtime consumer coplains missing someobject implementation, should not aware of since accepting interface. exception in thread "main" java.lang.noclassdeffounderror: objects/someobject what missing? package interfaces; public interface isomeinterface { } package objects; import interfaces.isomeinterface; public class someobject implements isomeinterface{ } package locator; import interfaces.isomeinterface; import objects.someobject; public class locator { public static isomeinterface locateimplementation() { return new someobject(); }} package consumer; import interfaces.isomeinterface; i...

Identify the destination in HTTPS connections -

how browser figure out destination in https connection? headers encrypted.. update:no not homework.. name student because i'll learning in huge awesome field when browser views url https://www.gmail.com/ first thing browser resolves www.gmail.com 72.14.213.19 . next browser opens tcp connection 72.14.213.19 on port 443. the browser & server before headers transmitted negotiate public key encryption scheme (rsa) based on ssl certificate digitally signed. in process browser checks certificate authenticity before communicating. once trust between client & server has been established, client can encrypt headers in way server can decrypt. proceeds make http request inside ssl tunnel. the server decrypts message, serves request , encrypts in way that particular client can decrypt. the browser decrypts response, reads headers , makes decisions how proceed there. this has been overview of https connection event. :d

html - Why do a div and a table behave differently when given width=100% here? -

Image
here's code, reduced relevant parts: <html><head><title></title> <style type="text/css"> body { background-color: #fff; } #titlebar{ border: solid 1px black; margin:10px; } #bodywrapper{ float: left; width: 100%; } #bodycolumn{ margin-left: 230px; height:500px; } #menucolumn{ float: left; width: 230px; border: solid 1px black; margin-left: -100%; height:500px; } .bigcontent{ width: 100%; margin:10px; } .section{ border: 1px solid black; padding:10px; overflow: auto; } </style></head><body> <div id="titlebar">title</div> <div id="bodywrapper"><div id="bodycolumn"> <table class="section bigcontent"><tr><td>first</td></table></table> <div class="section bigcontent">second</div> </div></div> <div id="menucolumn">menu</div> </bo...

c++ - How to create TitleAreaDialog using WTL or Windows SDK (no MFC)? -

Image
i trying create titleareadialog using wtl or windows sdk (please no mfc). google able find these 2 links: http://www.codeproject.com/kb/dialog/dialogheader.aspx (mfc article) http://www.codeproject.com/kb/dialog/taskdialogs.aspx (doubtful.. how use it) the desired output eclipse jface titleareadialog (see below image). kindly suggest way using sing wtl or windows sdk (with c++). thanks finally able solve using dialog header link. went through code twice or may thrice :) , ported wtl. there example in pure c++/win sdk: xmessagebox . replacing default windows messagebox (although there mode uses title area + icon). if working vista or greater , want grab basic information via checkboxes, radio buttons etc have @ this: vista_taskdialog_wrapper , vgtaskdialog

c# - Using Javascript inside a dynamically load UserControl in jQuery Ui Tabs -

i need insert javascript code inside usercontrol load ajax call via jquery ui tabs. let me explain... this view (with jquery loaded) <script type="text/javascript"> $(document).ready(function () { $("#tabs").tabs({ cache: false, }); getcontenttab (1); }); function getcontenttab(index) { var url='<%= url.content("~/home/getusercontrol") %>/' + index; var targetdiv = "#tabs-" + index; $.get(url,null, function(result) { $(targetdiv).html(result); }); } </script> <div id="tabs"> <ul> <li><a href="#tabs-1" onclick="getcontenttab(1);">nunc tincidunt</a></li> <li><a href="#tabs-2" onclick="getcontenttab(2);">proin dolor</a></li> <li><a href="#tabs-3" onclick="getconte...

asp.net - scriptresource.axd 404 error in asp net 4 application - webresource works fine though -

hey everyone, have .net 4 application deployed production. app loadas fine, except referenced js files arent loading properly. using fiddler found scriptresource.axd calls returning 404 errors. heres kicker, page making call via webresource.axd, , request works fine. any ideas can check for? running iis7. load balanced, have machinekeys in config. added httphandlers section scriptresource.axd.. im still having same issue.. stumped... update - think ou websrver has no idea axd file is. there install .net install axd mappings in iis? "404" mean (under conditions) "not enabled" or "not allowed". had time on server , had enable extension. another way use process monitor see whether real files being searched iis process , not found.

c# - How can FTPClient delete a directory? -

i want delete folder in ftp. can ftpclient object delete it? ftpwebrequest provides delete action. here piece of code achieve : ftpwebrequest reqftp = ftpwebrequest.create(uri); // credentials , login handling... reqftp.method = webrequestmethods.ftp.deletefile; string result = string.empty; ftpwebresponse response = reqftp.getresponse(); long size = response.contentlength; stream datastream = response.getresponsestream(); streamreader sr = new streamreader(datastream); result = sr.readtoend(); sr.close(); datastream.close(); response.close(); it should work on files , directories. indeed, please check have right permissions. also, not delete folders while not empty. must traverse them recursively delete content before. the exceptions thrown due right permissions problems ...

asp.net - Multiple controls with the same ID '' were found. FindControl requires that controls have unique IDs -

update: here observed: if org.registrations.count = 1 txtbox.id "_registration0_0" string .... .... if org.registrations.count = 2 act strange txtbox.id "_registration2_0" txtbox.id "_registration2_1" after starts again _registration2_0 ps: dont have problem if count = 1 end update the error messages says trying have duplicate id below creating dynamic textbox, see whats wrong in code? protected void gv_rowcreated(object sender, gridviewroweventargs e) { students org = (namespace.students )(e.row.dataitem); foreach (registration reg in org.registrations) { int _count = org.registrations.count; (int rowid = 0; rowid < _count; rowid++) { textbox txtbox = new textbox(); txtbox.id = "_registration" + e.row.rowindex + "_" + rowid; txtbox.text = reg.name; e.row.cells[7].controls.add(txtbox); } } } it seems if have multipl...

Adobe Flex delayed observer for auto-complete TextInput -

does know if there flex 3 or flex 4 equivalent jquery delayedobserver? http://code.google.com/p/jquery-utils/wiki/delayedobserver if not, how go implementing in flex? i'm not sure component , couldn't find actual running sample anywhere via google. if you're looking delay call can use timer or calllater . if you're looking autocomplete component, prone recommend own autocomplete component . flex 4 / spark version available free, although not have api breadth flex 3 mx version does.

TSQL - Mapping one table to another without using cursor -

i have tables following structure create table doc( id int identity(1, 1) primary key, documentstartvalue varchar(100) ) create metadata ( documentvalue varchar(100), startdesignation char(1), pagenumber int ) go doc contains id documentstartvalue 1000 id-1 1100 id-5 2000 id-8 3000 id-9 metadata contains documentvalue startdesignation pagenumber id-1 d 0 id-2 null 1 id-3 null 2 id-4 null 3 id-5 d 0 id-6 null 1 id-7 null 2 id-8 d 0 id-9 d 0 what need map metadata.documentvalues doc.id so result need like id documentvalue pagenumber 1000 id-1 0 1000 id-2 1 1000 ...

asp.net - Why would User.IsInRole return true, but AuthorizeAttribute not? -

i'm securing asp.net mvc 2 application, , have user in role "foo". this true: user.isinrole("foo") but yet, when attempt lock down controller action following, user denied: [authorize(roles = "foo")] public actionresult privatepage() { return view(); } if isinrole reports true, why authorize attribute not allow user in? it caused if storing persistent cookies forms authentication cookie. in scenario isinrole may check against cookie without verifying date login.

Calling a URL from a stored procedure in SQL Server? -

just wondering if possible call url stored procedure (eventually adding procedure sql job) webpage refreshes database, excellent if automate process. edit: i want able request webpage store procedure. on page load of desired webpage there function refreshes database. want refresh database @ 4 every day. in order me not manually go onto site @ 4am (still sleeping) need else me. thought sql jobs excellent, can set time, , job up. don't know powershell well, , wanted know if request url, or visit url using stored procedure or other way. you can task scheduler (part of windows). create scheduled task opens internet explorer , browses page: "c:\program files\internet explorer\iexplore.exe" "http://yoursite.com/yourpage.aspx" or 64-bit windows: "c:\program files (x86)\internet explorer\iexplore.exe" "http://yoursite.com/yourpage.aspx" alternatively, create job using sql server agent, , create single step of type "ope...

sql - Mysql statement (syntax error on FULL JOIN) -

what wrong sql statement, says problem near full join, i'm stumped: select `o`.`name` `offername`, `m`.`name` `merchantname` `offer` `o` full join `offerorder` `of` on of.offerid = o.id inner join `merchant` `m` on o.merchantid = m.id group `of`.`merchantid` please gentle, not sql fundi mysql doesn't offer full join, can either use a pair of left+right , union; or use triplet of left, right , inner , union all the query wrong, because have group select columns not aggregates. after convert left + right + union, still have issue of getting offername , merchantname random record per each distinct of.merchantid , , not same record. because have inner join condition against o.merchant, full join not necessary since "offerorder" records no match in "offer" fail inner join. turns left join (optional). because grouping on of.merchantid , missing offerorder records grouped under "null" merchantid. this query work, ea...

sharepoint - Get value from programmatically created TextBox in C# -

i got itching problem , cant code work how can read value textbox when form posted? some code... protected override void createchildcontrols() { base.createchildcontrols(); textbox querybox = new textbox(); querybox.id = "querybox"; querybox.tooltip = "enter query here , press submit"; controls.add(querybox); button querybutton = new button(); querybutton.usesubmitbehavior = false; querybutton.id = "querybutton"; controls.add(querybutton); if (page.ispostback == true) { try { string query = querybox.text; datagrid datagrid = new datagrid(); datagrid.datasource = camelot.sharepointconnector.data.helper.executedatatable(query, connectionstring); datagrid.databind(); controls.add(datagrid); } catch (exception a) { controls.add(new literalcontrol(a.message)); } // try } // if } // void i've shortened c...

video - Does FFMPEG support user data section injection when encoding? -

the mpeg , h.264 standards both define mechanism injection of arbitrary metadata stream video frames. i've google'd bit , unable determine if ffmpeg supports this. it? no, not support this. said, isn't hard implement , inject metadata in encoded frames post encoding.

comments - Documentation style -

from syllabus 1 of programming classes: "your documentation sufficient if possible read comments, without looking @ code, , explain code does." have of heard of documentation style this? practice? seems extremely overzealous me. code should easy follow. can achieved in number of ways: appropriate , meaningful naming commenting on difficult algorithms or complex code extensive documentation of code appropriate documentation use 3 approaches appropriate. however, when audience code trying understand code , assess understanding of concepts - ie in academic context, third 1 highly desirable. all code should written , documented can understood worst detractor, when on callout @ 3 o'clock in morning because there problem production system. at same time, excessive comments item maintained, , kept in sync code when changes made code, , comments least item maintained under change.

python - How to make invalidating Beaker cache work? -

i have function decorated beaker cache decorator. function located in module imported main app. from caching import cache, my_cached_function now, in 1 function used decorated function: def index(): data = my_cached_function() # no args in function, try invalidate cache: def new_item(): cache.invalidate(my_cached_function, 'namespace') since beaker cache configured 'cache.type': 'memory' , i've tried: def new_item(): cache.invalidate(my_cached_function, 'namespace', type='memory') what doing wrong here? notes in typical scenario, call index() of time. need cache cleared whenever new_item() called, index() call take account new items created new_item() function. the application in question web application running on top of bottle framework. you need invalidate cache before my_cached_function called. see beaker.cache.cachemanager documentation example.

cpan - Some Simple Errors With a IRC Bot Made With Perl -

i'm following tutorial called programming irc bots in perl make simple irc bot channel @ abjects server, problem i'm getting weird errors. take look: nathan-camposs-macbook-pro:desktop nathan$ ./bot.pl ./bot.pl: line 1: use: command not found ./bot.pl: line 4: my: command not found ./bot.pl: line 8: syntax error near unexpected token (' ./bot.pl: line 8: my $conn = $irc->newconn(' nathan-camposs-macbook-pro:desktop nathan$ with code: use net::irc; # create irc object $irc = new net::irc; # create connection object. can have more 1 "connection" per # irc object, we'll working one. $conn = $irc->newconn( server => shift || 'summer.abjects.net', # note: irc port 6667, firewall won't allow port => shift || '6667', nick => 'ibot', ircname => 'i\'ve bee built inathan!', username => 'ibot' ); # we're going add conn hash know channel # want opera...

visual studio 2010 - ASP.NET MVC 2: "Could not load file or assembly" -

all of sudden, i'm getting error: could not load file or assembly 'wnvhtmlconvertdemo' or 1 of dependencies. located assembly's manifest definition not match assembly reference. (exception hresult: 0x80131040) but i've since removed trace of using dll , references... yet i'm still getting error! is there mysterious place project looking file? use "clean solution" in vs2010. , rebuild project.

complexity theory - Reconciling Quine-McCluskey Algorithm -

i'm looking @ article on wikipdia algorithm, , see 2 seemingly contradictory statements: "it gives deterministic way check minimal form of boolean function has been reached" and "has limited range of use since problem solves np-hard" thoughts? p.s. there visual studio plugin can reduce conditional logic applying algorithtm highlighted code? the algorithm takes exponential time. np-complete problems can solved in exponential time. presumably problem referred np-complete in addition being np-hard. the discrepancy because don't understand definition of np-hard: http://en.wikipedia.org/wiki/np-hard

python - How to import rlib in an rpython program to be translated using pypy's rpython -

i trying file io in program compiled pypy's translate tool. since open , os.open not supported, need rlib.streamio. tried import rlib gives following error [translation:error] importerror': import statement raises [type importerror: 'no module named rlib'] i translate using $ ./pypy-1.4.1-src/pypy/translator/goal/translate.py myscript.py how import rlib in myscript.py? it's from pypy.rlib import streamio

quality R code to learn form -

i find 5 top programmed r packages regarding code quality. looking @ code want learn how improve. many packages not programmed, unfortunately. more , more use map(), reduce() , filter() functions, , produces better code. first, recommend reading through this thread in quite same subject on stat.stackexchange.com "winner" package zoo package. besides concrete answers found on stackexchange, reccomend looking around on github , r-forge , lot of source can studied online. repositories tagged r . another approach find package written aid of roxygen , can suppose, author make package correct documentation :) anyway, suggest packages of @hadley also, wrote quite lot packages: smaller , bigger ones also, besides can find other r resources in github repositories.

Iphone - Twitter log out using MGTwitterEngine -

this question has answer here: logout twitter in iphone using oauth+mgtwitterengine library 7 answers i'm working on twitter integration on iphone application using mgtwitterengine. can tell me how log out current user? thank you, andrei for logout use these lines self._engine object of sa_oauthtwitterengine (void) ourlogoutmethod { [self._engine setclearscookies:yes]; [self._engine clearaccesstoken]; nshttpcookie *cookie; nshttpcookiestorage *storage = [nshttpcookiestorage sharedhttpcookiestorage]; (cookie in [storage cookies]) { nsstring* domainname = [cookie domain]; nsrange domainrange = [domainname rangeofstring:@"twitter"]; if(domainrange.length > 0) { [storage deletecookie:cookie]; } } }

css - Style overflow:hidden and SVG Firefox 3.6 -

i display svg flows on screen don't want see scroll bars. setting overflow:hidden in body works chromium , opera not firefox 3.6. know fix? thanks. html, body { overflow:hidden } works me: http://phrogz.net/tmp/wide_svg.xhtml

ruby on rails - Call a method on a variable where the method name is in another variable -

<% @labels.each |label| %> <input type="text" name="<%=label.name%>" value="<%=@car.(label.related_to) %>" class="big-font" style="width: <%=label.width%>px; top: <%=label.y_coor%>px; left: <%=label.x_coor%>px;" /> <% end %> hello guys, i'm new rails should easy question answer. the issue here: <%=@car.(label.related_to) %> . label.related_to holds string "make". i'm trying pretty much: @car.make any idea guys? thanks, alain use send send message object: @car.send(label.related_to) if there chance of label.related_to not being valid method object, you'll want prepared catch nomethoderror