Posts

Showing posts from April, 2010

Adding Custom Fields to Devise Registration - Ruby on Rails 4 & Devise 3 -

hi, have model coach i'm trying add specific fields to. have created migration , added fields registration receive error nomethoderror in devise::registrations#new & undefined method `first_name' thank taking @ this... update: have migrated database here code looks far: registration sign coach <%= form_for(resource, as: resource_name, url: registration_path(resource_name)) |f| %> <%= devise_error_messages! %> <div><%= f.label :first_name %><br /> <%= f.text_field :first_name, autofocus: true %></div> <div><%= f.label :email %><br /> <%= f.email_field :email, autofocus: true %></div> <div><%= f.label :password %><br /> <%= f.password_field :password, autocomplete: "off" %></div> <div><%= f.label :password_confirmation %><br /> <%= f.password_field :password_confirmation, autocomplete: "off&quo

java - BufferedWriter doesn't throw any error, but file is blank -

i'm brand new using java web servers, , i'm writing basic application writes micro-posts file, later called , displayed. ( know database better this, assignment , using file-i/o keep things simple.) here method in servlet receives form post , writes data file: protected void dopost(httpservletrequest request, httpservletresponse response) throws servletexception, ioexception { string content = request.getparameter("postcontent"); calendar cal = new gregoriancalendar(); int day = cal.get(calendar.day_of_month); int month = cal.get(calendar.month) + 1; //add 1 because calendar class numbers months 0-11 int year = cal.get(calendar.year); int hour = cal.get(calendar.hour); int minutes = cal.get(calendar.minute); string datetime = integer.tostring(month) + "/" + integer.tostring(day) + "/" + integer.tostring(year) + " " + integer.tostring(hour) + ":" + integer.tostring(minutes); s

sql - Query compare from a table and a sum of multiple row in another table -

i have question regarding sql query , keep getting error. im trying getting qty value row in master_drawing table , compare same name sum of multiple occurences same key head_mark. this sql select master_drawing.total_qty totalqty, sum(master_drawing_assigned.assigned_qty) sumassignedqty master_drawing, master_drawing_assigned head_mark = 'testmultiple' , project_name = 'millhouse' what keep getting 'ora-00918: column ambiguously defined' am doing wrong here? in end, need compare totalqty sumassignedqty further operation this tabe structure master_drawing, head_mark varchar2(20 char), entry_date date, comp_type varchar2(20 char), weight number(11,2), surface number(15,3), profile varchar2(20 char), project_name varchar2(20 char), length number(15,2) not null, total_qty number(38), subcont_status varchar

c# - Disable/ Hide a control inside a specific row of GridView -

Image
i have below code create gridview in asp.net , inside gridview have delete button. below code works fine , shows delete in rows. want hide/ disable delete button in first row. can suggest code part? <asp:gridview id="gridview1" runat="server" showfooter="true" autogeneratecolumns="false"> <columns> <asp:boundfield datafield="rownumber" headertext="row number" /> <asp:templatefield headertext="cat"> <itemtemplate> <asp:textbox id="textboxcat" runat="server" enabled="false"></asp:textbox> </itemtemplate> </asp:templatefield> <asp:templatefield headertext="delete" > <itemtemplate> <asp:linkbutton id="deleteitemsgridrowbutton"

Uploading a file in asp.net in one of the folders listed in the solution explorer -

i trying upload file asp.net website. issue want file saved on web server in 1 of folders included in solution of website while developing in visual studio. i not able access rights folder , wonder how user have access folder. want save file in folder , allow other users download it. fileupload1.postedfile.saveas(server.mappath("~/folder")); the error is: access path 'c:_________________________________is denied system.unauthorizedaccessexception any suggestions welcome. thank you shaleen you should grant read , write permissions aspnet / network service user specified folder. if reason stuck on this, can test set write permissions user verify problem resolved. after remove permissions , test again network service account. check msdn article more information http://msdn.microsoft.com/en-us/library/ff647402.aspx .

java - reading lots of messages from amazon sqs -

i trying read sqs queue bunch of messages on (~2mil) running in trouble how setup threading model decent performance. i tried this: executorservice es = executors.newfixedthreadpool(16); //getapproximatenumberofmessages() - uses sqs regular (not async) client call getqueueattributes, etc final atomicinteger approximatenumberofmessages = new atomicinteger(getapproximatenumberofmessages()); while(approximatenumberofmessages.get() > 0) { es.execute(new runnable() { @override public void run() { //getmessages uses sqs regular (not async) client call receivemessage() list<message> messages = getmessages(); (message message : messages) { handlesinglemessage(message); } approximatenumberofmessages.decrementandget();

phpunit selenium select with assign value -

when assign value not work var $title = "name=order[contact][title]" ; var $title_val = "label=mr" ; public function fillcustomerinfo() { $this->select($this->title, $title_val); return $this; } normal working public function fillcustomerinfo() { $this->select("name=order[contact][title]","label=mr"); return $this; } so,how can assign value in function? thanks in advance. you can use this var $title_val = "label=mr" ; if call variable need use $this->title_val; so.the correct code is var $title = "name=order[contact][title]" ; var $title_val = "label=mr" ; public function fillcustomerinfo() { $this->select($this->title, $this->title_val); return $this; }

c# - WildCard Search Using Linq -

i having cardtable values cardtable id card no ------- ---------- 1 | 0001-1234-5678-9001 2 | 0001-1234-5678-9002 3 | 0001-1234-5678-9003 4 | 0001-1234-5678-9004 5 | 0001-1234-5678-9005 now want search in table using linq card no i.e. 0001-1234-5678-9001 (using number directly) or 0001123456789001 (using number without dashes) can in this? in comments other answers have indicated want execute query on server side. can converting card number canonical card number has format used in database: string getcanonicalcardno(string cardno) { if (cardno.length == 19) return cardno; if (cardno.length != 16) throw new argumentexception("invalid card number.", "cardno"); return string.format( "{0}-{1}-{2}-{3}", cardno.substring(0, 4), cardno.substring(4, 4), cardno.substring(8, 4), cardno.substring(12, 4) ); } this function convert card number 0001-1234-5678-9001 .

javascript - while(1) JSON injection -

i read post why google prepend while(1); json responses? can kind of php script ? i try $time=time(); $hash=md5(mt_rand(1,200000)); $arr = array('time' => $time, 'hash' => $hash); while(1);json_encode($arr); in ajax answer have error fatal error : maximum execution time of 30 seconds exceeded in c:\xampp\htdocs\foo\1.php on line 6 thank girish works : 1.php <?php $time=time(); $hash=md5(mt_rand(1,200000)); $arr = array('time' => $time, 'hash' => $hash); echo "while(1);".json_encode($arr); ajax -side responsetext=req.responsetext.substring(9); var obj=json.parse(responsetext); statuselem.innerhtml = obj.hash

html - wanted some standard CSS coding -

Image
i new css designing. i have developed page using html. i have header including buttons homepage, mydata, help. when click mydata link, 1 submenu come below it. personal data ,official data , employee document. when click on personal data, on left hand side of page menu come content address, passport details, pan etc. when click address link display table having address related data in center of page. here have taken line in between left menu , center table. i have used 6 div's , 6 different css's doing this. <div id="fourth_page_left_line"> </div> <div id="fourth_page_left_line1"> </div> <div id="fourth_page_left_line2"> </div> <div id="fourth_page_left_line3"> </div> <div id="fourth_page_left_line4"> </div> <div id="fourth_page_left_line5"> </div> css: #fourth_page_left_line { left: 190px; top: 130px; position:

ios - Autolayout ignores navigationbar -

Image
i have following storyboard view. but gives me following view when run it. could tell me why view pushed far below navigationbar . can see top space to: top layout 49. when change 5 example button gets bigger, strange because i've set height equals 30 .

symfony 1.4 twitter bootstrap login -

i have old working login form in symfony 1.4.each field displayed using symfony helpers(renderlabel). <form action="<?php echo url_for('core/login') ?>" method="post" class="form-signin"> <div class="alert-error"> <?php if(!empty($error)): ?> <span class="error"><?php echo $error ?></span><br /><br /> <?php endif; ?> </div> <h2 class="form-signin-heading">welcome company</h2> <legend>please sign-in</legend> <?php echo $form['username']->renderlabel() ?><br /> <?php echo $form['username'] ?> <?php if($form['username']->haserror()): ?> <span class="error"><?php echo $form['username']->geterror() ?></span> <?php endif; ?> <br /> <?php echo $form['password&

javascript - Page Jerk on Jquery.load() Function -

i using jquery.load(html) function load html in div. code below. $("#preview-content").load("abc/abc.html", function(){ $('#workphone').text('0123456'); //...and more text fields fill here } when code execute whole page gets jerk. looks page refreshing while in actual 1 div loading. have changed .load() function ajax call below. $.ajax({ url: "abc/abc.html", datatype: 'html', success: function(html) { $("#preview-content").html(html); return false; } }); and showing same result. navigation, toolbar, grid, everthing jerk reloaded. idea doing wrong?

android - Listview flickering on notifyDataSetChanged() when using universal image loader -

i facing same issue mentioned in link given below: https://github.com/nostra13/android-universal-image-loader/issues/376 i have checked solutions in above link , seems given below solution solving problem: imageaware imageaware = new imageviewaware(imageview, false); imageloader.displayimage(imageuri, imageaware); but same flickering issue happen, if pass options displayimage () method in above code. means, below code causing issue: imageaware imageaware = new imageviewaware(imageview, false); imageloader.displayimage(imageuri, imageaware,options); how can stop flickering issue when when passing 'options' displayimage() method? here option passing method: options = new displayimageoptions.builder().showimageforemptyuri(r.drawable.empty).showimageonloading(r.drawable,loading).showimageonfail(r.drawable.failed).cacheondisc(true).bitmapconfig(bitmap.config.rgb_565).imagescaletype(imagescaletype.in_sample_int).build(); the solution not reload image whe

android - Download latest ADT and it is juno -

i download latest adt 64 bit - adt-bundle-windows-x86_64-20140624 , when open it not usual adt eclipse juno. what should do? link screenshot: http://tinypic.com/view.php?pic=241sgvd&s=8#.u60gjvl_tz9 this adt comprises of android sdk , eclipse

Usage of npm packages in cordova / phonegap -

i’m trying add package cordova project using npm, either i’m doing terribly wrong or i’m not getting way should work… i’m using latest version of cordova (v3.5.0). have created application: cordova create testapp cd testapp cordova platform add android cordova run android everything works perfectly, , app appears on android device. want add package ‘pako’ app: https://github.com/nodeca/pako . i’m still in same directory (see above) , enter “npm install pako”. package installed in “/node_modules/”. however, when build application android (cordova build android / cordova run android / cordova prepare), none of installed packages (in “/node_modules/” directory) copied platform specific folder “platforms/android/….”. in other words, how use npm package in cordova / phonegap application? shouldn’t package copied automatically cordova cli right platform? is possible @ all? or have create manual build script using grunt example when want use npm packages? since can’t find examples

pointers - shared C++ object through memory -

i have quick question familiar inter-process communication. situation i have program (program a) can add code to, limited. main program generate lot of data. the way data formulated limited, create second program (program b) , hence need data b. , cause run functions no return value. i aware of named pipes, feel might bulky? - not sure though - have instance following concerns (may unfounded): data flow => convert binary -> place data in memory -> server read -> convert string -> through switch statement determine requested -> requested -> convert binary -> place in memory -> read client , convert string / acceptable format. it has use switch statements on both sides , if want different format of info other string, need take consideration one message might have wait complete, might slower during lot of calls @ same time? - not sure though other inter process communication methods has same problem. better solution think create "object&q

msbuild - How to setup CruiseControl.NET with MSTest running Selenium Webdriver unit tests? -

i've been looking while step step instruction or examples of how setting cruisecontrol.net mstest works, no actual luck. i'm hoping might able , point me in right direction. i'm sure has been asked loads of times searching couldn't find answer. <exec> <executable>c:\program files (x86)\microsoft visual studio 12.0\common7\ide\mstest.exe</executable> <basedirectory>d:\<project>\celeriac\pumpkin.selenium\bin\debug</basedirectory> <buildargs> /testcontainer:pumpkin.selenium.dll /test:<testname> /runconfig:localtestrun.testrunconfig /resultsfile:testresults.trx </buildargs> <buildtimeoutseconds>600</buildtimeoutseconds> </exec> i've added above ccnet.config file after msbuild (which works fine) running tests after build complete doesn't work. i not 100% if basedirectory looks correct? or need else in buildarg

asp.net mvc - authenticating MVC 5 application using Third part other then Social networks -

i got mvc 5 application using asp.net identity authentication works fine. i want mvc 5 application use authentication existing application traditional asp.net authentication i want existing traditional asp.net authentication application used single sign-on , mvc application use auth cookie sure can. you can create own custom applicationuser (identityuser) , create own userstore implements iuserstore interface. just check out default applicationusermanager in first line of create function see applicationmanager constructed new userstore. there can plug in custom user & userstore. here info. http://www.asp.net/identity/overview/extensibility/overview-of-custom-storage-providers-for-aspnet-identity

c# - ASP.net MVC passing data from Partial View Back To the Main -

i dynamically loading partial view using ajax, textboxes entry on same page main data list, without having reload main data list each time edit made. data list shown, user can click on entry load textbox, in view mode, after can select edit edit entry. issue have edit button in main view, , id of item want edit in partial view. my main view @model presentationlayer.models.hr.equipmenttypes @{ viewbag.title = "equipment"; } @section script{ <script type="text/javascript"> $.ajaxsetup({ cache: false }); </script> } <h2>links</h2> <h3>all links</h3> <table> <thead> <tr> <td>name</td> </tr> </thead> @foreach (var equipmenttype in model.equipmenttype) { <tr> <td>@ajax.actionlink(equipmenttype.name, "index", "link", new { id = equipmenttype.id }, new aja

apache poi - Create in a textbox excel with java -

i have document excel textboxes want create in textboxes text java code code value , how i'm going edit using poid apache try { fileinputstream fsip = new fileinputstream(new file("c:\\book1.xls")); // inputstream input = new fileinputstream("book1.xls"); poifsfilesystem fs = new poifsfilesystem(fsip); hssfworkbook wb = new hssfworkbook(fs); hssfsheet sheet = wb.getsheetat(0); hssfpatriarch pat = sheet.getdrawingpatriarch(); list children = pat.getchildren(); iterator = children.iterator(); while (it.hasnext()) { hssfshape shape = (hssfshape) it.next(); if (shape instanceof hssftextbox) { shape.getanchor() hssftextbox textbox = (hssftextbox) shape; hssfrichtextstring richstring = textbox.getstring(); string str = richstring.getstring(); system.out.println("string: "

matplotlib - Plotting dynamically and conditionally -

Image
i have make plot getting updated after every 2 seconds (for total 20 seconds). in each update in range of 0 1 step 0.2 have 2 channels. , 3 options either 1 of them gets selected or none or both , everytime depending on value want determine among 3 options , want plot in different colours. can ?(i have 2 different functions initialization , refresh of plots. i have got solution . used this def update_result(name, x, y,result): axes, lines = figs[name] if(result == 0): axes.plot(x,y,'g^') elif(result == 1): axes.plot(x,y,'ro') elif(result == 2): axes.plot(x,y,'bs')

Error on Programmatically changing the SelectManyCheckbox List in Oracle ADF -

i have selectmanychecbox on jsff bound list in managed bean. now issues when click on radio button, of check boxes should removed, ie list should updated have lesser number of check boxes. now when have selected lets 5 out of 10 check boxes, , when update list, leaves me 2 options in check boxes...and @ point adf faces raise issue selection should limited , all. please tell me how reset checkboxes default/unselected state before updating list. or there other way rid of error here example, , works: <f:view xmlns:f="http://java.sun.com/jsf/core" xmlns:af="http://xmlns.oracle.com/adf/faces/rich"> <af:document title="main.jsf" id="d1"> <af:form id="f1"> <af:panelgrouplayout id="pgl1"> <af:selectoneradio label="setvalues" id="sor1" autosubmit="true" valuechangelistener="#{viewscope.test.onsetva

mysql - How to Restrict Members wont see admin_page.php using session -

i have registered sessions using array containing: username, password , role. don't want show administrator page whomever enters site member. how can restrict admin_home.php using session> this code: -> login_check.php <?php session_start(); include('connect.php'); $name = $_post['name']; $password = $_post['password']; $role = $_post['member']; $sql = "select * login_register name = '$name' , password = '$password' , role = '$role'"; $retain = mysql_query($sql, $con); $count=mysql_num_rows($retain); $row=mysql_fetch_array($retain); if($count == 1){ $_session['user'] = array('name' => '$name', 'password' => '$password' , 'role' => '$member'); if ( $role == "admin"){ header("location:admin_home.php");} else if ( $role == "member"){ header("location:member_home.php");}} else { echo "<a

opencv - How to remove similar images based on hog features? -

i have 5000 images , each image can generate vector 1000 dimensions(hog feature), of images similar want remove similar ones. there way achieve this? =============================================================== as @thedarkside ofthemoon suggested, let me explain little bit more trying do. using svm + hog features image classification. have prepared training data of training images similar want remove similar ones reduce computation cost. don't know if removal of similar images has side effect on final classification rate criteria of 'similarity' must found. that's trying do. in way(not using hog features) can compute color histogram each image , compare against others. like, get first image , compute histogram, now each other images calculate histogram , compare first one. if find close match on histogram can discard it. , using cv_comp_correl match in range of 0-1.

html - Make an element's width depend on its grandparent's dynamic width--while having a fixed width parent -

Image
pew, sounds complicated, huh? try describe can. basically, have 3 elements: div width auto, table width 500 , span width should auto, dependant on table's cell width. let me show you: <div> <table> <tr> <td><span>some random content</span></td> <td><span>some random content</span></td> </tr> <tr> <td><span>some random content</span></td> <td><span>some random content</span></td> </tr> </table> </div> here's css; borders enhanced clarity: table, tr, td { border: 1px solid black; } table { width: 500px; } span { border: 1px dotted red; display: block; word-wrap: break-word; } div { border: 1px dotted green; } rendered, looks this: perfectly fine. noticed green dotted border? that's div: wide browser window. however, if resize whole thing, looks th

c# - Getting certificicate from decimal value serial number failed -

i using encryptedxml class decrypt part of xml document. within called following .net method : public virtual symmetricalgorithm getdecryptionkey (encrypteddata encrypteddata, string symmetricalgorithmuri) node of xml document encrypted self signed certificate. here xml key info details : <keyinfo> <ds:x509data xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> <ds:x509issuerserial> <ds:x509issuername>cn=certname</ds:x509issuername> <ds:x509serialnumber>-180xxx</ds:x509serialnumber> </ds:x509issuerserial> </ds:x509data> </keyinfo> i have certificate added in localmachine/personal cert store. when execute code got : system.security.cryptography.cryptographicexception: unable retrieve decryption key. @ system.security.cryptography.xml.encryptedxml.getdecryptionkey(encrypteddata encrypteddata, string symmetricalgorithmuri) @ webcom.common.federation.saml.customencryptedxml.getdecryptionkey(e

c++ - gcc/mingw linker fails with "first defined here" when using boost and quantlib - is it my fault? -

after upgrading gcc 4.8 on windows box, code no longer builds, linker fails. there 14 identical error messages, first 1 is: [mingw]\local\lib/libquantlib.a(normaldistribution.o):normaldistribution.cpp:(.data$_zzn5boost4math6detail11erf_inv_impiens0_8policies6policyins3_13promote_floatilb0eeens3_14promote_doubleilb0eeens3_14default_policyes9_s9_s9_s9_s9_s9_s9_s9_s9_s9_eeeet_rksb_sd_rkt0_pkn4mpl_4int_ili64eeee1p[_zzn5boost4math6detail11erf_inv_impiens0_8policies6policyins3_13promote_floatilb0eeens3_14promote_doubleilb0eeens3_14default_policyes9_s9_s9_s9_s9_s9_s9_s9_s9_s9_eeeet_rksb_sd_rkt0_pkn4mpl_4int_ili64eeee1p]+0x0): multiple definition of `long double boost::math::detail::erf_inv_imp, boost::math::policies::promote_double, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies

javascript - How can i acess numberText[i].text() in function inside onclick event of circles[i]? -

when access "numertext[i].text()" in function of circles[i]'s on click event handler firebug prompts error:"numbertext[i] undefined ". want assign text returned calling "numertext[i].text()" variable "score" var score=0; for(var i=0;i<3;i++){ //adding number text numbertext[i]=new kinetic.text({ x:circles[i].getx(), y:circles[i].gety(), text:i, fill:'white', name:'ntext' }); group[i].add(circles[i],numbertext[i]); layer.add(group[i]); //zn click circles circles[i].on('click',function(){ score=numbertext[i].text(); //here "numbertext[i] undefined" error fires scoretext.text(score); layer.draw(); }); } plz me

data mining - Guaranteeing the same subset for several techniques in Rapidminer's X-Validation -

i in feature selection stage of class data mining project, main objective of compare several data mining techniques (naive baiyes, svm,etc...). in stage using wrapper x-validation,like in example below: <?xml version="1.0" encoding="utf-8" standalone="no"?> <process version="5.3.008"> <context> <input/> <output/> <macros/> </context> <operator activated="true" class="process" compatibility="5.3.008" expanded="true" name="process"> <process expanded="true"> <operator activated="true" class="optimize_selection" compatibility="5.3.008" expanded="true" height="94" name="optimize selection (3)" width="90" x="179" y="120"> <parameter key="generations_without_improval" value="100"/&g

image - Different plots in the same figure when using clear -

i have 3 .m files , each 1 plots graph. need superimpose results 3 of them, did copy 3 codes single .m file. the problem need clean (by using command "clear"), between every program, , therefore, between every plot. anyone has suggestion on how plot 3 results in single figure, please? thanks! :-) try following approach: single file containing 4 functions. function ploteverything() [x1 y1] = data1(); [x2 y2] = data2(); [x3 y3] = data3(0.5); figure plot(x1, y1); hold all; plot(x2, y2); plot(x3, y3); title 'my awesome plot of everything'; xlabel 'x'; ylabel 'y'; legend({'one', 'two', 'three'}); end function [x y] = data1() x = 1:5; y = 0.5 * x; end function [x y] = data2() x = 2:2:10; y = sqrt(x); end function [x y] = data3(p) x = linspace(0,7,15); y = 0.1 * rand(size(x)) + p * x.^2; end put al in file ploteverything.m , , call command line ploteverything . no need explici

.htaccess - Redirect 301 not working because of Long Dash (special character) -

i've got issue when redirecting 1 of blog's url: http://suitelife.com/category/moving-to-barcelona-tips/barcelona-legality%e2%80%93barcelona-shopping-health-public-transport as can see %e2%80%93 pain in a**, looked @ diverse forums, no solution there appeared solve situation. i put line in .htaccess : rewriterule ^category/moving-to-barcelona-tips/barcelona-legality([^.%e2%80%93])barcelona-shopping-health-public-transport(.*)$ category/moving-to-barcelona-tips/barcelona-day-life$1 [r=301,l] p.s: i've got rewriteengine on , rewritebase / etc. i've redirected other urls, 1 not working. many in advance! :) florian you can use take regex avoid matching character: rewriterule ^category/moving-to-barcelona-tips/barcelona-legality.*?barcelona-shopping-health-public-transport(.*)$ category/moving-to-barcelona-tips/barcelona-day-life$1 [r=301,l,b] note use of .*? instead of character match arbitrary string there.

MySQL Order By Date -

i have mysql database. database contains documents datetime column called "created". want group day in order have document count per day. however, days have 0 documents , result not part of output. example need '2001-01-01' have 0 count if documents not exist. i thinking of creating table date range interested on , outer join table. can group date have results. is there better way of doing such thing? my sql code: select date(created_at),c.text dates d left outer join classifier c on d.n=date(c.created_at) c.classifier="2014streamlrall" , date(c.created_at)>='2014-03-01' , date(c.created_at)<='2014-05-01' order d.n; the left join still not work. there no better way in mysql . it lacks both method generate arbitrary length resultset (similar postgresql's generate_series ) , recursive sql required emulate such method (which used in sql server , oracle). even on sql server, populating , keeping table

linux - apt-get update error due to armhf -

while installing cuda on ubuntu, ran following command in terminal: sudo sh -c 'echo "foreign-architecture armhf" >> /etc/dpkg/dpkg.cfg.d/multiarch' the command failed , when sudo apt-get update , gives me whole bunch of failed fetch errors. cuda installation however, succeeded. how can revert back, don't errors when update? you need delete entry "foreign-architecture armhf" "/etc/dpkg/dpkg.cfg.d/multiarch" file.

c# - Printing an aspx file in Asp.net -

i have used following code print html div contents & works fine, when using ajax control in aspx page gives me error message, i.e: "extender control 'calendarextender2' not registered extender control. extender controls must registered using registerextendercontrol() before calling registerscriptdescriptors(). parameter name: extendercontrol" here c# code protected void btnprint_click(object sender, eventargs e) { stringwriter stringwrite = new stringwriter(); system.web.ui.htmltextwriter htmlwrite = new system.web.ui.htmltextwriter(stringwrite); page pg = new page(); pg.enableeventvalidation = false; htmlform frm = new htmlform(); pg.enableeventvalidation = false; pg.controls.add(frm); frm.attributes.add("runat", "server"); frm.controls.add(divcontent); pg.designerinitialize(); pg.rendercontrol(htmlwrite); string strhtml = stringwrite.tostring(); httpcontext.current.response

php - Symfony 1.4 Propel Join Criteria needs peer constants -

i want share quite annoying you, because problem cost me lot of time understand: lets start quite simple: $c = new criteria(); $c->add(personpeer::id, 123); personpeer::doselect($c); $c = new criteria(); $c->add("person.id", 123); personpeer::doselect($c); of course, both works because personpeer::id representation of string "person.id". now join: $c = new criteria(); $c->add(personpeer::id, 123); $c->addjoin(personpeer::id, orderpeer::person_id, criteria::left_join); $c->add(orderpeer::amount, 10); personpeer::doselect($c); quite simple, works... replace constants: $c = new criteria(); $c->add(personpeer::id, 123); $c->addjoin("person.id", orderpeer::person_id, criteria::left_join); $c->add("order.amount", 10); personpeer::doselect($c); ... still works. replace constants: $c = new criteria(); $c->add("person.id", 123); $c->addjoin("person.id", "order.person_id", c

sql server - Alias not recognised in subquery case statement SQL -

i have following query runs fine when isn't populated i'm having difficulty getting right references data in where. code below: select g.id id, g.printed printed, g.createddate createddate , case when ( select count(distinct custsubga.customerid) pickingassignment_pickingassignmentusergroup custsubg join pickingassignment custsubga on custsubga.id = custsubg.pickingassignmentid join customer custsub2c on custsubga.customerid = custsub2c.id custsubg.pickingassignmentusergroupid = max(g.id) ) > 1 'multiple' else ( select max(custsub2c.name) pickingassignment_pickingassignmentusergroup custsub2g join pickingassignment custsub2ga on custsub2g.pickingassignmentid = custsu

gem not working after installing 'thin' - rails 3.2.8 -

i got stuck in dead end after trying install gem 'thin' on environment rhel 6.0 ruby 1.9.3 rails 3.2.8 as indicated, added gem 'thin' to gemfile , ran bundle install the installation seemed successful, after that, whenever run 'gem', get <internal:prelude>:8:in `lock': error: failed build gem native extension. (gem::ext::builderror) error: failed build gem native extension. deadlock; recursive locking gem files remain installed in /usr/local/lib/ruby/gems/1.9.1/gems/eventmachine-1.0.3 inspection. results logged /usr/local/lib/ruby/gems/1.9.1/extensions/x86_64-linux/1.9.1-static/eventmachine-1.0.3/gem_make.out while if run again 'bundle install' get unfortunately, fatal error has occurred. please see bundler troubleshooting documentation @ http://bit.ly/bundler-issues. thanks! <internal:prelude>:8:in `lock': error: failed build gem native extension. (gem::ext::builderror) error: failed build

php - Magento Connect Manager & ftp write file permissions -

after transferring site development domain live domain have tried use magento connect manager install extension, keep getting: connect error: please check sufficient ftp write file permissions. magento folder not have sufficient write permissions, downloader requires. i have set folder permissions be: root: 777 downloader (and recursively directories only) 777 downloader/config.ini 666 media 777 media/downloadable 777 var 777 app/etc 777 app/code/community 777 var/cache 777 i have used magento file permissions cleanup tool located @ post: http://www.magentocommerce.com/wiki/groups/227/resetting_file_permissions i have flushed cache , disabled cache within site moment. still no joy! keep getting same error message - can advise? try downloader , inner folders permission 775 , files 664 .

Magento admin form not saving the decimal values with decimal -

for 1 of custom module have following sql setup script $installer = $this; $installer->startsetup(); $installer->run(" create table {$this->gettable('wholesale')} ( `wholesale_id` int(11) unsigned not null auto_increment, `title` varchar(255) not null default '', `percentage` float(5,3) not null, `status` smallint(6) not null default '0', `created_time` datetime null, `update_time` datetime null, primary key (`wholesale_id`) ) engine=innodb default charset=utf8; "); $installer->endsetup(); the value passed percentage` float(5,3) not null, column saving decimal 00 example. if save value 10.23 save in database 10.00. please help i ran same issue. after clearing cache "flush magento cache", started save properly. in case, had altered column , being cached.

sql - What is better way to specify location of user : 3 columns or one location varchar column in mysql? -

i need way assign address user . address consists of 3 values : country region city it possible create 3 columns country, region , city. possible create 1 varchar column , separate country,region,city comma. which approach better if need query user country and/or region and/or city? it best practice store address in 3 separate columns. makes easier search 1 value or using and/or statements query based off of several values.

java - What kind of exception should go in the catch with assertEquals? -

i'm making webdriver , part of check title make sure on right page. benefit want show dialog box when title doesn't match right give me error message in console. believe it's exception problem. suggestions? try{ assertequals("current page title", "account inventory - select manager", pagetitle); } catch(exception ex) { jframe frame = new jframe("message"); joptionpane.showmessagedialog(frame , "the title not match"); } assertequals throw assertionerror when condition not met. should either catch error explicitly, or widen catch include throwable rather exception . see type hierarchy diagram below understand why catch (exception e) won't catch assertionerror . java.lang.object |--- java.lang.throwable |--- java.lang.error | --- java.lang.assertionerror // not descendent of exception |--- java.lang.exception however... tests supposed automated can

Switching jquery ui tabs and dispay corresponding button -

well, must simple of you, have no idea how accomplish this. i have set of tabs , 3 buttons. each button corresponding tab. here's html: <div id="tabs"> <ul> <li><a href="#tabs-1">apartmans</a></li> <li><a href="#tabs-2">eco housee</a></li> <li><a href="#tabs-3">other facilities</a></li> </ul> <div class="divider-h"></div> <a href="#" class="btn-a btn-3 btn-3e icon-arrow-right btn-apartmans">all apartmans</a> <a href="#" class="btn-a btn-3 btn-3e icon-arrow-right btn-ecohouse">eco housee</a> <a href="#" class="btn-a btn-3 btn-3e icon-arrow-right btn-facilites">other facilities</a> any appreciated. here's html a.btn-apartmans {

xslt - Error: "the focus is undefined" -

i use xslt (fpml root of document): <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:template match="/"> <xsl:sequence select="/fpml"/> </xsl:template> </xsl:stylesheet> within code: if(schema.isvalid()) { qxmlschemavalidator validator(schema); qbytearray data(this->xmltextedit->toplaintext().tostdstring().c_str()); qbuffer buffer(&data); buffer.open(qiodevice::readonly); if (validator.validate(&buffer)) qdebug() << "instance document valid"; else qdebug() << "instance document invalid"; qxmlquery query(qxmlquery::xslt20); query.setfocus(&buffer); qdebug() << qdir::current(); qurl xslt("test__.xslt"); if( xslt.isvalid()) { query.setquery(

php - How to handle multiple submit buttons when the number of buttons is variable? -

what have tried accomplish here fetch data database , display form. how name submit buttons can identify them on actions page? if(isset($_post["sch"])) { $_session['e']=$_post["phon"]; $result_set=mysql_query("select * bill_info phone='".$_session['e']."' , net_payable=0 order bill_no"); if($row=mysql_fetch_array($result_set)) { echo "<form name=\"shpen\" method=\"post\" action=\"vgbill2.php\"> <table border=\"0\">"; { echo "<tr><th>bills</th><th>action</th></tr>"; echo "<tr><td>".$row[0]."</td><td><input type=\"submit\" name=\"".$row[0]."\" value=\"generate\"></td></tr>"; } while($row=mysql_fetch_array($result_set)); //e