Posts

Showing posts from April, 2011

PHP Calculator not working as expected -

i have created php calculator when try divide 2 numbers multiplies them link code= http://pastebin.com/raw.php?i=9qtmjmqy <?php ?> <html> <body> <?php if(isset($_get['page'])){ $page = $_get['page']; } else{ $page = ''; } class calc{ var $number1; var $number2; function add($number1,$number2) { $result = $number1 + $number2; echo("the sum of $number1 , $number2 $result<br><br>"); echo("$number1 + $number2 = $result"); exit; } function subtract($number1,$number2) { $result = $number1 - $number2; echo("$number1 subtract $number2 $result<br><br>"); echo("$number1 - $number2 = $result"); exit; } function multiply($number1,$number2) { $result = $number1 * $number2; echo(...

jquery mobile - Unable to show config screen as dialog -

i have html file called config.html lives in same directory index.html. the idea load config on startup of app , pop config screen if config's not set. want set config , jump app continues run normally. here method: function _showconfig(callback) { jquery.mobile.changepage("config.html", { transition: "pop" } ); } when run this, executes line, appears loading config screen briefly before whole thing vanishes.

javascript - Selections in D3, Jquery -

in answer mike posted here , overviews 3 different ways apply change matched element based on index or custom filter. i'm trying clarify, more people myself, actual selections in these solutions. so given document 6 svg rects class .bar , have these different selections , return: d3.select(".bar"): [array[1] 0: rect.[object svganimatedstring] length: 1 parentnode: html __proto__: array[0] d3.selectall(".bar"): [array[6] 0: rect.[object svganimatedstring] 1: rect.[object svganimatedstring] 2: rect.[object svganimatedstring] 3: rect.[object svganimatedstring] 4: rect.[object svganimatedstring] 5: rect.[object svganimatedstring] length: 6 parentnode: html __proto__: array[0] $(".bar"): [ <rect class=​"databars" x=​"53.191489361702125" width=​"212.7659574468085" y="4.761904761904762" height=​"11.11111111111111">​</rect>​, <rect class=​"...

html - Whole of button not clickable -

as can see in jsfiddle when try , click button , not 'more' link doesn't work. http://jsfiddle.net/cm5e8/ scss button { padding: 8px 20px; border: 0; @include border-radius(6px); font-size: 0.8em; text-transform: uppercase; float: right; cursor: pointer; display: block; { display: block; color: white; text-decoration: none; } } .green { background: #9fd468; display: block; &:hover { background: #ace175; } &:active { @include box-shadow (inset 2px 2px 1px #759f49); } } html <button class="green"> <a href="<?php the_permalink(); ?>">more</a> </button> the <a> tag around text in button, in order make whole button clickable, need wrap <a> tag around button. here's code: <a href="<?php the_permalink(); ?>"> <button class="green">more</button> </a>

html - When i Zoom out web 4 div go down to next line -

any idea why when zoom out website 4div go down next line. demo: http://autovin.org/tp/ /* reset styles */ * {padding:0px; margin:0px;font-family:segoe ui;} /* background */ body {background:url(images/grids.gif) white;} /* wrapper */ .wrapper {width:998px;margin:0 auto;} /* header */ .header {padding:20px 0 20px 0;} /* navigation */ .nav {background:#82b2c9;color:white;} /* content */ .content {padding:10px 0;overflow:hidden;} /* box */ .box {width:240px; margin:0 10px 10px 0;border:1px solid black;float:left;} .box:nth-child(4n){margin:0;} /* pagination */ .pagination {clear:both;} /* footer */ .footer {background:#82b2c9;color:white;} i use percentages , em units instead of pixels because browsers more compatible them. in case, don't see people zooming out far anyways. want quick fix, suggest rethinking start. read box sizing , percentages. box sizing super great. luck! http://jsfiddle.net/sheriffderek/xr6nc/ html <ul> <li><a h...

multithreading - Multi threading console app issue c# -

i have console app infinite loop , webrequest. but wanted know multi threading library this. so loop gets web request , populates results in mongo database. has done each request. bit stuck approach ideal this? any advice good. thanks you use parallel.foreach , potentially set maximum number of threads, , run operation on entire collection. be aware multithreading require synchronize access shared data. that being said, in scenario, of time waiting on io. such, using asynchronous method calls better threading operations, threading block multiple threads unnecessarily. msdn has nice walkthrough on accessing web using async , await converted use.

visual studio - Hiding VB.NET extension methods / modules -

i have library written in vb.net containing extension methods. vb.net has 2 characteristics in opinion @ odds concept of extension methods: extension methods must declared in module ( extension methods ) all module members @ namespace scope ( type promotion ) this means extension methods either accessible @ namespace level, or not accessible @ all. doesn't make sense, because scope conceptually type extend, not namespace. the fact method declared extension influences naming, because while global utility method might include type, getdictionaryvalueornull , extension method can getvalueornull because should clear declared dictionary type. when extension methods global, can confusing: in (non-dictionary) class has getvalue method. if type "getvalue", visual studio list both "getvalue" , "getvalueornull", making appear though current class supports both operations. is there solution (other "write in c#")? can mark module non-g...

python - I get "TypeError: exceptions must derive from BaseException" even though I did define it -

according python documents, exception derived baseexceptions , should use user defined exceptions. have: class visaioerror(exception): def __init__(self, error_code): abbreviation, description = _completion_and_error_messages[error_code] error.__init__(self, abbreviation + ": " + description) self.error_code = error_code and raise(visa_exceptions.visaioerror, status) but (trackback snippet): file "c:\python32\lib\site-packages\pyvisa\vpp43.py", line 400, in check_status raise(visa_exceptions.visaioerror, status) typeerror: exceptions must derive baseexception note: converting code python 27 32 i have : raise visa_exceptions.visaioerror(status)

How do I post values obtained from an html form to an URL using javascript? -

i'm new html , js , have form few fields need posted url. <form> <div> <label style="font-size:16px" for="title">title:</label> <input type="text" id="title" maxlength="128"/> </div> <div> <label style="font-size:16px" for="description">description:</label> <textarea id="description" maxlength="1999"></textarea> </div> <div> <label style="font-size:16px" for="idnumber">idnumber:</label> <input type="number" id="idnumber"/> </div> </form> i need values entered form posted url knows how process input. i'm sure easy i'm new , i'm having trouble finding solution. apologies incorrect terminology. thanks! you can use action attribute: <form action=...

mysql - Why won't this INSERT INTO statement work? -

this pretty basic question, apologies. i have simple sql (mysql5) table , i'm trying command line insert data it. keeps popping error , have no idea why. this console output: mysql> show columns queries; +-------+-----------+------+-----+-------------------+-----------------------------+ | field | type | null | key | default | | +-------+-----------+------+-----+-------------------+-----------------------------+ | id | int(11) | no | pri | null | auto_increment | | query | varchar(100) | no | | null | | | date | timestamp | no | | current_timestamp | on update current_timestamp | | match | int(11) | yes | | null | | +-------+-----------+------+-----+-------------------+-----------------------------+ 4 rows in set (0.00 sec) mysql> insert queries (query, match) values ('cheese', 4...

visual studio 2010 - How to execute 'msbuild' command from a batch file -

i create batch file make builds vs project in on click. days following steps: opens cmd console administrador go path of project/solution (using cd.., cd commands) write following command make build: msbuild mysolution.sln /p:configuration=debug as commented before, i'd make process in 1 click. so, i'm trying create .bat file it. this code of batch file: set location="c:\mypath\..\myfoldersolution" set pathmsbuild = "c:\windows\microsoft.net\framework64\v4.0.30319\msbuild.exe" @echo off cls call %pathmsbuild% cd %location% msbuild.exe "lucre.sln" /p:configuration=debug pause however, when try execute batch file following error: 'msbuild' not recognized internal or external command, operable program or batch file. any clue or know if possible , if so, how appreciate regards! you're not in right directory, need cd directory msbuild in. try this: set pathmsbuild="c:\windows\microsoft.net\framework...

java - Is there any option to stop applying analyzer? -

hi developing mini application using elastic search. setting :- settingbuilder = xcontentfactory.jsonbuilder().startobject() .startobject("index") .startobject("analysis") .startobject("analyzer") .startobject("custom_analyzer") .field("type", "custom") .field("tokenizer","keyword") .field("filter", new string[]{"standard","ngram_filters"}) .endobject() .endobject() .startobject("filter") .startobject("ngram_filters") .field("type", "ngram") .field("min_gram", "1") .field("max_gram","10") .endobject() .endobject() .e...

Python: Copying lines that meet requirements -

so, basically, need program opens .dat file, checks each line see if meets prerequisites, , if do, copy them new csv file. the prerequisites must 1) contain "$w" or "$s" , 2) have last value @ end of line of dat 1 of long list of acceptable terms. (i can make-up list of terms , hardcode them list) for example, if csv list of purchase information , last item purchased, want include fruit. in case, last item id tag, , want accept handful of id tags, there list of 5 acceptable tags. tags have veriable length, however, last item in list (and 4th item on list) let me give better example, again fruit. my original .dat might be: dgh$g$h $2.53 london_port gyro dgh.$wfft$q5632 $33.54 55n39 barkdust uykj$s.52ue $23.57 22#3 apple wsiajsm_33$4.fj4 $223.4 ha25%ek banana only line: "uykj$s $23.57 22#3 apple" copied because has both 1) $w or $s (in case $s) , 2) last item fruit. once .csv file made, going need go through , replace spaces commas, that...

c# - How do I pass variable arguments from managed to unmanaged with a C++/CLI Wrapper? -

to implement params(variable arguments) functionality in managed domain, following in c++/cli such as: funcmanaged(int n, ...array<int>^ variableparams) i'm dumbfounded on how pass unmanaged domain takes in variable arguments. funcunmanaged(int n, ...) i tried pass array in, ended badly (access violations, junk data, etc). //where unmanagedvariableparamsarray int array funcunmanaged(int n, unmanagedvariableparamsarray); resources suggest create va_list , pass around, vfuncunmanaged(int n, va_list vl) but how create va_list in c++/cli domain take in variableparams ? refactoring legacy unmanaged codebase not desirable solution. if really, desperate not impossible. variadic function can called c code , call has generated c compiler. let's take example: #include <stdarg.h> #include <stdio.h> #pragma unmanaged void variadic(int n, ...) { va_list marker; va_start(marker, n); while (n--) { printf("%d\n"...

How do you use HtmlToPlainText() method from org.jsoup.examples -

mind i've been programming in java 1 week on crash course gentle. i'm writing program take online news article , reader comments , converting them graphml document , i've been getting hang of java , jsoup i'm trying convert comments lightly formatted plain-text lines elements comments = qadoc.select("li[data-comment-id]"); (element comment : comments) { //code commenttext = comment.select("div[class$=d2-body]").first().htmltoplaintext(); //code } but keep getting "error: cannot find symbol" pointing .htmltoplaintext() when try compile i've put import java.lang.object; import org.jsoup.examples.htmltoplaintext; at beginning of class along other imports necessary can't find source htmltoplaintext it's not in cookbook listlinks way not using eclipse ide yet je editor , command prompt in windows thanks htmltoplaintext class in jsoup library, , " method " try call it's constructor, not abl...

jQuery is not loading on any page except front page - Wordpress -

i'm having issue wordpress theme i'm building, in jquery seems load on front page. i've tried playing functions.php file, changing from: wp_enqueue_script('jquery'); to: if (!is_admin()) add_action("wp_enqueue_scripts", "my_jquery_enqueue", 11); function my_jquery_enqueue() { wp_deregister_script('jquery'); wp_register_script('jquery', "http" . ($_server['server_port'] == 443 ? "s" : "") . "://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js", false, null); wp_enqueue_script('jquery'); } as i've read through google, though doesn't seem change anything, no matter put in there can't seem plugins work on single pages. you can see example of single page i'm having trouble @ http://cloggedcap.ca/customer-sites/cloggedcaptestsite/wordpress/projects/toxsic/ images supposed open in lightbox. if check out root of site ...

php - Change Caption of Label -

i'm trying change caption label dinamically, doesn't change. have debugged , variable isn't null. here code: the html file load xml , js files.... here xml file: <?php <object class="mpage1" name="mpage1" baseclass="mpage"> <property name="designconfigname">iphone - vertical (320x480)</property> <property name="designconfigwidth">320</property> <property name="designconfigheight">480</property> <property name="usebackground">1</property> <property name="animations">a:0:{}</property> <property name="background"></property> <property name="caption">mpage1</property> <property name="font"> <property name="family">helvetica, arial, sans-serif</property> <property name="size">16px</property> </property...

javascript - PHP Redirect Loop with cross sessions -

the problem while trying make sessions able go cross domain, ex. m.website.com , website.com have somehow created redirect loop. thing is, when log in on m.website.com goes /home supposed says has redirect loop. know session thing working though because if right after go website.com/home i'm logged in , good. if process vice versa (log website.com/home , try , go m.website.com/home) redirect loop aswell. sqlconnect.php $mysql_host = "localhost"; $mysql_database = ""; $mysql_user = ""; $mysql_password = ""; //establish mysql connection mysql_connect($mysql_host, $mysql_user, $mysql_password); mysql_select_db($mysql_database); ini_set('session.cookie_domain', '.website.com' ); session_name("webtsite"); m.website.com/home.php <?php include "sqlconnect.php"; include "class.user.php"; session_start(); if(!isset($_session['ok'])) { header("location: index...

c# - ComponentOne Report - Changing Forecolor -

i using c1report , want change forecolor of output, cannot. can please tell me what's wrong code? why can not change forecolor? string script = "detail.forecolor =rgb(80,80,80)"; rpt.sections.detail.onformat = script; c1documentviewer1.document = rpt.fixeddocumentsequence; the detail section of c1report not have forecolor property. may try setting backcolor property or may set forecolor property of fields present in detail section.

Django - TypeError on deserializing json from jQuery POST -

i'm pushing fair amount of data via jquery ajax django app in form of json. data received server, can't parse it. in views file, have from django.http import httpresponse django.utils import simplejson def savestrategy(request): if not request.user.is_authenticated: return httpresponse(simplejson.dumps({"response" : "failure"})) else: #this section here throws typeerror - expected string or buffer #update_tasks = simplejson.loads(request.post.get("tasks", false)) #update_strategy = simplejson.loads(request.post.get("strategy", false)) update_strategy = request.post.get("strategy", false) update_tasks = request.post.get("tasks", false) print update_strategy return httpresponse(simplejson.dumps({"response" : "success"})) which destination of if (typeof currenttaskid !== "undefined") { $("#save_strategy_task").trigger("c...

.net - ClickOnce: Shortcut to content file -

i have written , deployed clickonce app has content files located in directory @ same level exe. can find these files under c:\users\vhacpabeaudb\appdata\local\apps\2.0\dz8le60v.jxc\h0472boz.kgp\vapa..tion_2c7673512b48a223_0002.0002_4712fd016c82a834\macros so, can drag 1 of these files on desktop , create shortcut. however, can't share shortcut file user since content file references in different path. is there way reference files in consistent way between click once installations? or there more appropriate place store common files? after research, came no valid answer or way achieve i'm trying do. have play within click-once boundaries.

Magento hide out of stock products -

i have system->configuration->catalog->inventory->display out of stock products option set no . but out-of-stock products still exist in category list. config option works product collection? how can hide out-of-stock products category product collections? do following. go app/code/core/mage/catalog/block folder , copy navigation.php . override navigation.php in local package. open navigation.php of package , paste following code in file: if ($category->getisactive()) { $cat = mage::getmodel('catalog/category')->load($category->getid()); $products = mage::getresourcemodel('catalog/product_collection')->addcategoryfilter($cat); mage::getsingleton('catalog/product_status')->addvisiblefiltertocollection($products); mage::getsingleton('catalog/product_visibility')->addvisibleincatalogfiltertocollection($products); mage::getsingleton('cataloginventory/stock')->addinstockfiltertocollection($pr...

java - Iterate through a number starting at the end and adding every other digit -

i working on school assignment, looking guidance on doing wrong. part of larger program, trying work on loop before implement rest of program. basically, loop suppose iterate through number , add every other number, example: if number entered 48625, return sum of 5+6+4. figured have combine loop if statement iterate through each nth number, worked out far: class testloop{ public static void main (string args[]){ int num = 12345; int sum = 0; for(int = 0; num > 0; i++) { if(i%num == 0) { sum += num % 10; } num /= 10; system.out.println(sum); } } } unfortunately, not working. returns 6,5,5,5,5. not adding nth values planned. i tried following: int num = 12345; int sum = 0; while(num > 0) { sum += num % 10; num /= 10; } but did not work either, returned 15, sum of digits in variable num. know close solution, it's somewhere between 2 ...

Slow loading time for Android App -

i searched , couldn't find relevant answer problem. occasionally, android app slow in loading. use button close app. when start app again, sometimes, app takes time load, after starting other activities main activity. load new activity using intent.flag_activity_single_top flag. i suspect activity didn't stop pressing button; so, when relaunch app @ other time have slow loading. if force stopped app before relaunch, loads immediately. my question should put finish() @ activity when press button? i use intent.flag_activity_single_top make transition activity, right flag use? thanks quote flag_activity_single_top developer.android.com if set, activity not launched if running @ top of history stack. this means activity not being launched. suggest not use flags altogether start activities. cannot sure unless paste code , specify want achieve. another note: doubt want "destroy" app when user presses "back" button. should l...

Convert files xls to pdf with Android and http apache mime -

that such night, write ask if , coregir following code, right through listview , presslong, took path of file, try , turn service: of: http://www.convertapi.com/excel-pdf-api i have not use webview, or use hidden way thank code is: mprefs = getsharedpreferences("rutapath", context.mode_private); string rutasave = mprefs.getstring("externa", ""); string resultcode = "0"; httppost httppost = new httppost("http://do.convertapi.com/excel2pdf/json"); multipartentity entity = new multipartentity( httpmultipartmode.browser_compatible ); // file parameters file=new file(rutasave+"prueba.xls"); //toast.maketext(this,"cargando: " +rutasave+"prueba.xls",toast.length_short).show(); outputdir=rutasave; ...

html - Using GWT and CSS, how to flip vertically all the letter at even positions in input element? -

i use gwt. need flip vertically letter @ positions while keeping letters @ odd positions intact in element. i'm using css style: -webkit-transform: rotatex(180deg). flips whole text in input element. how can implemented using gwt , css? you can rotate text matching css selector. because there no way select individual letter using css, way rotate letters wrapping them spam (or other tag).

ember.js - Ember JS and Multiple single page apps -

say have web app - large, complex, rails app, accounting application. see use several single page apps instead of typical rails round tripping pages. example, can see user better served intuitive single page/dynamic app for: creating bank reconciliation creating invoice filling out time report etc.. these distinct 1 page apps... all ember apps see single page , single purpose. i want have many single page apps, built ember. how respect to: routes: i'd have combination of server routes , client routes. how in ember? serve different ember applications, each own application router , routes? templates: "applets" compiled , pushed down client on load? or leverage require.js , load each single page app depending on if they're navigated to? ... can 2 questions? in advance! routes: i'd have combination of server routes , client routes. how in ember? serve different ember applications, each own application router , routes? depend...

Twitter - share button, but with image -

i want use regular share button on page https://twitter.com/about/resources/buttons#tweet add embedded image site, not link. i know 1.1 api , uploading, making tw application , ask visitor on site to give permission write on timeline share 1 pic site not scenario, think alternatives. i've noticed when paste links of pic uploaded on twitter tweet, if paste link https://pbs.twimg.com/media/bppk_kucmnbxspn.jpg not going embeded, if paste link pic.twitter.com/nudsx1zkwy embeded. think if make profile , app call https://upload.twitter.com/1/statuses/update_with_media.json , upload pic, , paste link in share button tweet pic embeded. or there better way? use php. look twitter cards . trick not in button rather page sharing. twitter cards pull image meta tags similar facebook sharing. example: <meta name="twitter:card" content="summary_large_image"> <meta name="twitter:site" content="@site_username"> <meta ...

svn - Subversion pre-commit hook filtering unwanted files (most generated by quartus & nios) -

i wonder if there's way pre-commit hook used in svnserve can "filter" files based on list of extensions. have prepared list similar global ignore list in "%appdata%/subversion/config" own added patterns such *.cdf *.sof *.elf quartus , nios projects. our primary objective save space filtering out unnecessary files during commit, i.e. not displayed " svn status " i have done lot of searches on google couldn't find satisfying solution. 1 of approaches have write windows batch file automatically enable , replace global ignore list on subversion client side own list. problem obvious: works on single client. if want enforce filtering globally, every single client using repository must execute batch file. not mention not uses windows platform. the next approach have found modify svn:ignore property recursively each pattern can ignored globally. again, method requires client-side operations , it's non-trivial maintain - applies current dire...

Bluetooth pairing from command line in android JB 4.1.1 -

in reference board, using android jelly bean 4.1.1. want use bluetooth command line. know commands enable/disable bluetooth, scanning devices etc. ,but don't know how pair scanned device command line. android jelly bean 4.1.1 using bluez stack bluetooth. can me can pair board other bluetooth device command line. thanks. this worked charm me, of-course requires super-user privileges :) # hcitool cc <target-bdaddr>; hcitool auth <target-bdaddr> courtesy

java - How to get boolean value by executing the Prepared Statement? -

i facing problem. have no idea correct or not. actually, executing prepared statement query return true/false boolean. when query should executed executed successfully, return true boolean; return false. what should do??? the code below: string updatelistquery = "update recon_exception_etm_dcr set group_id = ?, assign_dt = sysdate recon_id = ? , upper(trim(reason_desc)) <> 'reconciled' , trunc(duty_date) = ? " ; try{ conn = connect.getconn(); getgroupnamestmt = conn.preparestatement(updatelistquery); getgroupnamestmt.setstring(1, groupid); getgroupnamestmt.setstring(2, reconid); getgroupnamestmt.setstring(3, defformatdt); flag = getgroupnamestmt.execute(); flag = true; }catch(sqlexception e){ flag = false; e.printstacktrace(); }finally{ try{ conn.commit(); getgroupnamestmt.close(); conn.close(); }ca...

reporting services - SSRS 2008 - Count instances of a returned result -

in ssrs need identify how many times driver logs onto system between user specified dates - have report displaying [driver] "loggedon at" [timeon] "logged off at" [timeoff] "for duration of" [timeoff-timeon] (a bit more thats bones). the resulting report looks , works fine: david niven logged on @ .... duration of 3 hours john jones logged on @ ... duration of 7 hours david niven logged on @ ... duration of 5 hours david niven logged on @ ... duration of 2 hours paul newman logged on @ .... duration of 3 hours etc etc what need provide summary - ie between user specified dates david niven logged on 3 times total duration of 10 hours john jones logged on 1 time total duarion of 7 hours paul newman logged on 1 time total duartion of 3 hours can use expression add number of times each driver logged on in ssrs 2008 , how long ? - if so, how - can give more specific example of query if needed ... many many in advance you can use 2 di...

android - cannot get the response -

fileinputstream fileinputstream = new fileinputstream(sourcefile); url url = new url(uploadserveruri); // open http connection url conn = (httpurlconnection) url.openconnection(); conn.setdoinput(true); // allow inputs conn.setdooutput(true); // allow outputs conn.setusecaches(false); // don't use cached copy conn.setrequestmethod("post"); conn.setrequestproperty("connection", "keep-alive"); conn.setrequestproperty("enctype", "multipart/form-data"); conn.setrequestproperty("content-type", "multipart/form-data;boundary=" + boundary); conn.setrequestproperty("uploaded_file", filename); dos = new dataoutputstream(conn.getoutputstream()); dos.writebytes(twohyphens + boundary + lineend); ...

iphone - Crop letter from image using Masking -

Image
what need: 1) choose image library or camera 2) write , text 3) text cropped image! below image can clarify more on need. i know masking , cropping of image did masking frame in emoji me app . need know how image should cropped according dynamic text. please give suggestions. ... uiimage *image = [uiimage imagenamed:@"dogs.png"]; uiimage *mask = [uiimage imagenamed:@"mask.png"]; // result of masking method uiimage *maskedimage = [self maskimage:image withmask:mask]; ... - (uiimage*) maskimage:(uiimage *)image withmask:(uiimage *)maskimage { cgimageref maskref = maskimage.cgimage; cgimageref mask = cgimagemaskcreate(cgimagegetwidth(maskref), cgimagegetheight(maskref), cgimagegetbitspercomponent(maskref), cgimagegetbitsperpixel(maskref), cgimagegetbytesperrow(maskref), cgimagegetdataprovider(maskref), null, false); cgimageref maskedimageref = cgimagecreatewithmask([image cgimage], mask); ...

javascript - AngularJS - Render HTML tags that are contained in a string -

my database stores product information, , lot of organised lists. load data angular $scope.post . for instance, $scope.post.size_description = '<li> fits true size. take normal size\r</li> <li> slim-cut, mid-rise style</li> <li> long in length, alter fit</li> <li> model wears 48\r</li> <li> model measures: waist size 32, height 6\'1"/ 185cm\r</li>'. when try load data angular app, gets rendered text (i.e. <li> not parsed). understand happens security reasons, there way around it? as damax has said here: https://stackoverflow.com/a/11640420/769083 <div ng-bind-html-unsafe="post.size_description"></div>

php - Asynchronous request in database -

there code: <form name="step1" action="step2.php" method="post"> email: <input type="text" name="email" class="input-medium"> <button class="btn btn-small btn-warning" type="submit">check</button> </form> and that: step2.php <?php $email = $_post['email']; $result = mysql_query("select email,discount buyers email='$email'"); if (mysql_num_rows($result) <= 0) { echo "are new client is't it? <br>"; echo "your discount 0%<br>"; } else{ echo "<br/>nice see again! <br/>"; $getsalary = mysql_fetch_array($result); echo "you discount already: "; echo $getsalary[discount]; echo " %"; } ?> so, possible request in database without submit form , redirect new page (step2.php in example)? mean, query result shown immediately.. think onblur() method, don't know h...

c# - Updating DataGrid after deleting files -

i have wpf application shows , deletes subfiles in gridview after selecting folder folderbrowserdialog() . have datatable , filler() function display subfiles in datagrid. when user clicks button, files deleted. problem is, when delete files, datagrid not refresh. tried datagrid1.items.refresh(); dont know put it, did not worked. in winforms same code, did not encounter problem.here filler() function: private void filler() { string[] files = directory.getfiles(@pathbox.text); table = new datatable(); datagrid1.datacontext = null; (int = 0; < files.length; i++) { if (i == 0) { table.columns.add("name"); table.columns.add("type"); table.columns.add("size"); } fileinfo information = new fileinfo(files[i]); filesysteminfo systeminformation =...

jquery - show hide inputTextarea on click of a commandLink in jsf -

on click of commandlink, inputtextarea should appear/render. here code trying - <h:form id="myform"> <p:commandlink id="onuselink" style="text-align: right; vertical-align: bottom;"> <p:ajax event="click" render=":myform:onuse" ></p:ajax> <h:graphicimage styleclass="rollover imgaligntop" style="border:none;" name="plus.gif" library ="images"/> </p:commandlink> <p:inputtextarea id="onuse" size="15"></p:inputtextarea> </h:form> somebody please help. you don't need p:ajax update component. there update attribute on command button itself. usual way accomplish scenario put textarea in panelgroup. update panel group & apply rendered components. and don't need refer components id attached form id [formid:componentid] when its in same form . try : togglebean.java import javax.fa...

Facebook javascript login using ajax-jquery -

i trying create fb javascript loging using ajax, php. works , fetch required data facebook. once user click on login page gets reloaded twice after login completes , beofre showing data. here code. can point out bug or link? <?php session_start(); $appid = '669340023079549'; $appsecret = '390c04c60d19f38e113ea44f268aca44'; // facebook app secret $return_url = 'http://yoursite.com/connect_script/'; //path script folder $fbpermissions = 'publish_stream,email'; //more permissions : https://developers.facebook.com/docs/authentication/permissions/ ?> <!doctype html> <html xmlns:f b="http://www.facebook.com/2008/fbml" xml:lang="en-gb" lang="en-gb" ><head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script> <title>js/ajax facebook connect</title> <script> function ajaxresponse() { ...

javascript - how to reload page after take printout using jquery? -

below function used take printout of div reloading of page not working after printing(links , jquery ui tabs not working) function printdiv(id) { var divelements = document.getelementbyid(id).innerhtml; var oldpage = document.body.innerhtml; document.body.innerhtml = "<html><head><title></title></head><body>" + divelements + "</body>"; window.print(); document.body.innerhtml = oldpage; } use code: location.reload()

Writing a text file using python -

how can write test below using python text file? required when have write several text files different parameters. my_file = e:\test.jpg band_subset = ( 1 0 0 ) spatial_subset1 = ( 25.0 50.0 ) spatial_subset2 = ( 25.0 50.0 ) para1 = ( 0.0 0.0 0.0 0.0 0.0 0.0 ) end = end with open('filename', 'w') f: f.write(yourstring) where >>> yourstring = """my_file = e:\test.jpg band_subset = ( 1 0 0 ) spatial_subset1 = ( 25.0 50.0 ) spatial_subset2 = ( 25.0 50.0 ) para1 = ( 0.0 0.0 0.0 0.0 0.0 0.0 ) end = end""" you replace values using following code. with open('filename', 'w') f: f.write(yourstring.format(band_subset, spatial_subset_1, spatial_subset_2, para1)) where yourstring = """my_file = e:\test.jpg band_subset = {} spatial_subset1 = {} spatial_subset2 = {} para1 = {} end = end""" always use help function or consult python docs. write(....

UPDATE SQL SERVER -

i have update statement can't cause have insert in column "campo" enitre variable, not function... update tbwordvariabili set campo='ltrim(to_char(mvesposizione, '9g999g999g990d00', 'nls_numeric_characters = '',.'' ' ))' variabile='esposizione_ora' ; update tbwordvariabili set campo='dbo.formatnumber (mvsaldo, '2', ',r2r', 'zero') mvsaldo' variabile='cliente_saldo' ; update tbwordvariabili set campo='cap+' '+localita' variabile='capcitta'' ; update tbwordvariabili set campo=''rata n.'+dbo.lpad(nrata,3,' ')+' - scadenza: '+convert(nvarchar,data,103)+' - importo: '+ cast(imp_totale nvarchar)' variabile='pdr_dettaglio_rate' ; update tbwordvariabili set campo='cap+' - '+localita+ ' ('+provincia+')'' variabile='cliente_loca_full' ; update tbwordvariabili set campo='...

sql - Need a query to insert 'level' into an adjacent list -

i have table so id node parentid 1 0 2 b 1 3 c 1 4 d 2 5 e 2 6 f 3 7 g 3 8 h 3 9 4 10 j 4 11 k 10 12 l 11 i need query generate 'level' field shows how many levels deep particular node is. example below id node parentid level 1 0 1 2 b 1 2 3 c 1 2 ...

excel - How fill in the next row of a list in a spreadsheet using a macro? -

i need write spreadsheet when press button adds row of data , asks parameters needed calculations, cant seem fill in data in next row down? complete begginner macros in excel , have done basic programming matlab on uni course. script far follows: sub addpostol() ' addpostol macro dim rngseek range set rngseek = range("b1") while rngseek <> "" 'if cell isn't empty, drop down 1 row: rngseek = rngseek.offset(1, 0) end rngseek.offset(0, 1) .font .name = "solid edge ansi1 symbols" .size = 11 .value = 1 end <--added end 'don't need call range() around rngseek - range type rngseek.offset(0, 3) = "=rc[-1]" rngseek.offset(0, 4) = "0" rngseek.offset(1, 1) .font.bold = true <--don't need if 1 statement end 'can use statement here if want: rngseek .offset(1, 1) = "x value" .off...

Android show progress bar while image loading dynamically -

in 1 of project, loading images dynamic url. need show loading dialogue still images loads. loading images using async task. new android. please 1 give me little my code looks like. tablelayout table = (tablelayout)findviewbyid(r.id.tablelayout_1); for(integer i=0;i<2;i++){ tablerow rowp = new tablerow(this); rowp.setbackgroundcolor(color.parsecolor("#fff000")); imageview image = new imageview(this); string ed="http://www.domain.com/image.jpg"; image.settag(ed); downloadimagestask td=new downloadimagestask(); td.execute(image); rowp.addview(image); table.addview(rowp); } } private class downloadimagestask extends asynctask<imageview, void, bitmap> { imageview imageview = null; @override protected bitmap doinbackground(imageview... imageviews) { this.imageview = imageviews[0]; r...