Posts

Showing posts from March, 2010

javascript - jquery - how to continue the execution of one function once another function has returned a value -

i have function called showauthorinfo performs animation, , executes other code logic once animation finished: self.showauthorinfo = function(){ var authorid = $authorlink.attr('data-author-id'); //pl-int - determine info needs captured here var isactive = $modalinfowindow.hasclass('active'); self.$modalinfowindow.animate({ 'bottom': '0px' },200,function(){ self.$modalinfowindow.addclass('active'); self.loadauthorinfo(authorid); }) } however, because want show , hide modal window via various function calls, executing different callbacks each time animation completed, i'd wrap animation function. question is, can use above function call custom function animation happens, , have animation function return value function, whereon can proceed? i break function multiple functions, feel complicated, because have pass on function-specific parameters wouldn't apply cases (for example, in code above, if going call anima

ios - Develop for iPhone 4 or 5 First -

Image
i've searched every combination can try , find answer this, i'm sure it's been asked somewhere....so forgive me if can point me in right direction. if you're developing new ios app, setup layout in ib iphone 5 or 4 screen size first? i've found plenty of articles on using autolayout move iphone 4 apps iphone 5, not vice versa....which makes me think desired workflow apps aren't going have separate interface 2 create interface in ib 3.5" screen size , use autolayout adapt iphone 5's 4" screen. can clarify best practice me? kendall geln makes points. better build smaller screen , resize - because shrinking elements provide bad , cramped experience user. on note need make sure graphics (images , videos) sized both screen sizes. when creating graphics, may best create them @ large scale first , size them down needed. another design consideration creating different interfaces 4-inch , 3.5-inch screens. 4-inch screen taller , provid

eclipse - Editor similar to Compare Editor -

is there example showing editor similar eclipse compare editor (simplified)? looking way create editor split in 2 parts top part dsl , bottom ast of dsl. the best place start org.eclipse.compare.compareconfiguration class. after that, can review usage in org.eclipse.ltk.internal.ui.refactoring.texteditchangepreviewviewer.comparepreviewer, org.eclipse.compare.internal.compareeditor/org.eclipse.compare.compareeditorinput ... there lot editors/views in eclipse use stuff.

How to get PC-Lint to print fully qualified function name in message? -

i'm using pc-lint generate xml file contains warnings generated run. the process works almost flawlessly, rather annoying exception. can't message format print qualified function name warning found. prints stripped down function name. no namespace, no class name. here format string use (i've included relevant format info documentation @ end of post): -"format=<message> <file>%f</file> <func>%i</func> <line>%l</line> <type>%t</type> <code>%n</code> <desc>%m</desc> </message>" so, example, this: class bar { void foo(int bar) { } }; the error (lines broken easier reading): <message> <file>d:\code\cpptest\cpptest.cpp</file> <func>foo</func> <line>3</line> <type>info</type> <code>715</code> <desc>symbol 'bar' (line 2) not referenced</desc> </message> as c

iOS App crashes on facebook sdk login button -

i have facebook login button on main screen. can log in , log out using button many times want, , work fine. on layer, there button share score on facebook. there 2 cases: case1 if logged in, shares score. , case2 if not logged in, tells user need log in. share button code: [fbrequestconnection startforpoststatusupdate:message completionhandler:^(fbrequestconnection *connection, id result, nserror *error) { uialertview *alert; nslog(@"%@",error); if (!error) { alert = [[uialertview alloc] initwithtitle:@"you score" message:@"has been published" delegate:self cancelbuttontitle:@"ok" otherbuttontitles: nil]; } else{ alert = [[uialertview alloc] initwit

php - Insert HTML input using ajax. Something wrong with code -

if click on submit button using php, data recorded in mysql. through ajax _autosave.php update works. insert not work. going crazy.... can not understand ajax code in first.php <script type="text/javascript"> $(document).ready(function() { setinterval(function (){ var date_day1=$("#date_day1").val(); var amount1=$("#amount1").val(); data = 'date_day1=' + date_day1 + '&amount1=' + amount1; $.ajax({ type: "post", url: "_autosave.php", data: data, cache: false, /*success: function(){ $(".done").show().html("saved draft!"); }*/ }); settimeout(function(){ $(".done").hide(); }, 1000);// 15 seconds }, 3000);// 1 minute }); </script> html input <td><input type="text" name="date_day1" id="date_day1" value="<?php echo $_post['date_day1']?>" size="1"></td> <td><input type="text&

c# - How to programmatically switch between SlideMaster and Default view? -

i need switch in slidemaster mode selected main parent slide button click. need return default mode , select last selected in mode slide. does know how (for pp2007 / pp2010 / pp2013)? thanks i in way in vba: sub switch_to_slidemaster() dim cursld long cursld = activewindow.view.slide.slideindex 'switch slidemaster application.windows(1).viewtype = ppviewslidemaster 'return default application.windows(1).viewtype = ppviewnormal 'set slide activewindow.presentation.slides(cursld).select end sub i hope cope converting. (tested pp 2010)

ios - Getting Remaining Text After Selection is Cut -

is there simple way of getting remaining text after selection cut? let me suppose have textview control "hello, jim" in it. if "jim" selected, want store "hello" variable, " without using [textview1 cut:self]. in following code, can other part. uitextrange *selectedtextrange = textview1.selectedtextrange; nsuinteger location = [textview1 offsetfromposition:textview1.beginningofdocument toposition:selectedtextrange.start]; nsuinteger length = [textview1 offsetfromposition:selectedtextrange.start toposition:selectedtextrange.end]; nsrange selectedrange = nsmakerange(location, length); nsstring *str = [textview1.text substringwithrange:selectedrange]; nslog(@"%@",str); of course, that's other part. thank help. nsstring *remaining = [textview1.text stringbyreplacingcharactersinrange:textview1.selectedrange withstring:@""];

removeall - Java LinkedHashSet remove some elements from the end -

i working on problem i'm required store elements requirements of no duplication , maintaining order. chose go linkedhashset since fulfilled both requirements. let's have code: linkedhashset hs = new linkedhashset(); hs.add("b"); hs.add("a"); hs.add("d"); hs.add("e"); hs.add("c"); hs.add("f"); if(hs.contains("d")){ //do remove elements added after"d" i-e remove "e", "c" , "f" //maybe hs.removeall(collection<?>c) ?? } can please guide me logic remove these elements? am using wrong datastructure? if so, better alternative? i think may need use iterator removal if using linkedhashset. find element, keep removing until tail. o(n), if wrote own linkedhashset (with doubly linked list , hashset) have access raw linking structure cut linked list in o(1), still need remove elements cut linked list hashset o(n) cost arise

python - Why is the same object throwing a "NoneType" object Attribute error in one instance and not others? -

i using django set cart functionality on ecommerce site. items entered cart_item s in mysql table. before question, relevant code: charm = false if postdata.get('charm_sku'): charm_sku = postdata.get('charm_sku','') ch = get_object_or_404(charm, sku=charm_sku) #get products in cart cart_products = get_cart_items(request) product_in_cart = false # check see if item in cart cart_item in cart_products: if cart_item.product.id == p.id: if charm == true: if cart_item.charm.id == ch.id: # update quantity if found cart_item.augment_quantity(quantity) product_in_cart = true else: if cart_item.charm.id == "": # update quantity if found cart_item.augment_quantity(quantity) product_in_cart = true edit: reworked code shown above, causing both if cart_item.charm.id 's throw attirbuteerror: '

deployment - Capistrano deploy from local machine -

im trying create new user deploy application local machine external server. i've got working using root understand it's not secure use root, therefore want create user called 'deployer'. i've added user external server , copied local is_rsa.pub key /.ssh/authorized_keys on server, when run cap development deploy keep getting following error: failed: "sh -c 'if [ -d /var/www/vhosts/xyz.co.uk/shared/cached-copy ]; cd /var/www/vhosts/xyz.co.uk/shared/cached-copy && git fetch -q origin && git fetch -- tags -q origin && git reset -q --hard 2b738f4ca8008dcf9e84c4be5d63d906a7bfd760 && git clean -q -d -x -f; else git clone -q git@github.com:xyz/xyz.co.uk.git /var/www/vhosts/xyz.co.uk/shared/cached-copy && cd /var/www/vhosts/xyz.co.uk/shared/cached- copy && git checkout -q -b deploy 2b738f4ca8008dcf9e84c4be5d63d906a7bfd760; fi'" on x.xx.xx.xxx if run ssh -t git@github.com on external server say

What is the meaning of "Invalid Argument" and what causes this error when debugging JavaScript in Internet Explorer? -

i getting error when using getelementbyid() . won't post entire program since it's homework assignment, when comment out line of code don't more syntax errors. should looking in rest of code have caused problem? document.getelementbyid("bugone").style.left = xpos + "px"; also- "invalid argument" error caused by? "invalid argument" going runtime error, not syntax error. don't jump getelementbyid() culprit - have lot going on in 1 line of code. debugging, it's useful break complex statements: var bugone = document.getelementbyid("bugone"); var left = xpos + "px"; bugone.style.left = left; in ie8, if set bad value on style property, "invalid argument" error. i'm guessing xpos contains either undefined or nan . set breakpoint in debugger , examine value of xpos .

javascript - Change chart type and redraw with multiple series in Highcharts -

i have dashboard various charts, each adjacent dropdown change type of chart. i'm hoping accomplish redrawing chart rather destroying , creating new one. i first stumbled upon solution seems highcharts team, in investigating, seems broken. upon selecting "column" select, chart re-renders without first series data. found consistent issue...highcharts wants render last series way using "addseries" method: for(var i=0;i<series.length;i++) { serie = series[0]; serie.chart.addseries({ type: newtype, name: serie.name, color: serie.color, data: serie.options.data }, false); serie.remove(); } var chart = new highcharts.chart(options, function(chart){ $('#charttype').change(function(){ changetype(chart.series, this.value); }); }); try selecting "column" in select here: http://jsfiddle.net/2hlr5/ i found had accomplished using older version of highcharts , jquery 1.7.1.

windows - can't send mail in php using external smtp server -

i'm trying send mail out external smtp server using php script below, <?php $recipient="john_doe@gmail.com"; $subject="website customer"; $message="customer name: ".$_post['name']."\r\n"; $message.="customer email: ".$_post['email']."\r\n"; $message.="customer message: ".$_post['msg']."\r\n"; $mailheader="from: <maria@comcast.net> \r\n"; $mailheader.="reply ".$_post['email']; ini_set("smtp","comcast.net"); mail($recipient, $subject, $message, $mailheader); ?> <!doctype html> <html> <head> <title>sending mail website customer</title> </head> <body> <p>thanks, <strong><?php echo $_post['name']; ?></strong>, message.</p> <p>your email address: <strong><?php echo $_post['email']; ?></strong></p> <p

asp.net mvc - unable to display the validation messages from @Html.ValidationSummary() in MVC view -

i have simple form created in partial view , loading form on jquery dialog. view tightly bound model. when user clicks on submit button out entering inputs, need show validation messages. <div> <form method="post" enctype="multipart/form-data" id="ssimform" action="home/processuploadedfile" onsubmit="return false;"> <div> <h3> select file uploaded :</h3> <span> <input type="file" name="uploadfilename" id="uploadfilename" /></span> </div> <div> <h3> select date range :</h3> <span class="uslabel">from date(mm/dd/yyyy): </span> <input class="usdate" id="usfromdate" name="startdate" type="date" /> <span class="uslabel">to date(mm/dd/yyyy): </span&

java - How to determine which platform the current app is running on in LibGDX? -

i need offer different app logic depending on deployment platform libgdx app running on, i.e. desktop or android, etc., does libgdx api offer method of identifying current runtime platform? this post, "abstracting platform specific code in libgdx" offers solution of sorts, i'm wondering if there directly available in api (?). you potentially use application#gettype() , return 1 of values defined application.applicationtype : android applet desktop ios webgl

android - Bundle putIBinder getIBinder deprecated -

it seems bundle has deprecated putibinder , getibinder thought useful passing binders (through bundles) on service. since these deprecated, there alternative this? i need pass ibinder object on service, , thought bundle approach easiest (best) solution this. thanks, j posting may deals binders. use approach, still works bundle // write bundle.putparcelable(key, new parcelablebinder(binder)); // read parcelablebinder value = bundle.getparcelable(key); ibinder binder = binder == null ? null : value.getbinder(); // or possible npe ibinder binder = bundle.<parcelablebinder>getparcelable(key).getbinder() public static class parcelablebinder implements parcelable { ibinder mbinder; public parcelablebinder(ibinder binder) { mbinder = binder; } private parcelablebinder(parcel in) { mbinder = in.readstrongbinder(); } public ibinder getbinder() { return mbinder; } @override public int describecontents() {

How can I seralilze a value in C# to store in a mySql database that WordPress can deserialize? -

i'm building app updates wordpress database; wordpress stores serialized values in of fields. need serialize values , store them in wordpress wordpress can still deserialize them normal, if data entered directly in wordpress. does know how this? here's example of value stores serialized data in mysql: _voucherlocations = a:5:{i:0;s:3:"all";i:1;s:0:"";i:2;s:0:"";i:3;s:0:"";i:4;s:0:"";} all entered in wordpress form "all" when enters "all" in winforms form, has stored same way seen above in mysql database theme i'm using in wordpress recognizes , can use it. hope clear. i'm using c# entity framework 5 , latest mysql data adapater provided microsoft in winforms app. btw if , gets exceptions when trying insert, update or delete operations, it's because entity framework changes identity integer in mysql unasigned decimal; had manually go in entire entity framework generated code , change w

ios - Load an storyboard (UITableViewController) from ViewController -

i want load storyboard viewcontroller. code looks follows: - (ibaction)button_action:(id)sender { uistoryboard * sb = [uistoryboard storyboardwithname:@"addreportview" bundle:nil]; addreportviewvc * vc = [sb instantiateviewcontrollerwithidentifier:@"addreportview"]; [self.navigationcontroller pushviewcontroller:vc animated:true]; } the view pushed not see expected view controller (which uitableviewcontroller) instead see empty gray view controller. remember in both identifier name , storyboard name, capitalization matters. i've gotten wrong many times...

Wordpress: loop through post with custom field -

i loop through posts , category_name=news, how can display each post's custom field? thank in advance. <?php $prenewsposts = new wp_query(); $prenewsposts->query('posts_per_page=3&category_name=news'); while($prenewsposts->have_posts()): $prenewsposts->the_post(); ?> <a href="<?php the_permalink(); ?>" class="atitle" ><?php the_post_thumbnail('thumbnail'); ?><?php the_title(); ?></a> <?php the_excerpt(); ?> <hr style="width: 95%; border: 1px solid #e6e6e6; " /> <?php endwhile; ?> this should work, place inside while loop. make sure change custom_field name of custom field echo get_post_meta($prenewsposts->post->id, 'custom_field', true);

asp.net - Adding link dynamically to Template Field -

i need replace link each data bound item. checked out databound event of datarow. problem can't control link shows up. i'm trying stay away javascript , keep in code behind. below asp code , code behind have. want try keep same possible, not changing html template items. process im using follows. i have custom object contains fields , data of blog entry. items put list , supplied datagrid. <asp:gridview id="grdrecentnews" runat="server" autogeneratecolumns="false" datakeynames="key" gridlines="none" pagesize="4" showheader="false" allowpaging="true"> <pagersettings visible="false" /> <columns> <asp:templatefield> <itemtemplate> <b

jquery - How to regex replace live() function to on() function -

i know regex used in order change $(".delete_package").live("click", function() { into $("body").on("click", ".delete_package", function() { any appreciated :) i don't know phpdesigner, try replace with: regex: \$\((["'][^"']+["'])\)\.live\((["'][^"']+["']) replace: $(document.body).on($2, $1 some regex engines use \ character backreferences, $1 \1 .

java - Underlined JLabel -

i trying make jlabel underlined. searched everywhere, got nothing. in properties, there no option underlining jlabel. can do? jlabel label = new jlabel("<html><u>your text here</u></html>"); label.setcursor(cursor.getpredefinedcursor(cursor.hand_cursor)); or jlabel label = new jlabel("underlined label"); font font = label.getfont(); map attributes = font.getattributes(); attributes.put(textattribute.underline, textattribute.underline_on); label.setfont(font.derivefont(attributes));

multithreading - Windows Multi Timer: Why Timer callback function execute time-out can cause another timer became mess? (deep in Timer implementation mechanism ) -

here source code: #include <windows.h> #include <iostream> using namespace std; #pragma comment(lib, "winmm.lib") uint videotimerid; uint audiotimeid; static void callback onvideotimer( uint utimerid, uint umsg, dword_ptr dwuser, dword_ptr dw1, dword_ptr dw2 ) { cout << "[video-timer] systemtime: " << timegettime() << endl; sleep(30); } static void callback onaudiotimer( uint utimerid, uint umsg, dword_ptr dwuser, dword_ptr dw1, dword_ptr dw2 ) { cout << "----[audio-timer] systemtime: " << timegettime() << endl; } int main() { timebeginperiod(1); videotimerid = timesetevent(40, 1, onvideotimer, null, time_periodic); audiotimeid = timesetevent(128, 1, onaudiotimer, null, time_periodic); while (1); return 0; } in case, ok. output is: [video-timer] systemtime: 10705911 [video-timer] systemtime: 10705951 [video-timer] systemtime: 10705991 ----[audio

javascript - Get only file name from file input on internet explorer -

i need return file name html input file. <input type="file" id="whatever" /> the javascript code im using name of file is: document.getelementbyid("whatever").value; in firefox gives file name want, in ie full path. i think string manipulation way name. what easiest/shortest way name (extension too) in javascript? thanks. you can try var path = document.getelementbyid("whatever").value; var filename = path.match(/[^\/\\]+$/); console.log(filename);

c++ - overloading operators for struct as map key -

hi i'm having problems overloading operator of struct use key. here struct intend use map key, has 2 char arrays: struct fconfig { char product[3]; char exchange[4]; bool operator < (const fconfig &rhs) const { return (strcmp(product, rhs.product) < 0 || strcmp(exchange, rhs.exchange <0)); } }; my comparison long 1 of product or exchange not equal rhs's, key considered unique. use , "invalid operator <" during runtime. i'm totally new @ creating keys, i'm still having trouble understanding logic when overwriting < operator. appreciate help, thanks! your confusion how operator < should work pretty common. want this: bool operator < (const fconfig &rhs) const { int product_comparision = strcmp(product,rhs.product); if (product_comparision<0) return true; if (product_comparision>0) return false; return strcmp(exchange,rhs.exchange)<0; } since pro

javascript - fade background image of div, and text within it -

using jquery, i'd cycle through 3 different background-images , 3 sets of text within "box", fading next every 6 seconds. css: .box { background: url(/filepath/to/image.jpg) no-repeat center center; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; } html: <div class="box"> <h1>headline</h1> <h2>sub-text</h2> </div> what's best way this? you can't fade between background images of same element. suggestion insert 3 (or many want, really) images, positioned absolutely on top of each other , fade between those. you can same text elements you'd fade through, or construct series of divs containing combination of both. actually, there's infinite number of approaches take achieve effect you're describing, trying fade background-image ain't 1 of them. <div class="box"> <div class="slide bg1&qu

python - I want collect all characters and events that end with a certain text? -

i want collect data before specified text or ends it, have tried following: .{30}value_*|.{55}value2_* but have specify how many characters want collect before specified ending text, want collect of them (note im dealing python/perl regexes here) try like: "(.+?)value_*|(.+?)value2_*" without knowing data looks can't more specific. break down: .+ matches 1 or more characters, while ? makes non-greedy, doesn't consume entire line @ once, , parentheses capture match (in python @ least).

c# - Sitecore - Update workflow history -

is possible programmatically set workflow comment? e.g. admin user "reject" item workbox, ask comment. later on, our agent process retrives comment , send email. need custom module same thing (admin reject functionality). it same code used sitecore set workflow comment guess... below code executing of workflow commands assuming know id of command item: public bool execute(item item, id commandid, string comment) { var workflowid = item[fieldids.workflow]; if (string.isnullorempty(workflowid)) { throw new workflowexception("item not in workflow"); } iworkflow workflow = item.database.workflowprovider.getworkflow(workflowid); var workflowresult = workflow.execute(commandid.tostring(), item, comment, false, new object[0]); if (!workflowresult.succeeded) { var message = workflowresult.message; if (string.isnullorempty(message)) { message = "iworkflow.execute() failed unk

Php - How do I use a for loop inside API request -

here sample request works, names hard coded $client->batchdeleteattributes(array( 'domainname' => $domainname, 'items' => array( array('name' => '5149572a86deb5161fbb22bdab',), array('name' => '5149572a86deb5161fbf7487b9',), ) )); i can name values using following loop foreach($_post['d'] $key => $value) { } i confused how integrate foreach loop api request. assume need create array using foreach loop , use array in api request don't know syntax. thanks! without knowing format of $_post data it's hard give detailed solution, along these lines should heading in right direction: $names = array(); foreach ($_post['d'] $value) { $names[] = array('name' => $value); }

ruby - Redmine Plugin Partials not being found -

i have been following redmine plugin tutorial , read page on hooks , still can't plugins partials render, using render_on keyword or otherwise. here's i'm putting partials: app └── views ├── issues │   └── _issue_mail_settings_form.html.erb └── projects └── _mail_settings_form.html.erb here class render_on keyword, in lib directory: class mailsettingissuehooks < redmine::hook::viewlistener render_on :view_issues_form_details_bottom, :partial => "issues/issue_mail_settings_form" end in init.rb require 'mail_setting_issue_hooks' . if load redmine this, can't view page issues - 404 error. console output request here , though doesn't useful. if define method named view_issues_form_details_bottom in mailsettingissuehooks , returns string, renders correctly. how render_on keyword decide p

jquery - Sending JSON object to WCF Rest Service -

i trying application working using rest, wcf , json (new technologies). have 'get' working fine. 'post' causing me problems. as see below 'pack up' json using json.stringify, fire off post rest resource. however, when object gets wcf method handling request object null. here code: $(document).ready(function () { var input = { customer: { customerid: "1", firstname: "luke", lastname: "sayaw", email: "lumsayaw@gmail.com", mobile: "0433395106", state: "qld" } }; $.ajax({ url: 'http://local.rest/restservice.svc/getcustomer', contenttype: "application/json; charset=utf-8", data: json.stringify(input), datatype: 'json', type: 'post', async: true, succes

c# - Passing Object vs String as Method Paramter -

with following code, understand getstringagain(classone.str1) better getastring(classone) because want pass in necessary because of data hiding/encapsulation etc. however, there memory benefits? classone object larger string, since in both methods, passing in reference object, , therefore reference copied stack, both efficient in terms of memory? class classone() { public string str1 = "string1"; public string str2 = "string2"; } class classtwo() { public classtwo() { classone classone = new classone(); string = getastring(classone); string b = getstringagain(classone.str1) } private string getastring(classone classone) { return classone.str1; } private string getstringagain(string str) { return str; } } string , class reference types it means 2 functions take reference managed heap actual data held nothing copied. if know pointers basicly same passing poin

actionscript 3 - How to refresh itemrenderer in flex -

Image
i have developed flex application contains itemrenderer displays list of items. problem if select item background gets highlighted , if go page , come same page again, item had selected before still highlighted. there solution can refresh itemrenderer clear highlighted background every time when open page? so sounds when "go page , come back" you're navigating other screen in app , returning screen has list. item says selected because view being re-used. it's not new view being created scratch... to remove selection list, can set selectedindex of list -1, or perhaps set selecteditem of list null (or perhaps undefined docs state). can either of these things right before navigate next screen, or when navigate list. there's few more ways solve this: don't re-use view reset dataprovider on list when navigate back etc... but setting selectedindex or selecteditem efficient method.

c# - Servicestack - Order of operation Fluent Validation and Request Filters -

we have few request filters , utilise validation feature. [attributeusage(attributetargets.method, inherited = true)] public class myfilterattribute : attribute, ihasrequestfilter { ... } in apphost: public override void configure(container container) { .... plugins.add(new validationfeature()); .... } i need fluent validation run after request filters, filters add data dto validated. have seen order of operations doesn't validation fits in...at least didn't see. any appreciated. the validationfeature things in servicestack simple plugin source code can found going servicestack github repo pressing 't' activate github's find files feature , start typing in parts of class name, e.g vfe bring validationfeature first result. inside validationfeature can see in iplugin.register(iapphost) feature how works: public void register(iapphost apphost) { if(!apphost.requestfilters.contains(validation

folder - How to find files whose paths do not exist in the text file using powershell -

i need check , return files exist in filesystem, not listed in given text file. instance, text file (sample.txt) contain paths like: \\shareddrive\data\devs\common\app_name\subfolder1\archive\archive1.vbproj \\shareddrive\data\devs\notcommon\app_name\subfolder1\user\webapp.vbproj \\shareddrive\data\devs\uncommon\app_name\subfolder1\manager\managerial.vbproj it happens there vb project files exists on drive not among list, want return along full path. instance: \\shareddrive\data\devs\common\app_name\subfolder2\windows\sharedarchive.vbproj \\shareddrive\data\devs\notcommon\app_name2\subfolder1\user2\webapp2.vbproj i tried this: $log = "e:\pshell\notexists.log" get-content "e:\pshell\sample.txt" | where-object { #keep paths not exists !(test-path $_) } | set-content $log but other way around. try this: $basedir = "\\shareddrive\data\devs" $log = "..." $paths = get-content sample.txt get-childitem $basedir -recurse -fil

Insert comma separated values in single column of mysql table using c# -

this question has answer here: syntax error due using reserved word table or column name in mysql 1 answer i have many fields has comma separated values in it. have insert them in mysql table hometoschool[0] = "name"; hometoschool[1] = "mumbai, 400080, india"; hometoschool[2] = "malad, mg"; var cmdtext ="insert schoolschedule(name, from, to) values (@name, @from, @to)"; cmd.parameters.addwithvalue("@name", hometoschool[0]); cmd.parameters.addwithvalue("@from", hometoschool[1]); cmd.parameters.addwithvalue("@to", hometoschool[2]); connection.open(); cmd.executenonquery(); i getting error due comma separated values. i bet error message this: "you have error in sql syntax; check manual corresponds mysql server version right syntax use near 'from, to) values.." act

twitter bootstrap - How to Dynamically change Themes of website using ruby on rails -

in website want dynamically assign themes in application.erb.html using dropdown on selected change of ruby on rails application.. my application.html.erb file follows <%= stylesheet_link_tag "#{current_theme}" %> <%= select_tag(:current_theme, options_for_select([['cerulean'], ['superhero'], 'amelia'], ['cosmo']])) %> i want change current theme dynamically requirement want assign theme on dropdown select change please me first of need create separate directories each theme can managed in convenient way. next select default theme , store in browser session. when user changes theme need trigger change event on dropdown, update session , select theme. in layouts/application.html.haml this. <%= stylesheet_link_tag "#{session[:theme]}" %> <%= select_tag(:current_theme, options_for_select([['cerulean'], ['superhero'], 'amelia'], ['cosmo']])) %>

php - How to hide previous table rows that were shown based on previous search -

the idea of following code user search based on maintenance operation no, operation type, member performs operation, or employee pc needs maintenance. when user selects, example, operation type, drop-down menu show , selects type. after table of maintenance information show up. example, user selects type printing. table show following information: operation no, member name, employee name, maintenance type 1001, adem, john, printing 1003, george, smith, printing 1010, william, john, printing the problem facing when user selects search operation no, example, , selects operation no 1001, rest of rows (1003 , 1010 shown based on previous search) still shown (they must hidden because not match search type). the code is <script> function check() { var dropdown = document.getelementbyid("optype"); var current_value = dropdown.options[dropdown.selectedindex].value; if (current_value == "opno") { document.getelementbyid("operatio

java - Print Fibonacci number -

my program supposed output fibonacci number based on user has entered (ex. if enter 7 program output 13). portion works. part having trouble when program checks makes sure number user entered positive , less or equal 70. it supposed ask user input again, instead outputs "fibonacci #-1 0" , stops. here's code: import java.util.scanner; public class scalvert_fibonacci { public static void main ( string args[] ) { scanner input = new scanner ( system.in ); int sum = 0; int num; int f1 = 0, f2 = 0, f3 = 1; system.out.print("which fibonacci number like? "); num = input.nextint(); if (num == 0) return 0; else if (num == 1) return 1; while (num < 0 || num > 70) { system.out.print("which fibonacci number like? "); num = input.nextint(); } for(int = 1; <= num; i++) { f1 = f2; f2 = f3; f3 = f1 + f2;

javascript - Enhancement for HTML Drag and Drop upload file? -

i know question bit naive, think it's put on here anyway. i have html drag , drop upload file. question if possible when user clicks on droparea (beside normal behavior drag , drop file droparea) , select file dialog opened , when user selects files, can call drop events , start process of normal drag , drop. is possible or has done or thought of that? thanks i've had success binding drop events on input element. see jsfiddle here: http://jsfiddle.net/lpvcm/ good luck! html <div id="container"> <div id="instructions">drag file here.</div> </div> javascript var container = document.getelementbyid('container'), file = null, instructions = document.getelementbyid('instructions'); addfileinput(); function addfileinput() { var el = document.createelement('input'); el.setattribute('type', 'file'); el.setattribute('class', 'fileinput&

android - Can we make a complete server side app using cross platform like titanium and phonegap -

i want make app ios , android , want app should cross platform.the basic purpose of email social sites mean if body uses in company can see catalogs of videos , audio , record audio video app possible make using java script cross platform or have make different ios , android cross-platform frameworks such titanium or phonegap/cordova can build cross-platform application ios , android using javascript. however use of native features such camera, not easiest thing use, not implemented in frameworks , not mobile operating systems. but in case, titanium or phonegap should able handle features need android , ios, plus if feature not implemented yet, can still use or write native plugin framework, give more flexibility.

python - How can one find the Unicode codepoints that a font has glyphs for, on a Debian-based system? -

from scripting language (python or ruby, say) on debian-based system, find either 1 of: all unicode codepoints particular font has glyphs for all fonts have glyphs particular unicode codepoint (obviously either 1 or 2 can derived form other, whatever easier great.) have done in past running: fc-list : file charset ... , parsing output @ end of each line, based on this code fontconfig seems me there ought simpler way of doing this. (i'm not sure right stackexchange site question, looking answer can used programmatically.) i try of freetype 2 language bindings . here's perl solution list unicode code points of font using font::freetype : use font::freetype; font::freetype->new->face('dejavusans.ttf')->foreach_char(sub { printf("%04x\n", $_->char_code); });

httpresponse - can not send response message from httpserver created using java -

i creating httpserver in application, using: httpserver server = httpserver.create(new inetsocketaddress(8000), 0); this server first send response message using outputstream os = httpex.getresponsebody(); os.write(("your request being handled, please wait").getbytes()); and opens 1 jfilechooser. if goes wrong throw error using os.write(("failed handle request").getbytes()); when application runs on user's machine, creates httpserver properly, find through logs when user sends request server, nothing happens. displays blank page. when remove os.write lines works fine , displays filechooser pop-up. not aware going wrong. please me on this. have tried these approaches: try { os.write(("your request being handled, please wait").getbytes()); os.close(); //code open jfilechooser pop-up } catch (exception e) { os.write(("failed handle request because"+e.getmessag

javascript - Operations with window.open -

i have javascript code opens page doing following: location.href("newpage.cfm?param1=xxx&param2=yyy"); the "newpage" must return previous, passgin parameters, this: location.href("prevpage.cfm?param1=www&param2=kkk") . now, want same thing, open newpage, using: window.open my question is: how can return previous page, closing new 1 ( window.close ), passing new parameters? you can access previous window using window.opener . http://www.w3schools.com/jsref/prop_win_opener.asp so need change code to: window.opener.location.href("prevpage.cfm?param1=www&param2=kkk"); window.close(); this in opened window.

css - using BOXY JQuery plugin -

i using following boxy plugin of pages. boxy plugin i have different style of outer box of boxy popup each page. issue had noticed hardcoded html , css classes in boxy.js file. can please me out , point me right direction? use different styling per page using same boxy plugin. thanks you can overwrite css properties if: it has more specific selector (eg. img.myclass beats .myclass ) it defined later in code you use !important in property though !important feature misused, causing many developers not it, it's in fact useful when used correctly. when want overwrite 3rd party css example ;) .myclass { color: red; } .myclass { color: blue !important; /* overwrites red color */ }

c# - How do I show a HTML editor in an ASP.NET MVC 4 page -

i have been working on mvc app. use @html.editorfor(model => model.textfield) display textbox. now want use wysiwyg html editor instead don't know how incorporate razor view. have field set allow html in model. any advice appreciated. if want use tinymce can this: the model public class editormodel { [uihint("tinymce_full"), allowhtml] public string textfield { get; set; } } the template under shared -> editortemplates @* don't forget reference jquery library here, inside view or layout. <script src="@url.content("~/scripts/jquery-x.x.x.min.js")" type="text/javascript"></script> *@ <script src="@url.content("~/scripts/tinymce/jquery.tinymce.js")" type="text/javascript"></script> <script type="text/javascript"> (function () { $(function () { $('#@viewdata.templateinfo.getfullhtmlfieldname(string

converting the coordinates of a 300 dpi image to coordinates of a 72 dpi image -

i'm working on tess4j project , using tess4j, i've gotten coordinates of words in image. problem is, these coordinates tiff image. project involves writing layer of text overr image in pdf document. take resolution of pdf document 72dpi. coordinates morphed , placed. if can bring down resolution 300 dpi 72dpi , pass image tessaract, wont coordinates need? if not, alternatives? tried multiplying coordinates 300/72. surprisingly, doesnt work. thanks in advance! to convert 300dpi 72dpi, need multiply 72/300, not other way round. in floating point or multiplication first , division then, in (x * 72) / 300. pdf units 1/72 of inch. scaling down original image not idea, since loss of information reduce output text quality.

image - Error in else value on android -

i want change visibility when special status so else else { imageview image_a_wrong = (imageview)findviewbyid(r.id.imageview1); image_a_wrong.setvisibility(view.gone); } but appear error on eclipse. do know why ? my imageview <imageview android:id="@+id/imageview1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/quo100px" android:visibility="gone" /> tks advance all here complete file package com.example.androidhive; import java.util.arraylist; import java.util.hashmap; import java.util.list; import org.apache.http.namevaluepair; import org.json.jsonarray; import org.json.jsonexception; import org.json.jsonobject; import android.app.listactivity; import android.app.progressdialog; import android.content.intent; import android.os.asynctask; import android.