Posts

Showing posts from May, 2012

How to integrate WebSync with ASP.NET MVC 4 -

as title said, want use websync , frozenmountain , with asp.net mvc 4 , haven't found tutorial it. know how that , where start ? or if have better way implement comet asp.net mvc 4, please let me know. thanks help. do know how that, start? the documentation first place might start @ when need apprehend new tool or framework not familiar with: http://docs.frozenmountain.com/websync4/ or if have better way implement comet asp.net mvc 4, please let me know. you might checkout signalr .

html - Bootstrap sticky footer with vertically centred content -

trying modify bootstrap's sticky footer example http://getbootstrap.com/2.3.2/examples/sticky-footer-navbar.html have vertically centred content, still fail that. the full code below. i'm trying vertically align part between "begin page content" , "end page content" comments. would appreciate help. <html lang="en"> <head> <meta charset="utf-8"> <title>sticky footer &middot; twitter bootstrap</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content=""> <meta name="author" content=""> <!-- css --> <link href="../assets/css/bootstrap.css" rel="stylesheet"> <style type="text/css"> /* sticky footer styles -------------------------------------------------- */ html,

ravendb shardstrategy & shardeddocumentstore -

can choose have few objects sharded, typically have potential have large amount of data , leave others stored across instances? for example when have banking transaction, might want store customers , transactions in different shards , might want store list of bank branches in databases. possible? you can that, not in single database. way works, have 2 databases on each server (and 2 document stores) 1) sharded, transactions & customers 2) standard, banks. the banks database replicated nodes.

ios - IBM Worklight 6.0 - AutohideSplashScreen has no effect -

i have ported project worklight 6.0. used autohidesplashscreen far, not seem have effect in 6.0. easy reproduce: create new project ipad environment set autohidesplashscreen false in config.xml deploy , run -> splash screen disappears automatically this important because app has ugly flicker on startup. is there workaround proper splash screen handling again? this known. worklight @ moment disregards option , splash screen set disappear after web resources have been loaded. i cannot comment on future plans, true current situation not ideal , we'd address. to knowledge there no workaround.

php - Sum of column equals, A - B -

this may straight forward one. i'm playing around little app i'm trying create. i've got form users submit "buy_price" , "sell_price". trying work out if have made loss or profit. better have column within database works out "margin" i.e "margin coulmn = sell_price-buy_price" (and how this). or better within php. thank in advance. dan edit: use database because store data , can view purchase history. want make section such "best trades" ones highest margin etc. i absolutely not store calculated values in database simple - maintenance outweigh marginal gains in efficiency. even without storing value, still have option on whether calculate value upon retrieval (with mysql ) or php when rendering. select buy_price, sell_price, (buy_price - sell_price) margin x sql aside, i'd still go calculating upon render php .

java - How to exclude transitive dependency -

i use javamail in same project cxf. cxf brings older version of javamail not suit me. how excluded? did so: compile (group: 'org.apache.cxf', name: 'cxf-rt-bindings-soap', version: apachecfxversion) { exclude module: 'geronimo-javamail_1.4_spec' } but did not help. find in war web-inf \ lib \ geronimo-javamail_1.4_spec-1.6.jar try this: configurations { all*.exclude module: 'geronimo-javamail_1.4_spec' }

How i work with mongodb in ruby on rails -

how use mongodb in ruby on rails, how run rake command? step step? please tell me scaffold example. i'm beginners in ror. ............................................................................................................................................................................................................................................................................................................................................................................................. take @ mongoid if beginner, recommend start studying ruby before jump rails

c# - How to maintain Form request value when page is refresh -

when post value form submit request on redirect action after refresh redirected page posted value lost.how maintain request value when page refresh. to persist value(s), use: session variables, cookies, or query string values.

javascript - transaction.executeSql Success function error -

i did function select data db , show alert, i'm getting following error in success function: cannot read property 'rows' of undefined retrievedata here functions function selectall(){ db.transaction( function(transaction) { transaction.executesql("select * cdprodutos", [], retrievedata()); //the retrievedata function data sent/returned in parameters (transation, results) }); } function retrievedata(transaction, results) { for(var = 0; < results.rows.length; i++) { var data = results.rows.item(i)['id'] alert(data.value); } } it looks function being executed , there no data being passed it, rows property coming undefined. writing () after retrievedata , invoking function immediately. remove () use callback. it appears need pass data along it, anonymous function trick here: function selectall(){ db.transaction( function(transaction) { transaction.executesql("select

iphone - uialertview don't do action -

i have put alert view 2 buttons, buttons don't open urls. don't know error. please. here's code: -(ibaction)showalertview { uialertview *alert = [[uialertview alloc] initwithtitle:@"obrir en..." message:@"es pot requirir la aplicació de google maps" delegate:self cancelbuttontitle:@"millor no..." otherbuttontitles:@"mapes",@"google maps",nil]; [alert show]; } - (void)alertview:(uialertview *)alertview clickedbuttonatindex:(nsinteger)buttonindex { nsstring *title = [alertview buttontitleatindex:buttonindex]; if([title isequaltostring:@"mapes"]) { uiapplication *ourapplication = [uiapplication sharedapplication]; nsstring *ourpath = @"http://maps.apple.com/?q=plaça+del+rei+43003+tarragona"; nsurl *oururl = [nsurl urlwithstring:ourpath]; [ourapplication openurl:oururl]; } if

maven 2 - Spring 3.2.3 : activemq 5.5 dependency problems -

i'm trying upgrade project spring 3.2.3, spring 3.0.7. i'm stuck on problem activemq dependencies , can't figure out jar need or conflicting in first place. following stacktrace org.unitils.core.unitilsexception: unable create application context locations [classpath:producerservicecontext-test.xml] @ org.unitils.spring.util.applicationcontextmanager.createinstanceforvalues(applicationcontextmanager.java:121) @ org.unitils.spring.util.applicationcontextmanager.createinstanceforvalues(applicationcontextmanager.java:36) @ org.unitils.core.util.annotatedinstancemanager.getinstanceimpl(annotatedinstancemanager.java:234) @ org.unitils.core.util.annotatedinstancemanager.getinstance(annotatedinstancemanager.java:121) @ org.unitils.spring.util.applicationcontextmanager.getapplicationcontext(applicationcontextmanager.java:65) @ org.unitils.spring.springmodule.getapplicationcontext(springmodule.java:235) @ org.unitils.spring.spri

ios - Can you install an Android Device Simulator in xcode when using Apportable -

can install android device simulator in xcode when using apportable convert ios app android or need android device compile , run project? dont have android device , wanted test before go buy one. thanks note easier work android device emulator, possible use emulator: ~/.apportable/sdk/toolchain/macosx/android-sdk/tools/android launch android tool can create avd's. make sure install arm eabi v7a system image, create avd target of api level 17, cpu/abi of arm (armeabi-v7a), sd card size of around 500 mib, choose builtin skin of wvga800, select hardware features of abstracted lcd density of 240, max vm application heap of 48 , device ram size of @ least 512, internal storage should @ least 500 mib. , of make sure check box use host gpu. to run emulator: dyld_library_path=~/.apportable/sdk/toolchain/macosx/android-sdk/tools/lib/ ~/.apportable/sdk/toolchain/macosx/android-sdk/tools/emulator-arm -avd emulator -gpu on this launch android emulator (note: take bit l

Rails create and destroy nested attributes on update model form -

i have products model has_many :tags . the tags created on product creation. when update product, can update attributes, including tags' attributes. but question is, how can i, remove tag or create 1 when update product on product update form? do have create separate tag form or that? here update product form: <%= form_for(@product), id: 'edit_form' |f| %> <div class="field"> <%= f.label :name %><br> <%= f.text_field :name %> </div> <div class="field"> <%= f.label :description %><br> <%= f.text_area :description %> </div> <div class="field"> <%= f.label :location %><br> <%= f.text_field :location %> </div> <div class="field"> <%= f.label :price %><br> <%= f.text_field :price %> </div>

.net - How to Convert Row to Column in Linq and SQL -

Image
i have table called languagemaster having below record language keyname keyvalue english city aa swedish city aaswedish german city aager chines city aachines french city aafr spanish city aaspanish how convert languagemaster table below table keyname english swedish german chines french spanish city aa aaswedish aager aachines aafr aaspanish please let me know how write query in both sol , linq. update : created following generic method can build pivot table collection public static datatable topivottable<t, tcolumn, trow, tdata>( ienumerable<t> source, func<t, tcolumn> columnselector, expression<func<t, trow>> rowselector, func<ienumerable<t>, tdata> dataselector) { datatable table = new datatable(); var rowname = ((memberexpression)rowselector.body).member.name; table.columns.add(new datacolumn(rowname)); var colu

vba - Excel Macro - Search Range of Cell for 0, then return "empty" cell -

this first time using forum, , vba skill not developed. hope can help. i have 2 columns of data, column a , column b . column a - returns sequential "month-year" or 0. if spreadsheet current date (=now()) less feb, cell february returns 0. column b - want column check each cell in column a. if column cell has date identifier, want placed in column b. if column has 0 identifier, want column b return "empty" cell. reason why doing graphing bar chart. when trick program making empty cell (x-axis) graph not show data month (which want). trying make dynamic graph, have no experience in vba (only c programming =/). you don't need vba (or formulas) this. highlight column (the entire column), copy it. highlight column b (the entire column, right click, paste special, select values , number formats, okay. highlight column b again. press ctrl+h, type 0 (or failing might 00/01/1900) in 'find what', leave 'replace with' 1 blank. tick

Download .csv with javascript -

i want generate .csv in javascript. have object, name "archivo". problem when generate file csv, in each line add ',', don't know happen archivo=[], each line string + '\n'. if (navigator.appname == 'microsoft internet explorer') { var popup = window.open('','csv',''); popup.document.body.innerhtml = '<pre>' + archivo[i] + '</pre>'; }else{ location.href='data:application/download; charset=utf8,' + encodeuricomponent(archivo); } any can me? you should consider using csv generator library, handles you. i've written light-weight client-side csv generator library might come in handy. check out on http://atornblad.se/github/ (scroll down headline saying client-side csv file generator ) it requires functioning filesaver implementation handling calls window.saveas() . check out e

php - Form submit not displaying message -

i have html form id of newticket , jquery in head section of page: <script type="text/javascript"> $(document).ready(function(){ $("#message").hide(); $("#newticket").submit(function(e){ e.preventdefault(); datastring=$("#newticket").serialize(); $.ajax({ type: "post", url: "newticket_go.php", cache: false, data: datastring, success: function(res){ //$("#message").show(); $("#message").html(res); $('#message').fadein('slow'); if(res.indexof("success")!=-1) { window.location.href = res.substr(8); } } }); }); }); </script> i have <div id="me

jquery - How can I prompt user to rotate device if in a certain mode landscape or portrait, similar to GameInformer App -

Image
i have website best viewed in landscape mode. how can have if user loads website in landscape mode fine if loads in portrait mode or rotate landscape portrait mode image or popups taking entire screen asking them rotate landscape? thinking javascript/jquery can this. i have seen done on ipad game informer app if user opens app in portrait or rotates landscape portrait opaque image pops asking them rotate landscape. [see ipad screenshot] instead of jquery/js can use css styled div container instead, shown when device in portrait mode. you can catch orientation media query example: /* screens */ #info {display: none;} /* when orientation in portrait mode */ @media , (orientation:portrait) { #info { display: block; } }

asp.net mvc 4 - Apply regional settings to application based on user profile -

i have mvc 4 application international users (all on world). want add new page called profile settings users can select regional settings , mean should able select: - time zone (utc +- .....) - date format (dd.mm.yyyy or dd/mm/yyyy or mm/dd/yyyy ....) - time format (12/24 - pm) - number format (1234.56 or 1234,56) after user selects regional settings, specific data (date, time, number ...) should shown in specific format. any advice how make work? most of time, shouldn't expose each , every detail of culture format users. instead, provide drop-down list of cultures want support. cultures specified using codes. common codes en-us (english/usa), es-mx (spanish/mexico) , de-de (germany/german). first part refers language, , second part refers specific country or region. once have selected culture code, can apply each user, such as: cultureinfo culture = new cultureinfo("en-us"); thread.currentthread.currentculture = culture;

ios - Input Power value for CIGammaAdjust filter in Core Image -

i want perform auto gamma correction using core image filter cigammaadjust. cigammaadjust requires "inputpower" value set in following code: cifilter* gammafilter = [cifilter filterwithname:@"cigammaadjust"]; [gammafilter setvalue:resultimage forkey:@"inputimage"]; [gammafilter setvalue:??? forkey: @"inputpower"]; resultimage = [gammafilter valueforkey: @"outputimage"]; the question is, how should calculate value input power? have gamma value of image calculated. how convert image gamma value input power? tried using reciprocal of gamma value doesn't seem give right result. https://developer.apple.com/library/mac/documentation/graphicsimaging/reference/coreimagefilterreference/reference/reference.html#//apple_ref/doc/uid/tp30000136-dontlinkelementid_69 this mac dev library says, "... inputpower: nsnumber object attribute type ciattributetypescalar , display name power. default value: 0.75 discussion: f

UrlMapping to static files in Grails -

i want map static files sitemap.xml , robots.txt located in web-app directory. urls should follows: http://www.mydomain.com/sitemap.xml http://www.mydomain.com/robots.txt how have set url mapping make these routes work? i use mapping robots.txt : "/robots.txt" (view: "/robots") and have grails-app/views/robots.gsp contains content robots.txt . way can use <g:if env="..."> have different content different environments. in order work ".xml" extension, need change content negotiation config. grails.mime.file.extensions = false // disables parsing of file extensions urls request format

perl - Best way to check for incorrect hash key input -

in perl script, have subroutine called hundreds of times many different sets of parameters, values sent in ones differ defaults. (it goes without saying number of permutations , combinations large) make more robust, checking on parameters. here shrunken version of subroutine (the actual version has dozens of parameters specific, lengthy names): # obtain parameters differ defaults , send processing sub importantsub { %params = ( commandtype => 5, commandid => 38, channel1enable => 0, channel2enable => 0, channel3enable => 0, channel4enable => 0, channel5enable => 0, channel6enable => 0, channel7enable => 0, channel8enable => 0, channel9enable => 0, channel10enable => 0, # goes on long time @_ ); # make sure have many keys expect - verify # no additional parameters added (real version has 92) if( key

php - How to insert linebreaks in generated html code -

i using codeigniter generate html table insertion template view. unfortunately coming out long string on 1 line like: <table id="mydatatable" class="table table-bordered table-striped" style="clear: both"><tbody><tr><td>id</td><td><a href="#" id="id" data-type="text" data-pk="2" data-url="/post" data-title="id">2</a></td></tr><tr><td>email</td><td><a href="#" id="email" data-type="text" data-pk="2" data-url="/post" data-title="email">a@b.com</a></td></tr><br><tr><td>notes</td><td><a href="#" id="notes" data-type="text" data-pk="2" data-url="/post" data-title="notes">notes go here</a></td></tr><br> ... i wan

wordpress - Creating sub nav using wp_list_pages(); -

i'm using following code produce list of pages bottom 2 levels of wordpress page hierarchy: <?php if($post->ancestors){ $ancestors = end($post->ancestors); $children = wp_list_pages("title_li=&child_of=".$ancestors.""); } ?> this seems bring in pages higher last 2 levels though. there can add the code above make list bottom 2 level pages?

c# - Writing Image on a Cell of an excel in interop? -

i doing export excel .but have export images in excel cell. public void generateandsaveexcel(dataset ds) { try { bool excelcreated = createexcelapplication(); bool workbookcreated = createworkbook(); if (excelcreated && workbookcreated) { bool worksheetadded = addworksheet(); if (worksheetadded) { createheader(ds.tables[0].columns); addrows(ds.tables[0].rows, ds.tables[0].columns); save(@"c:\worksheet1.xlsx"); } } else { } } catch (system.unauthorizedaccessexception) { } catch (system.runtime.interopservices.comexception) { } catch (system.io.ioexception) { } { excelapp.quit(); workbook = null; worksheet = null; dispose(); } } here have columns id,name,sereenshot1,sereenshot2. sereenshot1,sereenshot2 image

python - Function that returns a tuple gives TypeError: 'NoneType' object is not iterable -

what error mean? i'm trying make function returns tuple. i'm sure i'm doing wrong. appreciated. from random import randint = randint(1,3) b = randint(1,3) def make_them_different(a,b): while == b: = randint(1,3) b = randint(1,3) return (a,b) new_a, new_b = make_them_different(a,b) your code returns none if a != b . since, have return statement inside while loop, if while loop never gets executed, python returns default value of none cannot assigned new_a, new_b . >>> print make_them_different(2, 3) none >>> print make_them_different(2, 2) (2, 1) you fix returning default values (since different , that's intend do) def make_them_different(a,b): while == b: = randint(1,3) b = randint(1,3) return (a,b) # dedented return line. demo - >>> make_them_different(2, 2) (3, 2) >>> make_them_different(2, 3) (2, 3)

c++ - Can't use fixup_bundle() to create a portable bundle with Qt -

i searched issue on other posts, nothing far. here am. i'd create bundle portable. portable in "i can run on os x machine, if required libs (qt) not installed". unfortunately, can't figure out how use fixup_bundle() (which seems right tool it) achieve goal. here minimal cmake generated c++ project : main.cpp #include <qstring> #include <iostream> int main() { qstring s("hello, world!"); std::cout << s.tostdstring() << std::endl; return 0; } cmakelists.txt cmake_minimum_required(version 2.8.11) project(test) # part because use custom build of qt. that's not # relevant part (i guess?) file(glob qtroots path_to_qt/qt-4.8.1/osx/bin/qmake) find_program(qt_qmake_executable names qmake paths ${qtroots}) find_package(qt4 components qtcore required) include(${qt_use_file}) add_executable(test macosx_bundle main.cpp) target_link_libraries(test ${qt_libraries}) install(script bundle.cmake) bundle.cma

mysql - Subquery with Wordpress posts and post_meta -

i know not right, although working. i need find posts (as revenue) near given radius , location, need subquery latitude , longitude info in post_meta. it's gonna hurt eyes, here is: /* lat -23.6480147 lng -46.704116399999975 radius 20km 6371 para km e 3959 para miles */ select vision_outlet.wp_posts.id 'id', vision_outlet.wp_posts.post_title 'nome', ( select vision_outlet.wp_postmeta.meta_value vision_outlet.wp_postmeta vision_outlet.wp_postmeta.meta_key = 'formatted_address' , vision_outlet.wp_postmeta.post_id = vision_outlet.wp_posts.id ) 'formatted_address' , ( select vision_outlet.wp_postmeta.meta_value vision_outlet.wp_postmeta vision_outlet.wp_postmeta.meta_key = 'lat' , vision_outlet.wp_postmeta.post_id = vision_outlet.wp_posts.id ) 'lat', ( select vision_outlet.wp_postmeta.meta_value vision_

c# - Is there a native spell check method for datatype string? -

i working on tool analyses huge amounts of data inputted hand using old database gui not allow spell check, have on post-process. first serious program in c# , wondering, before implementing more complicated stuff dictionaries or using external libraries nhunspell, if there native method applied on regular strings check if string has spell errors inside. i've read spellcheck class don't know how used on simple string, outside usage of textboxes. if possible give me example of how please? thanks in advance. i've worked on similar, i've used nhunspell (which can nuget ), got (it's not exact code, it's pretty near): public idictionary<string, ienumerable<string>> analyze(string text) { var results = new dictionary<string, ienumerable<string>>(); using (var hunspell = new hunspell("resources\\en_gb.aff", "resources\\en_gb.dic")) { string[] words = regex.split(text, @"\w+&quo

sorting - redis sort by multi fields -

it's easy use sql query multi sort fields.for example: select * user order score desc,name desc with 2 fields sort(score,name). how should in redis? use sorted set of redis sorted score. have prepare score according needs. finalscore = score*max_name_value + getintrepresentation(name) //max_name_value maximum value returned getintrepresentation() method and use zadd myset finalscore value and use zrevrange myset 0 10

xcode4.6 - Can't Run my iOS App from Xcode 4.6 after installing Xcode 5 -

i installed resently xcode 5 ios 7 sdk on mac os 10.8. problem can't more run ios app xcode 4.6, here's errors: - when run app xcode, after build have message: "can't find existing path [myproject.app path]" , file exist in specified path. - when generate ipa , install itune have message: "not supported device". my app works fine before installing new xcode (5 + ios 7 sdk) 1 have solution? thanks rachid easy solution! xcode 5 previous change formats. knowledge common issues are: 1. changing xib/storyboard file, can check answer here solution: how fix project opened in xcode5 dp3 accident? it can change framework path format (you should error when compiling), solve check answer here: sentestingkit/sentestingkit.h' file not found on xcode 4.6.x if both doesn't work please add more details , love help.

fetch a attribute form Next & Prev div using Jquery -

i'm trying out example learn how fetch attribute "href" of "a tag" next & prev div's. consider click on 'a tag' in div id="rw2", need href of tag in prev div#rw1 , next div#rw3. <div class="plist" id="rw1"> <div class="image"> <a href="1.html">1</a> </div> <div class="some"></div> <div class="few"></div> </div> <div class="plist" id="rw2"> <div class="image"> <a href="2.html">2</a> </div> <div class="some"></div> <div class="few"></div> </div> <div class="plist" id="rw3"> <div class="image"> <a href="3.html">3</a> </div> <div class="som

asp.net mvc - Displaying one object value (from a collection) in a label -

i learning mvc4. display records in tabular format using foreach . now, need display the description of (only) first topic object in label. need without foreach . how can it? view @model mvcsampleapplication.models.labeldisplay @{ viewbag.title = "index"; } <h2>index</h2> @using (html.beginform()) { foreach (var item in model.topics.select((model, index) => new { index, model })) { <div>@(item.index) --- @item.model.description---- @item.model.code</div> <div></div> } } controller action public actionresult index() { labeldisplay model = new labeldisplay(); topic t = new topic(); t.description = "computer"; t.code=101; topic t3 = new topic(); t3.description = "electrical"; t3.code = 102; model.topics = new list<topic>(); model.topics.add(t); m

delphi - Memory leak on simple HTTPRIO -

i'm having memory leak when quit application on thttprio object created. i have webservice defined followed: type tsimplewebservice = class protected fhttprio : thttprio; public constructor create(url : string); property httprio : thttprio read fhttprio; end; implementation constructor tsimplewebservice.create(url : string); begin fhttprio := thttprio.create(nil); fhttprio.url := url; end; i testing/creating webservice followed (customercare webservice interface): procedure tfrmmain.button1click(sender: tobject); var webservice: customercare; begin webservice := getsimplecustomercareservice; webservice := nil; frmmain.close; end; function tfrmmain.getsimplecustomercareservice: customercare; var webservice: tsimplewebservice; begin webservice := tsimplewebservice.create('http://this.is.a.test'); result := webservice.httprio customercare; end; when click button1, i'm not doing create webservice, set nil again , quit a

Select all anchor tags with an href attribute that contains one of multiple values via xpath in lxml / Python -

i need automatically scan lots of html documents ad banners surrounded anchor tag, e.g.: <a href="http://ad_network.com/abc.html"> <img src="ad_banner.jpg"> </a> as newbie xpath, can select such anchors via lxml so: text = ''' <a href="http://ad_network.com/abc.html"> <img src="ad_banner.jpg"> </a>''' root = lxml.html.fromstring(text) print root.xpath('//a[contains(@href,("ad_network.")) or contains(@href,("other_ad_network."))][descendant::img]') in example check on 2 different domains: "ad_network." , "other_ad_network.". however, there on 25 domains check , xpath expression terribly long connecting conatains-directives "or". , fear expression pretty inefficient concerning cpu ressources. there syntax checking on multiple "contains" values? i concerned links via regex in single line o

android - Block "Complete action using" chooser from launching -

whenever user action multiple apps can support, prompted "complete action using" popup asking them choose app. security purposes, don't want chooser popup @ , instead force open action within app. is there single place in project can set intents open activities within project? since don't have access source in linkify, cannot set package name intent. either don't use linkify , set the clickablespan objects yourself, or replace spans created linkify own clickablespan objects.

jquery - Jqplot not working with requirejs, jquerymobile, marionette -

i trying use jqplot jquery mobile, marionette , requirejs. have included jqplot required css script files in head tags, when trying plot chart using below code define([ 'plot' ], function() { console.log("success..inside offer page script."); console.log("plot..."+$.jqplot); $.jqplot.config.enableplugins = true; var s1 = [ 2, 6, 7, 10 ]; var ticks = [ 'a', 'b', 'c', 'd' ]; plot1 = $.jqplot('chart1', [ s1 ], { seriesdefaults : { renderer : $.jqplot.barrenderer, pointlabels : { show : true } }, axes : { xaxis : { renderer : $.jqplot.categoryaxisrenderer, ticks : ticks } }, highlighter : { show : false } }); }); it gives me errors like uncaught typeerror: undefined not function jqplot.barrenderer.js:41 (line 41: $.jqplot.barrenderer.prototype = new $.jqplot.linerenderer();) uncaught typeerror: canno

vbscript - Connecting to a Remote Server on a different domain -- how do I enter the username and password? -

i have vbscript parsing information on remote machine. i have line of code connection strcomputer defined name of server connecting to. set objwmiservice = getobject("winmgmts:{impersonationlevel=impersonate!\\" & strcomputer & "\root\cimv2") as long executing script on same domain remote server, script run fine. requirement able run script 1 domain access remote computer on different domain. to this, need provide username , password. think username must have domain part of it? anyways, possible? if so, how , enter username , password this? can add argument. according microsoft should possible. need authenticate against remote domain, though, e.g. this: computer = "..." username = "otherdomain\user" password = "..." set locator = createobject("wbemscripting.swbemlocator") set wmi = locator.connectserver(computer, "root\cimv2", username, password) wmi.security_.impersonationlevel = 3

Rock, Paper, Scissors in JavaScript -

i'm working on making first game (rock paper sissors) , ran issue when userchoice scissors , computerchoice rock , program cannot return winner rock. can program give me winner other combination. i have code here: var userchoice = prompt("do choose rock, paper or scissors?"); var computerchoice = math.random(); if (computerchoice < 0.34) { computerchoice = "rock"; } else if(computerchoice <= 0.67) { computerchoice = "paper"; } else { computerchoice = "scissors"; } var compare = function(choice1, choice2) { if(choice1 === choice2) { return "the result tie!"; } if(choice1 === "rock") { if(choice2 === "scissors") { return "rock wins"; } else { return "paper wins"; } } if(choice1 === "paper") { if(choice2 === "rock") { return "paper wins"; } else { if(choice2 === "scissors&

jquery - Using Javascript to POST xml to api -

i'm trying post xml data , redirect current page, can't seem work. when this: <form action="http://onehouse.freshdesk.com/helpdesk/tickets.xml" method="post"> it works , posts data website want to. however, leads user xml page want post , have redirect current contact form page , have success message of kind. i've tried using: function loadxmldoc() { var xmlhttp; if (window.xmlhttprequest) {// code ie7+, firefox, chrome, opera, safari xmlhttp=new xmlhttprequest(); } else {// code ie6, ie5 xmlhttp=new activexobject("microsoft.xmlhttp"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readystate==4 && xmlhttp.status==200) { document.getelementbyid("mydiv").innerhtml=xmlhttp.responsetext; } } xmlhttp.open("post","http://onehouse.freshdesk.com/helpdesk/tickets.xml",true); xmlhttp.send(); } i don't errors in conso

Excel COUNTIF with link to another workbook -

i trying count of records sheet in different workbook. i'm using following formula: =countif('c:\path\to\file\[work1.xlsm]sheetname'!$a:$a,"*")-1 note: file xlsm. has header row, that's why i'm subtracting 1 if have work1.xlsm file open @ same time 'summary' workbook, numbers populate , correct. once close work1, #value in cell. so 2 questions: is there reason won't work? is there better way write this? thanks consideration. countif doesn't work closed workbooks, looks can use counta, i.e. =counta('c:\path\to\file\[work1.xlsm]sheetname'!$a:$a)-1

python - How to read data from Excel and write it to text file line by line? -

i want write code data excel , write text file. here code have: import xlrd import os.path wb = xlrd.open_workbook(os.path.join('d:\trb 2014 data','sps1 demo data.xlsx')) wb.sheet_names() sh = wb.sheet_by_index(0) = 1 while sh.cell(i,11).value != 0: load = sh.cell(i,11).value d1 = sh.cell(i,13).value d2 = sh.cell(i,14).value d3 = sh.cell(i,15).value d4 = sh.cell(i,16).value d5 = sh.cell(i,17).value d6 = sh.cell(i,18).value d7 = sh.cell(i,19).value db1 = str(load) + " " + str(d1) + " " + str(d2) + " " + str(d3)+ " " + str(d4)+ " " + str(d5)+ " " + str(d6)+ " " + str(d7) file = open("output.txt", "w") file.write(db1 + '\n') file.close = + 1 the problem code data written text file displayed @ first row. therefore, although have 20 rows of data in excel, text file shows last data in excel file @ first row in text file. ha

Android: boolean value not changing? -

in program, boolean value (called metronomeon) supposed set true @ click of 1 button, , false @ click of different button. class have (mainactivity) implements runnable. after thread gets started, in run method, depending on value of metronomeon, it's supposed execute block of code. problem after onclick method button supposed set metronomeon true, metronomeon's value isn't changed. buttonlisteners (the method called in oncreate): public void buttonlisteners() { bstart.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { metronomeon = true; } }); bstop.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { currentbeatindex = 1; tvcurrentbeatindex.settext(""); metronomeon = false; } }); } the run method: if (metronomeon) { tvbpm.settext("in if statement");

jquery - How to disable buttons from Button Helper for single image, and enable all this buttons for the gallery? (Fancybox 2) -

fancybox 2. html: <p><b><h3>gallery</h3></b></p> <br /> <p><a class="image" rel="group" href="http://farm4.staticflickr.com/3787/9028269192_9b4ddf345d_b.jpg" title="tolpis barbata (mariluzpicado)"> <img src="http://farm4.staticflickr.com/3787/9028269192_9b4ddf345d_m.jpg" alt="" /> </a> <a class="image" rel="group" href="http://farm4.staticflickr.com/3745/8971419780_cb88b22947_b.jpg" title="(dsavin)"> <img src="http://farm4.staticflickr.com/3745/8971419780_cb88b22947_m.jpg" alt="" /> </a> <a class="image" rel="group" href="http://farm9.staticflickr.com/8522/8478415115_152c6f5e55_b.jpg" title="a ride in blue? (cembayir_photography)"> <img src="http://farm9.staticflickr.com/8522/8478415115_152c6f5e55_m.jpg" alt="&q

wsdl - Simplifing WsSecurity to JaxWS metro Implementation -

i'm using jaxws metro project implementation , i'm using tutorial add ws security feature web services. http://java.globinch.com/enterprise-java/web-services/jax-ws/secure-usernametoken-java-web-services-using-metro-wsit/ what have understand add ws security web service.you must first generate manually wsdl file add wsit configuration part web service put modified wsdl in project , modify sun-jaxws.xml take care of modified wsdl file(so not generate new one). think it's extremley difficult all web services.in addition,i'm using eclipse there no generating tool(like netbeans). want know there simple solution ?

ruby - Rails/nokogiri_parse multiples sites handling errors -

i developping on rails 3 , using nokogiri. controller parses multiples sites , shows result on view. problem is, when 1 of these sites unavailable (403 or 503 error example), webapp crashes because of site. my question: there way check availability of parsed pages before nokogiri opens it, or better, going through/ignoring unavailability ? thanks part of controller: docvariable1 = nokogiri::html(open("http://www.site1.com/")) @variable1 = {} docvariable1.xpath('//div[6]/h3/a').each |link| @variable1[link.text.strip] = link['href'] end docvariable2 = nokogiri::html(open("http://www.site2.com/")) @variable2 = {} docvariable2.xpath('//div[6]/h3/a').each |link| @variable2[link.text.strip] = link['href'] end docvariable3 = nokogiri::html(open("http://www.site3.com/")) @variable3 = {} docvariable3.xpath('//div[6]/h3/a').each |link| @variable3[link.text.strip] = link['href'] end part of view &l

matlab parallel processing on several nodes -

i have studied pages , discussion on matlab processing, still don't know how distribute program on several nodes(not cores). in cluster using, there 10 nodes available, , inside each node there 8 cores available. when using "parfor" inside each node ( locally between 8 cores), parallel-ization works fine. when using several nodes, think (not sure how verify this) doesn't work well. here piece of program run on cluster: function testpool2() disp('this comment') disp(['matlab number of cores : ' num2str(feature('numcores'))]) matlabpool('open',5); disp('this comment!!') tic; i=1:10000 b = rand(1,1000); end; toc tic; parfor i=1:10000 b = rand(1,1000); end; toc end and outputs : this comment matlab number of cores : 8 starting matlabpool using 'local' profile ... connected 5 labs. comment!! elapsed time 0.165569 seconds. elapsed time 0.649951 seconds. {warning: objects of distcomp.abstractstorage c

winforms - VB.NET - Combobox goes blank when a button is clicked, databind doesn't update -

please forgive me, has been time since i've used vb.net may easy. i have simple login form text box, combobox , button. combobox binded sql database , displays user names users table. idea select name, type in password, , logon new form (this part works great!). if type wrong password, form pops message says "invalid." reason @ stage, combobox goes blank. drop down has empty spaces names once were. typing in name password here results in object reference errors. have tried combo box reset , searched web nothing works!!! (i know not secure login, easy example of binding data combo box , checking against sql table). help! enter code here private sub button1_click(sender object, e eventargs) handles btn_logon.click try dim str_user string = users_namecombobox.selectedvalue dim str_pwd string = tb_pwd.text str_user = str_user.trim 'messagebox.show(str_user & "|" & str_pwd)'used verify stage works