Search Results

Search found 2396 results on 96 pages for 'inner'.

Page 10/96 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • How to determine the inner context node within an XSLT select

    - by Marcus Rickert
    Hi there! I'm trying to determine a subset of nodes stored in the variable objs by using a user defined function cube:is_active: <xsl:variable name="active_cubes" select="$objs[cube:is_active(XXX) = 'TRUE']"/ Since the function does not allow a local context I'm required to pass it as a parameter (denoted by XXX). However, the usual suspects "." or "current()" do not work since they refer to context node of the surrounding block and NOT to the current element of objs which is evaluated. The only solution so far which DOES work is: XXX=SOME_CHILD_TAG/.. But this is really ugly since it depends on the existence of the child tag for the parent node to work correctly. Is there any other way? Thanks!

    Read the article

  • Synchronizing access to an inner object's methods?

    - by user291701
    Suppose I have the following: public class Foo { private ReadingList mReadingList = new ReadingList(); public ReadingList getReadingList() { synchronized (mReadingList) { return mReadingList; } } } If I try modifying the ReadingList object in two threads, the synchronization above won't help me, right?: // Thread 1 foo1.getReadingList().setName("aaa"); // Thread 2 foo2.getReadingList().setName("bbb"); do I have to wrap each method I want synchronized like so: public class Foo { private ReadingList mReadingList = new ReadingList(); public synchronized void setReadingListName(String name) { mReadingList.setName(name); } public synchronized void setReadingListAuthor(String author) { mReadingList.setAuthor(author); } ... and so on for each method of ReadingList I want exposed and synched? I'd end up just writing wrapper methods for each method of ReadingList. Thanks

    Read the article

  • AsyncTask, inner classes and Buttons states

    - by Intern John Smith
    For a musical application (a sequencer), I have a few buttons static ArrayList<Button> Buttonlist = new ArrayList<Button>(); Buttonlist.add(0,(Button) findViewById(R.id.case_kick1)); Buttonlist.add(1,(Button) findViewById(R.id.case_kick2)); Buttonlist.add(2,(Button) findViewById(R.id.case_kick3)); Buttonlist.add(3,(Button) findViewById(R.id.case_kick4)); Buttonlist.add(4,(Button) findViewById(R.id.case_kick5)); Buttonlist.add(5,(Button) findViewById(R.id.case_kick6)); Buttonlist.add(6,(Button) findViewById(R.id.case_kick7)); Buttonlist.add(7,(Button) findViewById(R.id.case_kick8)); that I activate through onClickListeners with for example Buttonlist.get(0).setActivated(true); I played the activated sound via a loop and ifs : if (Buttonlist.get(k).isActivated()) {mSoundManager.playSound(1); Thread.sleep(250);} The app played fine but I couldn't access the play/pause button when it was playing : I searched and found out about AsyncTasks. I have a nested class PlayPause : class PlayPause extends AsyncTask<ArrayList<Button>,Integer,Void> in which I have this : protected Void doInBackground(ArrayList<Button>... params) { for(int k=0;k<8;k++) { boolean isPlayed = false; if (Buttonlist.get(k).isActivated()) { mSoundManager.playSound(1); isPlayed = true; try {Thread.sleep(250); } catch (InterruptedException e) {e.printStackTrace();}} if(!isPlayed){ try {Thread.sleep(250);} catch (InterruptedException e) {e.printStackTrace();} } } return null; } I launch it via Play.setOnClickListener(new PlayClickListener()); with PlayClickListener : public class PlayClickListener implements OnClickListener { private Tutorial acti; public PlayClickListener(){ super(); } @SuppressWarnings("unchecked") public void onClick(View v) { if(Tutorial.play==0){ Tutorial.play=1; Tutorial.Play.setBackgroundResource(R.drawable.action_down); acti = new Tutorial(); Tutorial.PlayPause myPlayPause = acti.new PlayPause(); myLecture.execute(Tutorial.Buttonlist); } else { Tutorial.play=0; Tutorial.lecture.cancel(true); Tutorial.Play.setBackgroundResource(R.drawable.action); } } } But it doesn't work. when I click on buttons and I touch Play/Pause, I have this : 07-02 11:06:01.350: E/AndroidRuntime(7883): FATAL EXCEPTION: AsyncTask #1 07-02 11:06:01.350: E/AndroidRuntime(7883): Caused by: java.lang.NullPointerException 07-02 11:06:01.350: E/AndroidRuntime(7883): at com.Tutorial.Tutorial$PlayPause.doInBackground(Tutorial.java:603) 07-02 11:06:01.350: E/AndroidRuntime(7883): at com.Tutorial.Tutorial$PlayPause.doInBackground(Tutorial.java:1) And I don't know how to get rid of this error. Obviously, the Asynctask doesn't find the Buttonlist activated status, even if the list is static. I don't know how to access these buttons' states, isPressed doesn't work either. Thanks for reading and helping me !

    Read the article

  • Carrying scope of "this" into inner functions

    - by Matrym
    How can I extend the scope of this inward? I thought reassigning a higher scoped variable would do the trick... what am I doing wrong? http://jsfiddle.net/8bqXM/ function Player(configs) { this.opts = { playerID: "cSurf" }; configs = $.extend(this.opts, configs); var the = this; this.init = function(){ var $player = $("#" + the.configs.playerID); alert($player.attr("id")); } } var cSurf = new Player(); $(document).ready(function(){ cSurf.init(); });

    Read the article

  • XSLT: change node inner text.

    - by nabo
    I need to transform the following xml doc: <a> <b/> <c/> myText </a> into this: <a> <b/> <c/> differentText </a> So, i wrote this XSLT document <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="xml" version="1.0" omit-xml-declaration="no" /> <xsl:template match="/a/text()"> <a> <b/> <c/> differentText </a> </xsl:template> </xsl:stylesheet> This way, i get the following result: <?xml version="1.0" encoding="utf-8"?> <a> <b /><c /> differentText </a> <a> <b /><c /> differentText </a> <a> <b /><c /> differentText </a> The result appears repeated 3 times because 3 matches are being done.. Why? I could i fix it? Thanks

    Read the article

  • jquery: inner: outerHeight

    - by Mango
    That I got no idea how. I need a function that the window height or the monitor configuration is larger than 1200, put a div position top = 1000px and else put in another position top = 800px

    Read the article

  • Sorting multidimensional array on inner value php [duplicate]

    - by Silver89
    This question already has an answer here: Reference: all basic ways to sort arrays and data in PHP 4 answers Say I have the following array, how can I sort it on sort_by? Array ( [10] => Array ( [Masthead_slide] => Array ( [id] => 1456464564 [sort_by] => 1 ) ) [6] => Array ( [Masthead_slide] => Array ( [id] => 645454 [sort_by] => 10 ) ) [7] => Array ( [Masthead_slide] => Array ( [id] => 4547 [sort_by] => 5 ) ) )

    Read the article

  • Difference in displaying inner div between IE and Chrome

    - by Gaara
    I have this code that has one "outerDIV" that contains an "innerDIV". On chrome the "innerDIV" size is 491px, whereas on IE it is 425px (same as outerDIV). Hence, on Chrome I can see the first two children of "innerdiv": "My test string #1" and "test2". But for IE I can only see the first child. I am not quite sure what the "right" behavior should be, as firefox does the same as IE. However I would like to have IE do the same as Chrome. I have been experimenting with some css styles (mainly overflow and display), but still can't make it right: IE will expand its height instead of its width to make the elements fit. Can you guys help me figure out a way to change the css so that IE will wraps the div elements inline? As a restriction though, I cannot change the width on the HTML. As a benefit, I am using a css that only loads for IE to patch these kind of IE inconsistencies. The same css will NOT load for chrome, so I don't need to worry about messing with chrome when changing the IE CSS. Thanks in advance! <html> <head> <style type="text/css"> <!-- body { font-family: helvetica; } .myContainer { overflow: hidden; border: 1px solid rgba(0, 0, 0, .5); font-size: 14pt; height: 49px; line-height: 49px; overflow: hidden; display: block; } .myContainer > DIV { float: left; white-space: nowrap; display: block; } .myContainer .item:first-child { padding-left: 10px; } .myContainer .item { float: left; padding-right: 32px; } --> </style> </head> <body> <div id="outerDIV" class="myContainer" style="display: block; width: 425px;"> <div id="innerDIV"> <div class="item"> --------My test string #1-------- </div> <div class="item"> ------test2------- </div> <div class="item"> test </div> </div> </div> </body> </html>

    Read the article

  • Inner join 2 tables one to many 2 where clauses

    - by user2892350
    I'm a relative rookie at this,so please bear with me... I have 2 tables: OrderDetail and OrderMaster...both have a column named SalesOrder. OrderDetail table has multiple rows per unique SalesOrder. OrderMaster table has one row per unique SalesOrder. OrderDetail has a column named LineType. OrderMaster has a column named OrderStatus. I want to select all records from OrderDetail that have a LineType of "1" AND whose matching SalesOrder line in the OrderMaster table has a OrderStatus column value of "4". In plain English, orders with a Status 4 are open and ready to ship, LineType value of 1 means the Detail Line is a product code. How should this query be structured? It's going into VS 2008 (VB). Many thanks in advance!!! Mike

    Read the article

  • Jquery .load and inner jquery .append

    - by speekeazy
    Hello, Ive just started using jquery for the .load ajax functionality. When i load an external page to a specific div it loads fine. inside the external page there is an .append that .appends javascript to the head. This works on the initial load but when i use .load to load it this portion is not showing. //This is the .load for the div function loadContent(elementSelector, sourceUrl) { url = ""+sourceUrl+""; $(""+elementSelector+"").load(url); alert(url); } //This is the append in the other page that is embedded in a js var cUrl = "http://intensedebate.com/js/genericCommentWrapper2.php?acct="+idcomments_acct+"&postid="+idcomments_post_id+"&title="+idcomments_post_title+"&url="+idcomments_post_url; alert(cUrl); commentScript.type = "text/javascript"; commentScript.src = cUrl; $('head').append(commentScript);

    Read the article

  • .NET regex inner text between td, span, a tag

    - by mushtaqck
    <table > <tr> <td colspan="2" style="height: 14px"> tdtext1 <a>hyperlinktext1<a/> </td> </tr> <tr> <td> tdtext2 </td> <td> <span>spantext1</span> </td> </tr> </table> This is my sample text how to write a regular expression in C# to get the matches for the innertext for td, span, hyperlinks.

    Read the article

  • Clearing Only inner text and not the childnodes

    - by Ravisha
    I have an xml as below < Image>ImageValue11 <Type>png<Type> <Value>ImageValue11</ Value> </ Image> Here ImageValue1 is present in two places.I want to remove innerText for Image node which is the parent.For which i am usign below code XmlNode customImageNode = imagedoc.SelectSingleNode("//Image"); customImageNode.InnerText = string.empty; But this is clearing the child nodes as well.Please let me know how to clear this test off .Looking for a generic solution.

    Read the article

  • how can this inner enum code be improved ?

    - by mafalda
    I have this construct public class Constants{ enum SystemA implements Marker{ ConstOne(1), ConstTwo(2), ConstThree(3); SystemA(int i) { number =i; } int number; } enum SystemB implements Marker{ ConstFour(4), ConstFive(5), ConstSix(6); SystemB(int i) { number =i; } int number; } } I have Marker so I can pass to method like this method(Constants.SystemA) or method(Constants.SystemB) What is the best way to list all the enum values ? I also want to make sure that it is not duplicating the number in any of the enums

    Read the article

  • Why doesn't this inner class compile?

    - by Vincenzo
    This is my code: #include <algorithm> class A { void f() { struct CompareMe { bool operator() (int i, int j) { return i < j; } } comp; int a[] = {1, 2, 3, 4}; int found = std::min_element(a[0], a[3], comp); } } Error message: no matching function for call to ‘min_element(int&, int&, A::f()::CompareMe&) What am I doing wrong?

    Read the article

  • What's wrong with this inner query (MySQL)...

    - by stuboo
    ...besides the fact that I am a total amateur? My table is set up like this: CREATE TABLE `messages` ( `id` int(6) unsigned NOT NULL AUTO_INCREMENT, `patient_id` int(6) unsigned NOT NULL, `message` varchar(255) NOT NULL, `savedate` int(10) unsigned NOT NULL, `senddate` int(10) unsigned NOT NULL, `SmsSid` varchar(40) NOT NULL COMMENT 'where we store the cookies from twilio', `sendorder` tinyint(3) unsigned NOT NULL COMMENT 'the order we want the msg sent in', `sent` tinyint(1) NOT NULL COMMENT '0=queued, 1=sent, 2=sent-unqueued,4=rec-unread,5=recd-read', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=143 ; I need a query that will SELECT * FROM `messages` WHERE `senddate` < $now AND `sent` = 0 (AND LIMIT TO ONLY ONE RECORD PER `patient_id`) I've tried the following: SELECT * FROM `messages` WHERE `senddate` IN (SELECT `patient_id`, max(`senddate`) GROUP by `patient_id`) AND `senddate` < $now AND `sent` = 0 ; But I get this error: MySQL client version: 5.1.37 `#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GROUP by patient_id) AND senddate < 1270093898 AND sent = 0 LIMIT 0, 30' at line 5

    Read the article

  • inner workings of PHP (really long PHP script)

    - by econclicks
    I have a really long php script for just 1 page i.e. something like: mywebsite.com/page.php?id=99999 I have about 10000-20000 cases of the id, each with a different settings. Will this slow down my website significantly? i.e. my question is really along the lines of, what happens when php is executed. does the server execute it and display the results, or does the client's computer download it, execute it and display the results. if its the latter, does it mean a really slow load time? each of the 10000-20000 cases has about 20-25 lines of code after it. thanks, xoxo

    Read the article

  • How to generalize a method call in Java (to avoid code duplication)

    - by dln385
    I have a process that needs to call a method and return its value. However, there are several different methods that this process may need to call, depending on the situation. If I could pass the method and its arguments to the process (like in Python), then this would be no problem. However, I don't know of any way to do this in Java. Here's a concrete example. (This example uses Apache ZooKeeper, but you don't need to know anything about ZooKeeper to understand the example.) The ZooKeeper object has several methods that will fail if the network goes down. In this case, I always want to retry the method. To make this easy, I made a "BetterZooKeeper" class that inherits the ZooKeeper class, and all of its methods automatically retry on failure. This is what the code looked like: public class BetterZooKeeper extends ZooKeeper { private void waitForReconnect() { // logic } @Override public Stat exists(String path, Watcher watcher) { while (true) { try { return super.exists(path, watcher); } catch (KeeperException e) { // We will retry. } waitForReconnect(); } } @Override public byte[] getData(String path, boolean watch, Stat stat) { while (true) { try { return super.getData(path, watch, stat); } catch (KeeperException e) { // We will retry. } waitForReconnect(); } } @Override public void delete(String path, int version) { while (true) { try { super.delete(path, version); return; } catch (KeeperException e) { // We will retry. } waitForReconnect(); } } } (In the actual program there is much more logic and many more methods that I took out of the example for simplicity.) We can see that I'm using the same retry logic, but the arguments, method call, and return type are all different for each of the methods. Here's what I did to eliminate the duplication of code: public class BetterZooKeeper extends ZooKeeper { private void waitForReconnect() { // logic } @Override public Stat exists(final String path, final Watcher watcher) { return new RetryableZooKeeperAction<Stat>() { @Override public Stat action() { return BetterZooKeeper.super.exists(path, watcher); } }.run(); } @Override public byte[] getData(final String path, final boolean watch, final Stat stat) { return new RetryableZooKeeperAction<byte[]>() { @Override public byte[] action() { return BetterZooKeeper.super.getData(path, watch, stat); } }.run(); } @Override public void delete(final String path, final int version) { new RetryableZooKeeperAction<Object>() { @Override public Object action() { BetterZooKeeper.super.delete(path, version); return null; } }.run(); return; } private abstract class RetryableZooKeeperAction<T> { public abstract T action(); public final T run() { while (true) { try { return action(); } catch (KeeperException e) { // We will retry. } waitForReconnect(); } } } } The RetryableZooKeeperAction is parameterized with the return type of the function. The run() method holds the retry logic, and the action() method is a placeholder for whichever ZooKeeper method needs to be run. Each of the public methods of BetterZooKeeper instantiates an anonymous inner class that is a subclass of the RetryableZooKeeperAction inner class, and it overrides the action() method. The local variables are (strangely enough) implicitly passed to the action() method, which is possible because they are final. In the end, this approach does work and it does eliminate the duplication of the retry logic. However, it has two major drawbacks: (1) it creates a new object every time a method is called, and (2) it's ugly and hardly readable. Also I had to workaround the 'delete' method which has a void return value. So, here is my question: is there a better way to do this in Java? This can't be a totally uncommon task, and other languages (like Python) make it easier by allowing methods to be passed. I suspect there might be a way to do this through reflection, but I haven't been able to wrap my head around it.

    Read the article

  • What is the problem with the logic in my UPDATE statement?

    - by Stefan Åstrand
    Hello, I would appreciate some help with an UPDATE statement. I want to update tblOrderHead with the content from tblCustomer where the intDocumentNo corresponds to the parameter @intDocumentNo. But when I run the my statement, the order table is only updated with the content from the first row of the customer table. What is the problem with my logic? I use Microsoft SQL Server. Thanks, Stefan UPDATE dbo.tblOrderHead SET dbo.tblOrderHead.intCustomerNo = @intCustomerNo , dbo.tblOrderHead.intPaymentCode = dbo.tblCustomer.intPaymentCode, dbo.tblOrderHead.txtDeliveryCode = dbo.tblCustomer.txtDeliveryCode, dbo.tblOrderHead.txtRegionCode = dbo.tblCustomer.txtRegionCode, dbo.tblOrderHead.txtCurrencyCode = dbo.tblCustomer.txtCurrencyCode, dbo.tblOrderHead.txtLanguageCode = dbo.tblCustomer.txtLanguageCode FROM dbo.tblOrderHead INNER JOIN dbo.tblCustomer ON dbo.tblOrderHead.intOrderNo = @intDocumentNo

    Read the article

  • SQL Server 2005 RIGHT OUTER JOIN not working

    - by CheeseConQueso
    I'm looking up access logs for specific courses. I need to show all the courses even if they don't exist in the logs table. Hence the outer join.... but after trying (presumably) all of the variations of LEFT OUTER, RIGHT OUTER, INNER and placement of the tables within the SQL code, I couldn't get my result. Here's what I am running: SELECT (a.first_name+' '+a.last_name) instructor, c.course_id, COUNT(l.access_date) course_logins, a.logins system_logins, MAX(l.access_date) last_course_login, a.last_login last_system_login FROM lsn_logs l RIGHT OUTER JOIN courses c ON l.course_id = c.course_id, accounts a WHERE l.object_id = 'LOGIN' AND c.course_type = 'COURSE' AND c.course_id NOT LIKE '%TEST%' AND a.account_rights > 2 AND l.user_id = a.username AND ((a.first_name+' '+a.last_name) = c.instructor) GROUP BY c.course_id, a.first_name, a.last_name, a.last_login, a.logins, c.instructor ORDER BY a.last_name, a.first_name, c.course_id, course_logins DESC Is it something in the WHERE clause that's preventing me from getting course_id's that don't exist in lsn_logs? Is it the way I'm joining the tables? Again, in short, I want all course_id's regardless of their existence in lsn_logs.

    Read the article

  • Need help joining tables...

    - by yuudachi
    I am a MySQL newbie, so sorry if this is a dumb question.. These are my tables. student table: SID (primary) student_name advisor (foreign key to faculty.facultyID) requested_advisor (foreign key to faculty.facultyID) faculty table: facultyID (primary key) advisor_name I want to query a table that shows everything in the student table, but I want advisor and requested_advisor to show up as names, not the ID numbers. so like it displays like this on the webpage: Student Name: Jane Smith SID: 860123456 Current Advisor: John Smith Requested advisor: James Smith not like this Student Name: Jane Smith SID: 860123456 Current Advisor: 1 Requested advisor: 2 SELECT student.student_name, SID, student_email, faculty.advisor_name FROM student INNER JOIN faculty ON student.advisor = faculty.facultyID; this comes out close, but I don't know how to get the requested_advisor to show up as a name.

    Read the article

  • How can I make an SQL statement that finds unassociated records?

    - by William Calleja
    I have two tables as follows: tblCountry (countryID, countryCode) tblProjectCountry(ProjectID, countryID) The tblCountry table is a list of all countries with their codes and the tblProjectCountry table associates certain countries with certain projects. I need an SQL statement that gives me a list of the countries with their country code that do NOT have an associated record in the tblProjectCountry table. so far I got to here: SELECT tblCountry.countryID, tblCountry.countryCode FROM tblProjectCountry INNER JOIN tblCountry ON tblProjectCountry.countryID = tblCountry.countryID WHERE (SELECT COUNT(ProjectID) FROM tblProjectCountry WHERE (ProjectID = 1) AND (countryID = tblCountry.countryID)) = 0 The above statement parses as correct but doesn't give the exact result I'm looking for. Can anyone help?

    Read the article

  • About local Final varibles in java

    - by Sathish
    In java Program, parameters which is defined as String in method declaration.But in method definition it is accessed as final String variable. Whether it'll lead to some issues (like security, memory problem)? For Example: Method Declaration join(String a,String b); Method definition public void join(final String a,final String b) { Authenticator au = new Authenticator(){ public PasswordAuthentication getPasswordAuthentication(){ return new PasswordAuthentication(a,b)} }; } Please help for me and clarify my doubts. Thanks in advance P.S. I;m accessing a and b as final variable because i've to use it in the inner class.

    Read the article

  • querying databases on same server with linq

    - by geoff swartz
    In normal sql I could do joins on tables in different databases as long as they were on the same server (or linked servers). In linq I can't figure out how to do that. Is this possible? For example, if I have a database called db1 and another called db2. db1 has a table called people and db2 has a table called address I could do something like... select a.addressline1, p.firstname from db1.dbo.people p inner join db2.dbo.address a on p.peopleid = a.peopleid Is this possible with linq? Thanks.

    Read the article

  • Linq To Sql Left outer join - filtering null results

    - by Harry
    I'd like to reproduce the following SQL into C# LinqToSql SELECT TOP(10) Keywords.* FROM Keywords LEFT OUTER JOIN IgnoreWords ON Keywords.WordID = IgnoreWords.ID WHERE (DomainID = 16673) AND (IgnoreWords.Name IS NULL) ORDER BY [Score] DESC The following C# Linq gives the right answer. But I can't help think I'm missing something (a better way of doing it?) var query = (from keyword in context.Keywords join ignore in context.IgnoreWords on keyword.WordID equals ignore.ID into ignored from i in ignored.DefaultIfEmpty() where i == null where keyword.DomainID == ID orderby keyword.Score descending select keyword).Take(10); the SQL produced looks something like this: SELECT TOP (10) [t0].[DomainID], [t0].[WordID], [t0].[Score], [t0].[Count] FROM [dbo].[Keywords] AS [t0] LEFT OUTER JOIN (SELECT 1 AS [test], [t1].[ID] FROM [dbo].[IgnoreWords] AS [t1]) AS [t2] ON [t0].[WordID] = [t2].[ID] WHERE ([t0].[DomainID] = 16673) AND ([t2].[test] IS NULL) ORDER BY [t0].[Score] DESC How can I get rid of this redundant inner selection? It's only slightly more expensive but every bit helps!

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >