Posts

Showing posts from April, 2014

c# - Check if the image resource is null -

i working on windows phone 8 application. string image = "/mydata/" + myobject.imagename + "big.png"; bitmapimage bmp = new bitmapimage(new uri(image , urikind.relative)); myimage.source = bmp; i have image in folder mydata/, have 2 sets of images <imagename>big.png,<imagename>small.png. so here happening want check if <imagename>big.png exists in location or not, if not pick <imagename>small.png. how ? edit i solved myself, here how. file.exists("path file") here path should `foldername/filenames` , not `/foldername/filenames` thanks helped me. string image = "/mydata/" + myobject.imagename + "/big.png"; string filename = path.getfilename(image); if(!string.isnullorempty(filename)) { messagebox.show("file exist -"+filename); } else { messagebox.show("no file exist -"); } bitmapimage bmp = new bitmapimage(new uri(image , urikind.relative)); if

javascript - Updating MongoDB array from variable array in batch operation? -

i working in node.js , attempting push or pull contents of array mongodb collection. [working] code pull objects array in fieldarray looks this: for (var i=0; < mylist.length; i++) { collection.update( {field:"myvalue"}, {$pull: {fieldarray: mylist[i]}}, function(err, item){...} ); } i'm aware of ability use $push/$each, $addtoset/$each , $pullall don't seem accept values dynamically array (or haven't found indication can). basically, i'd able use function array of 1 item or 1 hundred, using appropriate batch calls. is there way make such call without having loop through separate call on database each iteration? you want $pullall . trying iterate over collection.update( { "field": "myvalue" }, { "$pullall": { "fieldarray": mylist } } ) if doesn't work then array elements not matching structure used in document. make them way.

return model object from spring controller -

i have spring controller in curd methods there. @controller public class editemployeecontroller { @autowired private employeemanager employeemanager; @requestmapping(value = "/", method = requestmethod.get) public string listemployees(modelmap map) { map.addattribute("employee", new testemployee()); map.addattribute("employeelist", employeemanager.getallemployees()); system.out.println("calling listemployees"); return "editemployeelist"; } @requestmapping(value = "/add", method = requestmethod.post) public string addemployee(@modelattribute(value="employee") testemployee employee, bindingresult result) { employeemanager.addemployee(employee); return "redirect:/"; } @requestmapping("/delete/{employeeid}") public string deleteemplyee(@pathvariable("employeeid") integer employeeid) { employeemanager.deleteemployee(em

Python BeautifulSoup similar divs in the same container sorting -

i able scrape data want, since divs in 1 container "content-body" when results dumped whole ( can test code , see) in match_date match tourny. import requests bs4 import beautifulsoup, tag lxml import html import requests import mysqldb import urllib2 import itertools import re import sys datetime import date, timedelta td, datetime urls =("http://www.esportsheaven.net/?page=match") hdr = {'user-agent': 'mozilla/5.0'} req = urllib2.request(urls,headers=hdr) page = urllib2.urlopen(req) soup = beautifulsoup(page) tournament=soup.findall('div',{'class':['content-body']}) match_time = soup.find_all("div", style = "width:10%; float:left;") match = soup.find_all("div", style = "width:46%; float:left; margin-left:2%; margin-right:2%") tourny = soup.find_all("div", style = "width:40%; float:left; overflow:hidden;") tag in tournament: tag in match_time: pr

javascript - button not work in IE11 -

problem: http://jsfiddle.net/7zdbb/1/ if click first , second row's deny button, third row's deny button can't click in ie 11. i tested on ie8、ie9、ie10、firefox , chrome, , not problem. this source code. <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <style> #main table{ border-collapse:collapse; width:100%; } #main td{ border:1px solid #eea; padding:4px 6px; } #main table tr.excepted td{ background:#f99; } form table {background:#fefef1} </style> <script src="jquery.js" type="text/javascript"></script> </head> <body > <div id="base"> <div id=&qu

generating alphanumeric employees id using trigger in mysql? -

hello friends want create table employees create table if not exists `employees` ( `sno` int(11) not null auto_increment, `empcode` varchar(20) not null, `employeename` varchar(20) not null, `fathername` varchar(20) not null, `gender` varchar(6) not null, `dob` date not null, `contactno` varchar(12) not null, `address` varchar(100) not null, `city` varchar(20) not null, `state` varchar(20) not null, `branch` varchar(20) not null, `dateofjoining` date not null, primary key (`sno`), unique key `empcode` (`empcode`) ) engine=innodb default charset=latin1 auto_increment=1 ; and want generate unique employee code when insert new record in employees table in sequence in employees table example cg000001 cg000002 ... on using mysql trigger not able logic fail time please me using after trigger can't access new flushed. you need before trigger. create trigger bi_table_name before insert on employees each row begin set new.empcode = c

add two date using datetime php class -

i need add 30 days 2014-03-06 . i've done below code:- $due_dt = new datetime("2014-03-06"); $act_dt = $due_dt->add("+30 days"); this code giving below error:- message: datetime::add() expects parameter 1 dateinterval, string given any please... use datetime::modify $date = new datetime('2014-03-06'); $date->modify('+30 days'); echo $date->format('y-m-d');

android - How to create a link to google live traffic maps from my Application? -

i implementing live traffic data in application. tried many ways add google traffic data application. didn't succeed. decided integrate google maps live traffic link application. how that? can me? if using google maps api android v2 sdk, can use : googlemap.settrafficenabled(true); to display traffics layer on google maps. more : https://developers.google.com/maps/documentation/android/reference/com/google/android/gms/maps/googlemap#settrafficenabled(boolean)

c# - How do I get StatusCode from HttpRequestException? -

i'm missing obvious here. i'm using httpclient throws httprequestexception contains statuscode in message string. how can access statuscode ? edit : more info, wrote question in rush. i'm using httpclient access api within webapi project. yes, know why i'm calling ensuresuccessstatuscode() . want propagate errors downstream such 404 , 403. all wanted consistently transform httprequestexception httpresponseexception using custom exceptionfilterattribute . unfortunately, httprequestexception not carry info use besides message. hoping uncover statuscode in raw (int or enum) form. looks can either: use message switch status code (bleh) or create version of ensuresuccessstatuscode , throw exception that's usable. status code passed part of string httprequestexception cannot recover such exceptions alone. the design of system.net.http requires access httpresponsemessage.statuscode instead of waiting exception. http://msdn.m

extjs - submit form on ENTER press int EXT js -

i new ext.js; need submit form when enter pressed below code dont know call in listener of password field here code: ie:what function call in listener <script type="text/javascript"> ext.onready(function() { ext.tip.quicktipmanager.init(); ext.create("ext.container.viewport", { layout: "border", rtl: <spring:theme code='theme.rtl' text='false' /> }); ext.create("ext.window.window", { title: "<spring:message code='title.login' text='login' />", height: 310, width: 450, closable: false, layout: "border", items: [{ xtype: "panel", border: false, bodycls: "login-header", height: 160, region: "north"

security - wso2 esb policy with user groups -

i'm trying create policy xml secure proxy service. take policy xml example i'm not able add user on user groups. when give url of policy marks security if properties type of security usernametoken user groups empty. <wsp:policy wsu:id="utovertransport" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> <wsp:exactlyone> <wsp:all> <sp:transportbinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"> <wsp:policy> <sp:transporttoken> <wsp:policy> <sp:httpstoken requireclientcertificate="false"></sp:httpstoken> </wsp:policy> </sp:transporttoken> <sp:algorithmsuite xmlns:sp="http://schemas.xmlsoap.org/w

node.js - NodeJS OpenShift App times out on https, but not http -

i've got simple app deployed on openshift uses cloudflare dns provider, since support cname records root domain, our current domain provider not. the issue setup somewhere along line https not working. believe openshift issue because it's same kind of issue when you've mapped domain name app haven't added proper aliases yet - timeout essentially. we've got 2 aliases - www , without. there's no option specify https or openshift aliases can see. there aren't ssl certificates assigned these aliases not need or use https - we're on free plan. the main url access site http://www.jcuri.com - notice works expected, https://www.jcuri.com times out. initially thinking of using cloudflare page rules auto-redirect non-https url locked down behind paywall we're hoping avoid, don't need of pro features. is there i'm missing here? seems openshift denying https connections purely because don't have certificates assigned aliases. wouldn&#

jquery - Okvideo : Redirect to another page/section after video finished playing -

i trying full screen background video vimeo. found okfocus's okvideo, how make page jump page after video finished playing? i'm quite new jquery~ helping! look @ line 257 of okvideo.js. contains conditional tests see if video finished. if replace next line like: location.href = 'http://url.com'; this should link page once video complete. may have try setting onfinsihed option loop. hope helps!

video - Changing parameters in real time -

i running pipeline gstreamer . is there way change parameters of application/x-rtp in real time? for example- "play-speed" field. maybe events? couldn't understand how. edit: the main problem using seek event "pcapparse". when load mp4 file, seek event works great. but when load pcap file, nothing happens on seek event. those 2 pipelines: data.pipeline = gst_parse_launch ("filesrc name=my_filesrc ! queue ! decodebin2 ! autovideosink", null); data.pipeline = gst_parse_launch ("filesrc name=my_filesrc ! queue ! pcapparse caps=\"application/x-rtp, payload=(int)96, media=(string)video, clock-rate=(int)90000, encoding-name=(string)h264, **play-speed=2.0**\" ! queue ! gstrtpjitterbuffer latency=100 ! decodebin2 ! autovideosink", null); i found can control video speed "play-speed" on "application/x-rtp". problem have set before hit play button- not in real time. i'd if send

windows phone 8 - Display splash page only on the 1st launch, or after a crash or a kill of the app -

could please explain how display splash page when first launch or crash or kill app in windows phone. you use isolatedstorage check if app opened before or not private static bool hasseenintro; /// <summary>will return false first time user ever runs this. /// everytime thereafter, placeholder file have been written disk /// , trigger value of true.</summary> public static bool hasuserseenintro() { if (hasseenintro) return true; using (var store = isolatedstoragefile.getuserstoreforapplication()) { if (!store.fileexists(landingbitfilename)) { // write placeholder file 1 byte long know they've landed before using (var stream = store.openfile(landingbitfilename, filemode.create)) { stream.write(new byte[] { 1 }, 0, 1); } return false; } hasseenintro = true; return true; } } for crash system, use bugsense windows phone

Calendar control of crm 2013 Online is not working in chrome -

one of our client updated windows 8.1 , had ie 11, not officially "supported" crm yet. recommended him switch chrome calendar control not working there.it shows blank box instead of calendar.we had tested in windows 8.1 on chrome,calender control working fine.but not track problem on system.does have same problem?

c++ - How to add options check menu to CMFCToolBar to allow multiple checks at time -

Image
i want add menu button cmfctoolbar allow checking multiple options @ time, when add menu , check item on click menu closed need menu menu in customization button in following image first, suggest different design. you're proposing non-standard behavior. menus don't act way. second, how menu close when selections complete? now, having said that, if feel need pursue design, recommend handle cmfctoolbarmenubutton::openpopupmenu , derive own menu cmfcpopupmenu. cmfcpopupmenu mini frame window @ lower level. should able provide behavior want within derived popup menu class.

android - version request fail error by versions dots? -

i'm trying create version query in as3. search current version works fine var appxml1:xml = nativeapplication.nativeapplication.applicationdescriptor; var ns1:namespace = appxml1.namespace(); var current1:string = appxml1.ns1::versionnumber[0]; online search new version works fine var apploader:urlloader = new urlloader(); var apprequest:urlrequest = new urlrequest("http://xxx/app/version/app.xml"); apprequest.method = urlrequestmethod.post; apploader.load(apprequest); var xml:xml = xml(apploader.data); i fail @ if statement if (xml.version > current1) { gotoandstop(3); } current version 2.0.0 new online version 2.0.1 code in frame 2, when testing movie not stop in frame 3 remains on frame 2 i suspect error dots in version number. possible? how solve problem. thank (sorry bad english) i wrote utility function, simple, test versions. compare versions, , result can 1 - if version1 greater version2, 0 - version1 , version2 equal, -

javascript - how to submit html form with current hash location -

i have html form want able submit current hash location <form action="editcustomer.php?seq=<?php echo $_get["seq"]; ?>#" method="post" name="form1"> is possible? to current hash value, you'll need this: <form onsubmit="this.action='editcustomer.php'+location.hash" action="editcustomer.php" method="post" name="form"> off topic: it's common practice this, makes possible jump added anchor point, example directly submitted form (#form-xy), enhancing user experience.

.net - BizTalk send port with NTLM authentication and custom user and password -

i want set send port in biztalk can send requests service uses ntlm authentication. i have tried using wcf-basichttp transportcredentialonly , ntlm believe biztalk uses account used host. is possible specify custom username , password? if using ntlm authentication trying set user name , password has no effect use identity of host user. no, can't specify custom username , password. so if want use user have create host running under user, opens can of worms user have member of windows group other host users run under. edit other suggestion others have made use custom binding, blog yet on biztalk impersonation wcf adapters paolo salvatori goes detail how achieve that.

Serialize DateTime property to XML in C# -

i´m programming student , know if possible change format of date when serialize in xml file. date attribute of observablecollection of objects "loan", objects have 2 datetime properties, 1 of dates nullable object. serialize collection including date. i obtain in xml file: <outdate> 15-03-2014 </outdate> <!--if date null don´t want appear node--> and i´m getting this: <outdate>2014-03-15t00:00:00</outdate> <indate xsi:nil="true" /> this part of code project: part of class loan, mark serializable, looks this: private string isbn; private string dni; private datetime dateout; private datetime? datein; // setters , gettters , constructors this method serialize: // pass 3 collections method loans, books , clients public void serializetoxml<t>(string file, string node, observablecollection<t> collection) { xmlrootattribute root = new xmlrootattribute(node);

android - Google in app purchase and cracking -

i developed app that's become popular , cracked it. know if know, first of all: how?, if know workaround avoid this. app using in-app purchase per google example unlock premium features in way: private iabhelper mhelper; if (!ispro(getactivity())) { mhelper = new iabhelper(getactivity(), kkk); mhelper.enabledebuglogging(true); mhelper.startsetup(new iabhelper.oniabsetupfinishedlistener() { public void oniabsetupfinished(iabresult result) { if (!result.issuccess()) { return; } // have been disposed of in meantime? if so, quit. if (mhelper == null) return; // iab set up. now, let's inventory of stuff own. mhelper.queryinventoryasync(mgotinventorylistener); } }); } iabhelper.queryinventoryfinishedlistener mgotinventorylistener =

linux - Cannot connect Mapr-tables on Mapr-FS? -

hj all, i'm use mapr m7 edition on centos 6.4, 64bit. i'm test mapr-tables on mapr click mapr-tables --> error home directory (/user/root) missing user. please create in order cache recent tables administered user. i'm read mapr doc show: http://doc.mapr.com/display/mapr/setting+up+mapr-fs+to+use+tables set user directories mapr tables because mapr tables, files, created users, mapr tracks table activity in user's home directory on cluster. create home directory @ /user/ on cluster each user access mapr tables. after mounting cluster on nfs, create these directories standard linux mkdir command in cluster's directory structure. when user foo not have corresponding /user/foo directory on cluster, querying mapr list of tables belong user generates error reporting missing directory. but not know /user/ created? i'm mount client linux: ok and me create directory, lot. if mount nfs partition in /mapr , should create d

Neo4j Cypher - String to Integer -

here value in property r.weight string. have tried following possibilities convert integer, int(r.weight) integer.parseint(r.weight) convert(int,r.weight) but nothing works. there proper function so? reduce(total = 0, r in relationships(p): total + int(r.weight)) note : not possible duplicate of gremlin type conversion version : 1.9.5 as stated in comments above there no easy way cypher in 1.9.x. workaround use neo4j-shell , use gsh or jsh or eval command execute script iterates on relationships , converts value of weight property string numeric.

ruby on rails - Custom devise resource name -

i'm using devise authentication. i have custom registration controller in api namespace, defined follow: class api::registrationscontroller < devise::registrationscontroller # ... end my user model defined outside api namespace follow: class user < activerecord::base # ... end in functional tests, put following line in setup devise knows work user , not api_user : @request.env["devise.mapping"] = devise.mappings[:user] it works great in tests don't know how replicate behaviour in real world. the sign_up_params method looks params['api_user'] instead of params['user'] when sanitising. any idea on how that? i don't think still need solution went through same problem , solved : instead of namespace :api devise_for :users end in config/routes.rb file, put : scope :api, module: :api devise_for :users end hope other people :d

php - Routing back to index ( / ) -

i have come across problem can't seem figure out. i doing project in laravel 4, , have form handle navigation between different pages. routes between pages got there, except when try click on 1 return in index file. attempting promts me notfoundhttpexception. the navigation: <td><form action="/" method="post"><input type="submit" name="ht" value="hver time" /></form></td> <td><form action="hverdag" method="post"><input type="submit" name="hd" value="hver dag" /></form></td> <td><form action="hvertirsdag" method="post"><input type="submit" name="htirs" value="hver tirsdag" /></form></td> <td><form action="kontrollcm" method="post"><input type="submit" name="kcm" val

javascript - Would it benefit to pre-compile jade templates on production in express -

when using jade-lang on production, benefit having form of middleware pre-compiles .jade views , uses them in res.render? or automatically happen when node_env=production? i'm exploring options on how speed-up jade rendering on production. when jade compiles template, template cached. in production environment if warm cache, there no need pre-compile template. if don't, template cached after first compilation. i recommend have jade's source code better understand how works. exports.render = function(str, options, fn){ // ... var path = options.filename; var tmpl = options.cache ? exports.cache[path] || (exports.cache[path] = exports.compile(str, options)) : exports.compile(str, options); return tmpl(options); }; source: https://github.com/visionmedia/jade/blob/1.3.0/lib/jade.js#l255-l259 exports.renderfile = function(path, options, fn){ // ... options.filename = path; var str = options.cache ? exports.cache[key] || (exports.

database - SQL query to bring all results regardless of punctuation with JSF -

so have database articles in them , user should able search keyword input , search should find articles word in it. so example if search word alzheimer's want return articles word spell in way regardless of apostrophe so; alzheimer's alzheimers results should returned. @ minute search exact way word spell , wont bring results if has punctuation. so have @ minute query is: private static final string query_find_by_search_text = "select o emailarticle o upper(o.headline) :headline or upper(o.implication) :implication or upper(o.summary) :summary"; and user's input called 'searchtext' comes input box. public static list<emailarticle> findallemailarticlesbyheadlineorsummaryorimplication(string searchtext) { query query = entitymanager().createquery(query_find_by_search_text, emailarticle.class); string searchtextuppercase = "%" + searchtext.touppercase() + "%"; query.setparameter("headline"

sql server - SQL View: ORA Error -

i created view in ms sql. worked perfectly. when exported , imported project oracle environment, view didn't work anymore. far know, used meta sql. hope can help! select oprid , descr1 , descr , descr5 , descr6 , descr7 , year , weekofyear --when working more 6 hours, subtract .5 hours break , case when (convert(decimal(10,1) , datediff(minute , dg_monday_start , dg_monday_end))/60) >= 6 (convert(decimal(10,1) , datediff(minute , dg_monday_start , dg_monday_end))/60 - 0.5) else (convert(decimal(10,1) , datediff(minute , dg_monday_start , dg_monday_end))/60) end 'monday' , case when (convert(decimal(10,1) , datediff(minute , dg_tuesday_start , dg_tuesday_end))/60) >= 6 (convert(decimal(10,1) , datediff(minute , dg_tuesday_start , dg_tuesday_end))/60 - 0.5) else (convert(decimal(10,1) , datediff(minute , dg_tuesday_start , dg_tuesday_end))/60) end 'tuesday' , case when (convert(decimal(10,1) , da

COUNT DUPLICATE RECORDS IN MYSQL -

i need query count duplicate records, for example table name -customer =================== customer_id-col name 222 111 222 222 111 122 output be customer_id count 222 3 111 2 222 3 222 3 111 2 122 1 i tried query select customer_id,count( customer_id ) c customer group customer_id having c >1 output is customer_id count 222 3 111 2 122 1 is possible in advance thanks raja try this select t.customer_id,s.duplicate_count ( select customer_id,count(customer_id) duplicate_count yourtable group customer_id having (duplicate_count > 0) ) s join yourtable on s.customer_id = t.customer_id fiddle demo op: customer_id count 222 3 111 2 222 3 222 3 111 2 122 1

apache poi - Reading Excel Data Issue From DB (CLOB Column) in Java with POI -

i have question looks me hard @ first glance maybe has easy solution cant figure out yet. need read binary data of excel file stored in oracle database clob column. everything ok reading clob string in java. excel file binaries on string parameter. string respxls = othraw.getoperationdata(); // here excel file inputstream bais = new bytearrayinputstream(respxls.getbytes()); poifsfilesystem fs = new poifsfilesystem(bais); hssfworkbook wb = new hssfworkbook(fs); then try read bytestreamdata , put in poifsfilesystem exception: java.io.ioexception: invalid header signature; read 0x00003f1a3f113f3f, expected 0xe11ab1a1e011cfd0 i googled excel problems, mention read access. download same excel file hdd , change nothing it(even did not open it), , use fileinputstream giving file path. has worked flawless. reason? any advice or alternative way read clob appreciated. thanks in advance, regards. clob means character large object; want use blob - binary large obj

openldap - LDAP server vs LDAP sdk -

i reading through various open source ldap's. openldap - ldap server unboundid - ldap sdk questions can elaborate difference between ldap server , ldap sdk ? it more helpful if answer differences between openldap , unboundid ? an ldap server server. sdk provides client-side library. openldap , unboundid 2 different ldap products. openldap provides both server , client, , sdk. unboundid provides sdk , possibly server too, have ask them.

ruby on rails - techniques to deploy web application: heroku vs in house vs vps ect ect -

i'm looking document explains techniques make deployment of web applications: in cloud, in-house, in housing ect ect ... every technique know pros , cons, general idea. i searched online have not found comprehensive , interesting. can me? apps web apps have same structure -- series of files running on server "stack", accessed sequentially middleware, or framework-based load structure your question, therefore, more stack going scaleable, efficient, robust & expansive (can add resources). here options: heroku "managed" cloud (environment set up) runs off aws instances versatile (runs gem / app) owned salesforce lots of add-ons highly scalable not sure price easy deployment ( git push heroku master ) cloud (aws / rackspace) "full" cloud you're responsible environment (os, gems, ruby ver etc) you're responsible uptime you have maintain db etc yourself scaling can pain in ass can deploy app in tot

php - Session cookies http & secure flag - how do you set these? -

just received results of security audit - clear apart 2 things session cookie without http flag. session cookie without secure flag set. the application coded in php , suggestions fix are: set session cookie http flag set session cookie secure flag i have looked @ examples don't understand how implement on linux server. don't have access .ini file . possible set these in htaccess file? alternatively, how , implement in code? since asked .htaccess, , setting php_ini_all , put in .htaccess: php_value session.cookie_httponly 1 php_value session.cookie_secure 1 note session cookies sent https requests after that. might come surprise if lose session in non-secured http page (but pointed out in comments, point of configuration in first place...).

javascript - node.js + API + Json formatting -

i developing rest api using node.js + postgis.in problem in formatting result consider db below: name key value xxxxxx population 232 xxxxxx marginal 24 yyyyyy population 6372 yyyyyy marginal 566 i want output below: [{ name:xxxx key:population value:232 key:marginal value:24 }, { name:yyyyy key:population value:6372 key:marginal value:566 }] i executing following query: select name, key, value map70 key in ('population', 'marginal') group name, key, value but getting output below: [{ name:xxxx key:population value:232 }, { name:xxxx key:marginal value:24 }, { name:yyyyy key:population value:6372 }, { name:yyyy key:marginal value:566 } ] how can have output want..help me solve this.thanks in advance. you can't have output want. [{ name:xxxx key:population value:232 key:marginal value:24 }, { name:yyyyy key:population value:6372 key:marginal value:566 }] in javascript , hasht

sql server - MS-SQL and specific LIKE clause -

i have table in 1 column named pattern stored patterns such as: [11|01][22|88]333[4|0] . want create query similar this: select mt.id dbo.mytable mt '11223334' mt.pattern i know pattern not correct , not work, wonder if possible create query part [22|88] (two digits or 2 digits) work. important question. another question if solution store such patterns in db , - compare in way (please note 1 string compared multiple patterns, not 1 pattern compared multiple strings). update in other words - looking query more one-digit values, i.e. like '[22|88]' should values 22 or 88 , not 28 or 82 . as have said pattern not correct want. [11|01] not mean 11 or 01 , means single character 0 , 1 or | e.g. select * (values ('0'), ('1'), ('|')) t (col) col '[11|01]'; will return 3 values. need define, actually, define pattern [11|01][22|88]333[4|0] , logic more complicated. be: select * (values (&

e commerce - google tag manager - data layer implementation for ecommerce -

i want use google tag manager ecommerce tracking. not sure in setting of data layer. me implements on site or programmer , send him data need get? thanks , answers. your programmer per documentation provided google : https://support.google.com/tagmanager/answer/3002596?hl=en

javascript - Cycle2 for Bootstrap 3, destroying cycle on mobile, reinitialising on larger than mobile -

i've got strange one. i've got slideshow using cycle2 works great. i'm initialising in html with: <div class="content-slide-show cycle-slideshow" data-slides=".slide" data-next=".cycle-slideshow .next-slide" data-previous=".cycle-slideshow .previous-slide"> and i'm watching out initialized , destroyed event calls using var contentslideshowelement = $('.content-slide-show'); contentslideshowelement.on( 'cycle-initialized', function() { contentslideshowinitialized = true; }); contentslideshowelement.on( 'cycle-destroyed', function() { contentslideshowinitialized = false; }); then using watching window resizing using $(window).resize(function(){ destroycontentslideshowformobile(); }); function destroycontentslideshowformobile(){ if( contentslideshowinitialized && $(window).width() < 768 ){ contentslideshowelement.cycle('destroy'); } if(

php - user authentication with zend framework 2 -

i want add user authentication project. use book "webentwicklung mit zend framework 2" written michael romer. first step on line 240 not work. here files: authcontroller.php: <?php namespace application\controller; use application\form\loginform; use zend\mvc\controller\abstractactioncontroller; use zend\view\model\viewmodel; class authcontroller extends abstractactioncontroller { private $loginform; public function loginaction() { if(!$this->loginform) { throw new \badmethodcallexception('login form not yet set!'); } //var_dump($this); if($this->getrequest()->ispost()) { $this->loginform->setdata($this->getrequest()->getpost()); if($this->loginform->isvalid()) { var_dump($this->loginform->getdata()); exit; } else { return new vie

Error running VB.NET program on windows 8 -

i made program on visual studio.net. os windows-7. installed program in computer contains windows-8 , showed following error installing .net framework 3, 3.5 didnt work see end of message details on invoking just-in-time (jit) debugging instead of dialog box. ************** exception text ************** system.invalidoperationexception: error occurred creating form. see exception.innerexception details. error is: not load file or assembly 'microsoft.visualbasic.powerpacks.vs, version=10.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a' or 1 of dependencies. system cannot find file specified. ---> system.io.filenotfoundexception: not load file or assembly 'microsoft.visualbasic.powerpacks.vs, version=10.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a' or 1 of dependencies. system cannot find file specified. @ mms.frmagent.initializecomponent() @ mms.frmagent..ctor() in d:\vss\project_work\mmss (2)_working\mms\agent.vb:line 4 ---

Rails views: how to prevent empty HTML tags from being output? -

often times in html have output e.g. list of links this: / note: slim template! ul - if can? :edit, user li create - if can? :destroy, user li destroy this leads empty ul tags being output when both can? s return false. what's common pattern prevent this? thing can think of following: - if edit = can?(:edit, user) && destroy = can?(:destroy, user) ul - if edit li create - if destroy li destroy but looks clumsy me. better idea? first of all, i'm amazed see people preferring slim on haml. slim on erb , haml. secondly, think code: - if edit = can?(:edit, user) && destroy = can?(:destroy, user) ul - if edit li create - if destroy li destroy will not output ul if there either edit or destroy false. in such conditions, prefer use helper methods(because move logic there , keep views clean): module applicationhelper def show_content_for(user) contents = [] contents <&

excel - Using range based on variables only -

i'm trying use range operator based on variables there "application defined object defined error". i've tried this: thisworkbook.sheets(1).range(cells(lfirstrow, cint(k)), cells(xllastrow, cint(k))).value = thisworkbook.activesheet.range("b5:b" & xllastrow).value and this: if k > 26 kletter = chr(int((k - 1) / 26) + 64) & chr(((k - 1) mod 26) + 65) else kletter = chr(k + 64) thisworkbook.sheets(1).range(lfirstrow & kletter & ":" & xlastrow & kletter).value = thisworkbook.activesheet.range("b5:b" & xllastrow).value where k loop counter , defined integer . xllastrow llastrow+1 , llastrow is llastrow = .range("a" & .rows.count).end(xlup).row lfirstrow 11 @ beginning , lfirstrow = lfirstrow + llastrow - 5 what's wrong? in advance.

Javascript retrieve absolute XPATH via ID of Node -

hello trying retrieve xpath of document via id of node, saw simple matter when looking @ code simple: //iframe[@id=key]; but won't work, i've tried every combination of syntax can think of , not luck, print out "undefined". code function getnode(htmlurl, filename, xpath, callback){ var key = filename+xpath; var frame = document.getelementbyid(key); frame.addeventlistener("load", function(evt){ var value= frame.contentdocument.evaluate(xpath, frame.contentdocument, null,9,null); if(value!=null){ callback(value); } }, false); frame.contentwindow.location.href = htmlurl; } function init(htmlurl, filename, xpath){ getnode(htmlurl, filename, xpath, function(node) { console.debug(node.outerhtml); }); } am trying xpath

gpuimage - GPUimagemovie (iOS) quality settings? -

i'm integrating gpuimage library in app, far good: nsurl *sampleurl = [[nsbundle mainbundle] urlforresource:@"myfile" withextension:@"mp4"]; moviefile = [[gpuimagemovie alloc] initwithurl:sampleurl]; moviefile.runbenchmark = no; moviefile.playatactualspeed = yes; moviefile.shouldrepeat = yes; however, feels compression settings bit off. i'd ramp quality of video, i'm not sure how supposed that. can point me in documentation of gpuimage or give me example? sadly gpuimage samples don't show how done. thanks! well, apparently compression settings weren't blame (in case @ least). what doing wrong, because in rendering pipeline, since using hdr textures non video components, had implemented own bilinear filtering shader setting texture binding gl_nearest. of course made rendering of movie bit off, artifacts looked compression issue, while in fact fault. in short, think compression settings in gpuimage aren't blame @ all.

c# - msbuild does not compile all .cs files in project -

i have .net solution builds locally, on our build server fails build, errors like: the type or namespace name 'xxx' not exist in namespace 'foo.bar' (are missing assembly referece?) the strange thing i've noticed when inspect dll compiled locally decompile, type xxx exists in foo.bar.dll. when inspect foo.bar.dll compiled on build server type xxx not exist, in fact non of classes in foo.bar namespace exist in dll. in example, namespace foo.bar contains classes attributed serializable, xmltypeattribute , xmlroot, affect way msbuild builds project? check build generation order.(right click on project, project dependency, build generation order) seem project reference foo.bar.dll compiled before foo.bar.dll add foobar denpendency of project. compile in local because have compiled manually foobar before

javascript - how do i transform my code to work in chrome -

i have function works in ie not in chrome, because of "microsoft.xmldom" , selectsinglenode (i think), please me convert code chrome, thanks! var xmldictionary = null; function ongridmembersselection(id,xml) { var domdoc = new activexobject("microsoft.xmldom"); domdoc.loadxml(xml); var helphtml2 = ""; var xmlhttp = new xmlhttprequest(); xmlhttp.open("get", "dictionary.xml", true); xmldictionary = xmlhttp.responsexml; xmlhttp.send(); helphtml2 += xmldictionary.selectsinglenode("terms/term[key='" + domdoc.selectsinglenode("members/member/@uname").text + "']/desc").text; alert(helphtml2); } you can use xmlhttp=new xmlhttprequest(); instead of: var domdoc = new activexobject("microsoft.xmldom"); . other brows

liferay 6 - How to make a Theme apply for all the pages in the Portal? -

i new liferay , still trying learn . please excuse if dumb question . i have got different pages in portal (10-15 including child pages ) through user can navigate within portal . i have created own theme based on default welcome theme , provided liferay 6.1 . now question , every page need set page , feel own theme ?? (i asking , though navigated ) liferay --> control panel --> site pages --> , feel and selected current theme own theme , theme not showing pages ?? please tell me if there way can select theme pages . by way using liferay 6.1 version . thanks in advance . ideally once assigned theme site pages[public , private pages] via liferay --> control panel --> site pages --> , feel , should applied pages of site. but in case if have individually modified particular page's , feel [before step above], retain old theme applied , have individually change it. hope help.

ios - NavigationController is showing another view controller instead of pushing viewcontroller -

i have main viewcontroller named viewcontroller(if run project runs firstly). if push detailviewcontroller, showing viewcontroller view. here part of code: appdelegate.m viewcontroller *viewcontroller = [[viewcontroller alloc] initwithnibname:nil bundle:nil]; self.navigationcontroller = [[uinavigationcontroller alloc] initwithrootviewcontroller:viewcontroller]; self.window = [[uiwindow alloc] initwithframe:[[uiscreen mainscreen] bounds]]; self.window.rootviewcontroller = self.navigationcontroller; [self.window makekeyandvisible]; viewcontroller.m detailviewcontroller *detailvc = [[detailviewcontroller alloc] initwithnibname:nil bundle:null]; [self.navigationcontroller pushviewcontroller:detailvc animated:yes]; check following code detailviewcontroller *detailvc = [[detailviewcontroller alloc] init]; [self.navigationcontroller pushviewcontroller:detailvc animated:yes];