Posts

Showing posts from July, 2011

javascript - Issue with jquery select all option -

i have code here need in order make possible multiple selection. now, @ moment optionally, chose single selection or multiple selection, code below: <span>selection mode: </span> <select onchange="$('#dg').datagrid({singleselect:(this.value==1)})"> <option value="0">single row</option> <option value="1">multiple rows</option> </select><br/> selectoncheck: <input type="checkbox" checked onchange="$('#dg').datagrid({selectoncheck:$(this).is(':checked')})"><br/> checkonselect: <input type="checkbox" checked onchange="$('#dg').datagrid({checkonselect:$(this).is(':checked')})"> what can in order make multiple selectable? thanks.. remove that. in page's javascript file, or in embeded <script> block write: $('#dg').datagrid({singleselect:false});

objective c - GPUImage memory usage -

i noticed more use gpuimage, more memory app takes on time (using instruments monitor memory use). as example, use each filter in different methods: (uiimage*)toonfilter:(uiimage*)theimage { gpuimagesmoothtoonfilter *smoothtoonfilter = [[gpuimagesmoothtoonfilter alloc] init]; [smoothtoonfilter settexelheight:0.0025]; [smoothtoonfilter settexelwidth:0.0025]; return [smoothtoonfilter imagebyfilteringimage:theimage]; } (uiimage*)sketchfilter:(uiimage*)theimage { gpuimagesketchfilter *sketchfilter = [[gpuimagesketchfilter alloc] init]; [sketchfilter settexelheight:0.003]; [sketchfilter settexelwidth:0.003]; return [sketchfilter imagebyfilteringimage:theimage]; } (uiimage*)pixellatefilter:(uiimage*)theimage { gpuimagepixellatefilter *pixellatefilter = [[gpuimagepixellatefilter alloc] init]; [pixellatefilter setfractionalwidthofapixel:0.01; return [pixellatefilter imagebyfilteringimage:theimage]; } and h

javascript - Can't remove cookies, which are generated by PHP -

here how create cookie in php , javascript php, before loading page, first create cookie via php . setcookie('my_key', $value, 0,admin_cookie_path); javascript. i'm using jquery cookie plugin. when dropdown changed, change cookie value. jquery.cookie("my_key", selected); in google chrome, works expected. the value of my_key cookie altered when dropdown changed. in firefox, generates identical cookie. yes, identical my_key cookie generated php: same name, same expire(browser session), same domain, same path, same httponly(blank), same security(blank) the difference new cookie set new value. i try jquery.removecookie('my_key') can delete new cookie. i'm not sure if bug of firefox, or did wrong. but, truly, annoying issue. update 1: it's true didn't specific path in javascript , right can change cookie generated php when set path. still not able delete cookie via js. fyi, i'm able delete cookies in php

iscroll4 - Why does iScroll is bouncing back to initial position? -

i using iscroll , works until 1 point @ point scrolling area bouncing back. settimeout(function () { var gridscroll = new iscroll('iscroll-wrapper-grid'); }, 100); http://jsfiddle.net/hjakw/ ul { margin:0; } fixes problem. not sure why iscroll doesn't take margin account. maybe says in docs that.

python - Creating Period for Multi Quarter Timespan in Pandas -

many companies release quarterly financial data maps nicely pandas period: p = period('2012q1', freq='q-dec') which in filings labeled "three months ended march 31, 2012". however financial data released in form: "nine months ended september 30, 2005". how create period object "nine months ended september 30, 2005"? another way of expressing period "2005(q1-q3)". i asked: extract quarterly data multi quarter periods

Creating javascript regex tp replace characters using whitelist -

i'm trying create regex replace characters not in specified white list (letters,digits,whitespaces, brackets, question mark , explanation mark) code : var regex = /^[^(\s|\w|\d|()|?|!|<br>)]*?$/; qstr += tempstr.replace(regex, ''); what wrong ? thank you the anchors wrong - allow regex match entire string the lazy quantifier wrong - wouldn't want regex match 0 characters (if have removed anchors) the parentheses , pipe characters wrong - don't need them in character class . the <br> wrong - can't match specific substrings in character class. the \d superfluous since it's contained in \w (thanks alex k.!) you're missing global modifier make sure can more 1 replace. you should using + instead of * in order not replace lots of empty strings themselves. try var regex = /[^\s\w()?!]+/g; and handle <br> s independently (before regex applied, or brackets removed).

database - Will "where `id` in (...)" be comparable in performance with common "where" statement? -

the title tells all. let's say, have separate class, serves query processor in dsl. is, feed query in dsl, , runs query. this query processor talk whatever database connector library use , extract only ids of records matching criteria. this... let's "sets", of ids fed class actual orm on database , constructs domain objects records having ids. this way not need include query parsing abilities orm mechanics , have totally dumb method fetch records ids. as addition, let's suppose have types of caching imaginable, starting web page cache down dbms query cache. will scheme have bad performance compared traditional building of (sql or, maybe, mongodb-style) queries , running them on database directly? i understand require 2 queries per fetch operation, instead of one. question magnitude of difference. my overall goal separate interface queries interface of actual objects gotten queries. example, yii's cactiverecord s fail @ it, being combinatio

c# - Difficulty in understanding class Property declaration -

this question has answer here: what bool? return type mean? 3 answers a curious c# syntax question mark 3 answers i going through class library in 1 of our projects. i came across statements public int? variablename what mean..i going create classes new application refering current application . so ,i know , in scenarios can use , not possible avoid it int? means "nullable". being nullable allows have null values in int. check out link if need understand bit more, http://msdn.microsoft.com/en-us/library/2cf62fcy%28vs.80%29.aspx how nullable types work in c#?

apache - redirect based on directory in path via .htaccess -

via .htaccess, how redirect this http://www.somedomain.com/de/foo to this: http://www.de-domain.com/foo the redirection should depend on second parameter, in example above "de". depending on server configuration should able on .htaccess somedomain.com . if works appropriately might try [r=301,l] make redirection permanent: rewriteengine on rewritecond %{http_host} ^(www\.)?somedomain.com$ rewriterule ^([a-z]{2})/(.*) http://www.$1-domain.com/$2 [r,l]

extjs4 - ExtJS 4.2.1 - Cannot get View instance from the controller -

in app have viewport 1 item, main view, simple class extending ext.container.container. i have main controller too, , i'm trying view instance, dynamically can push corresponding items if user logged or not. i've tried using views: ['mainview'], refs[ { selector: 'thextype' }], etc no luck. i using reference (ref) in sencha touch kind of things, can me extjs v4.2 ? just clarification, i'm not trying dom element, i'm trying view instance associated methods. thanks in advance, define xtype of view: xtype: 'mainview' and in controller: requires: ['...'] // view class // ... refs: [{ ref: 'mainview', selector: 'mainview' // xtype }] and can instance of view in controller this.getmainview()

ruby on rails - Send multiple files to a webservice -

i'm trying send multiple files webservice (and proceed, depending on response afterwards, that's not @ yet). following code sends 1 file: def show ... conn = faraday.new(:url => 'webservice.abc' ) |faraday| faraday.request :multipart faraday.adapter :net_http end payload = { :files => faraday::uploadio.new("#{rails.root}/fileone.xml", 'application/xml') } conn.post 'http://webservice.abc', payload @output = response.body end and i'm stuck, trying find way send 2 (or more) files @ once, necessary purpose of webservice compare these. seems when put them array, can't handled with. i'm looking way "bundle" files in order post them afterwards (as said before- works 1 file) tyia time thanks deepak, gave me hint right direction. should :files[i], though- payload line question reads: payload = { :files[0] => faraday::uploadio.new("#{rails.root}/fileone.xml", &

c# - Toggle EF5 Connections During Runtime -

i've got project in ui have radio button list consists of 2 elements: development , production. in project i'm using ef5 model sprocs accomplish database ops. want create way use radio buttons toggle between development , production database servers during runtime cannot find way of doing this. need replace database server portion in connection string located in app.config. using transforms not appear option here. is there way can accomplish without having reconstruct ef connectionstring? you use dependency injection , have 2 dbcontext classes. based on radio button value, can determine dbcontext use. or in dbcontext constructor, pass in connection string use: public class mydbcontext : dbcontext { public mydbcontext(string connstringname) : base("name=" + connstringname) { } }

ssh - Reading netCDF files stored on a remote filesystem in R? -

i need read netcdf file r stored on remote filesystem. have ssh access filesystem, files big store onto local computer. i have tried advice here: can r read file through ssh connection? tried following: library(ncdf) d = open.ncdf(pipe('ssh hostname "path/to/file/foo.nc"')) however, keep getting error bash: path/to/file/foo.nc: permission denied any ideas on how fix this? it not possible open file directly within r using ssh, there few options available you. 1. mount remote server local filesystem on ssh. there packages let mount remote machines local filesystems on ssh; on linux, example, might use sshfs whereas on windows might use win-sshfs . once you've mounted remote file system, able access netcdf files r other file, although i'm not sure performance implications may be. ssh(sftp) filesystem windows: http://code.google.com/p/win-sshfs/ ssh filesystem: http://fuse.sourceforge.net/sshfs.html 2. break larger files down sm

sql - How can I stop the delete on a parent if a child entity that references that parent exists? -

i have following ddl using sql server 2012: create table subject ( [subjectid] int identity (1, 1) not null, [name] nvarchar (50) not null, constraint [pk_subject] primary key clustered ([subjectid] asc) ) create table topic ( [topicid] int identity (1, 1) not null, [name] nvarchar (50) not null, [subjectid] int not null, constraint [pk_topic] primary key clustered ([topicid] asc) ) alter table [topic] check add constraint [fk_topicsubject] foreign key([subjectid]) references [subject] ([subjectid]) on delete cascade create table subtopic ( [subtopicid] int identity (1, 1) not null, [topicid] int not null, [name] nvarchar (4000) not null, constraint [pk_subtopic] primary key clustered ([subtopicid] asc) ) alter table [subtopic] check add constraint [fk_subtopictopic] foreign key([topicid]) references [topic] ([topicid]) on delete cascade when try run scripts following message: {"introducing foreign key cons

iis express - How do I bypass the 'ports, protocols and domains must match' CORS issue whilst in development? -

i have local site running asp.net mvc 3 on http , https through iis express. the http url http://localhost:4000 , https https://localhost:44301 . i'm trying hook stripe payments api not port, protocol , domain mismatch. i've tried using cors tell trust stripe.com seems due port mismatch , cannot figure out how tell ignore that. adding following header not product difference. access-control-allow-origin:* when accessing payment page via http, following: blocked frame origin " https://checkout.stripe.com " accessing frame origin " http://localhost:4000 ". frame requesting access has protocol of "https", frame being accessed has protocol of "http". protocols must match. it gets worse when using ssl local ssl port not 443. how tell cors ignore port mismatch whilst in development? you can disable same origin policy while in development. load chrome following argument: --disable-web-security https

asp.net mvc 4 - How to configure multiple sitemaps using MVCSiteMapProvider v4 with StructureMap DI -

the problem, essentially, can't sitemap config support multiple sitemaps. it's looking "default" when name instances , request another. background. i've been pouring on docs new implementation of mvcsitemapprovider. using dependency injection configure sitemapprovider. have existing structuremap di implementation, followed instructions , added, in our case objectfactory.configure(x => { ... x.addregistry<mvcsitemapproviderregistry>(); ... }); then started tweaking mvcsitemapproviderregistry.cs file implement multiple sitemap scenario. have multiple site map files, either work long it's called "default". if remove "default" item breaks , complains "default" missing. assume because can't find instance. here's how have them defined. suspect problem somewhere in here... loader says have configure in global.asax looking isitemaploader i'm adding multiple configuration sitemapbuilderset... anyway

javascript - Replace d3.js symbols with images -

referring fiddle example : i need replace symbols images...or possibly single image @ first..like instance, image: https://github.com/favicon.ico what trying in code follows: vis.selectall("path") .data(nodes) .enter().append("path") .attr("transform", function(d) { return "translate(" + d.x + "," + d.y + ")"; }) .append("image") .attr("xlink:href", "https://github.com/favicon.ico") .attr("x", -8) .attr("y", -8) .attr("width", 16) .attr("height", 16) .style("stroke", "black") .style("stroke-width", "1px") .call(force.drag); it appending image tag each of path tags, not showing image itself. hints? you're appending each image child of each path. want append group contains both path , image (which think asking in first com

iis 7 - CA Certificate request failure - The RPC server is unavailable - DCOM was unable to communicate with the computer -

This summary is not available. Please click here to view the post.

asp.net - Unable to attach to application WebDev.WebServer40.exe Visual Studio has insufficient privileges -

unable attach application webdev.webserver40.exe visual studio has insufficient priveleges debug process. i getting following error when trying debug simple new asp.net web application. thanks help. i closed visual studio , killed visual studio processes. after restarted visual studio , worked me.

c# - Does the SQL Server CE engine have to be told the commandtype is text if that should be obvious? -

i've got code: using (sqlceconnection sqlconn = new sqlceconnection(@"data source=\my documents\\platypusdb.sdf")) { sqlconn.open(); string dmlstr = "insert platypus_settings (setting_name, setting_value) values(?, ?)"; sqlcecommand cmd = new sqlcecommand(dmlstr, sqlconn); cmd.commandtype = commandtype.text; //<-- necessary? cmd.parameters[0].value = settingname; cmd.parameters[1].value = settingval; try { cmd.executenonquery(); } catch (exception ex) { platypus.exceptionhandler(ex, "writesettingsval"); } } ...but don't know if commented line needed, bloatcode, or doesn't matter either way? ... don't know if commented line needed no. not because it's obvious because happens default. from msdn : property value 1 of commandtype values. default text. having said that, not bloat-code , might include it, make code little less ambigious read

Multiple comparison of string variable in perl -

i'm trying make kind of bash-like case statement in perl using if operator. my $var = shift @argv; print "err\n" if (!$var || ($var ne "one") || ($var ne "two")); the problem is, 'if' statement not work expected. example, if pass input 'one' or 'two' prints 'err', but, if swap 'ne' 'eq' script works correctly. perl version 5.16.3 linux read on de morgan’s laws : not($p && $q) == (!$p || !$q) not($p || $q) == (!$p && !$q) if allowed values "one" or "two" , write: print "err\n" unless defined $var , $var eq "one" || $var eq "two"; if want use ne , then: print "err\n" if ! defined $var or $var ne "one" && $var ne "two"; these 2 forms equivalent. if have more 2 allowed strings, gets easier , more efficient using hash: my %allowed; @allowed{"one", "

javascript - Run function on click in an specific container -

i have 2 questions: first how can change function, triggerd when user clicks on div id "canvascontent": event.add(window, "load", function() { and more important how can define function of button below triggerd when function of above has been triggerd first? <input type="button" onclick="sketch.todataurl()" style="" value="speichern"> thanks! event.add isn't thing, event object is . //set variable both functions have scope it. var canvasclicked = false; //add 'click' event dom element "canvascontent" //you use .addeventlistener() document.getelementbyid("canvascontent").onclick = function(e) { //do whatever canvasclicked = true; }; //call sketch data when button clicked function sketchdata() { //only sketch dataurl if canvas has been clicked. if (canvasclicked) { sketch.todataurl() } } and then... <input type="button"

c# - Preventing Autofixture from filling child collections -

i'm using latest version of autofixture, , i'd prevent filling automatically child collections. for example, have class person has list property. want properties filled, except list. i tried using customization : public class removemultiples : icustomization { public void customize(ifixture fixture) { fixture.customizations .oftype<filteringspecimenbuilder>() .where(x => x.specification dictionaryspecification) .tolist().foreach(c => fixture.customizations.remove(c)); fixture.customizations .oftype<filteringspecimenbuilder>() .where(x => x.specification collectionspecification) .tolist().foreach(c => fixture.customizations.remove(c)); fixture.customizations .oftype<filteringspecimenbuilder>() .where(x => x.specification hashsetspecification) .tolist().foreach(c => fixture.customizations.remove(c

javascript - Find index in array different from the array that loaded -

line 35, before alert, returns -1. tried $(this).index() same result. here should do: clicking en.gif should return 4, grand_array_pics[4] should give me en_array_pics , load .gifs in array. $(document).ready(function () { var main_pics = ["an.gif", "bn.gif", "cn.gif", "dn.gif", "en.gif", "gn.gif"]; var starting_pics = ["an.gif", "cn.gif", "en.gif"]; var an_array_pics = ["bn.gif", "en.gif", "gn.gif", "an.gif","dn.gif"]; var bn_array_pics = ["cn.gif", "dn.gif", "gn.gif"]; var cn_array_pics = ["dn.gif", "gn.gif", "an.gif", "cn.gif"]; var dn_array_pics = ["en.gif", "an.gif", "cn.gif"]; var en_array_pics = ["gn.gif", "an.gif", "cn.gif", "en.gif"]; var gn_array_pics = [&

How can I pass parameters to the bit.ly api using python? -

i'm trying pass in parameters link_clicks , link_countries bit.ly apis python i'm not sure of syntax pass parameters here. how can add parameters api call? import sys import bitly_api import os config import config #connect bitly conn_btly = bitly_api.connection(access_token=config['access_token']) #get links links = conn_btly.user_link_history() print 'links okay' link in links: #add params link link_full = link['link'] + '?rollup=false' print link_full #get clicks clicks = conn_btly.link_clicks(link_full) #print results #print link['link'], clicks print clicks the resulting output links okay http://mzl.la/19xsyct?rollup=false ... bitlyerror: not_found you need pass in rollup keyword parameter instead: clicks = conn_btly.link_clicks(link['link'], rollup=false) you expected pass in python boolean value. parameter not part of bit.ly url, parameter api call instead.

mysql - Trigger can't work properly when check condition -

i want store records in 2 way. if exists, update information if dosn't exist, insert new record here outline schemas tables: product_purchase_item has product_purchase_item_id, product_id, quantity columns product_stock has product_stock_id, product_id, product_total_quantity columns i creating trigger delimiter // create trigger store_check after insert on product_purchase_item each row begin declare x integer; set x =(select product_id product_stock product_id = new.product_id); if new.product_id !=x insert product_stock values(null,new.product_id,new.quantity); else update product_stock set product_total_quantity=product_total_quantity+new.quantity product_id=new.product_id; end if; end;// delimiter;// the problem in product_stock table, insert query doesn't work when product record not exist, update query work when product record exist. is insert statement "doesn't work"? or, problem insert state

machine learning - Clustering Baseline Comparison, KMeans -

i'm working on algorithm makes guess @ k kmeans clustering. guess i'm looking data set use comparison, or maybe few data sets number of clusters "known" see how algorithm doing @ guessing k. i first check uci repository data sets: http://archive.ics.uci.edu/ml/datasets.html?format=&task=clu&att=&area=&numatt=&numins=&type=&sort=nameup&view=table i believe there in there labels. there text clustering data sets used in papers baselines, such 20newsgroups: http://qwone.com/~jason/20newsgroups/ another great method (one thesis chair advocated) construct own small example data set. best way go start small, try 2 or 3 variables can represent graphically, , label clusters yourself. the added benefit of small, homebrew data set know answers , great debugging.

sql server 2008 - Best method in writing this ColdFusion based report -

i'm looking see best way in writing report i'm developing in coldfusion 10 be. basically, consists of reading data 2 tables in mssql database, applying conditions based on finds on specific column, populating data excel , sending out via email. i've written reports before it's simple reading data table, using poiutility create spreadsheet , sending via email, 1 little different because of conditions. i've read using cfspreadsheet instead of poiutility, i'm not sure in case. here’s example of tables layout looks easy can put it: table1 id | name | address table2 id | appsinfo in excel report, i’ll have 1 sheet data laid out similar following: id | name | address | appalpha | appbravo | appdelta | 12345 | john | 123 ave | yes | yes | no | my problem is, appsinfo column on table2 contains xml formatting each id : <start> <id=”12345”> <appname=”appdelta”> <appname=”appbravo” </id> </start>

ios - AFNetworking setAuthorizationHeaderWithUsername:password: vs. setDefaultCredential -

i'm using afnetworking , associated goodies, , i've subclassed afoauth2client oauth work tokens , forth. for testing purposes, i'm working on dev server requires username & password access pages/api endpoints. when browse 1 of pages, little dialog box, enter credentials, , i'm time. understand "basic authentication" or "basic access authentication". so when instantiate afoauth2client subclass, use [self setauthorizationheaderwithusername:@"user" password:@"pass"]; with appropriate username , password type browser when prompted, when attempt access dev server, using httpoperationwithrequest: method, rejected. so instead, when instantiate client, try: nsurlcredential *credential = [nsurlcredential credentialwithuser:@"user" password:@"pass" persistence:nsurlcredentialpersistencenone]; [self setdefaultcredential:credential]; and works fine requests make; server lets me in. now far unde

php - Strange linebreak characters showing up in my view -

i using codeigniter generate html table insertion template view. how insert linebreaks in generated html code , experimentation, have been able change code to: $string='<table id="mydatatable" class="table table-bordered table-striped" style="clear: both">\n <tbody>\n'; foreach ($array $key => $value) { $string=$string."\t\n<tr><td>$key</td>"; $element='<td><a href="#" id="'.$key.'" data-type="text" data-pk="'.$rowid.'" data-url="/post" data-title="'.$key.'">'.$value.'</a>'.'</td></tr>\n'; $string=$string.$element; } $string=$string.'</tbody>\n</table>'; i inject produced html string ci view looks like: <!doctype html> <html lang="en"> <head> <base href="<?=base_url();?>&q

javascript - How can I change H1 color as you scroll down the page? -

i have page large 100% width photo @ top , title on top of photo. have fixed position title change color scroll past photo. have been able create working version in jsfiddle here: http://jsfiddle.net/dtzdz/647/ here javascript (i new js) var tstart = 100 // start transition 100px top , tend = 300 // end @ 300px , cstart = [255, 255, 255] // white , cend = [156, 156, 156] // black , cdiff = [cend[0] - cstart[0], cend[1] - cstart[1], cend[1] - cstart[0]]; $(document).ready(function () { $(document).scroll(function () { var p = ($(this).scrolltop() - tstart) / (tend - tstart); // % of transition p = math.min(1, math.max(0, p)); // clamp [0, 1] var cbg = [math.round(cstart[0] + cdiff[0] * p), math.round(cstart[1] + cdiff[1] * p), math.round(cstart[2] + cdiff[2] * p)]; $("h1 a").css('color', 'rgb(' + cbg.join(',') + ')'); }); }); unfortunately, once start scrolling h1 no longer changes color when hover on it. when

Trimming an int array for bucket sort in C -

i writing bucket sort program in c. after merge small buckets large bucket, need remove -1s padded small buckets with. i'm pretty new c, there simple solution overlooking. this solution, seems return array 1 trailing junk value , trailing 0s fill array until size of untrimmed bucket (where desired result bucket without -1s, junk values, , trailing 0s). // function trim bucket of given size bucket containing no -1s int* trimbucket(int* bucket, int size) { int n = 0, = 0; int* newbucket; // loop count number of elements between 0 , 9999 for(n = 0; n < size; n++) { if(bucket[n] != -1 && bucket[n] < 10000) i++; } // create new bucket equal number of elements counted // filled -2 differentiate -1s contained in bucket array newbucket = allocateandinitiateoned(i, -2); = 0; for(n = 0; n < size; n++) { // want va

asp.net - Editable gridview based on list -

is possible create gridview based on list? have following list: id = 1 name = john zip = 33141 id = 2 name = tim zip = 33139 i want able create editable gridview list when bind grid view, seems put everyting in 1 column, , can't figure out how seperate different columns here code setting datasource of gridview : datatable table = convertlisttodatatable(personlist); gridview1.datasource = table; gridview1.databind(); static datatable convertlisttodatatable(list<string> list) { // new table. datatable table = new datatable(); // max columns. int columns = 7; // add columns. (int = 0; < columns; i++) { table.columns.add(); } // add rows. foreach (var rd in list) { table.rows.add(rd); } return table; } here example: private class person { int m_iid; string m_sname; string m_szip; public int id { { return m_iid; } }

visual studio debugging - Why is VS 2010 ignoring _NT_SYMBOL_PATH? -

does vs 2010 handle symbol file resolution differently other ms products? repro steps: open control panel , make sure _nt_symbol_path set valid, srv*c:\debugsymbols*\buildserver\builds\symbols* http://msdl.microsoft.com/download/symbols open minidump file windbg or vs 2012 => debugger succeeds loading symbols open same minidump file vs 2010 => debugger fails find symbols open options dialog inside vs , set debugging symbols path same 1 above. (this setting saved when close vs.) open same minidump file vs 2010 => debugger succeeds loading symbols this repro's on machines in our dept. setting path manually one-time operation , it's fine on dev box, it's major pain in lab vms reimaged. does 2010 use additional environment variable(s) other tools don't? does vs have master settings file, overridden each user's currentsettings.vssettings? after asking around , scouring web, found out reliable source _nt_symbol_path envir

visual c++ - obtaining Current directory in VC++ forms -

i working on vc++ forms code. need current directory open form of project. while tried code find on internet same problem. posting 1 of code below. output of code true or false not returning string current directory value. tchar pwd[max_path]; getcurrentdirectory(max_path, pwd); messagebox::show(convert::tostring(&pwd), "my application", messageboxbuttons::okcancel, messageboxicon::asterisk); please me out how know current directory in vc++ forms you passing address of pointer convert::tostring(). pwd array , using variable name without array subscript automatically decays pointer. want use either convert::tostring(pwd) or convert::tostring(&pwd[0])

mysql - Match statement spaced words return results from multiple columns -

in situation, want find records contain name steve in 1 column , email@email.com in another. know im missing operator, dont know which select firstname,lastname,middlename,company_name, primary_emailaddress,alternate_emailaddress,personal_address_line1, personal_address_line2,personal_address_city,facebook_username, twitter_username,googleplus_username,linkedin_username, personal_website_url,birthday_month,notes,personal_address_zipcode, company_address_zipcode,home_phonenumber,company_phonenumber, cell_phonenumber,birthday_day,birthday_year,hash,image_file contacts ( match( firstname,lastname, primary_emailaddress,alternate_emailaddress,personal_address_line1, personal_address_city,company_name, company_address_line1,company_add

fortran - having error on the READ statement below. Any help why or what should I do? -

i getting error message, error 90 file access , properties incompatible . piece of code gives me error following: parameter (npt=250, npr=9) implicit real*8 (a-h,o-z) character*255 arqdat dimension z(npt,npt,npr) common/cprop/ tmin,tmax,dt,pmin,pmax,dp,vmin,vmax,dx,dx2,dy,dy2,z real*4 rgas !* read matrix open(unit=10,file=arqdat,form='unformatted', access='direct',recl=1) read(10) z !this statement giving error arqdat binary file close(unit=10) you opened file access='direct' doing sequential read on - not allowed. when people access='direct',recl='1' want read byte @ time, have combine rec= value in read statement. in modern fortran there other, better ways (such access='stream'). what compiler using , on operating system?

curl - Is it possible to create a file upload tunnel (server to server) with PHP without temp file overhead -

let's clarify first things first. since year 2007 i'm using divshare upload files 'the cloud'. working okay service in ways little outdated , there no plans of divshare it. uploading possible outdated interface of divshare or tools needs adobe air or java. want customize myself html5 drag , drop features example. i have rest-api service , can upload files server-side there no ajax-api allows me upload directly services customized upload method. i don't want hear switch cloud service provider because expensive this, have many projects rely on service. service working ok (for downloads) no reason switch. users use divshare website (clumsy interface) upload files or using provided java or air application if possible. as wrote before, can upload files directly server-side api. can make html form can upload (a) file(s) server , after upload divshare service inefficient if ask me, when uploading large files, mp3 files or video files. besides, server not powerful

html - how to make a div with transform: translate 3d stack up on top of a masked layer ( not working despite Z-index being higher) -

i trying make div transformation(css) stack on top; here markup, need green div show on top of blue div. blue masked layer , green dialog shows on top of it. i tried setting z-index , din't work. blue shows on top of green. also if change blue div sibling of the green div works, want keep mark same i.e blue div sibling parent green div any pointers? here js fiddle link... http://jsfiddle.net/yrtxt/9/ css #wrapper{ width:100%; } #red, #green{ height:200px; width:400px; } #red{ background-color:red; position:absolute; -webkit-transform: scale(1); } #pink{ background-color:pink; height:250px; width:150px; top: 50px; position:absolute; -webkit-transform: translate3d(0%,0px,0px); -webkit-perspective: 1000; } #green{ background-color:green; position:absolute; -webkit-transform: translate3d(0,0,0); top:100px; right: 0px; left: 0px; z-index: 1111; } #blue{ background-color: blue; width

vba - How to execute this Excel to XML function in a sub? -

can assist how can use function below converts data in excel file xml file in sub? when go create macro default has sub need have function. need able use maybe custom button on toolbar possibly or how can use spreadsheet need convert excel xml file? public function exporttoxml(fullpath string, rowname _ string) boolean on error goto errorhandler dim colindex integer dim rwindex integer dim ascols() string dim oworksheet worksheet dim sname string dim lcols long, lrows long dim ifilenum integer set oworksheet = thisworkbook.worksheets(1) sname = oworksheet.name lcols = oworksheet.columns.count lrows = oworksheet.rows.count redim ascols(lcols) string ifilenum = freefile open fullpath output #ifilenum = 0 lcols - 1 'assumes no blank column names if trim(cells(1, + 1).value) = "" exit ascols(i) = cells(1, + 1).value next if = 0 goto errorhandler lcols = print #ifilenum, "<?xml version=""1.0""?>" print #ifilenum, "<

java - Generic Types Related But Incompatible -

still trying grasp generics concept... line public interface filestructure<l extends filestructurelevel<l>, r extends filestructureresource> extends nodestructure<l, r> gives following message: type argument l#1 not within bounds of type-variable l#2 l#1,l#2 type-variables: l#1 extends filestructurelevel<l#1> declared in interface filestructure l#2 extends nodestructurelevel<l#2> declared in interface nodestructure now, seem trivial, type bounds different. however, confusing actually, narrowing bound, since public interface filestructurelevel<e extends filestructurelevel> extends nodestructurelevel<filestructurelevel> so whatever l1 is, going extend l2 . why mismatch? anyone? further, given declaration public interface nodestructure<l extends nodestructurelevel<l>, r extends nodestructureresource> and public class filestructureresource implements nodestructureresource<file> why doesn't

Django filter the queryset of ModelChoiceField - what did i do wrong? -

i know many questions exist same topic, confused on 1 point. intent show 2 modelchoicefields on form, not directly tie them game model. i have following: forms.py class addgame(forms.modelform): won_lag = forms.choicefield(choices=[('1','home') , ('2', 'away') ]) home_team = forms.modelchoicefield(queryset=player.objects.all()) away_team = forms.modelchoicefield(queryset=player.objects.all()) class meta: model = game fields = ('match', 'match_sequence') views.py def game_add(request, match_id): game = game() try: match = match.objects.get(id=match_id) except match.doesnotexist: # have no object! pass game.match = match # form form = addgame(request.post or none, instance=game) form.fields['home_team'].queryset = player.objects.filter(team=match.home_team ) # handle post-back (new or existing; on success nav game list) if

Changing Django template context with Javascript -

is possible change html rendered django changing variables (context) javascript? for example, render, {{ item }} , can hide rendered {{ item }} hiding django variable itself? or have select rendered html @ point. how django's context preprocessors work javascript? you have remember javascript runs after html rendered. no it's not possible want (changing django variable js). if want hide content of {{ item }}, wrap in html element select , hide js. hope helps.

google cast - How does one query the "parameters" sent to a Chromecast Reciever app? -

the docs shown on page demonstrate how send arbitrary parameters sender app receiver app: https://developers.google.com/cast/chrome_sender specifically, here: request.parameters = "v=abcdefg"; but, don't see how receiver app supposed access parameters once sent? have example of jscript receiver see string? it looks chromecast pulls down built-in application settings following url: https://clients3.google.com/cast/chromecast/device/config if take @ file, you'll notice many of urls this: https://www.youtube.com/tv ?${post_data} notice ${post_data} specified part of url defines application. guessing, assume unless application setup on google's whitelist, you'll unable receive data via url. it may worth using channel send data require application instead of trying use request.parameters.

Facebook FB.ui send dialog intermittently returns invalid link error -

this has been working fine on week. fb.ui({ method: 'send', to: connectionid, name: subject, picture: staticurl + 'images/logoformysite.png', link: homeurl + '/' + username + '/something=' + var1 +'&somethingelse=' + encodeuri(var2) + '&evenmore=' + encodeuri(var3), description: invitemessage, }); i had had error last week if url within facebook domain, facebook block it. fixed , both picture , link not belong facebook domain , come site. started happening today nothing changed. intermittent. an error occurred. please try again later. api error code: 100 api error description: invalid parameter error message: 'link' invalid. it not clear why works , not other times if sending same user. wondering if missed announcement. hope @ least fail consistently not case. update: not sure how link setting in dialog can set globally on page. send recipients of message wrong link. helpful see example of how

haskell - Pattern Matching on GADTs -

i've created gadt expressions. when pattern match on constructors have constraints, typechecker unable deduce constraints on type variables used in constructor's constraints. think code , error message more elucidating. {-# language gadts, multiparamtypeclasses #-} import data.word data expr value :: -> expr cast :: (castable b) => expr -> expr b class castable b cast :: -> b instance castable word64 word32 cast = fromintegral instance (show a) => show (expr a) show (cast e) = "cast " ++ show e -- error the error get: gadt.hs:16:30: not deduce (show a1) arising use of `show' context (show a) bound instance declaration @ gadt.hs:15:10-34 or (castable a1 a) bound pattern constructor cast :: forall b a. castable b => expr -> expr b, in equation `show' @ gadt.hs:16:9-14 possible fix: add (show a1) context of data constructor `cast'

wordpress plugins using Jquery not functioning -

i used wordpress plugin called jquery updater , broke functionality of plugins use jquery. how fix jquery functionality use plugins again? example, http://www.stratumplans.com/nqdc/ i testing collapse-o-matic plugin. see drop down carrot, there should title expands text. not work. i these errors: uncaught referenceerror: cufon not defined www.stratumplans.com/:296 anonymous function) uncaught typeerror: object [object object] has no method 'on' collapse.min.js? ver=1.5.2:1 (anonymous function) collapse.min.js?ver=1.5.2:1 l jquery.min.js:2 .firewith jquery.min.js:2 v.extend.ready jquery.min.js:2 uncaught typeerror: object [object object] has no method 'on' gprofiles.js? ver=2013augaa:2 gravatar.init gprofiles.js?ver=2013augaa:2 (anonymous function) wpgroho.js?ver=3.5.2:32 e.resolvewith jquery.min.js:2 e.extend.ready jquery.min.js:2 c.addeventlistener.c i have deactived plugins , tried one. have researched not sure if understand @ root of it.

android - White frame around my Alert Dialog Object? -

Image
the problem started when trying dismiss dialog on close button being pressed. i couldn't working original approach tried 1 , has weird border around dialog when being presented. here dialog class: package com.pivotl.postcardsfromalaska; import android.app.alertdialog; import android.app.dialog; import android.app.dialogfragment; import android.os.bundle; import android.view.layoutinflater; import android.view.view; public class pfadialogfragment extends dialogfragment { static pfadialogfragment newinstance() { pfadialogfragment f = new pfadialogfragment(); return f; } @override public dialog oncreatedialog(bundle savedinstancestate) { //getting proper access layoutinflater trick layoutinflater inflater = getactivity().getlayoutinflater(); view view = inflater.inflate(r.layout.enter_actions, null); //propmanager = new propmanager(getsherlockactivity()); alertdialog.builder builder = new alertdialog

c# - If I'm just learning MVVM whats the best framework? -

which framework easiest install , use if i'm learning mvvm. know wpf not mvvm pattern. i'm looking project have lots of documentation , tutorials follow templates set up. don't want spend 1 day installing , trying simple mvvm project running. far i've found mvvm lite looks , cinch , wpf applications framework (waf) can comment on these , tell me 1 best start if i'm learning pattern? for getting started, not use kind of external library. in opinion, main goal learn basics of design pattern , not using borrowed code. take time study mvvm about, goals, benefits , pitfalls, in "pure" form possible. thinking classes building, how communicate , how works best way can learn pattern. introducing third party code may going though problems without realizing or why happened, or adapting programming style way framework wants work. in view, understanding why works far more important, particularly in beginning. once you've got basics , have underst

cross browser - Why does the NPAPI plugin resize work fine on Chrome but fail on Firefox? -

i'm developing npapi plugin displaying ip-camera video. in order support 4:3, 5:4, , 16:9 ratio need resize plugin according users' selection. it works on chrome, doesn't work on firefox @ all. here code embed id=ipcam type="application/npipcam2" width=720 height=576 function onchangecmbwindowratio() { try { var w=640; var h=480; var value=cmbwindowratio.value; if(value=="4:3") { w=640; h=480; } if(value=="5:4") { w=720; h=576; } else if(value=="16:9") { if(screen.width>1440 ) { if(isie6) { w=880; h=495; } else { w=1280; h=720+20; } } else { w=880; h=495; } } if(isie6) { ipcam.dt("ie6#plugin w="+w+",h=&qu

ruby - Install bundle of gem within other rails application -

i have following setup: a rails 4.0.0 application => master application through application developers can create gem skeletons now i´d create gem skeleton source code , run bundle install of gem gemfile through call in rails master application: class myclass # works def create_gem_skeleton path = "path-to-gem-skeleton-outside-the-rails-master-app" fileutils.mkdir_p(path) `cd #{path} && bundle gem my-new-gem` end # method gets called, after created gem skeleton , manipulated bit preferences def my_method path = "path-to-gem-skeleton-outside-the-rails-master-app" exec `cd #{path} && bundle install` # not work, installs rails master bundle inside rails master application, never touches new gem-skeleton system `cd #{path} && bundle install` # =||= .. same here `cd #{path} && bundle install` # =||= .. same here end end anybody idea how can run such "bundle install&

html - Wordpress: Current menu item only highlights when inspector is open -

the site working on: http://www.greenvilleosaka.com/ i trying highlight current page user on, rule seen below seems disable highlight color causing link retain normal color: .current-menu-item a:link {color:#ffffff;} oddly enough, when inspect google chrome, changes hover color (grey) inspector matched css rules shows white (the correct color), , weirder, computed styles shows original link color (gold). if open inspector other way walk current menu item, stays wrong color (normal, gold) inspector shows correct color (white) in both computed , matched css rules. any appreciated!!! (inspecting in ff firebug shows correct colors while gold) change css from .current-menu-item a:link {color:#ffffff;} to .current-menu-item {color:#ffffff;}

vba - Is there a way to simply write data to a file using visual basic -

i'm designing application using visual basic , xaml, , wondering if there "easy" way read/write data file. application going need remember few variables (preferably stored in array) on start up. from microsoft: sub openexample() dim sfirst, slast, saddress, scity, sstate, szip string '' create data file '' open file input. open "datafile.txt" output #1 '' write data file. write #1, "john", "doe", "an address", "a city", "a state", "a zip" '' close file. close #1 '' retrieve data file '' open file input. open "datafile.txt" input #1 '' loop until end of file reached. while not eof(1) '' read data variables. input #1, sfirst,slast,saddress,scity,sstate,szip '' print data debug window. debug.print sfirst,slast,saddress,scity,sstate,szip loop &