Posts

Showing posts from June, 2014

Grouping by line items in mysql -

i need result of 1 column different on each row. this how data appears: ticketnumber legnumber commission 100 1 50 100 2 50 this how need appear: ticketnumber legnumber commission 100 1 100 100 2 0 so when legnumber = 1 need commission group ticketnumber, when legnumber > 1 commission should zero. tried writing case statement no avail. suggestions on how accomplish this? you can use group by attribute select table1.ticketnumber, legnumber , case when legnumber = 1 sum(table2.commission) else 0 end commission table1 join (select ticketnumber, sum(commission) commission table1 group ticketnumber) table2 on table1.ticketnumber = table2.ticketnumber group table1.ticketnumber, legnumber order table1.ticketnumber, legnumber sql fiddle

Laravel profile update with e-mail unique:users -

i'm new in laravel. try make profile update page... works if try apply rule set email field unique:users have problem when user try update example name , don't want change email. public function rules() { return [ 'name' => 'required|max:255', 'email' => 'required|email|max:255|unique:users', ]; } i want restrict user use same e-mail else using... want ignore if same e-mail in user profile , don't want change that. public function updatedata(updatedatarequest $request){ db::table('users') ->where('id', auth::user()->id) ->update(array('email' => $request->email, 'name' => $request->name)); return redirect('panel'); } how right? this exact situation used example in docs. https://laravel.com/docs/5.2/validation#rule-unique forcing unique rule ignore given id: sometimes, may wish ignore giv

Convert multiple SQL Server queries into one -

i have page ask of users opinion topic. responses saved table. want check how many users selected option 1,2,3 , 4. what have multiple t-sql queries run believe there simplified version of code have written. grateful if can simplify queries 1 single query. thank you. here sample of data in database table enter image description here $sql4 = "select count(co) gnappitms co='1' , mountid='".$mountid."'"; $stmt4 = sqlsrv_query($conn2, $sql4); $row4 = sqlsrv_fetch_array($stmt4); $sql5="select count(co) gnappitms co='2' , mountid='".$mountid."'"; $stmt5=sqlsrv_query($conn2,$sql5); $row5=sqlsrv_fetch_array($stmt5); $sql6="select count(co) gnappitms co='3' , mountid='".$mountid."'"; $stmt6=sqlsrv_query($conn2,$sql6); $row6=sqlsrv_fetch_array($stmt6); $sql7="select count(co) gnappitms co='4' , mountid='".$mountid."'"; $stmt7=sqlsrv_query($

osx - System.getenv() Not Pulling Any Env Vars in Android Studio? -

i'm using retrolambda in android project. set 2 env variables export in .bashrc, java7_home , java8_home point absolute paths of both java sdks, after source'd .bashrc again. however, trying compile project gives me error. when print out results of system.getenv("java7_home"), null back. however, curiously, when run env , grep variables in terminal, see them there. strangely, not assigning path string jdks directly seems work. have attempted restart of both android studio , computer in case changes .bashrc didn't take effect, nothing has worked. does have insight problem, or else try? i'm running mac os x it's worth.

LDAP custom attribute cannot be searched? -

i have special custom attributes ldap setup. have custom attribute called "groupcode". have bunch of entries special attribute able write ldap database. lets have entry attribute "xyz" , attribute "wasd". search filter "(groupcode=xyz)" , "(groupcode=wasd)" neither 1 of these search return anything. however, if change filter "(groupcode=*)", return entries have groupcode attribute. have examined attribute properties, , looks normal, apache directory studio shows of "string" value, don't know why isn't searching filter provided. knowledge ldap structure limited complexed. have idea, please let me know. appreciated. thanks. can see if can formulate same search criteria ldapsearch command in command line? ldapsearch -h ldap://ldap_server -d ldap_auth_login -b ldap_base -w pw -x "criteria" if so, can experiment criteria. ldapsearch -h ldap://ldap_server -d ldap_auth_login -b ldap_ba

How to load environment variables in the Rails console? -

i think little, easy question! i'm using .env file keep environment variables, , i'm using foreman . unfortunately, these environment variables not being loaded when running rails console rails c so, i'm loading them manually after running console, not best way. i'd know if there better way that. about year ago, "run" command added foreman ref: https://github.com/ddollar/foreman/pull/121 you can use follow: foreman run rails console or foreman run rake db:migrate

CakePHP 3.0: Get model data from two degree model of separation in pagination -

now i'm tired can't think well. sorry anticipated if duplicate question , if english weird. in cakephp 3.0 have model "asistencias". asosiated "ejecutivos". so, in asistencias table, have de fk ejecutivo_id , works ok when try access data ejecutivos table because made correct declaration: $this->paginate = [ //'contain' => ['sucursales', 'cedentes', 'ejecutivos'], 'contain' => ['ejecutivos'], 'limit'=>100, 'order'=>['asistencias.entrada'=>'desc', 'ejecutivos.nombre'=>'desc'] ]; as can see, i've commented line 2. take out asosiation of cedentes , sucursales asistencias. now, fks sucursal_id , cedente_id belongs ejecutivos table, instead asistencias table. it's me make others tasks in cakephp doesn't interest you. my question how can access sucursales ,

c# - Parameter.addwithvalue - ExecuteReader: CommandText property has not been initialized -

i error executereader: commandtext property has not been initialized @ adapter.fill(ds) line. weird thing if replace @user actual string (e.g. 'name') works fine, seems broken in part sets parameter. i've tried set string both , without ' 's (i.e. @user/'@user'). i've tried using both = , like . user.identity.name.tostring() has been tested return logged in user correctly setting textbox it. sorry non-english database variables , if question has been answered somewhere. i've given after half dozen hours of searching, though (maybe suck @ it). relevant code: using system; using system.collections.generic; using system.linq; using system.web; using system.web.ui; using system.web.ui.webcontrols; using system.configuration; using system.data; using system.data.sqlclient; public partial class bruker : system.web.ui.page { protected void page_load(object sender, eventargs e) { string conn = configurationmanager.connectionstrings[&q

wpf - Squaring ListView items using a DataTemplate -

i trying style listview in project, , i'd items squared. below current state based on answers found online. my listview : <listview scrollviewer.horizontalscrollbarvisibility="disabled" scrollviewer.verticalscrollbarvisibility="hidden" grid.row="1" background="transparent" itemssource="{binding ribbonitemlist}" itemtemplate="{staticresource ribbonpageslistitemtemplate}" /> and here's try @ squaring listview s itemtemplate : <datatemplate x:key="ribbonpageslistitemtemplate" datatype="x:type apppage"> <grid width="auto" height="{binding relativesource={relativesource self}, path=actualwidth}"> <image height="25" width="25" source="{binding path=imgsrc}" /> </grid> </datatemplate> however, above not work, , can't find explanation or suitable solution. h

c# - How do I invoke .getmethodinfo? -

i have started read how open source encryption program works. the problem is, i'm stuck here on these 2 lines of code can't understand @ all, have looked @ msdn doesn't me @ understand these 2 lines do. methodinfo run = assembly.load(injres).gettype("resource.reflect").getmethod("run"); bool inj = (bool)run.invoke(null, new object[] { assembly.getexecutingassembly().location, "", payloadres, false }); i'm trying figure out way accomplish same thing, there way invoke .getmethod? this basic "reflection" in .net. basically happens here is: loads .net assembly indicated injres inside assembly, type definition resource.reflect (which class ) inside resource.reflect type, run method , save variable run invoke (in other works, "execute") run() function on null instance (which means run() static method) parameters (assembly.getexecutingassembly().location, "", payloadres, false) mor

java - setImageResource() with attrs value -

i'm trying put image imageview , custom attribute defined me, i'm doing way: attrs: <?xml version="1.0" encoding="utf-8"?> <resources> <declare-styleable name="myattr"> <attr name="my_image" format="reference"/> </declare-styleable> </resources> imageview attrs: app:my_image="@drawable/image" than in view : int imagesrc; typedarray ta = context.obtainstyledattributes(attrs, r.styleable.myattr, 0, 0); try { imagesrc = ta.getresourceid(r.styleable.myattr_my_image, -1); } { ta.recycle(); } and set image imageview with: imageview.setimageresource(imagesrc); but nothing appears, i've tried with: imagesrcdrawable = ta.getdrawable(r.styleable.myattr_my_image); and: if (android.os.build.version.sdk_int < android.os.build.version_codes.jelly_bean) { imageview.setbackgrounddrawable(imagesrcdrawable); } else { imageview.setback

MySQL Stored Procedure Variables - When to Use Which -

i new mysql. when use declared variable? when use undeclared variable (@vartest) . i wondering best practice. thank you. you should create procedural variables declare maintain proper scope. session variables declared outside function can changed inside function, , vice-versa. drop procedure if exists foo; delimiter $ create procedure foo() begin declare foo int; set foo = 123; set @foo = 456; select foo, @foo; end$ delimiter ; set @foo = "bar"; call foo(); select @foo;

Angularjs $viewValue without changing $modelValue -

in angular (1.4.x), there way dynamically change input context without changing $modelvalue? example: possible dynamically toggle time (moment) input text/content local/utc without changing $modelvalue. here's example change both view , model values. need mask input context , not model value. thanks! var app = angular.module('testparser', []); app.controller('mainctrl', function($scope) { $scope.data = { name: '' }; }); app.directive('changetime', function() { return { restrict: 'ea', require: 'ngmodel', link: function(scope, element, attrs, ngmodel) { //format text going user (model view) ngmodel.$formatters.push(function(value) { return value; }); //format text user (view model) ngmodel.$parsers.push(function(value) { return value; }); scope.data.time = moment().format('hh:mm:ss') scope.setlocaltime = f

string - How to compare each letters in an array with all the letters in another array? - Swift -

i have 2 different arrays called: criptedchar , alphabet. need check first character in criptedchar (so "criptedchar[0]) , check correspondence in alphabet. exemple: criptedchar // ["d","e","c","b"] alphabet // ["a","b","c" , on] want take d criptedchar[0] , check if there's "d" in alphabet , save position of "d" in second array. need increment number inside parenthesis of criptedchar. i'll take number user. can please me? thank you! func decript() { var criptedtext = incriptedtext.text! //get text uitextfield var criptedchar = array<character>(criptedtext.characters) //from text char & in array :d var alfabeto: array<character> = ["a","b", "c", "d", "e","f","g","h","i","j","k","l","m","n","o",&quo

python - scipy.interp2d warning and different result than expected -

Image
i'm trying convert matlab code equivalent python. have 3 arrays , want compute interp2d : nua = np.asarray([2.439,2.5,2.6,2.7,2.8,3.0,3.2,3.5,4.0,5.0,6.0,8.0,10,15,25]) nub = np.asarray([0,0.1,0.2,0.3,0.5,0.7,1]) a, b = np.meshgrid(nua, nub) betatab = np.transpose(np.asarray([[0.0,2.16,1.0,1.0,1.0,1.0,1.0],[0.0,1.592,3.39,1.0,1.0,1.0,1.0],[0.0,0.759,1.8,1.0,1.0,1.0,1.0],[0.0,0.482,1.048,1.694,1.0,1.0,1.0],[0.0,0.36,0.76,1.232,2.229,1.0,1.0],[0.0,0.253,0.518,0.823,1.575,1.0,1.0],[0.0,0.203,0.41,0.632,1.244,1.906,1.0],[0.0,0.165,0.332,0.499,0.943,1.56,1.0],[0.0,0.136,0.271,0.404,0.689,1.23,2.195],[0.0,0.109,0.216,0.323,0.539,0.827,1.917],[0.0,0.096,0.19,0.284,0.472,0.693,1.759],[0.0,0.082,0.163,0.243,0.412,0.601,1.596],[0.0,0.074,0.147,0.22,0.377,0.546,1.482],[0.0,0.064,0.128,0.191,0.33,0.478,1.362],[0.0,0.056,0.112,0.167,0.285,0.428,1.274]])) ip = scipy.interpolate.interp2d(a,b,betatab) when try run it, warning displayed: /usr/local/lib/python2.7/dist-packages/scipy/inter

c# - Getting wrong file content when downloading file from server? -

i have php script on our server use download file .net/unity3d : php script: <?php $name_to_save = $_get["name"]; $data_to_save = $_get["data"]; $myfile = $name_to_save . ".txt"; $fh = fopen($myfile, 'w') or die("can't open file"); fwrite($fh, $data_to_save); fclose($fh); ?> c# upload code: const string serversavefile = "http://website.com/webserver/save-new.txt"; const string serverphpfile = "http://website.com/webserver/save-new.php"; ienumerator anotheruploadroutine(string data) { string url = serverphpfile + "?" + "name=" + "save-new" + "&data=" + data; www post = new www(url); yield return post; if (post.error != null) print("there error saving data: " + post.error); } uploading works fine. but when try download, never downloaded values. previous uploaded values. c# download code: ienumerator anotherdown

java - JavaFX Character Comparator for TableColumn -

any idea why comparator not comparing? , never goes 1 of if-statements. if click on column header, nothing happens. example characters: {'g','c','null','b','null','a'} i want sorted, null values come after character values. sorted: a,b,c,g,null,null nullcomparator.java package de.hhn.pp.todomanager.model; import java.util.comparator; public class nullcomparator implements comparator<character> { @override public final int compare(final character o1, final character o2) { if (o1 == null && o2 == null) { system.out.println( "if1"); return 0; } if (o1 == null) { system.out.println( "if2"); return 1; } if (o2 == null) { system.out.println( "if3"); return -1; } system.out.println("pa

javascript - Losing autofus on Vue.js toggle of v-show -

strange, autofocus attribute of inputs don't work when changing element being displayed see fiddle attached: https://jsfiddle.net/e53lgnnb/6/ code: html: <body> <!-- email [post] --> <div class="" id="email" v-show="activestep == 'email'"> <form action="onboarding-5.html" @submit.prevent="submitform('email', 'password')"> <div class="form-row"> <input type="email" autofocus required placeholder="email"> </div> <p> <button type="submit" class="button">ok <i class="icon arrow-right"></i></button> </p> </form> </div> <!-- password [post] --> <div class="onboarding-content-wrap" id="password" v-show="activestep == 'password'"> <form ac

Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener -

this question has answer here: what nullpointerexception, , how fix it? 12 answers enter image description here when open android application crashes. here code: import android.manifest; import android.content.intent; import android.content.pm.packagemanager; import android.location.location; import android.location.locationlistener; import android.location.locationmanager; import android.os.build; import android.provider.settings; import android.support.v4.app.activitycompat; import android.support.v7.app.appcompatactivity; import android.os.bundle; import android.view.view; import android.widget.button; import android.widget.textview; public class mainactivity extends appcompatactivity { private button requestbutton; private textview coordinatetext; private locationmanager locationmanager; private locationlistener locat

c# - Why is User.Invoke("SetPassword") using my computer's current credentials and how I can I specify them instead? -

i able create new users in remote activedirectory server, doing using admin account on server. how that: string connection = "ldap://serveraddress/ou=newusers,ou=people,dc=mydomain,dc=local"; usersdirectoryentry = new directoryentry(connection, "adminusername","adminpass"); directoryentry newuser = usersdirectoryentry.children.add(userstring, "user"); newuser.commitchanges(); however, after trying set password using: updatepassword(newuser, "userpasswordmeetsrequirements"); where private static void updatepassword(directoryentry user, string password) { user.properties["pwdlastset"].value = -1; user.invoke("setpassword", new object[] { password.trim() }); user.properties["useraccountcontrol"].value = 0x0200 | 0x10000; user.commitchanges(); } where user of type directoryentry ( https://msdn.microsoft.com/en-us/library/system.directoryservices.directoryentry(v=vs.110).aspx )

bitcoin - NBitcoin ExtPubKey -

which part/format of exppubkey created nbitcoin should give transaction payments key generator or set on website default generate transaction payment addresses. in advance help. i find question little vague, first give general answer: have written class handles correctly key generation , storage you: here article it. if not misunderstand you, want to generate keys javascript in browser, can give string it. thing not give extpubkey , give wallet import format. extkey seedprivatekey = new extkey(); extpubkey seedpublickey = seedprivatekey.neuter(); bitcoinextpubkey seedmainnetpublickkey = seedpublickey.getwif(network.main); you can string calling seedmainnetpublickkey.tostring()

python 2.7 - Get sprite to stay on screen? -

how sprite remain on screen , on green platform? sprite keeps falling off screen, can please? player_image = pygame.image.load("bcquestchar.png") player_image.set_colorkey(white) def draw_background(screen, x, y): pygame.draw.line(screen, ground_green, [0, 400], [700, 400], 200) pygame.draw.line(screen, sky_blue, [0,0], [700,0], 400) pygame.draw.line(screen, sky_white, [0, 270], [700, 270], 150) #jumping player definition class player(pygame.sprite.sprite): def __init__(self): self.playing = false self.color = blue self.x = 50 self.y = 210 self.goaly= 450 self.gameover = false def jump(self): self.goaly -= 45 def draw(self, screen): screen.blit(player_image, [self.x, self.y]) #create player player = player() simply make function make sure when sprite's bottom touching bottom of screen, stops there, waiting other commands. example: if self.x >= 1000:

jquery - Content not sizing to modal window until browser window resize -

i'm trying place dynamic content in modal (popup) they're not sizing properly. however, if have popup open , resize browser window, kick place. content sizing hidden div prior opening modal. how can fix this? i'm assuming jquery way go? below screenshot of i'm facing. top part of photo appears when click link open modal & bottom pick happens after resize window (which i'm after). here's click event code. // lightbox link $(context).on('click', themifygallery.config.lightbox, function(event){ event.preventdefault(); var $self = $(this), $link = ( $self.find( '> a' ).length > 0 ) ? $self.find( '> a' ).attr( 'href' ) : $self.attr('href'), $type = themifygallery.getfiletype($link), $title = (typeof $(this).children('img').attr('alt') !== 'undefined') ? $(this).children('img&

ios - Difference between UIView.layoutMargins and AlignmentRect -

i'm figuring out (again) how set margin custom uiview instance. recall had set alignmentrect via alignmentrectinsets method. did not worked auto layout. searching on google found there property called layoutmargins. so question layoutmargins , alignmentrect ? affect each other? totally different things ? layoutmargins determines how things inside of view positioned auto layout. used keep objects specific distance away edges of view. alignmentrectinsets telling objects outside of custom view how should align it. example, might have view wavy or angled top. aligning other objects top of view may not quite right, might set inset on top alignment compensate. you care layoutmargins . i've never seen use alignmentrectinsets .

What is the easiest way to get chrome browser console logs with Selenium python -

what easiest way chrome console js errors selenium python this using not able full error message results = (self.driver.get_log('browser')) print results maybe this help? looks need pass on desired capabilities before getting log.

javascript - time zone api INVALID_REQUEST -

i can't seem find causing this. checked url again , again , can't seem find wrong it. function settime() { min = $("#minutes").val(); hour = $("select").val(); odg = $("#odgodina").val(); dog = $("#dogodina").val(); dat = $("#datepicker").val(); dat = dat.split("/"); //mm.dd.yyyy vreme = new date(dat[2], dat[0], dat[1], hour, min); sendinput(vreme); } function sendinput(time) { console.log(time.gettime()); var url = "https://maps.googleapis.com/maps/api/timezone/json?location="+lat+","+lngt+"&timestamp="+time.gettime()+"&sensor=false"; var testresenje = $.ajax({ url: url, }).done(function(response) { offset = response.rawoffset / 3600 + response.dstoffset / 3600; sendresponse(); console.log(offset); });} the url gets build is: https://maps.googleapis.com/maps/api/timezone/json?location=44.7220401,21.175114500000063&times

matlab - Pick the values from the corresponding max matrix -

i don't think asked question right, example make easier understand mean. lets have 2 matrices a = [5,5; 7,7]; b = [2,2; 6,4]; and 2 matrices, each 1 correspond 1 of above. lets say a' = [7,7; 9,9]; b' = [1,1; 10,5]; and need construct new matrix, check each pixel in a' , b', pick max, goes corresponding matrix , extract value there. in example newmat newmat = [5,5; 6,7]; it easy done loops, there way out using loops ? in advance! you can create logical matrix of aprime more bprime , can used grab values either a or b aprime_is_greater = aprime > bprime; % initialize c b , replace values aprime greater c = b; c(aprime_is_greater) = a(aprime_is_greater);

python - PySide widgets using .ui files being garbage-collected unexpectedly -

i have pyside qmainwindow i'm running in nuke. widgets used application use .ui files created in qt designer. until recently, qmainwindow class not given parent. because of this, when nuke minimized or changed focus, qmainwindow did not minimize or gain focus it. to fix issue, when creating qmainwindow, used qapplication.activewindow() method object feed qmainwindow parent. parent = qapplication.activewindow() window = mymainwindow(parent) if this, qmainwindow minimize , change focus nuke. however, when accessing subwidgets of widget created .ui files, raise exception traceback (most recent call last): ... runtimeerror: internal c++ object (pyside.qtgui.qpushbutton) deleted. i'm using method very similar this load .ui files onto qwidget classes why c++ objects being deleted (garbage-collected)? why behavior change when specify parent qmainwindow? there way parent qmainwindow nuke in minimizes , focuses correctly or different way load .ui files wi

appcelerator - Alloy - Controller.addTopLevelView? -

recently came across someone's code. alloy markup empty <alloy /> . in controller, adds view using $.addtoplevelview() . how come can't find documentation regarding function? good point. might because it's considered private, although start _ indicate since js doesn't support private methods. it against idea of alloy not use xml file markup instead use "classic" titanium code in controller method. however, might idea pr against following file request documented: https://github.com/appcelerator/alloy/edit/master/alloy/lib/alloy/controllers/basecontroller.js

python - how to append data to existing LMDB? -

i have around 1 million images put in dataset 10000 @ time appended set. i"m sure map_size wrong ref article used line create set env = lmdb.open(path+'mylmdb', map_size=int(1e12) use line every 10000 sample write data file x , y placeholders data put in lmdb. env = create(env, x[:counter,:,:,:],y,counter) def create(env, x,y,n): env.begin(write=true) txn: # txn transaction object in range(n): datum = caffe.proto.caffe_pb2.datum() datum.channels = x.shape[1] datum.height = x.shape[2] datum.width = x.shape[3] datum.data = x[i].tostring() # or .tostring() if numpy < 1.9 datum.label = int(y[i]) str_id = '{:08}'.format(i) # encode essential in python 3 txn.put(str_id.encode('ascii'), datum.serializetostring()) #pdb.set_trace() return env how can edit code such new data added lmdb , not replaced prese

c# - How to bind an `ObservableCollection` to Grid with Rows/Columns specified in the objects? -

i have inside grid: <ellipse grid.row="{binding path=game.tiles[2].row}" grid.column="{binding path=game.tiles[2].column}" fill="{binding game.tiles[2].fillcolor}" stroke ="{staticresource tilestroke}"></ellipse> how enumerate on 24 objects without typing 24 times? in order have list/collection of objects displayed, need employ "itemscontrol" of sorts. in case, following fragment might of help: <itemscontrol itemssource="{binding game.tiles}"> <itemscontrol.itemspanel> <itemspaneltemplate> <grid> <grid.rowdefinitions> <rowdefinition height="*"/> <rowdefinition height="*"/> <rowdefinition height="*"/> </grid.rowdefinitions> <grid.columndef

CakePHP 3 associates between two tables -

i trying create associations between 2 models ( servers , application_endpoints) tables in cakephp 3. achieve data application_endpoints table servers model. in view can access data. server can have multiple vips , endpoints in application_endpoints table , using hasmany association. in serverstable.php added below code: $this->hasmany('applicationendpoints', [ 'foreignkey' => 'server_id', 'dependent' => true ]); so when browse server view page , click on debug kit inside variable tab, dont see joins. see list of servers in array, each server in array doesnt show relationships application_endpoints table. please comment , let me know if not clear, linking sqlfiddle mysql schema. update 1 i tried code in serverstable.php: $this->belongsto('applicationendpoints', [ 'bindingkey' => 'server_id', 'jointype' => 'inner', ]

python - How to keep random.choice() from rechecking itself -

today writing code in give addition or subtraction of integer problems. example: from random import randint, choice while true: value_1 = randint(-9,9) value_2 = randint(-9,9) lol = choice(['+', '-']) number = input("what %s %s %s" % (value_1, lol, value_2)) if lol == "+": try: number_x = int(number) except valueerror: print("you did not enter number silly goose") else: if number_x == value_1 + value_2: print("you got answer right. job!!") else: print("incorrecto padwan. still have learn") elif lol == "-": try: number_x = int(number) except valueerror: print("you did not enter number silly goose") else: if number_x == value_1 -

xml - Where is the extra space coming from? (XSLT) -

i'm generating hyperlinks xslt , keep getting spaces @ end of linked words. my xml looks this: the last word needs <url id="1">link</url>. the link concatenated, using @id. here's xslt: <xsl:template match="//url"> <a href="../mainsite.html{@id}"><xsl:copy-of select="."/></a> </xsl:template> for reason, generates link on word 'link', adds space after it, though there no space between url tags. if switch out xsl:copy-of plain string problem goes away. eg: <xsl:template match="//url"> <a href="../mainsite.html{@id}">string</a> </xsl:template> where on earth space coming from? it's driving me mad, because link that's followed punctuation looks screwy. should looking @ track down problem? thank can help. <xsl:template match="//url"> <a href="../mainsite.html{@id}"><

How to set toolbar title in center in android in JAVA -

this question has answer here: android: how center title in toolbar 12 answers i know layout way set toolbar title in center. (have textview in toolbar) i looking java way same. toolbar layout <android.support.v7.widget.toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/colorprimary" android:minheight="?attr/actionbarsize"> </android.support.v7.widget.toolbar> this how setting toolbar title in activity: toolbar toolbar = (toolbar) findviewbyid(r.id.toolbar); setsupportactionbar(toolbar); getsupportactionbar().settitle("my orders"); getsupportactionbar().setdisplayhomeasupenabled(true); title left aligned default. is there way (without changing layout) make title centered aligned? too

Pure CSS for the border between two text areas -

Image
i got design between 2 menu options there 2px border. please see image: the tricky thing border shorter height of menu texts. the menu texts have in 2 lines, exact way shown. have more items different width of text. have pure css solution it, cannot figure out right way. tried different ways , got closest: <div style="height: 15px; display:inline-block; border-left: 2px solid red; padding:0 15px;">first<br/>item</div> <div style="height: 15px; display:inline-block; border-left: 2px solid red; padding:0 15px;">second<br/>item</div> see picture above work: the problem border not in middle vertically. how can make border stay in middle vertically? or other css way achieve shown in design? example :before pseudo element: https://jsfiddle.net/qfadxsyd/7/ .box:before { position:absolute; content:''; height:80%; right:-1px; width:2px; top:0; bottom:0; margin:auto; backgroun

gsp - using <set> tag in grails -

i new grails. came across set tag can use in gsp pages set values similar setting model controller. <g:set var="home" value="something" /> so when write ${home} outputs "something". is there way set value in sessions in gsp pages , not controller using set tag? yes can in gsp pages well. have include attribute scope indicate scopes(session, flash, page , request) setting value to. <g:set var="home" value="something" scope="session" /> if donot include scope option defaults request scope. to display the value have write ${session.home} or ${request.home} or ${home} request scope. hope helps. for more : https://grails.github.io/grails-doc/3.0.x/ref/tags/set.html

Internet Explorer browsers request extra 'none/' pages for all pages on my website -

Image
yesterday decided use php's error_log sending error messages e-mail address. received hundreds of letters, telling me there attempts load '%some_page%/ none/ ' links. example, user tries load page relative link 'contacts/', page loaded , displayed correctly, there request 'contacts/ none/ ' page, web-server needs handle twice more requests. these requests ie users only. tried myself load several pages ie 8, displayed correctly, browser tried load these stupid '/none' pages. the same error described here , solution not found. don't use cms. website passes w3 markup validation without errors. don't know , cannot find helpful information problem in web. screenshot of chrome's devtools. last update : figured out because of css rules 'behavior: url(/custom/css/border-radius.htc);'. removed them , worked!

javascript - Uncaught TypeError: Cannot set property 'className' of null.active -

it's sign in button , form both contain in 1 id mainbutton box, each of them has different z-index . when click signin-btn , form show out. occur problem doesn't work when click button, , chrome dev tools shows uncaught typeerror: cannot set property 'classname' of null' seemly wrong javascript openform() . var button = document.getelementbyid('mainbutton'); var openform=function() { button.classname = "active"; }; var checkinput = function(input) { if (input.value.length > 0) { input.classname = "active"; } else { input.classname = ""; } }; #mainbutton .active { box-shadow: 0 19px 38px rgba(0, 0, 0, 0.3), 0 15px 12px rgba(0, 0, 0, 0.22); } #mainbutton .active .signin-form { -webkit-transform: scale(1, 1); -moz-transform: scale(1, 1); -ms-transform: scale(1, 1); -o-transform: scale(1, 1); transform: scale(1, 1); } <div id=&

amazon web services - AWS Domain Transfer stuck in Step 14 -

i had initiated domain transfer on amazon. whois records show domain transferred gandi (aws technical domain provider). however, past 5 days, i've been seeing domain in "pending requests", , stuck in step 14 message: domain transfer in progress: sent email registrant contact: transfer complete (step 14 of 14) . but didn't receive email on registrant contact, , neither domain moving "registered domains" section in aws route 53 console. how long take? it took 8 working days clock. domain transfer complete.

java - Pass value of one application to other package application in background like facebook & facebook messenger app -

i have 2 app app1(package name-: com.abc.q) , app2(package name -:com.xyz.y) in app1 there activity open app2 activity has notification comes parse.com .i want whenever app2 gets notification should show "1" in app1 in small red oval.in gist when app2 gets notification parse.com should show red oval notification in app1 in activity have decided. app1 acivity 1.)gkk.java public class gkk extends activity { mediaplayer oursong; private static final string tag = "gkk"; button button;private progressdialog pdialog; private webview webview; private webview webview1; public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); this.requestwindowfeature(window.feature_no_title); setcontentview(r.layout.lgin); webview = (webview) findviewbyid(r.id.webview1); webview1 = (webview) findviewbyid(r.id.webview11); webview.getsettings().setjavascriptenabled(true);