Posts

Showing posts from May, 2015

How to alter a DB2 Distinct type? -

i have modify distinct type: create distinct type tmonto decimal(13,2) comparisons; to decimal (10,3), how to? drop , create new 1 same name. why need new type in first place? decimal(10,3) not?

php - Zend Framework URL problems -

url http:// l o c l h o s t/hellozend/public/ index.php /artist/ works properly, don't see index.php there placed. if url http:// l o c l h o s t/hellozend/public/artist/ message not found - requested url /hellozend/public/artist/ not found on server. what's problem? i've tried configure apache, in type of url try open folder / r t s t / instead of calling controller a r t s t or whatever in url. same situation controller/action , on. you need add .htaccess file public folder .htaccess rewriteengine on rewritecond %{request_filename} -s [or] rewritecond %{request_filename} -l [or] rewritecond %{request_filename} -d rewriterule ^.*$ - [nc,l] rewriterule ^.*$ index.php [nc,l]

Is it possible to add jQuery UI theme (Combobox, button) to dynamic elements -

ex: dynamic select box or button (from ajax response) when inserted page should render in jquery ui combobox style or jquery ui button style. $.get("someurl", function(html){ $("p").append(html); // @ point selectbox & button should rendered // jquery ui combobox & jquery ui button } edited response html contains form list of textfield, selectbox & button <select name="scope" > <option value="in">in</option> <option value="out">out</option> </select> <div class="buttoncontainer"> <button name="save">save</button> <button name="cancel">cancel</button> </div> after html appended want style select box using $("select").combobox(). in main page (js file) have added below line in document ready method. $("select").combobox() $("button").button() like j

Possible difference between "Safari on iPad" and "Safari on iPhone" on JavaScript -

i have project involving google maps api , javascript codes. page build upon jquery mobile. have web page tested on chrome, firefox, opera , ie on desktop, , on various mobile phones well. it doesn't work on iphone (4, nor 5). mean, it's under android, wp8, chrome iphone simulator, , working on ipad (air, if matters). it appears google maps api not loaded @ all. should initialized after page load, , show map inside page. there's nothing. there's no alert querying user's location, happen when using ipad. the safari on iphone same version on ipad, os 7.0.4, apple webkit 537.51.1, safari 9537.53. devices connected same wifi network. due lack of mac can't use remote debugging function right now. any brief ideas what's wrong application? suspect it's inside javascript wrong. thanks. i've found problem , solved it. it because location service disabled safari (by default), on iphone. it's enabled on ipad (not sure if it's de

node.js - Does npm touch anything besides the node_modules folder when installing a package locally? -

i'm curious installing packages locally in project - not globally. is there difference between npm uninstall some-package , deleting some-package folder node_modules directory? after reading that: https://npmjs.org/doc/files/npm-folders.html no. there no difference, when using local modules between npm uninstall , deleting directory. however, think /tmp directory used when there additional process during installation (compilation, etc...). therefore, possible uninstall command remove files if needed (but can't see in present documentation) my 2 cents

oop - polymorphism + interfaces in php -

consider have code: (result "works") interface iuser { } interface irepository { function save(iuser $user); } class user implements iuser { } class repository implements irepository { # works iuser why not user? user implements iuser :) function save(iuser $user) { if(!$user instanceof user) throw new \invalidargumentexception('...'); echo 'works!'; } } $user = new user(); $repo = new repository(); $repo->save($user); this example works because user implements iuser. if implement save function way: function save(user $user) { it fails message declaration of repository::save() must compatible of irepository::save() from point of view isn't true. user compactible iuser. why php doesnt support this? there real reason or more bug in language? where difference in typechecking between typehint , instanceof? how other languages handels this? you have change iuser user in save m

c++ - Switch audio device using winapi -

i find http://www.daveamenta.com/2011-05/programmatically-or-command-line-change-the-default-sound-playback-device-in-windows-7/ , , works me, want switch audio devices, have 2 audio devices, if active 1st turn on 2nd, if active 2nd turn on 1st. don't know possible check if audio device active in windows the immdeviceenumerator com interface used program linked has getdefaultaudioendpoint method. it returns immdevice interface pointer, same type of interface pointer linked program gets while enumerating.

ios7 - iAd Banner Not Displaying (not showing on storyboards) -

#import "viewcontroller.h" @implementation viewcontroller - (void)viewdidload { [super viewdidload]; self.candisplaybannerads = yes; } i'm trying place iad banners in ios app no success. stumbled across method , tried (didn't work in simulator) , don't know if enough (adding didfailto....) ads work. couldn't work please me!!! edit: tells me there no ads available , configuration incorrect. doesn't display test ads :( i use bannerviewdidloadad when banner load , show banner animation, need implement <adbannerviewdelegate> : #pragma mark - adbannerviewdelegate - (void)bannerviewdidloadad:(adbannerview *)banner { nslog(@"banner loaded"); // display bannerview _iadbannerview.hidden = no; [uiview animatewithduration:0.4f animations:^{ _iadbannerview.alpha = 1.0f; }]; } and use didfailtoreceiveadwitherror when banner unload (so here, can

c# - Add Duplicates keys to NameValueCollection -

Image
i have read namevaluecollection allows duplicate keys added, not seem case when try use it. my code using (var wb = new webclient()) { var data = new namevaluecollection(); var sourcedata = (list<dictionary<string, object>>)dic["mapdata"]; var countsource = sourcedata.count; foreach (var item in (list<dictionary<string, object>>)dic["mapdata"]) { data.add("pp", item["latitude"].tostring() + "," + item["longitude"].tostring()); } var datacount = data.count; var response = wb.uploadvalues(@"http://dev.virtualearth.net/rest/v1/imagery/map/road/?maparea=" + swlat.tostring() + "," + swlong + "," + nelat + "," + nelong + "&mapsize=800,600&key=" + key, "post", data); return this.largejson(new { imagedata = createbase64image(response) }); } what observing my sourcedata contai

android - Combine PullToRefresh library with ListViewAnimations library -

i'm using https://github.com/nhaarman/listviewanimations animate listview , implement drag & drop functionality list items. now, need use cris banes's android-pulltorefresh https://github.com/chrisbanes/android-pulltorefresh library in same listview add more items. (yes, know deprecated , there's new version, 1 allows pull bottom of list). my question if there's way combine both libraries or workaround implement both functionality listview. thanks in advance.

java - How to use the method printHand(Card[] hand) where "Card" is the name of a separate class -

i'm new java , i'm becoming overwhelmed assignment professor gave because don't understand how use classes , methods predesignated assignment. what need provide in method main in order use method: public static void printhand(card[] hand) where card name of separate class? if give me quick explanation of question, grateful. this card class if answering question: public class card { // constants representing suits public final static int clubs = 0; public final static int hearts = 1; public final static int spades = 2; public final static int diamonds = 3; // constants representing values of // ace, jack, queen, , king. public final static int ace = 1; public final static int jack = 11; public final static int queen = 12; public final static int king = 13; // final keep them being changed // after cards constructed. private final int value; private final int suit; /** * constructs card s

Change part of data frame to character, then to numeric in R -

i have simple problem. have data frame 121 columns. columns 9:121 need numeric, when imported r, mixture of numeric , integers , factors. columns 1:8 need remain characters. i’ve seen people use loops, , others use apply(). think elegant way of doing this? thanks much, paul m try following... apply function allows loop on either rows, cols, or both, of dataframe , apply function, make sure columns 9:121 numeric, can following: table[,9:121] <- apply(table[,9:121],2, function(x) as.numeric(as.character(x))) table[,1:8] <- apply(table[,1:8], 2, as.character) where table dataframe read r. briefly specify in apply function table want loop on - in case subset of table want make changes to, specify number 2 indicate columns, , give name of as.numeric or as.character functions. assignment operator replaces old values in table new ones of correct format. -edit: changed first line recalled if convert factor number, integer of factor level , not number think

html - How can I absolutely position a block of multi-line text relative to the bottom of the last line? -

i'm struggling problem seems should solvable using css - it's conceptually simple , i'd assume relatively common problem, how achieve eluding me @ moment! i have container spanning 100% width , 100% height, , need absolutely position block of text have variable number of lines bottom of bottom line of text block @ fixed vertical position in container. can seem position relative top of text, no overflows out of container when there more lines. here jsfiddle of failed attempt @ positioning relative top of text. css: html, body, l-container { width:100%; height:100%; } .l-container { overflow: hidden; width: 100%; height: 100%; position: relative; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } .caption { position: relative; width: 360px; margin-left: -180px; left: 50%; top: 82%; text-align: center; } html: <body> <div class="l-container"> <div class="

html - Semantic way to select current or active links in navigation menu -

currently common way identify current link adding class anchor or parent: <li class="active"><a href="/">home</a></li> this technique has couple of drawbacks: adding class delegated server languages , means work presentation. even though there convention around active class name, it's stupid selector , doesn't seem semantically correct. i tried following no success: i looked :target pseudo-class, selector be: a:current , unfortunately doesn't exist yet. i thought rel attribute candidate, couldn't find fit. adding , attibute nav sets current link, need add id s every link, , css become verbose <style> [data-active^="home"] a[id^="home"]{ color:red; } </style> <nav data-active="home-link"><ul> <li><a id="home-link">home</a> ... is there different way select current links semantically correct? the purpose of s

javascript - Angular.js load, process and display dynamic template obtained via REST $resource -

i have angular app needs support customizable reporting. intention allow user select 1 of many reports available , have end rest api provide template and data json (end user can customize template). the app insert template somehow "reporting" view page put data in scope , angular should compile , display report / template. i've looked ng-include seems support url or path document, have template text via rest service , cannot use static urls or file paths, needs via rest api, if ng-include accepted template text directly might work doesn't. i've tried writing directive, trying call method on page (gettemplate()) load template fetched scope directive doesn't have access scope apparently. what tactic should use accomplish this? directive seems best i'm doing wrong , lost in docs , many attempts trying accomplish this. you compile dynamic template element on dom in controller , in controller have this: var el = angular.element('#

Python... Hide widget upon menu option selection - Tkinter -

working tkinter, trying make label disappear , appear in place when specific option selected menuoption(). can accomplish without need of "refresh" button? updated sample of code: mgui = tk() mgui.geometry('570x130+700+200') mgui.resizable(width = false, height = false) mgui.title('title') mylist = ['henry', 'tom', 'phil'] somevalue = stringvar() mlabel = label(text = 'name: ').grid(row = 0, column = 0, sticky = e) somemenu = optionmenu(mgui, somevalue, *mylist) somemenu.grid(row = 0, column = 1, sticky = w) somemenu.config(width = 14, anchor = w) mgui.mainloop() so, if somemenu.get() == 'tom' want hide mlabel... so i've added following: def something(): print somevalue.get() mylist = ['henry', 'tom', 'phil'] somevalue = stringvar() somevalue.trace('w', something) and getting typeerror: 'nonetype' object not callable.. hmmmmm you can p

java - Eclipse new folder requires parent -

hi relatively new eclipse (java) having huge problem. want group projects folder can't that. whenever go make new folder, requires me enter parent folder put in. folders gives option me select folders of past projects opposite of want. want put projects folder, not put folders projects. please help. you can't put projects in different directories without making new workspace. has been annoying me while, too. sorry bearer of bad news! see question: place eclipse project file in separate directory

c# - Reading in values into Array -

this program asks user array size asks user enter in array values. problem having loop read in array values doesn't work properly. no matter value n it sitll ask lot more inputs. int n; console.writeline("enter how many values entering in"); n = convert.toint32(console.read()); int[] arr = new int[n]; console.writeline("enter values in"); (int = 0; < n; i++) { arr[i] = convert.toint32(console.read()); } quick , easy fix: use int.parse(console.readline()) in place of convert.toint32(console.read()) explanation: you getting ascii value way doing it. example, if type in number 2 n variable have been set 50 .

from existing mysql database to EER diagram -

i have 1 mysql database , has 47 tables,all of tables use myisam engine,so means there isn't foreign key constraints. want translate existing database eer diagram , use mysql workbench. problem when translate database,i 47 tables , there no relation bwtween them,so want know if there way eer diagram relation eg.1:n,1:1?

view - Rails controller : How to pass parameters between actions in wizard style? -

i'm trying build wizard style site creating object. each step user inputs parameters. want create , persist object in db when parameters submitted @ final step. class experimentscontroller < applicationcontroller def wizard_step_1 render template: "experiments/wizards/step1" end def wizard_step_2 render template: "experiments/wizards/step2" end def wizard_step_3 binding.pry # how access params in step 1 & 2 here? end end view step1 below: <%= form_tag(action: 'wizard_step_2') %> <%= text_field_tag("user_name") %> <%= submit_tag("next >>") %> <% end %> view step2 below: <%= form_tag(action: 'wizard_step_3') %> <%= text_field_tag("user_email") %> <%= submit_tag("next >>") %> <% end %> i didn't put routes info here it's tested ok. when user visit step1 , input user name, when subm

javascript - How can I get an iframe to open a site saved in a variable? -

i making iframe browser program; it's pretty basic. going add bookmark feature prompt popped , saved site wanted bookmark variable. realized don't know how make iframe open site saved in variable. can me? you can set source of iframe using attr() method if have iframe. $('#myframe').attr('src', 'http://example.org/') if don't have iframe, can append new iframe page. $('#mysection').append("<iframe id='myframe'>")

linux - g++ static link to libstdc++.a error -

my application can compiled & linked via gcc/g++ 4.4.7, shipped centos 6.5. i wanna static link libstdc++.a via -static-libstdc++ , not supported 4.4.7. hence installed redhat-devtools-1.1 via following command, upgraded gcc/g++ 4.7.2 cd /etc/yum.repos.d wget http://people.centos.org/tru/devtools-1.1/devtools-1.1.repo yum --enablerepo=testing-1.1-devtools-6 install devtoolset-1.1-gcc devtoolset-1.1-gcc-c++ then compile application new toolset, fails /opt/centos/devtoolset-1.1/root/usr/bin/c++ -m64 -c -o2 -iinc -fpic -mmd -mp -mf "autoinit.o.d" -o autoinit.o autoinit.cpp /opt/centos/devtoolset-1.1/root/usr/bin/gcc -m64 -c -o2 -d_largefile64_source=1 -iinc -std=c99 -fpic -mmd -mp -mf "common.o.d" -o common.o common.c /opt/centos/devtoolset-1.1/root/usr/bin/gcc -m64 -c -o2 -d_largefile64_source=1 -iinc -std=c99 -fpic -mmd -mp -mf "rpc.o.d" -o rpc.o rpc.c /opt/centos/devtoolset-1.1/root/usr/bin/gcc -m64 -c -o2 -d_largefile64

Show and hide DIV in UIWebView based on keychain iOS Xcode -

how hide , show div based on value array? i've figured out how edit div in uiwebview using following: -(void)webviewdidfinishload:(uiwebview *)jswebview { // replace <div id="footer"> in webpage <img> instead. nsstring *jsstuff = [jswebview stringbyevaluatingjavascriptfromstring:@"document.getelementbyid('footer').innerhtml='<img src=\"http://url.to.image.png\">'"]; } i have nsarray populated active directory groups person member of. array pulled keychain using library tied app , populated different each person depending on group they're in. so, need figure out how show , hide div in uiwebview based on if they're in particular group or not. have each div labeled unique id, i'm thinking 'getelementbyid' work identifying div which. how match them similar this: if(nsarray contains thisvalue) { divid.visible = show; } else { divid.visible = hide; } edit: ended adding values arra

scala - Inheritance of immutable return types when extending traits in multiple levels -

i have following trait hierarchy. traita root trait, , given want data structures immutable, function commonupdatefunction() has generic return type. not sure if best way. have 2 other traits extend it, adding 2 other functions. classes extend one, classes extend other, classes need extend both. however, running problem because of generic type thing getting illegal inheritance, when in reality doing right type when updating data structure new one. furthermore seems cannot pass traita parameter because of generic type. trait traita[t <: traita[t]] { self : t => def commonupdatefunction() : t } trait traitb extends traita[traitb] { def somefunctionb() : integer = { /// code } } trait traitc extends traita[traitc] { def somefunctionc() : unit = { /// code } } class classb extends traitb { def commonupdatefunction() : classb = { /// code } } class classc extends traitc { def commonupdatefunction() : classc = { /// code } } class classa exten

facebook - facebbok js sdk login function not working -

my facebook login doesn't work. open popup ask me permission. allow permission stuck on blank popup , give me js error. error in event handler (unknown): error: failed execute 'observe' on 'mutationobserver': provided node null. @ observenodes (chrome-extension://ihamlfilbdodiokndlfmmlpjlnopaobi/jslib/rain1/overlay.js:216:13) @ init (chrome-extension://ihamlfilbdodiokndlfmmlpjlnopaobi/version2.js:218:6) @ htmldocument.<anonymous> (chrome-extension://ihamlfilbdodiokndlfmmlpjlnopaobi/version2.js:55:3) @ c (chrome-extension://ihamlfilbdodiokndlfmmlpjlnopaobi/jslib/jquery-1.9.1.min.js:3:7857) @ object.p.add [as done] (chrome-extension://ihamlfilbdodiokndlfmmlpjlnopaobi/jslib/jquery-1.9.1.min.js:3:8167) @ b.fn.b.ready (chrome-extension://ihamlfilbdodiokndlfmmlpjlnopaobi/jslib/jquery-1.9.1.min.js:3:2072) @ b.fn.b.init (chrome-extension://ihamlfilbdodiokndlfmmlpjlnopaobi/jslib/jquery-1.9.1.min.js:3:1602) @ b (chrome-extension://ihamlfilbdodiokndlfmmlpjlnopaobi

c# - Difference between function and method -

this question has answer here: difference between method , function 26 answers what difference between function , method ? can 1 suitable example ? , differences ?where routines called function , called method ? in advance function or method named callable piece of code performs operations , optionally returns value. in c language term function used. java & c# people call these methods (and function in case defined within class/object). a c++ programmer might call function or method (depending on if writing procedural style c++ code or doing object oriented way of c++). call function calling it's name result = mysum(num1, num2); call method referencing object first result = mycalc.mysum(num1,num2); check link in cubanazucy's answer. discussed in great detail on stack overflow.

java - One to One Mapping using JPA, While inserting data it's throwing an Exception -

i doing 1 one relationship using jsp. understand 1 one means,one object associated 1 object only.i created 2 tables 1 one relationsip. table pojo classes shown below. parenttable: @id @generatedvalue(strategy=generationtype.identity) private int id; private int num; //bi-directional one-to-one association childtable @onetoone(mappedby="parenttable") private childtable childtable; childtable: @id @generatedvalue(strategy=generationtype.identity) private int id; private string email; private string name; //bi-directional one-to-one association parenttable @onetoone @joincolumn(name="id") private parenttable parenttable; is there wrong while creating table 1 one relationship. if it's not trying inserting data table.while inserting data it's throwing exception. insert.java public class insert { public static void main(string[] args) { parenttable parenttable = new parenttable(); childtable childtable=new childtable(); parenttable

html - Creating a scrollable section in a page for infinite scrolling -

i want create section in page , create infinite scrolling window in it. friend suggested iframe option have alternatives; either html or css. ideas??? thanks! i assume mean? html <div><!-- content --></div> css div { height: 200px; width: 100px; border: solid 1px #ccc; overflow: scroll; } fiddle - http://jsfiddle.net/g2tfu/1/ always easier if show little bit of code in question... have attempted yourself. sam

php - Laravel 4 query paginate associated model -

i'm trying paginate query sellorders. $user = user::with('sellorders', 'sellorders.sellorderitems', 'sellorders.sellorderitems.status', 'sellorders.sellorderitems.device', 'sellorders.sellorderitems.device.brand')->find(\sentry::getuser()->id); what arguments can pass paginate method paginate sellorder instead of user? can't seem find i'm looking in docs. from can tell, trying paginate particular user's sellorders. my advice adjust code like: $user = \sentry::getuser(); if ($user) { $sellorders = $user->sellorders()->paginate(15); } this assumes have sellorders relationship set correctly on user model (and have extended sentry's user model so, , configured sentry use model: see https://github.com/cartalyst/sentry/issues/161 ).

Oracle Application testing Suite Login Failure script issue -

i new oracle application testing suite.i trying record flow oracle store inventory management application. when there pop entering login , pasword , after entering details flow fails "invalid user id , password". when same tried manually able login without issue. issue ? there setting issue ? can me issue ? oats default encrypts (obfuscate) password fields while recording scripts , adds deobfuscate before setting password field. check whether have removed deobfuscate() statement accidentally!

mysql - Group by and Having clause in the same query -

schema: place(pid, name, type, lat, lng, deleted) i want select count of places, grouping them type , having distance of < 10 km particular lat, lng query: select count(p.type) count (place p) p.deleted != 1 , p.pid in ( select p2.pid, ifnull(acos(sin((18.5236 *pi()/180)) * sin((p2.lat*pi()/180))+cos((18.5236 *pi()/180)) * cos((p2.lat *pi()/180)) * cos(((73.8478 - p2.lng)*pi()/180))) * 6371.009, 0) distance place p2 having `distance` < 10 ) group p.type; error: operand should contain 1 column(s) that because selecting 2 columns i.e pid , distance in sub select query. without using 2nd select column how can calculate distance. rewrite script this select count(p.type) count, -- remove if not necessary sum(ifnull(acos(sin((18.5236 *pi()/180)) * sin((p.lat*pi()/180))+cos((18.5236 *pi()/180)) * cos((p.lat *pi()/180)) * cos(((73.8478 - p.lng)*pi()/180))) * 6371.009, 0)) distance place p p.

iphone - Image not loading from file path in iOS -

i want load image saved file path of image stored in iphone. getting path still says file not exist. code : nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); nsstring *documentsdirectory = [paths objectatindex:0]; nsstring *imagepath = [documentsdirectory stringbyappendingpathcomponent:[nsstring stringwithformat:@"%@",self.imagename]]; bool fileexists=[[nsfilemanager defaultmanager] fileexistsatpath:imagepath]; nslog(@"%@",imagepath); uiimage *fetchimage = [uiimage imagewithcontentsoffile:imagepath]; fileexists returns no when path : /var/mobile/applications/2ed5c185-8528-48d3-be0b-28582dc3d294/documents/img_0028.jpg i ran problem well. save headache down road. you can't rely on documents directory stay consistent 1 build next. when re-deploy app path change: /var/mobile/applications/2ed5

javascript - Checking the contents of an iframe -

i working on chrome extension helps me remember passwords websites, , needs detect web pages used login. via jquery call $("input:password") . however, ran website has login form inside iframe, , attempting call $("iframe").contents() resulted in error due cross-origin security. is there way me reliably check contents of iframe? need know existence of password element, not interact in way. use window.postmessage code sample... otherwindow.postmessage(message, targetorigin, [transfer]); code receivemessage window.addeventlistener("message", receivemessage, false); function receivemessage(event){ if (event.origin !== "http://example.org:8080") return; // ... }

android - Display a specific spinner depending on radio button selection -

i working on android application want user select radiobutton corresponding 1 category, , add spinner within same layout, displayed spinner depends on radio button selected. means each radiobutton have different spinner. know how add view layout wondering how might go storing each of individual spinners , requesting them when corresponding category selected. possible store them within layout activity , select correct 1 using findviewbyid? agree trushit add spinners in view & on performing radio button event set visibility of spinners. yourspinner.setvisibility(view.visible); & yourspinner.setvisibility(view.gone);

mysql - Inserting an array into MongoDB -

i have table in mysql called new_ndnc contains 5 fields. each field contains 10 million rows. i have read each field array, , want insert whole array field in mongodb. my code below. #!/usr/bin/perl use mongodb; use mongodb::oid; use dbi; $dbs = 'amrit'; $user = 'root'; $pass = 'walkover'; $dbh = dbi->connect("dbi:mysql:database=$dbs", $user, $pass) or die "cannot connect mysql server\n"; $conn = mongodb::connection->new( host => 'localhost', port => 27017, db_name => 'amrit' ); $db = $conn->get_database('amrit'); $users = $db->get_collection('hell2'); $abcuid = $dbh->prepare('select service_area_code new_ndnc'); $abcuid->execute; @uid; while (my @row = $abcuid->fetchrow_array()) { push(@uid, @row); } $hh = $dbh->prepare('select phonenumbers new_ndnc'); $hh->execute; @route1; while (my @row = $hh->fetchrow_array())

repository pattern - Bounded context implementation and design -

let's have 2 bounded contexts, shipping context , billing context . each of these contexts need know customer. at data level, customer represented customertbl table in database. table consists of necessary columns describe customer. columns in customertbl (simplified): name physicaladdress paymentmethod the shipping context concerned name , physicaladdress while billing context concerned name , paymentmethod . in shipping context have modeled aggregate recipient : recipient has properties/value objects name , physicaladdress in billing context have modeled aggregate payer : payer has properties/value objects name , paymentmethod both recipient , payer aggregates separated context boundary. have own repositories. questions: is acceptable have multiple aggregates (provided in separate bounded contexts) using same "database table"? customer data needed in many more bounded contexts. not mean many aggregate, repository

visual studio - WF Designer Extension -

i trying write extension wf designer in visual studio should listen click/double click events on activities. the problem can't find documents describe how extend visual studio worklow designer. so looking way access workflowdesigner object hosted in visual studio. some google research lead me following pages: msdn.microsoft which suggests to: add reference host project activity library project containing custom activity. build solution. to use custom activity in designer, locate custom activity in toolbox, , drag activity onto designer surface. to use custom activity in code, add using statement refers custom activity project, , pass new instance of activity invoke. blog.msdn which gives tip place workflow designer extension dlls vs find them edit: have never written extension wf designer, try out now, since there few things want improve.

VBScript - RegEx - modify ObjMatch - Pattern = "(\d{2}) (\d{2}) (\d{2})" -

this stumbled across while trying learn little reg ex. set objregex = createobject("vbscript.regexp") dim re, targetstring, colmatch, objmatch set re = new regexp re .pattern = "(\d{2}) (\d{2}) (\d{2}) 0500z" .global = true .ignorecase = true end targetstring = "02 04 14 0500z joe eating sandwich" set colmatch = re.execute(targetstring) each objmatch in colmatch wscript.echo objmatch date1 = objregex.replace(objmatch, "(\d{2})(\d{2})(\d{2})") wscript.echo date1 issue: need find date shows "02 04 14 0500z" , assign variable in form "020414". when try replace obj match , reformat date doesn't work, instead showing exact text in brackets. i referenced: http://www.mikesdotnetting.com/article/24/regular-expressions-and-vbscript http://wiki.mcneel.com/developer/scriptsamples/regexpobject to refer content captured capturing group, use $n in replacement string (where n number): date1 = re.replace(objma

ios7 - To change the color of unselected UITabBar icon in iOS 7? -

i know question has been asked earlier well, still didn't solution searching solution on internet. i referred following posts: how can change text , icon colors tabbaritems in ios 7? only able change selected icons color using tintcolor . how change color of unselected tab bar items in ios 7? in have written own goztabbar class inherited uiview i want changes default gray color of uitabbar icon when in unselected state. any highly appreciated. in advance. i'm assuming not want change color using tintcolor? option use 2 images same, differ in color. 1 image selected tab, other unselected. in appdelegate.m - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions function, try this. uitabbarcontroller *tabbarcontroller = (uitabbarcontroller *)self.window.rootviewcontroller; uitabbar *tabbar = tabbarcontroller.tabbar; // repeat every tab, increment index each time uitabbaritem *firsttab = [tabbar.

ddms - Android Debug Monitor hierarchy view not showing -

Image
i trying connect app in adm unfortunately hierarchy view not showing. how should connect app adm tool? device: nexus 4 os: 4.3.3 error: [2014-02-06 13:00:14 - hierarchyviewer]missing forwarded port 021df5e049116bac [2014-02-06 13:00:14 - hierarchyviewer]unable view server version device 021df5e049116bac [2014-02-06 13:00:14 - hierarchyviewer]missing forwarded port 021df5e049116bac [2014-02-06 13:00:14 - hierarchyviewer]unable view server protocol version device 021df5e049116bac [2014-02-06 13:00:14 - viewserverdevice]unable debug device: lge-nexus_4-021df5e049116bac refer profile layout hierarchy viewer hierarchy viewer usage. today use hierarchy viewer app, , similar issue on both silulator , real device, hierarch viewer tree view window black. note: newer version of android studio, can open hierarchy viewer tools > android > android device monitor > window > open perspective... > hierarchy view below i'

Django, csrf_token does not appear on form after redirection -

i using middleware redirect pages landing page: (part of authrequiredmiddleware class. def process_request(self, request): assert hasattr(request, 'user') if not request.user.is_authenticated(): path = request.path_info.lstrip('/') if path not in ['ipn/', 'pp_cancel/', 'pp_success/', 'sitemap/', 'welcome/']: lang = request.get.get('lang', 'en') ru = request.get.get('ru', '') return render_to_response('landing_en.html', requestcontext(request, {'ru': ru})) and settings.py middleware_classes = ( 'django.middleware.cache.updatecachemiddleware', 'django.contrib.sessions.middleware.sessionmiddleware', 'djang

Android adjust width of the ad-mob advertise to 70% of the screen width -

Image
i want modify size of advertise of ad-mob 70% of screen shown in figure. tried it, through changing layout layout <linearlayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/adlinear" android:orientation="horizontal"> <com.google.ads.adview android:id="@+id/adview" android:layout_width="0dip" android:layout_height="wrap_content" ads:adsize="banner" ads:adunitid="xxxxxxxxxxxxxx" ads:loadadoncreate="true" android:layout_weight="0.7" > </com.google.ads.adview> <linearlayout android:layout_width="0dip" android:layout_height="fill_parent" android:layout_weight="0.3" android:background="#00ff00" > <imageview andr

sql server 2008 - SQL convert string data in hexadecimal format into string text -

i have table has column x. x storing large text values in hex format. want convert hex raw , validate data. when using below query, getting part of text after running query not complete text. original text large.... select utl_raw.cast_to_varchar2(hextoraw(x)) table name i tried below query, no use extracts same decalre @a varchar(max) select utl_raw.cast_to_varchar2(hextoraw(x)) new table name. kindly let me know how can extract or see large text sql. sample query may helpful. for ms-sql 2008 following stored proc convert hex string varchar(max): if exists (select * dbo.sysobjects name = 'f_hextostr' , xtype = 'fn') drop function [dbo].[f_hextostr] go create function [dbo].[f_hextostr] (@hexstring varchar(max)) returns varchar(max) begin declare @char1 char(1), @char2 char(1), @strlen int, @currpos int, @result varchar(max) set @strlen=len(@hexstring) set @currpos=1 set @result='' while @currpos<@strlen begin set @char1=

c# - How to cancel upload in Google Drive API? -

i developing application uploading file in google drive using drive api.i able upload image successfully.but problem is, when cancel uploading not cancelled.i uaing following code: google.apis.drive.v2.data.file image = new google.apis.drive.v2.data.file(); //set title of file image.title = filename; //set mime type of file image.mimetype = "image/jpeg"; //set stream position 0 because stream readed strm.position = 0; //create request insert file system.threading.cancellationtokensource ctsupload = new cancellationtokensource(); filesresource.insertmediaupload request = app.googledriveclient.files.insert(image, strm, "image/jpeg"); request.chunksize = 512 * 1024; request.progresschanged += request_progresschanged; //visible uploading progress //upload file request.uploadasync(ctsupload.token); following code written on cancel botton click event ctsupload.cancel(); based on following answer ( google drive sdk: cancel uploa

performance - Is there "skip weaving flag" in Maven? (exclude AspectJ) -

i build our multi-project application maven(lots of pom.xml-s). introduced aspectj, suspect aspectj contributes performance problems. in order sure, i'd build application time without aspectj , see how performs. not remove aspectj related stuff pom.xml, handy if there kind of flag or exclude aspectj build. there any? update: not seem have effect: -dmaven.aspectj.skip=true if want disable aspectj-maven-plugin temporarily, add profile parent pom.xml deregisters executions of plugin (by assigning them phase none ). (add own execution ids if have some): <profile> <id>noaspectj</id> <build> <plugins> <plugin> <groupid>org.codehaus.mojo</groupid> <artifactid>aspectj-maven-plugin</artifactid> <executions> <execution> <id>compile</id> <phase>no

php - One Controller showing 500 Internal Server Error Codeigniter -

i have completed project in codeigniter. working localhost. when uploaded web server, 1 of controllers show '500 internal server error'. i went through several questions in website, says .htaccess files, have not added .htaccess files. secondly, found 1 of libraries (extending form_validation) being not loaded in webserver, despite working in localhost. please help. what local , server operating system? probably if use windows localy , use linux on server have difference in case sensitive in file name. windows not case sensitive. check if have capital letter in controller names. example shouldn't use nameofyourcontroller.php nameofyourcontroller.php .

mysql - Relational table design: prevent circular references -

i have problem not sure how solve correctly. current design consists of 2 tables. employee , employee_management. rdbms mysql. employee: create table `employee` ( `id` int(11) not null auto_increment, `name` varchar(255) collate utf8_unicode_ci default null, primary key (`id`) ) engine=innodb default charset=utf8 collate=utf8_unicode_ci employee_management: create table `employee_management` ( `manager_id` int(11) not null, `employee_id` int(11) not null, unique index `association` (`manager_id`,`employee_id`), foreign key (`manager_id`) references employee(id) on update cascade on delete restrict, foreign key (`employee_id`) references employee(id) on update cascade on delete restrict ) test data: insert employee(name) values( 'bob smith' ) insert employee(name) values( 'bill smith' ) insert employee_management(manager_id, employee_id) values( 1,2 ) insert employee_management(manager_id, employee_id) values( 2,1

xpath - HTMLAgilitliyPack: select Form input subnodes not working -

form: <form method="post" name="contactform" action="form-handler.php"> <label for='name'>name:</label> <input type="text" name="name" /> <label for='email'>contact number:</label> <input type="text" name="phone" /> <label for='phone'>email:</label> <input type="text" name="email" /> <label for='message'>requirements:</label> <textarea name="message"></textarea> <input type="submit" value="submit" name="submit" class="quotebutton" /> </form> code: htmlnode.elementsflags.remove("form"); htmlnodecollection fromnodes = doc.documentnode.selectnodes("//form"); foreach (htmlnode formnode in fromnodes) { var

android - Start default search activity without the SearchView -

i implementing search widget http://developer.android.com/guide/topics/search/search-dialog.html#usingsearchwidget search widget provides same functionality search dialog. starts appropriate activity when user executes search, , can provide search suggestions , perform voice search. everything works fine, want start searchactivity without using search widget , same result when clicking on 1 of items bellow, how can achieve that? http://screencloud.net//img/screenshots/9b2638fbf1dd928abed678f9d3081479.png so when click lounge / nightclub same when use searchwidget(restaurant) you can start search activity this: intent intent = new intent(getactivity(), searchactivity.class); intent.putextra(searchmanager.query, "some text"); startactivityforresult(intent, 0); where searchactivity activity implementing

how to debug invalid subscript type 'integer' error in R -

i'm trying run code in r: extract maximum value in vector under conditions keep getting error error in list(id.2 = c(3l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, : invalid subscript type 'integer' the code following: require(dplyr) dat <- read.table(header = true, text = "id name year job job2 cumu_job2 1 jane 1980 worker 0 0 1 jane 1981 manager 1 1 1 jane 1982 sales 0 0 1 jane 1983 sales 0 0 1 jane 1984 manager 1 1 1 jane 1985 manager 1 2 1 jane 1986 boss 0 0 2 bob 1985 worker 0 0 2 bob 1986 sales 0 0 2 bob 1987 manager 1 1 2 bob 1988 manager 1 2 2 bob 1989 boss 0 0 3 jill 1989 worker 0 0 3 jill 1990 boss 0 0") dat %.% group_by(id) %.% mutate( all_jobs = sum(unique(job) %in% c("sales","manager","boss")), cumu_max = max(cumu_job2

android - how to block UI from coming up on softkeyboard display -

i using same activity multiple fragments. every fragment there searchview. except home fragment in other fragment display listviews. in home fragment have linear layouts display buttons , footer view. , when type in searchview in home fragment display listview.i want resize screen when keyboard up. have used below mentioned tag in manifest file actvity. android:windowsoftinputmode="adjustresize" it wokring fine in fragments except home fragment. in home fragment when tap on searchview(before typing.ie still displaying buttons) screen including footer view up. no issues layout contains buttons. becuase scrollable. topmost layout not visible fully. possible stop pushing footer layout top in fragment?

javascript - model.save() timing issue in ember-data with belongsTo relationship -

i have 2 models ( source , problem ) , saving instance relation other when click triggered through ui. app.sourcescontroller = ember.arraycontroller.extend actions: addproblem: (source) -> problem = @store.createrecord('problem', detectedon: new date(), source: source ) problem.save().then (problem) -> # handle success ,(e) -> # handle error false i source present when inside addproblem action, when client serializes model , sends request, detectedon attribute present, source_id found. now, here interesting part. when wrap save code in settimeout , both detectedon , source_id sent server: app.sourcescontroller = ember.arraycontroller.extend actions: addproblem: (source) -> problem = @store.createrecord('problem', detectedon: new date(), source: source ) settimeout -> problem.save().then (problem) ->

How to change minibuffer location in Emacs? -

this question has answer here: is possible move emacs minibuffer top of screen? 3 answers using getopts in bash shell script long , short command line options 28 answers i'm tired move eye minibuffer bottom of emacs. want minimize eye movement. there solution this? want following. setting minibuf location on top of current frame.(i don't know it's effective or not. ) if typed m-x, minibuf show center of current frame.(i think it's effective.) i find helps have minibuffer in same place on screen --- iow, standalone minibuffer frame . yes, involves eye movement, same place. might find helps. see library oneonone.el implementation easy try.

active directory - Get all member of groups contained by OU -

i trying users, part of group. single group no problem me: (& (objectcategory=person) (samaccountname=*) (memberof=cn=...,ou=...,dc=..) ) but need members of groups part ou. idea use following: (& (objectcategory=person) (samaccountname=*) (memberof=cn=*,ou=...,dc=..) ) but seems not work (the result empty). using apache ldap studio testing. there possibility filter users this? sorry don't think can use wildcard caracters in dn comparaison in active-directory. extensiblematch explained here may perhaps allow build filters on dn path, it's not supported in active directory. far know you've got following solution want: first groups in ou, each group members.

Grails logging not working -

i'm developing grails 2.3.4 application , had logging problems. actually, couldn't configure logging @ (accordingly http://grails.org/doc/latest/guide/conf.html#logging ) - had no output result. after brainstorming figured out, grails documentation configs not working project. nevertheless, configs variation worked fine (i saw result on screen): log4j = { appenders { console name:'stdout', layout:pattern(conversionpattern: '%c{2} %m%n') } root { error 'stdout' additivity = true } error 'org.codehaus.groovy.grails.web.servlet', // controllers 'org.codehaus.groovy.grails.web.pages', // gsp 'org.codehaus.groovy.grails.web.sitemesh', // layouts 'org.codehaus.groovy.grails.web.mapping.filter', // url mapping 'org.codehaus.groovy.grails.web.mapping', // url mapping 'org.codehaus.groovy.grails.commons', // core / classloading 'org.codehaus.groovy.grails.plugins', // plugins '

Run Perl Mojolicio Server from SSH -

i have mojolicio server on machine connect machine. have script checks if mojolicio - , run if not running. use following command line run server: ssh root@hostname 'cd /server_path/; (nohup /usr/bin/perl server_file >nohup.out &);' the server_file script raise server has following script: #!/usr/bin/env perl use mojo::base -strict; use file::basename 'dirname'; use file::spec::functions qw(catdir splitdir); # source directory has precedence @base = (splitdir(dirname(__file__)), '..'); $lib = join('/', @base, 'lib'); -e catdir(@base, 't') ? unshift(@inc, $lib) : push(@inc, $lib); # start commands application require mojolicious::commands; mojolicious::commands->start_app('myserver', 'daemon','-l','http://*:3030'); if server down , run command - see in machine server , running , listening port configured listen to. now, if try connect server browser don't not load. stuck on loadi