Posts

Showing posts from August, 2013

vba - Shared Excel macro enabled workbook - Excel cannot access the file issue -

Image
what want do. send macro enabled excel document colleagues working macro opens save file dialog , generates csv. what have done? i have made vba-macro in excel 2013 , works fine on machine. however, when send macro enabled excel-sheet colleague gets: microsoft office excel cannot access file 'path document on computer'. there several possible reasons: the file name or path not exist. the file being used program. the workbook trying save has same name open workbook my source: sub convert2csv() dim filename string filename = "ordersedel_" & format(now, "yyyy-mm-dd hh mm") & ".csv" application.filedialog(msofiledialogsaveas) .title = "xxx" .allowmultiselect = false .initialfilename = filename .filterindex = 15 result = .show if (result <> 0) ' create file filename = trim(.selecteditems.

xcode - Swift TableViewController is in Landscape -

i have tableviewcontroller when row tapped on goes url using kinwebbrowserviewcontroller. tableviewcontroller should in portrait kinwebbrowserviewcontroller can landscape or portrait. when go tableviewcontroller in landscape tableviewcontroller in landscape. how can stop this? the code orientation: class customnc: uinavigationcontroller { override func supportedinterfaceorientations() -> int { if visibleviewcontroller kinwebbrowserviewcontroller { return int(uiinterfaceorientationmask.all.rawvalue) } return int(uiinterfaceorientationmask.portrait.rawvalue)} } the code didselectrowatindexpath: override func tableview(tableview: uitableview, didselectrowatindexpath indexpath: nsindexpath) { let linkitem = linklabels[indexpath.row] string let webbrowser = kinwebbrowserviewcontroller() let url = nsurl(string: linkitem) webbrowser.actionbuttonhidden = true webbrowser.loadurl(url) self.navigationcontroller?.pushviewcontroller(web

database - SilverStripe CMS unpublish without user interaction -

a site of mine has strange behavior. time time of pages unpublished without user interaction. in page history there no entry activity. pages children of secured page. the unpublished pages not same. varies in page , in period. the apache access files give no information access outside. for testing changed content of these pages. after waiting few days 1 of these pages unpublished again. content of page did not change. can exclude possibility of nightly recovery of database provider. how can possible? system: silverstripe 3.1.12 (cms/framework) we can use onbeforeunpublish notify of when page unpublished debug problem. through sitetree extension. we declare sitetree extension in our config.yml file (or alternative yml file): sitetree: extensions: - sitetreeextension in extension class add onbeforeunpublish function email when ever page unpublished: class sitetreeextension extends dataextension { public function onbeforeunpublish() {

jsf - Validate regex for PrimeFaces Password -

i have password , repeat password fields,but want validate passwords depending on validate regex pattern along matching both password fields too. <p:outputlabel for="password" value="password" /> <p:password id="password" redisplay="true" value="#{newuserbean.newuserdto.password}" match="repeatpassword" label="password" required="true" requiredmessage="password required, cannot empty" validatormessage="password , repeat password fields must same" feedback="true" promptlabel="password should contain atleast 8 characters ,1 number , 1 special character" > </p:password> <p:outputlabel for="repeatpassword" value="repeat password" /> <p:password id=

ios - how to replace loading image from html img src on loading it from local file -

i have html code. want preload images , save in local file. transform html nsattributedstring , show string in uitextview. nsattributedstring *htmlattributedtext = [[nsattributedstring alloc] initwithdata:[htmltext datausingencoding:nsutf16stringencoding] options:@{ nsdocumenttypedocumentattribute : nshtmltextdocumenttype } documentattributes:nil error:&err]; textview.attributedtext = htmlattributedtext; how load images local file instead of loading internet? if understand right, me simplest , fastest way use sdwebimage after once downloaded image, lib save , next time when try download image same url lib give cached image.

xml - Treating sibling nodes as one for XSLT Muenchian grouping -

i'm trying use muenchian grouping display company policy documents in hierarchical way. policy documents added sharepoint , tagged language, category , document type. i'm using xml creates. i need take data 2 merged lists. way sharepoint works, my xml looks (with rows element each sharepoint list): i've had simplify remove hundreds of attributes sp adds went on stackoverflowsize limit, structure accurate. <dsqueryresponse> <rows> <row title="testitem" category="category 1" language="english" documenttype="content" /> </rows> <rows> <row title="doc1" category="category 1" language="english" documenttype="policy" /> <row title="policy2" category="category 2" language="english" documenttype="policy" /> <row title="policy3" category="category 1" language="neder

javascript - Checking if function exist in same scope when supplied the function name -

i've got format prototype method (simplified) , wanna check if char alphabetic (case insensitive), and if it's function declared in same scope . if is, want call function. if pass in x should execute alert. i'm gonna using method format date given format string. e.g. format('h:i:s') check if h, i, , s function , call them. how can achieve that? i tried based on answer: https://stackoverflow.com/a/359910/1115367 here's code: function time() { //initialization } time.prototype = { format: function (char) { if (char.test(/[a-z]/i) && typeof window[char] === 'function') { //undefined window[char](); } function x() { alert('works'); } } }; if pass in value returns: uncaught typeerror: undefined not function there no way retrieve local variables (or function) name (as far know anyway). declared named functions assigned variable of same name: func

java - error in attribute extended from trait in scala -

i using scala , have trait attribute "name" extended trait in userclass accessing attribute when tried declare name in trait this val name : string it gave error in child class child class ha unimplemented member when tried val name : string = "" it worked fine please tell me difference , reason why not working before , why worked after modification i'm assuming code looks this: trait hasname { val name : string } class person extends hasname a trait is, nature, abstract , means allowed have unimplemented methods. in effect, trait declaring this: all classes extending hasname guaranteed have val name : string instance variable. in variable dependent on actual child class in case above, code expanded to: trait hasname { val name : string = ??? } where ??? means particular 'function' unimplemented. after modification: trait hasname { val name : string } class person extends hasname {val name :

html5 - <picture> element doesn't work correctly - works partially on new devices -

i trying use <picture> element change size of logo if visits website mobile devices example. this code i'm using : <picture> <source srcset="http://www.pixelmedia.ro/ina/wp-content/themes/compass/ina/logo.jpg" media="(min-width: 1125px)"> <source srcset="http://www.pixelmedia.ro/ina/wp-content/themes/compass/images/logo-mobile.jpg" media="(min-width: 768px)"> <source srcset="http://www.pixelmedia.ro/ina/wp-content/themes/compass/images/logo-mobile.jpg" media="(max-width: 1123px)"> <img src="http://www.pixelmedia.ro/ina/wp-content/themes/compass/ina/logo.jpg" alt="alt text examplle!"> </picture> problem code works partially. example works on android cell phone latest version of chrome doesn't work on iphone 6. works on desktop , if resize de browser window change logo. however, not case on many new tablets. question problem ... ma

c++ - std::atomic<bool> fetch_and() and fetch_or() realization -

c++11 doc defines std::atomic::fetch_or() , std::atomic::fetch_and() integral types. in way, msvc++ 2012 std::atomic< bool > not implements functions. know why? i found solution. implement specialization std::atomic_fetch_or<bool> , std::atomic_fetch_or<and> . namespace std { template<> inline bool atomic_fetch_or<bool>(std::atomic<bool>* atom, bool val) { bool bres = !val; atom->compare_exchange_strong(bres, true); return bres; } template<> inline bool atomic_fetch_or_explicit<bool>(std::atomic<bool>* atom, bool val, std::memory_order order) { bool bres = !val; atom->compare_exchange_strong(bres, true, order); return bres; } template<> inline bool atomic_fetch_and<bool>(std::atomic<bool>* atom, bool val) { bool bres = true; atom->compare_exchange_strong(bres, val); ret

python - Bitnami Django Stack and module "requests": cannot import name 'certs' -

very specific stuff. i'm running bitnami django stack cloud vm on amazon. on 2 different "regular" machines, install requests running sudo pip install requests , seems bitname uses it's own specific structure, , going wrong when installing requests way. can related issue #2028 , fixed long time ago. i have following traceback: environment: request method: request url: http://54.94.226.137/ django version: 1.7.7 python version: 2.7.6 installed applications: ('django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.sites', 'vz_base', 'vz_api', 'vz_admin', 'vz_user') installed middleware: ('django.contrib.sessions.middleware.sessionmiddleware', 'django.middleware.common.commonmiddleware', 'django.middleware.csrf.csrfviewm

SQL count without wrapping query -

i have following hypothetical code , works getting number of rows of site select count(*) ( select site (select...) x left join foo.bars on foo.id = x.id group site ) is there other way count without using outer select? you can want count(distinct) : select count(distinct site) (select...) x left join foo.bars on foo.id = x.id; the 1 difference original version count null value of site . if important, query can modified take account.

sql - In postgres how do i use the apostrophe character as a literal -

i trying convert instances of character ’ ', cant work how it. this checks syntax okay isn't changing character ubuntu@ip-172-31-39-147:~$ echo "update musicbrainz.release set name = translate(name,'’','’') name ~ '[’]+';"|psql jthinksearch update 7284 if dont escape ' fails: ubuntu@ip-172-31-39-147:~$ echo "update musicbrainz.release set name = translate(name,'’',''') name ~ '[’]+';"|psql jthinksearch error: syntax error @ or near "[" line 1: ...ease set name = translate(name,'’',''') name ~ '[’]+'; and if escape it still fails different error ^ ubuntu@ip-172-31-39-147:~$ echo "update musicbrainz.release set name = translate(name,'’','\'') name ~ '[’]+';"|psql jthinksearch error: syntax error @ or near "[" line 1: ...ase set name = translate(name,'’','\'

jquery - Hide qTips on both distance and click event -

i want qtips hide on both events: click , distance :20, here code: hide : { distance : 20, }, if put instead of distance:20 -> event : 'click', works fine on click, if added both click gonna work!! can use both?? i tried using this: hide : { event: 'click', distance : 20, }, but said click works then!

Send file to ftp server using sockets in C -

i trying upload file ftp server using sockets. connects server , can read directories doesn't upload file. "stor" command creates file in server empty content. why getting "no data connection" response server , file empty? #include <sys/socket.h> #include <sys/types.h> #include <netinet/in.h> #include <netdb.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> #include <arpa/inet.h> int main(int argc, char *argv[]) { argv[0]="2"; argv[1]="ip"; int sockfd = 0, n = 0; char recvbuff[1024]; struct sockaddr_in serv_addr; char mesuser[100]="user ftpuser\n"; char mespass[100]="pass pass\n"; char mestor[100]="stor xx\n"; char mespasv[100]="pasv\n"; char meappe[100]="appe xx\n"; argc=2; if(argc != 2) { printf("\n usage: %s

statsmodels - Is there model selection score for GEE models besides the scale? -

i need compare different repeated measure or random effect models parameters have been inferred gee. however, there no model-selection variable besides scale. has implemented aic alternative gee proposed pan? http://50.28.42.145/faculty/wp-content/uploads/2012/11/rr2000-013.pdf other options model welcome

javascript - Adding a function to the scope of an Angular custom directive -

i have following angular directive. // component panel app.directive('component', function () { return { restrict: 'ae', scope: { heading: '@heading', componenttype: '@componenttype' getcomponenturl: function() { var componentpath = "./shell/partials/components/" + componenttype + ".html"; return componentpath; } }, template: '\ <div id="panel" class="panel panel-primary panel-component fill scrollable">\ <div class="panel-heading">\ <div class="row">\ <div class="col-sm-6">\ <h2 class="panel-title">{{heading}}</h2>\ </div>\ <div class="col-sm-6">\ <button type="button" class="btn btn-default pull-right btn-expa

android - When is ACTION_USER_PRESENT sent except for the screen unlocking? -

the documentation says: broadcast action: sent when user present after device wakes (e.g when keyguard gone). are there cases when action_user_present sent except screen unlocking?

c# - How to check a change in a Model Object fields without checking individual fields in MVC? -

i have big model public class somemodel { public int id { get; set; } .....a lot(24) of fields here..... } now on post actionresult edit(somemodel somemodel) want check if has been changed user respect original model values in database. using if else makes lot of messy code. there anyway check if altered user , if possible field altered user? i thinking using method one public class somemodel { //... public override bool equals(object obj) { var type = this.gettype(); bool sameobj = true; //for each public property 'somemodel' //[edited]type.getproperties().each(prop=>{ // sorry i'm using custom extension methode here //you should use instead type.getproperties().tolist().foreach(prop=>{ //dynamically checks they're equals if(!prop.getvalue(this,null).equals(prop.getvalue(obj,null))){ sameobj=false;

python - Using int containers with two x MCP3008 ADC Rpi -

the following code uses 2 mcp3008 chips attached rpi , home alarm panel. these 16 analog values fluctuate between 600 , 715 out of 1023 depending on pirs etc. the int value prints out: chip - 1023 chip b - 242 chip - 1023 chip b - 1023 chip - 0 chip b - 68 chip - 1023 chip b - 599 chip - 1023 chip b - 1023 chip - 16 chip b - 1023 chip - 1023 chip b - 1023 chip - 1023 chip b - 1023 i need: value 1 = chip 1 readvalue 1 value 2 = chip 1 readvalue 2 etc... i tried strings, lists, io, wrappers first value. could please go more detail want? currently, unclear. – sildoreth 35 mins ago mcp3008_a , mcp3008_b print out analog values chip.i want assign each of values specific name, eg.value1 = 1023, value2 = 654 etc.. want able write ( if value 2 >=653 ) , (value10 <= 702) something. hope explains bit better – maurice1 19 mins ago maybe clearer, @ bottom of code have #v1 = input.readline() , #

c# - ServiceStack.Text DynamicJson fails to parse an array -

running following code: var s = @"{ ""simple"": ""value"", ""obj"": { ""val"":""test"" }, ""array"": []"; var dyn = dynamicjson.deserialize(s); console.writeline(dyn.simple); console.writeline(dyn.obj); console.writeline(dyn.obj.val); console.writeline(dyn.array); prints: "value" {"val":"test"} base {system.dynamic.dynamicobject}: {"val":"test"} "test" "[]" which means dyn.obj returns object can continue navigate through dyn.array returns string . meaning cannot iterate through list of objects inside. what missing? edit i think have found issue. looking in github in pcl.dynamic.cs method yieldmember following: private bool yieldmember(string name, out object result) { if (_hash.containskey(name)) { var json = _hash[name].tostring(); if (json.

c# - How to disable Visual Studio 2008 localized string replacement in Designer? -

i use visual studio 2008, , in application have line of code in mainmenu.designer.cs this.btnsettings.text = "(5) " + strings.settings; where strings.exit following /// <summary> /// looks localized string similar settings. /// </summary> internal static string settings { { return resourcemanager.getstring("settings", resourceculture); } } but when rebuild application, above line converts automatically following this.btnsettings.text = "(5) settings"; how can turn off? i have line of code in mainmenu.designer.cs do not edit xxxx.designer.cs files. changes lost when ide regenerates file. need move statement constructor. ought find in mainmenu.cs source file.

java - Wrong Servlet path while using Servlet in form's action -

i trying send data login servlet using form in jsp. jsp , servlet in different folders. parent folder "mybay". in there folder named javaservlets , 1 named main_pages. in javaservlets there loginservlet.java , loginservlet.class. in main_pages there login.jsp. when submit username , password see tomcat stays in main_pages , does't in javaservlets folder. don't know if web.xml wrong. http status 404 - /mybay/main_pages/loginservlet //here see path wrong. right path /mybay/javaservlets/loginservlet can help? here code: login.jsp <form action="loginservlet" method="post"> <p> <label id="upodeiksh">username</label> <br /> <input type="text" name="username" id="koutaki" required/> </p> <br /> <p> <label

html - Table row width is changing to do match an element which is not inside the table-row -

Image
i have following html structure input icon on left side. <div class="fieldset"> <p>normal input</p> <div> <span><i class="icon-cart"></i></span> <input name=""> </div> </div> i using display:table properties style structure desired layout demonstrated in following image: however, icon ( <span> ) stretching width according title ( <p> ) above image below demonstrate: here current css used: /*fieldsets*/ .fieldset { width: 100%; display: table; position: relative; white-space: nowrap; margin-bottom: 15px; } .fieldset:last-of-type { margin-bottom: 0; } /*fieldsets > labels*/ .fieldset > p { width: 1%; margin-bottom: 3px; } /*fieldsets > input container*/ .fiel

Pass class as a function parameter in client program WCF C# -

i have written wcf program have class library declared function contains class parameter. i accessed function in client program don't know how pass class function. write code below. i have interface contains basic function declaration in class library there class implementing interface. interface contains method takes class parameter. that class parameter contains properties. [servicecontract] public interface icardetails { [operationcontract] string updatecardetails(car c); } public class cardetails : icardetails { public string updatecardetails(car c) { //some operations , initilizations string example = car.carno = "1234"; return "success"; } } public class car { private string carno; private string carmodel; public string carno { get{ return carno; } set{ carno = value; } } public string carmodel { get{ return carmodel; } set{ carmodel

Google Analytics Charts in javascript -

good morning. newbie in javascript, , think want easy, don´t know how. i'm trying draw google analytics graph display on own dashboard. code works, have several webs registered, , shows me same default unless change manually(the field called property). default web another. here code (i have changed client id 'xxx' <html> <head> <title> google analytics charts </title> </head> <body> <p align="center"><b><u>visits<u> </b></p> <!-- step 1: create containing elements. --> <section id="auth-button" hidden></section> <section id="view-selector"></section> <section id="timeline" class="left clear"></section> <section id="pie" class="right"></section> <section id="table" class="left clear"></section> <section id="gauge" class="r

built in - Implementing `__dir__` in Python: Does it need to return a list and does the list need to be sorted? -

i have class implements __dir__ method. however, not entirely nitty gritty details of dir api. a : required __dir__ returns list? implementation using set avoid listing attributes twice, need convert list before returning? documentation guess has list: if object has method named dir (), method called , must return list of attributes. however, not returning list break functionality @ point? b : result need sorted? documentation bit ambiguous here: the resulting list sorted alphabetically. does mean, calling built-in dir automatically sorts data returned __dir__ or mean dir expects sorted data __dir__ ? edit: btw, question encompasses python 2 (2.6 , 2.7) , 3 (3.3, 3.4). under python 2.7.3, answers are: a: yes, must list: >>> class f: ... def __dir__(self): ... return set(['1']) ... >>> dir(f()) traceback (most recent call last): file "<stdin>", line 1, in <module> typeer

asp.net mvc 4 - MVC4 model binding and int/decimal overflow -

let's created model property int? type. public class mymodel { [range(-100, 100, errormessage="too large")] public int? myvalue { get; set; } } in view use text box in form post server. @using (html.beginform()) { <p>enter value</p> <div>@html.textboxfor(m => m.myvalue)</div> <div>@html.validationmessagefor(m => m.myvalue)</div> <input type="submit" value="submit" /> } here controller code public class homecontroller : controller { public actionresult index() { var model = new mymodel(); return view(model); } [httppost] public actionresult index(mymodel model) { return view(model); } } now if enter extremely large number in text box, e.g 111111111111111111111111111111111111111111111111111111111111111111111111111111 , sure large integer data type. on post back, got message the value 

javascript - How do I change the installation path in an OS X installer built with pkgbuild/productbuild? -

we have application installs custom folder , have create installer application extension (plugin). installer of host application created cross-platform tool, permits user choose installation folder , permits install multiple versions on same system. host application not "app", in case of many mac programs, directory contains several files + "app". plugin installer should: 1. pkgbuild/productbuild based, because doesn't want use cross-platform installer because java based , had troubles it 2. query installed host applications cfbundleidentifier , choose 1 install 3. install content of payload directory of chosen host application managed find solutions first 2 requirements, don't know how proceed third. is there solution change installation path distribution.xml? played choice.customlocation attribute, didn't managed modify javascript. there "elegant" solution it? thanks.

authentication - How does SSL affect .NET Web Api security? -

i've read authentication , authorization inside of asp.net web api , i've understood must use ssl in order not letting people hold of authentication tokens. , if i'm not misstaken theese authenticantokens sent inside of header? , ssl hides theese headers public not to catch if use tools internet listening? if thats case guess create "custom" authentication not allowing api run unless specific header sent api call? people shouldn't able catch if use ssl? i realized i've used alot of questionmarks illustrate unclear thoughts are, or input highly appreciated, thanks! authentication, authorization , securing connection on ssl 3 different parts of web application. authentication basically authentication handles who are. example login provide user , password. application knows now, are. authorization authorization manages access rights user. says, on what have access. example if you've provided correct credentials, authenticated , ma

arrays - Replace sequence of integers in vector by single number -

let a vector of integers in want replace sequence of numbers precise number. example: a = [ 8 7 1 2 3 4 5 1 2 3 4 5 6 7 ] and want replace sequence 1 2 3 9 . the result be: b = [ 8 7 9 4 5 9 4 5 6 7 ] any advice? this 1 approach strfind , bsxfun - pattern = [1 2 3]; replace_num = 9; b = start_idx = strfind(a,pattern) %// starting indices of pattern b(start_idx) = replace_num %// replace starting indices replacement b(bsxfun(@plus,start_idx(:),1:numel(pattern)-1))=[] %// find group %// indices of pattern except starting indices , %// delete them

jquery - Getting ias working with ajax + pods in Wordpress -

so want infinite scroll ( http://infiniteajaxscroll.com/ ) work html part is: <div id="pagination"> <span class="pods-pagination-paginate "> <span class="page-numbers current">1</span> <a class="page-numbers" href="?action=search_speaker&amp;sort=az&amp;pg=2">2</a> <a class="page-numbers" href="?action=search_speaker&amp;sort=az&amp;pg=3">3</a> <a class="next page-numbers" href="?action=search_speaker&amp;sort=az&amp;pg=2">next ›</a> </span> </div> <div class="wrapper-pane clearfix"> <div class="pane"></div> <div class="pane"></div> <div class="pane"></div> <div class="pane"></div> </div> the js code is: var ias = jquery.ias({ container: ".wrapper-pane", item: ".pa

sprite kit - How to invoke a ColorSprite( set in GameScene.sks) in GameScene.swift or GameViewController.swift? -

i'm newbie sprite-kit. here question below, 1) add color sprite in gamescene.sks named "spritename" 2) want add physicsbody "spritename"(the color sprite) in scene.swift or gameviewcontroller.swift. so how ? i've found way tutorial below: http://www.techotopia.com/index.php/an_ios_8_swift_sprite_kit_level_editor_game_tutorial#creating_the_archery_scene and here key line in above example. let archeryscene = archeryscene(filenamed: "archeryscene") the first "archeryscene" .swift ,and latter .sks line means combine these 2 difference files name. and below way call .sks node in .swift let welcomenode = childnodewithname("welcomenode")

php - 1146 Table doesn't exist -

i follow error 1146 message: table 'system.qbruw_extensions' doesn't exist sql=select * qbruw_extensions element='com_imageshow' , type='component reinstall of component doesn't fix problem. qbruw_extensions existing in joomla mysql database com_imageshow folder existing in components folder of joomla joomla database repair doesn't fix problem. joomla 3.4.1 installed... try this select * dbjoomla.qbruw_extensions element='com_imageshow' , type='component' solution : next missing table either export required tables dbjoomla , import system database or use jdatabasedriver->getinstance method connect external database

Android mime messages to send email -

currently have , android app uses api javax.mail send emails. want same thing api more lightweight it. trying using org.apache.commons.net smtpclient , have achieved send simple text emails. problem don't know how add , attachment email. solution seems create manually mime messages. exist android lightweight api build mime messages can send using smpt? thanks

shape - Best type of collisions for this game -

i'm litte confused, because wanted create clone of 2d game ride tank , bullets can bounce walls, have irregular shapes (i paste link example @ end of post). , i'm stuck on collision detection "weird shapes", because don't know technique best. have read "bezier curve", "bresenham algorithm", "pixel perfect collision" , few other, still feel coplicate , believe there must simpler solution, don't see it. advice me should use, if want have ball bouncing shape? here video of game, want copy: https://youtu.be/dqdixlvkfvy i'm sorry quality, phone isn't there best device recording videos :p ps game called "action 2-4 players" - can search on youtube if want video better quality. :)

parsing - Can the antlr4 parser see matching opening and closing text pattern? -

i'm matching user-defined html-template tags (simplified): {% label %} ... {% endlabel %} the "label" alphanumeric value user can define himself, e.g.: {% mytag %}<div>...</div>{% endmytag %} is there way tell parser label start tag text has match endlabel end tag text? in other words, want invalid: {% mytag %}<div>...</div>{% endnotmatchingtag %} my lexer looks this: label : alpha (alpha|digit|underscore)* ; fragment underscore: '_' ; fragment alpha: [a-za-z] ; fragment digit: [0-9] ; end : 'end' endlabel : end label tagstart : '{%' tagend : '%}' ws : [ \t\r\n]+ -> skip ; and parser rule looks similar this: customtag: tagstart label tagend block tagstart endlabel tagend; (and block matches text or other tags recursively) right i'm checking match in listener, hopin

c# - How to determine if an element is matched by CSS selector? -

given selenium webdriver element instance, check if element matched given css selector. functionality similar jquery's is() function. i'm using .net bindings. example (suppose method called is ) var links = _driver.findelements(by.cssselector("a")); foreach (var link in links) { if (link.is(".myclass[myattr='myvalue']")) // ... else // ... other thing } is there kind of built-in stuff achieve this, or if not, can suggest possible implementation? i'm new selenium, , have no idea yet. update i see there no built-in way this. final goal implement methods jquery's parents(selector) , closest(selector) , suggestions appreciated more special case. there no selenium method equivalent of jquery's $(...).is(...) . however, dom offers matches . not complete replacement $(...).is(...) since not support jquery's extensions css selector syntax but, again, selenium not support these extensions either. yo

php - sql query to merge data of two table and display output -

below 2 table . i need join both table data , fetch result accordingly... for ex - in scheme master table there 8 rows different receipt no. in receipt entry table there 2 receipt created ... so need display balance receipt scheme master table book , receipt not present in receipt entry table. table name - scheme_master book_no2 receipt_no createddate 401 10 15-03-2015 401 11 15-03-2015 401 12 15-03-2015 401 13 15-03-2015 403 25 15-03-2015 403 26 15-03-2015 403 27 15-03-2015 403 28 15-03-2015 405 35 15-03-2015 405 36 15-03-2015 405 37 15-03-2015 405 38 15-03-2015 table name - receipt_entry book_no receipt_no 401 10 403 26 i need receipt not present in receipt entry table. expected output

javascript - How do I submit the value of a jQuery variable in a form? -

this should easy question. basically have form without fields, instead want pass along data on user has done on page when clicks submit button. data simple, few integers , strings stored in various jquery/javascript variables. however, i'm @ loss on how pass these variables along form , save in database. should first transform them instance variables , pass along via hidden form fields? should make entire form in jquery? should do? use ajax submit form. otherwise can modify values of form before submit. ie $('#whateverinput').val(yourvalueinavariable); run before form submit , should have new value server-side. don't think need ajax can try if want. can have hidden fields in form , modify values. if want try ajax http://api.jquery.com/jquery.ajax/ , follow format provided ie $.ajax({ url: "urlthatwillacceptdata", data: { javascript object here}, success: function() { want show success message here } });

"Excel has stopped working" when using VBA macro with on change event -

i experiencing consistent "excel has stopped working" error. have user form populates combo box dependent drop-down options based on user selects in 1st combo box. the error consistently created any of on-change event subs when user types 2nd combo box letter corresponds existing value should in 2nd box. if user selects option drop-down list, not occur -- when user types in 1st letter of matching value. example: if 1st combo box "fruit", 2nd combo options might "apple", "orange", etc. if user types in "a" or "o" in 2nd box (because matches corresponding values), crashes excel. why not "fill in" matching value on 1st combo box? error handling in place, never throws error in code, "excel has stopped working", crash. do need use enable/disable worksheet events within macros? if so, please offer suggestion of how implement , explanation of how works. have solved previous on change problems co

c++ - Int Array[ ] not printing good. -

here code: #include <stdio.h> void main() { int indeks, a[11], j, rezultat[50]; int n = 0; printf("unesite elemenate niza\n"); while (n < 10) { for(indeks = 0; indeks < 10; indeks++); scanf("%d", &a[indeks]); n++; } (n = 0; n < 10; n++) { printf("%d\n", a[n]); } } hello , have problem doesn't print array integer number enter in . it print out -858993460 ten times. this how looks in cmd. (sorry bad english) unesite elemenate niza: 1 /input starts here 3 5 1 0 2 3 5 7 4 /ends here -858993460 -858993460 -858993460 -858993460 -858993460 -858993460 -858993460 -858993460 -858993460 -858993460 /output result press key continue . . . the for loop nothing, since ends ; , while loop iterates, indeks 10 . suggest following #include <stdio.h> int main() // correct function type { int indeks,

javascript - Why angularJS loop rendering boxes in new row -

Image
i have products want display side side this. this hard coded code works fine. <div> <div class="box"></div> <div class="box"></div> <div class="box"></div> <div class="box"></div> <div class="box"></div> <div class="box"></div> but when trying achieve same thing angularjs loop. <div ng-repeat="product in products"> <div class="box"> //i fill details here. </div> </div> i got result. this css class. .box { padding : 5px; display : inline-block; min-width: 100px; min-height: 50px; background-color: red; } what changes need products can display side side , in next row if screen width full. fixing original problem your ng-repeat should on <div class="box"> <div> <div ng-repeat="product in products"