Posts

Showing posts from January, 2011

javascript - I have my code running on jsfiddle, but why can't on local computer? -

as title said, code running on jsfiddle: http://jsfiddle.net/paopaomj/zggpn/ and copy code on local computer (edit brackets),but failed run, miss? (ignoring css style here) <html> <head> <script type="text/javascript" src="http://code.jquery.com/jquery-2.0.2.min.js"></script> <!--<script type="text/javascript" src="tools.js"></script>--> <link rel="stylesheet" type="text/css" href="style.css"> </head> <body> <script> $document.ready(function(){ $("#command").keyup(function (e) { if (e.keycode == 13) { submit(); } }); var submit = function () { var commandel = document.getelementbyid("command"); var command = command...

java - Unparseable date: "2013-07-11T13:41:22.000Z" (at offset 23) -

can tell me why in world got exception? 08-28 08:47:05.246: d/dateparser(4238): string received parsing 2013-08-05t12:13:49.000z private final static string date_format_pattern = "yyyy-mm-dd't'hh:mm:ss.sssz"; public static date parsedate(string stringtoparse) { date date = null; try { date = new simpledateformat(date_format_pattern).parse(stringtoparse); } catch (parseexception e) { logger.logerror(tag, e); } return null; } 08-28 08:47:05.246: e/dateparser(4238): exception: java.text.parseexception: unparseable date: "2013-08-05t12:13:49.000z" (at offset 23) try using string date_format_pattern = "yyyy-mm-dd't'hh:mm:ss.sss'z'" the z @ end timezone offset. if you don't need maybe can drop on both sides.

Make a SingleApplication in Qt -

i have server programm works fine, listening incoming clients. hence, prevent duplicate lauch, want 1 server make service connected entities, if it's possible? you can lock specific file using lockforwriting method of qreadwritelock , keep locked long application running , if can't lock it, exit application. since 1 instance able lock file writing, other instances terminate themselves.

c# - iframe issue in IE -

i accessing below url in iframe tag. ie showing error "internet explorer cannot display webpage", other browser it's working fine. http://qaecat.burndy.com/comergent/en/us/adirect/fci?cmd=catdisplaystyle&domproductqueryname=ks15*&op=search&sso_user_name=public when accessing same chrome , firefox loading fine. using ie 10. any ideas? thanks, allen

vb.net - Splash screen Error "Application is not a member of My" -

i getting error when try run application "application not member of my", added splash screen, error coming code below. have tried running devenv.exe/resetsetting command prompt enable application framework , not work. simpler method of resolving appreciated imports system.windows.forms public notinheritable class splashscreen1 'todo: form can set splash screen ' application going "application" tab ' of project designer ("properties" under "project" menu). private sub splashscreen1_load(byval sender object, byval e system.eventargs) handles me.load 'set dialog text @ runtime according 'the application's assembly information. 'todo: customize application's assembly information ' in "application" pane of project ' properties dialog (under "project" menu). 'application title if true if not string.isnullorempty(...

html - Weird Chrome Quirk On First Load of Page - fixed, but why? -

i've encountered weird css quirk layout misbehaves on first load of web page, works after refresh. behavior observed in chrome. to reproduce: open https://coinchat.org/j:offtopic see right sidebar pushed underneath page, through there enough spacing , set float: right refresh page observe right sidebar no longer pushed underneath page. open new tab, open https://coinchat.org/j:offtopic go 2 the following code fixes this: $("#chatsidebar").hide(); settimeout(function(){ $("#chatsidebar").show(); }, 1); my question is, why ?

Set button state to active with jQuery -

i need buttons go .active state when keyboard button pressed , not when clicked. here code... in advance. script : $(document).on('keypress', function (e) { var tag = e.target.tagname.tolowercase(); if (e.which === 119 && tag != 'input' && tag != 'textarea') $('#forward').click(); if (e.which === 115 && tag != 'input' && tag != 'textarea') $('#back').click(); if (e.which === 97 && tag != 'input' && tag != 'textarea') $('#left').click(); if (e.which === 100 && tag != 'input' && tag != 'textarea') $('#right').click(); }); $(function () { $("#forward").click(function () { $.ajax('/forward'); }); $("#back").click(function () { $.ajax('/back'); }); $("#left").click(function () { ...

vba - Excel-2010 - CustomUI - Backstage : Errors when various files are opened in the same instance -

firstly, i'm happy join community. hope exchange advice. i'm french excuse me mistakes in sentences. i try explain problem : i had "good" idea use backstage of excel file create small dashboard. works well. the problem arises when file opened at same time file, in same instance of excel . second file trying access functions "backstage_onshow" , "backstage_onhide" of workbook have message "impossible run macro 'backstage_onshow' (or 'backstage_onhide'). possible macro not available in workbook ..." <- this translation french error message. how can not have message or rather ensure backstage specific file , not instance of excel? i show code snippets. more clear. in xml, have : <customui xmlns="http://schemas.microsoft.com/office/2009/07/customui" onload ="ribbon_load"> <ribbon startfromscratch="false"/> <backstage onshow="backstage_onshow" onh...

mongodb - how to calculate percentile -

i have access logs below, stored in mongodb instance: time service latency [27/08/2013:11:19:22 +0000] "post service http/1.1" 403 [27/08/2013:11:19:24 +0000] "post service b http/1.1" 1022 [27/08/2013:11:22:10 +0000] "post service http/1.1" 455 is there analytics function percentile_disc in oracle calculate percentile? ot calcualte latency percentiles on period of time. there still appears no native way calculate percentiles combining few aggregate operators can same result. db.items.aggregate([ {'$group': { '_id': { 'league': '$league', 'base': '$base', 'type': '$type' }, 'value': {'$push': '$chaosequiv'} }}, {'$unwind': '$value'}, {'$sort': {'valu...

php - print BASE64 coded image into a FPDF document -

i've base64 stored images in database. possible print data directly in pdf document, using fpdf? data sctructure of image data:image/png;base64,ivborw0kggoaaaansuheug7aaafqaaacwcayaaaaonxpvaaafguleqvr4ae2dc9buvvnhusn3qabena9h5a2icjxmj8hukymoqdfclikmrqzr1eydmqapnkrmc8jmhlbbhadjjav0lkqdzcmcqiqq2kerufardhcfdpx /33w tznpe/ 3ttaa9/ a2z9/32xvt5nvvbl2evtdfee9dts27bt4macjmacjm8acjtbvarv123xbbwimyaimyaimiaj26k4hjmacjmacjjaaanboayhez8eetmaetmae7nbdb0zabezabexgaats0adqim6ccziacziacdihuw6ygamygamywaai2kepobcdbrmwarmwarowq3cdmaetmaetmiebelbdh0ahogsmyaimyaimyifuomacjm i think $pdf->imagepng() should right function in fpdf. while comments suggested tcpdf solution, did want state there way entirely fpdf. thought process this: strip data:image/png;base64, uri using explode decode uri base64_decode save decoded data png file file_put_contents generate pdf , add png file image delete png file unlink always remember error check. if image fails save server not want con...

qt - QPainter drawText() in QGLWidget draw long Chinese text with English upside down -

Image
i use codes below draw text in qglwidget, when text long , mixed chinese(or japanese) english, text becomes upside down. knows why? ps1: when change qglwidget qwidget, ok. ps2: qt version 4.8.0, os ubuntu 12.04 64bit ps3: when firstly draw text image, draw image, ok. normal when using qwidget: upside-down when using qglwidget: mainwindow.h #ifndef mainwindow_h #define mainwindow_h #include <qglwidget> class mainwindow : public qglwidget { q_object public: explicit mainwindow(qglwidget *parent = 0); protected: void paintevent(qpaintevent* event); }; #endif // mainwindow_h mainwindow.cpp mainwindow::mainwindow(qglwidget *parent) : qglwidget(parent) { setgeometry(0, 0, 1000, 200); } void mainwindow::paintevent(qpaintevent* event) { qpainter painter; painter.begin(this); qstring text = qstring::fromlocal8bit( "this is一段a很长的long示例文本text。在非常长的时候会出现上下 颠倒的问题。你那里是否出现了?" \ "一段很长的示例文本。在非常长的时...

ios - POST with AFNetworking, error code -1001 -

i want post json message send server. don't have access server know working , set return success/failure message when message gets through. server requires app id , password connect i using afnetworking this. here code i'm using: nsurl* pushserverurl = [nsurl urlwithstring: @"http://myserverurl.com/"]; afhttpclient* networkinstance = [[afhttpclient alloc] initwithbaseurl: pushserverurl]; nsdictionary *parameters =[nsdictionary dictionarywithobjectsandkeys: @"myappid", @"app_id", @"mypassword", @"password", nil]; nsdictionary *params =[nsdictionary dictionarywithobjectsandkeys: parameters, @"user", nil]; [networkinstance postpath: @"users/login.json" parameters: params success:^ (afhttprequestoperation *operation, id jsonresponse) { nslog (@"success"); } failure:^ (afhttprequestoperati...

Where do I find the Google Places API Client Library for Python? -

it's not under supported libraries here: https://developers.google.com/api-client-library/python/reference/supported_apis is not available python? if not, language available for? andre's answer points @ correct place reference api. since question python specific, allow me show basic approach building submitted search url in python. example way search content in few minutes after sign google's free api key. access_token = <get 1 of these following directions on places page> import urllib def build_url(search_text='',types_text=''): base_url = 'https://maps.googleapis.com/maps/api/place/textsearch/json' # can change json xml change output type key_string = '?key='+access_token # first think after base_url starts ? instead of & query_string = '&query='+urllib.quote(search_text) sensor_string = '&sensor=false' ...

apache - What is TCPMon and How to install it on linux? -

i want know tcpmon , how install on linux based distribution. uses of tool tcpmon utility allows user monitor messages passed along in tcp based conversation. based on swing ui , works on platforms java supports.it has being part of axis1 , stands independent project. download , install on linux: 1.download zip package apache tcpmon release 2.go download directory , copy zip file preferred destination 3.open terminal , navigate folder downloaded zip file 4.type in terminal "unzip tcpmon-1.0-bin.zip" , unzip it type "cd tcpmon-1.0-bin/build" , hit enter type "chmod 777 tcpmon.sh" , hit enter 7.finally type ./tcpmon.sh that's it

json - Getting TAB_PAGENUMBER_IS_NOT_IN_DOCUMENT despite not using any page numbers -

i making post request /v2/accounts/<account_id>/envelopes . here error getting: { "errorcode": "tab_pagenumber_is_not_in_document", "message": "the pagenumber specified in tab element not in document tab refers to. tab on page 2 of document 3 recipient 1" } normally request contains text tabs , checkbox tabs, none of these tabs refer page. specify name , tablabel & value text tabs , name , tablabel & selected checkboxes. same error when send no tab data. here request json: { "allowmarkup": false, "allowreassign": false, "allowrecipientrecursion": false, "asynchronous": false, "authoritativecopy": false, "autonavigation": false, "brandid": "", "compositetemplates": [{ "inlinetemplates": [{ "sequence": "2", "recipients":...

android - Refresh listview onpost execute asynctask -

i know question has been posted multiple times , browsed of them there not result, performing deleting item mysql database not refreshing, here code of onclicklistener , button: onclick listener: holder.void_button.setonclicklistener(new onclicklistener(){ public void onclick(view v) { adapter = new customlistviewvoidadapter(context,r.layout.mytemp, items); item_selected= items.get(position); new deleteorder().execute(); }}); vi.settag(holder); } onpostexecute asynctask: protected void onpostexecute(string unused){ adapter.remove(item_selected); adapter.notifydatasetchanged(); } the adapter instatiated globally, can please check problem might be? not returning error, deleting item , not refreshing. regards ralph throwing out there, but, have tried adapter.notifydatasetinvalidated();? forces update. also, put code in asynctask! like such: protected void onpostexecut...

OpenGL How Many VAOs -

i writing opengl3+ application , have confusion use of vaos. right have 1 vao, normalised quad set around origin. single vao contains 3 vbos; 1 positions, 1 surface normals, , 1 gl_element_array_buffer indexing (so can store 4 vertices, rather 6). i have set helper methods draw objects scene, such drawcube() takes position , rotation values , follows procedure; bind quad vao. per cube face: create model matrix represents face. upload model matrix uniform mat4 model vertex shader variable. call gldrawelements() draw quad position face. i have set task of adding per-cube colors , realised can't add color vbo single vao change each cube, , doesn't feel right. i have read question; opengl vao best practices , tells me approach wrong, , should use more vaos save work of setting whole scene every time. how many vaos should used? approach of having 1 not optimal, should there vao every static surface in scene? ones move? i writing uniform variable each vert...

Modifying text in resetZoomButton doesn't work - highcharts -

i have been trying modify text resetzoombutton using theme option follows: http://jsfiddle.net/xurxt/ however, new text seems take effect when hover on zoom button. what wrong here? in lang object can set default resetzoom text.

Same Application bar for different xaml pages Windows Phone 8 -

for wp8 application, have create same application bar different pages, need create in xaml pages or there way define once , use across.. you can define appbar in app.xaml this.. <application.resources> <local:localizedstrings xmlns:local="clr-namespace:phoneapp12" x:key="localizedstrings"/> <shell:applicationbar x:key="globalappbar" isvisible="true" ismenuenabled="true" backgroundcolor="black" foregroundcolor="white"> <shell:applicationbariconbutton x:name="asd" iconuri="/1.png" text="0" /> <shell:applicationbariconbutton iconuri="/1.png" text="1" /> <shell:applicationbariconbutton iconuri="/1.png" text="2" /> <shell:applicationbariconbutton iconuri="/1.png" text="3" /> </shell:applicationbar> </application.resources...

class - Spell check SAP -

i followed tutorial, tutorial spell check , implement spell checker in sap. this solution working well, there small issue, when execute function module, spell check appears behind sap gui window. able see spell check, need minimize window , maximize it. i tried implement method set_visible , set_enable not work. know issue might be?

php - Get Latest Topic for each category in Forum Home Page in CodeIgniter -

Image
i creating simple forum using codeigniter. i want latest topic each category in forum home page. want so- it's ok category page latest topic, can't home page my controller home page category list - class category extends ci_controller { public function index() { $this->load->model('category_model'); $data['categories'] = $this->category_model->get_all_categories(); $this->load->view('forums/index', $data); } } my model - class category_model extends ci_model { function get_all_categories() { $get_categories = $this->db->get('categories'); return $get_categories->result_array(); } } db structure- topics topic_id topic_title topic_content topic_cat_id categories cat_id cat_name cat_description you can try this, hope helps: function get_all_categories() { $data = array(); $get_categories = $th...

android - How to vertically centre elements in a ListView? -

Image
i have number of switch elements laid out in listview . they're appearing follows: but need them vertically centred, e.g. i'm using following axml definition each list item: <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/widget32" android:layout_width="fill_parent" android:layout_height="wrap_content"> <switch android:id="@+id/switchoutput" android:layout_width="250dp" android:layout_height="wrap_content" android:text="[output name]" android:gravity="center_vertical" /> <imagebutton android:id="@+id/imgtime" android:background="@null" android:layout_width="wrap_content" android:layout_height="wrap_content" android:s...

javascript - win 8.1 Html audio continue play after app switched -

i wondering how let windows 8.1 app continue play music when app runs in background, it's js windows 8.1 store app. and audio html tag: <audio id="player" controls src="/1.mp3"></audio> you can following, a background audio declaration must in app manifest. in html can done as, <audio msaudiocategory="backgroundcapablemedia" controls="controls"> <source src="song.mp3"/> </audio> the javascript equivalent of above function playaudio () { // create new audio tag "backgroundcapablemedia" class if(!audtag) { audtag = document.createelement('audio'); audtag.setattribute("id", "audtag"); audtag.setattribute("controls", "true"); audtag.setattribute("msaudiocategory", "backgroundcapablemedia"); audtag.setattribute("src", "song.mp3"); d...

Ruby on rails admin actions -

i'm learning rails 4 , i'm looking build in basic admin functionality such creating , viewing users. can think of few ways manually, (such creating new controller or adding filters) i'm pretty sure there's "rails way" easily. i've been digging through docs , see references "built in authentication" support hunch, can't find actual documentation. for example, in cakephp can prefix actions admin_ , /admin/controller/action work automatically. there similar convention rails? if so, can find it? update: continue research this, start impression admin authorization in rails commonly not handled rails core, rather in gem cancan . perhaps why striking out searching rails docs. update2: question wasn't intended round-up of authorization gems, since appears gems typical way handle basic admin authorization, i'd find simplest, basic (and universal) option. couple options have been proposed below come bundled default dashboard views...

git - Gitlab6 clone not working -

i have gitlab6 setup @ 192.168.1.74:8001. want access gitlab 192.168.1.73. have account in , created new project. want clone project command "git clone git@192.168.1.74:user1/sample-project.git". it prompted me password saying "git@192.168.1.74's password: " , dont know password there no git user on 192.168.1.74. tried gitlab pass failed. have added shh public keys gitlab account. how fix this? thanks in advance.

Alter NVARCHAR column from NULL to NOT NULL in sql server -

i've created table column called ratevalue allowing null value want make not null. used sql server 2008 r2 i tried following not work alter table dbo.aaelement alter column ratevalue nvarchar(50) not null the problem pre-existing null values. get rid of null values first, alter: update aaelement set ratevalue = '' ratevalue null go alter table dbo.aaelement alter column ratevalue nvarchar(50) not null otherwise constraint violated it's being created.

How to use sleep in qt creator -

i using qt creator c++. want see these 2 pictures after each other every 3 seconds. according code, shows last image on screen. have idea doing wrong? you shall use qelapsedtimer() , implement slot shall connect qelapsedtimer's signal emitted after desired time. see qt more information on that. in slot, shall implement logic of showing images.

java - Reading filepath from properties file -

i'm trying read file filepath read properties, keep getting filenotfoundexception (the file exists). test.properties: test.value = "src/main/resources/file.csv" loadproperties.java: public class loadproperties { public static void main(string[] args) throws filenotfoundexception, ioexception { properties aprop = new properties(); aprop.load(new fileinputstream("src/main/resources/test.properties")); // works string filepath = aprop.getproperty("test.value"); system.out.println(filepath); // outputs: "src/main/resources/file.csv" filereader areader = new filereader("src/main/resources/file.csv"); // works filereader areader2 = new filereader(filepath); // java.io.filenotfoundexception } } why exception being thrown while line above works fine? how should read file path provided properties? you not supposed put " in property file. here java sees : string file ...

r - Huge amount of data graphical representation -

Image
i have large data.frame (ncols = 500, nrows = 14000). looks this: sample1 sample2 sample3 ..... gene1 22 0 0.11 ..... gene2 0.112 0.1 0.4 ..... gene3 0.45 0 0.19 ..... ..... ..... ..... ..... ..... i plot such huge amount of data without applying statistic clear (simply using colors or other tools) difference in terms of of numbers (magnitude) ex. between gene1 , gene2 sample 1 , on. idea apart heatmap? how using geom_raster ggplot2? # make data set.seed(1) df <- data.frame( matrix( runif(25) , 5 , 5 ) ) # x1 x2 x3 x4 x5 #1 0.5316382 0.4360309 0.09576886 0.56497254 0.43930824 #2 0.2383700 0.1531009 0.71377161 0.39367645 0.42211072 #3 0.5009796 0.6549886 0.05996069 0.08236798 0.08574704 #4 0.1171437 0.8765644 0.29892712 0.06071803 0.78011966 #5 0.5066046 0.5486397 0.34770099 0.07785835 0.09659246 # ...

Solr - Exception Handling -

i using solr(on tomcat server) webservices. when end user pass solr query url, request goes through webservice , render result in browser. in case of exception, getting http error 500 followed trace log in browser. not want end user see trace log wanted display custom error message in browser. any idea on how can achieve ? code snippet using private integer determinestart(final string start) throws dqsexception { integer intvalue = null; try{ intvalue = integer.valueof(start) ; return intvalue; } catch(numberformatexception e){ throw new dqsexception( "start should numeric value >= 0"); } } customized exception public class dqsexception extends exception { /** * */ private static final long serialversionuid = 7669894738044609438l; public dqsexception(string message, throwable e) { super(message,e); } public dqsexception...

deploying asp.net mvc4 app with EF 5.0 -

i pretty new asp.net mvc development. have developed asp.net mvc4 app targeting .net 4.0 , using ef 5.0 database connection. want deploy app in windows 2008 server iis 7.5. things need make sure installed in server application work properly? thanks! only two: .net 4.0 , optionally mvc 4. can avoid installing mvc 4 if include binaries in deployment package. ef5 standard .net 4.0 , sure have reference it, needed binaries in deployment package

probability - confidence interval for conditional probabilities -

is there possibility create confidence interval conditional probabilities? found formula create ci probabilities, not special case. confidence intervals i think mean confidence interval a random variable . example, if have continuous real-valued random variable x, like p(a <= x <= b) = 0.95 meaning 95% confident x between , b. conditional confidence intervals a conditional confidence interval statement like p(a <= x <= b | y = y) = 0.95 meaning, when y y, 95% confident x between , b, y other random variable.

c++ - about the pcl::ShapeContext3DEstimation -

i have segment pointcloud kinect , copute descripors using pcl::shapecontext3destimation each cluster. when output follows: std::cout << shapecontextfeatures->points[0] << std::endl; the result : (0, 0, 0, 0, 0, 0, 0, 0, 0)(nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, na...

PHP - Check if file exists without knowing the extension -

i saw this question , didn't work me. what need check whether file exists, in php, without knowing extension. use code: <?php if (count(glob("/database/".$_request['thetitle'].".*")) == 0) { echo 'true'; } else { echo 'false'; } ?> edit: maybe it's relevant saying script located in [root]/functions/validatefilename.php and database in [root]/database/ but returns false, no matter filename ( $_request['thetitle'] ) is. try: count(glob("./database/".$_request['thetitle'].".*"))

jquery - Select2 load data with Ajax from file -

i have script called listofvalues.php , queries database , returns json format values. what need pass these values select2 data member. need load once. i don't need pass values select2 input (term) listofvalues.php described in this example $('#select2div').select2({ //data:[], ajax: { datatype: "json", url: "listofvalues.php", success: function (data) { } } can me this? simple example it useful know format of object you're getting listofvalues.php , let's assume, sake of simplicity looks this: [ {"id": 1, "text": "option1"}, {"id": 2, "text": "option2"}, {"id": 3, "text": "option3"} ] this easiest format use, default, select2 can handle objects property names id , text , render them dropdown list. select2 initialisation might this: $('#select2div')...

elasticsearch - MVEL VerifyError with Bulk Update - Not updated few records in JAVA API -

i using elastic search bulk update java api. below script, using bulk update. in mapping nested object 'name' specified string field. string updatescript = "if(ctx._source.containskey(\"nestedobjects\") && ctx._source.nestedobjects.size()>0) { int nestedsize = ctx._source.nestedobjects.size(); boolean isupdated = false; (int = 0; < nestedsize; i++) { if(ctx._source.nestedobjects[i].containskey(\"name\")) { if(ctx._source.nestedobjects[i].name == \"ram\") { ctx._source.nestedobjects[i].name = \"ricky\"; isupdated = true; } } } if(!isupdated) { ctx._source.nestedobjects.add(\"name\":\"ricky\"); } }"; below code using bulk update. bulkrequestbuilder bulkrequestbuilder = client.preparebulk(); (int i=0; i<5; i++) { string documentid...

java - Redirection with method in Seam -

let's have button: <h:commandbutton value="assign task" action="#{taskassigner.assignto(user)}"/> which assigns new task user. i'd able redirect task page, equivalent clicking on link like <s:link value="#{task.description}" action="#{workontask.start}"> <f:param name="taskid" value="#{task.id}" /> </s:link> assuming in web-inf/pages.xml have like <page view-id="/task-list.xhtml"> <navigation from-action="#{workontask.start}"> <redirect view-id="/task.xhtml"/> </navigation> </page> i can't see how can in java in taskassigner.assignto(). need access seam component, right? need redirect /task.xhtml , set param taskid needed , run workontask.start() initialization on component. first, not recommended use s:link -tag action -attribute (see jboss forum ). for navigation issue replace (or com...

javascript - Remove hyperlink behaviour from child elements -

i have anchor tag inside append divs through jquery. want 'hyperlink' effect of parent <a> tag should not appear in appended child elements. how can achieve jquery or in other way. here fiddle of want. update: of answers tell how remove click effect. isn't there can prevent every default behavior of anchor tag child elements? fiddle ok. here sample html <a href="google.com" id="first"> <div> <p>blah</p> </div> <div> <p>blah</p> </div> <div> <p>blah</p> </div> </a> <a href="google.com" id="second"> <div> <p>blah 2</p> </div> <div> <p>blah 2</p> </div> <div> <p>blah 2</p> </div> </a> this css remove underscore, change font color , cursor ...

parameters - C# ShortCut Path Modification -

i've created program generates shortcut specific exe selected via open file dialog, using library. got work want program add parameter target path make this: ( "e:\cod4\iw3mp.exe" +seta map mp_crash ). can add ( + seta map mp_crash ) part after " mark without removing or ruining extension of .exe? here block of code wrote add parameter: label1.text = openfiledialog1.filename; shortcut.targetpath = label1.text + " seta map mp_crash"; shortcut.save(); this code add seta part target ruin extension , "e:\cod4\iw3mp.exe seta map mp_crash " please help. here full code : using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.windows.forms; using iwshruntimelibrary; using system.io; namespace windowsformsapplication18 { public partial class form1 : form { public form1() { initializeco...

c# - NHibernate: Stateful and Stateless sessions need different mappings -

i'm using fluent nhibernate read , write files. @ moment, have parent-child relationship, mappings defined by public class parentmappings: classmap<parent> { public parentmappings() { table("parent"); id(x => x.id).column("parent_id"); ... hasmany(x => x.children) .not.keynullable() .not.inverse() .keycolumn("parent_id") .cascade.all(); ... } } and public class childmappings : classmap<child> { public childmappings() { table("child"); id(x => x.id).column("child_id"); map(x => x.parentid).column("parent_id"); ... } } here problem. want able write parent/child table stateless session, preserve speed, read table stateful session, children collection gets loaded correctly. however, seems 2 approaches incompatible. call hasmany() breaks statl...

parsing - Evaluate a Special Expression in C# -

i have string have special substrings in special format: $( variablename ) and pattern can repeat nested many times: $( variablename $( anothervariablename ) ) such as: [ test string ] here test string contain $(variablea) , $(variableb$(variablec)) for test string let assume that $(variablea) = a, $(variableb) = b, $(variablec) = c, $(variablebc) = y what want replace special patters -> $(variablename) actual values such resulting string should be: here test string contain , y any suggestion generic , elegant solution? here straightforward solution performing recursive descent parsing : public static string replace( string input , ref int pos , idictionary<string,string> vars , bool stoponclose = false ) { var res = new stringbuilder(); while (pos != input.length) { switch (input[pos]) { case '\\': pos++; if (pos != input.length) { ...

jquery - execute code on scrolling down an element -

i using http://cubiq.org/dropbox/iscroll4/examples/simple/ in web page i'm developing , exceute code user scrolls/drags down, example text within specific row should fade in user scrolls down. though use this: $(window).on('scroll', function() { var st = $(this).scrolltop(); $( 'li.frame1 img' ).css({ 'top' : -(st/3)+"px", 'left' : -(st/3)+"px" }); }); but user scrolling down element #scroller , not window. how adapt or achieve i'm trying do? thanks! $("#scroller").on('scroll', function() { var st = $(this).scrolltop(); $( 'li.frame1 img' ).css({ 'top' : -(st/3)+"px", 'left' : -(st/3)+"px" }); }); replacing document "#scroller" should job.

php - How do I remove some of the square brackets that wrap a JSON array -

i trying workout how format brackets wrapping json array. pulling data array out of database using code. $result = mysqli_query($con,"select * table"); $column = array(); while ($row = mysqli_fetch_array($result)) { $column[] = array(array($row[0],$row[1],$row[2],$row[3],$row[4],$row[5]),$row[3],$row[2],$row[0]); } once converted json array prints screen in format. need first square brackets remain need swap second set of brackets (\'). var myvar = [ [["22","mike"," 151.1272","-33.9324","learning fish","08\/14\/13"],"-33.93024"," 151.12896172","22"], [["23","mike"," -2.09875","51.44501","learning french","08\/04\/13"],"51.44501"," -2.09775","23"], [["24","mike"," -2.16375","51.44823019014051","programming","08\/05\/13...

ruby on rails - Audited: undefined method `associated' for nil:NilClass -

so have entry model column called created_by default first user created entry. installed audited , in entry model have: belongs_to :user audited :associated_with => :user similarly in user model have following statements: has_many :entries has_associated_audits in entries form, trying create hidden_field in trying set created_by equal the associated user of first audit on entry. i'm getting error, when try load form view: undefined method `associated' nil:nilclass here code in view: .field = f.label :created_by %br = f.hidden_field :created_by, value: @entry.audits.first.associated and here code in entries_controller set @entry in view: def new @entry = entry.new authorize! :create, @entry @project = project.find(params[:project_id]) @entry.project_id = @project.id authorize! :update, :read, @project end i realize that, intuitively, doesn't make sense call @entry.audits in event of creating new audit...

php - Exception information:Message: Invalid controller specified (index) -

i inherited maintaining of php 1.0 website uses zend framework . , have no experience framework. changed wording on page , received following error message. have know idea begin fixing problem. exception information:message: invalid controller specified (index) , #0 /usr/local/zend/share/zendframework/library/zend/controller/front.php(954): zend_controller_dispatcher_standard->dispatch(object(zend_controller_request_http), object(zend_controller_response_http))#1 /usr/local/zend/share/zendframework/library /zend/application/bootstrap/bootstrap.php(97): zend_controller_front->dispatch() #2 /usr/local/zend/share/zendframework/library/zend/application.php(366): zend_application_bootstrap_bootstrap->run() #3 /var/www/ispadmin/public/index.php(47): zend_application->run() #4 {main} array: 'module' => string 'agreements' (length=10), 'controller' => string 'index' (length=5), 'action' => string 'index' (lengt...

javascript - Can I intercept form submit data to use with AJAX? -

i have django app shows list of items in selection item. when user changes selected item, use ajax insert form (using django's form , formset helpers) "content" section on page edit item's data. what is, when user clicks "save" button on form, javascript function sends post data though form had been submitted, , uses ajax again reinject new data page. i want maintain clean url @ times, return entry editing (hence ajax html replacement). i prefer not have grab form fields , reconstruct string django forms recognize correctly. is there way this? going whole thing wrong? to grab whole form , send using ajax on submit (assuming jquery): jquery('form').submit(function (event) { event.preventdefault(); var form = jquery(this); var data = form.serialize(); jquery.post(form.attr('action'), data, function(html) { ... }); });

wpf - Can't understand Error in XAML Converter -

Image
i use converter "convert" width. want make 10% of "parent" width. use parameter value "0.1" (10%). in converter value converted "1.0". dont know why (see picture below). percentageconverter.cs using system; using system.windows.data; namespace erdbuilder.shell.converter { public class percentageconverter : ivalueconverter { public object convert(object value, type targettype, object parameter, system.globalization.cultureinfo culture) { double dblvalue = system.convert.todouble(value); double dblparameter = system.convert.todouble(parameter); double val = dblvalue*dblparameter; return val; } public object convertback(object value, type targettype, object parameter, system.globalization.cultureinfo cul...

LLVM JIT : matching structure member alignment with gcc -

i'm using llvm c++ api in program compiled gcc, , i'm using 'executionengine' jit in same process. i'm using boost::fusion automatically lift c++ structs jit, , i've noticed when produce struct definitions in way, llvm calculates different offsets fields of struct gcc does. does know have llvm's determination "in alignment" gcc's? problem i'm casting "opaque" classes byte arrays in llvm struct definition (e.g.: if struct has std::string translate byte array of length sizeof(std::string))?

facebook - FQL and place locations? -

something i've been playing getting address information fql queries. example, can place, doesn't have of location information beyond lat/lng. is there way can place , have include location address? looking @ page, https://developers.facebook.com/docs/reference/fql/place - i'm not sure how done, , scanning documentation, can't seem find ability so. you can't if not saved place write https://graph.facebook.com/[page id of location/place] https://graph.facebook.com/the.logic.unit see details of location here or not. if there no detail here cannot details.

javascript - Using RequireJS for Recursive Map -

i'm using requirejs web application, , i'm stumped on how use requirejs build recursive map of same object. example, object called 'section', , want create child below each using same object: section > section > section > (etc...) here contents of section.js: define(['jquery'], function($) { children = []; function init() { require(['jquery', 'section'], function($, section) { children.push(section.init(mediator, this)); }); return children; } return { init: init } } this has resulted in self-referencing mess. don't know how can create new instance of section new, child section. this can done without changing requirejs parts. idea create reference self, similar window.self ? function section() { this.children = []; } var section = new section(); section.children.push(section); if each section has child new section, unless it's generated on demand, co...

python - Unable to unpack elements in list -

here's mwe of code: import numpy np # load data file. data = np.genfromtxt('data_input', dtype=none, unpack=true) print data here's sample of data_input file: 01_500_aa_1000 990.0 990.0 112.5 0.2 72 0 0 1 0 0 0 0 0 0 0 0 0 1 02_500_aa_0950 990.0 990.0 112.5 0.2 77 0 0 1 0 0 0 0 0 0 0 0 0 1 03_500_aa_0600 990.0 990.0 112.5 0.18 84 0 0 1 0 0 0 0 0 0 0 0 0 1 04_500_aa_0700 990.0 990.0 112.5 0.18 84 0 0 1 0 0 0 0 0 0 0 0 0 1 the unpack argument not appear work since prints: [ ('01_500_aa_1000', 990.0, 990.0, 112.5, 0.2, 72, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1) ('02_500_aa_0950', 990.0, 990.0, 112.5, 0.2, 77, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1) ('03_500_aa_0600', 990.0, 990.0, 112.5, 0.18, 84, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1) ('04_500_aa_0700', 990.0, 990.0, 112.5, 0.18, ...

java - Logging in to site with Apache HttpComponents -

i'm trying login meetme.com can't figure out how it. i'm using httpcomponents apache. when run code below respose code of 200. have 2 part question. 1. how login www.meetme.com 2. let's user typed in incorrect password, how can know response if successful login? import java.util.arraylist; import org.apache.http.httpresponse; import org.apache.http.client.httpclient; import org.apache.http.client.entity.urlencodedformentity; import org.apache.http.client.methods.httppost; import org.apache.http.impl.client.defaulthttpclient; import org.apache.http.message.basicnamevaluepair; import org.apache.http.namevaluepair; class me { private final string loginurl = "http://www.meetme.com"; private arraylist<namevaluepair> loginparameters; httppost post; httpclient client; public me(){ try{ client = new defaulthttpclient(); setloginparameters(); post = new httppost(loginurl); po...

css - How to scroll screen down with dropdown menu with jquery? -

my site http://868rcacs.ca/index.php , got drop down menu work [only visable on mobile] , when press menu button drops down want screen scroll down kinda clicking href="#namehere" scroll name="namehere" is possible achieve when i'm trying , if how it? from understand, want let window scroll down see entire menu? starters make logo size smaller, done js, in way of: window.scrollto($anchor.left,$anchor.top) or jquery: $('body').animate({$anchor: $anchor.top }) edit: explained here more code. http://css-plus.com/2010/11/create-a-scrolling-anchor-link-with-jquery/

php - Need help on Mod Rewrite .htaccess parent folder and 1 subfolder -

i not on understand .htaccess rewrite, , 1 give me headache. i have domain.com , , 1 folder called: app/webroot/ i want everything: domain.com/* rewrite folder domain.com/app/webroot/* then make me crazy. have 1 folder admin, called "system" under domain.com too. under domain.com/system not rewrite webroot. and finally, want system/something rewrite /system/index.php?subpage=something really sorry if guy think easy , can not it, stuck whole days already. here have tried do: rewriteengine on rewriterule ^(.*)$ app/webroot/$1 [l] rewritecond %{request_filename} -s [or] rewritecond %{request_filename} -l [or] rewritecond %{request_filename} -d rewriterule ^.*$ - [nc,l] rewriterule ^/?(system)/?([^/]+)/?$ /system/index.php?subpage=$1 [nc,l,qsa] rewriterule ^/?(system)/?([^/]+)/([^/]+)/?$ /system/index.php?subpage=$1&action=$2 [nc,l,qsa] rewriterule ^/?(system)/?([^/]+)/([^/]+)/([^/]+)/?$ /system/index.php?subpage=$1&action=$2&param=$3 [nc,l...

Using jQuery.queue with multiple element animations? -

jquery queue's annoying - can't head around it... the following function contains 4 animations want happen 1 after other (not @ same time). function startupanime() { $("#header").animate({"opacity":"1"},{duration:3000, queue:"global"}); $("#header").animate({"top":"0px"},{duration:3000, queue:"global"}); &("#loader").animate({"opacity":"0"},{duration:3000, queue:"global"}); $("#background").animate({"background-position" : "300px center"},{duration:3000, queue:"global"}); } $(window).load(function() { startupanime(); }) the 2 #header elements animate 1 after other, rest happen @ same time. i found out queue works if animating same element!! that's not useful... adding queue:"name" apparently supposed link them same queue... although stops them working me. am missing...