Search Results

Search found 14593 results on 584 pages for 'pat inside'.

Page 56/584 | < Previous Page | 52 53 54 55 56 57 58 59 60 61 62 63  | Next Page >

  • get js file query param from inside it

    - by vsync
    I load this file with some query param like this: src='somefile.js?userId=123' I wrote the below function in 'somefile.js' file that reads the 'userId' query param but I feel this is not the best approach. Frankly, its quite ugly. Is there a better way? function getId(){ var scripts = document.getElementsByTagName('script'), script; for(var i in scripts){ if( scripts.hasOwnProperty(i) && scripts[i].src.indexOf('somefile.js') != -1 ) var script = scripts[i]; } var s = (script.getAttribute.length !== undefined) ? script.getAttribute('src') : script.getAttribute('src', 2); return getQueryParams('userId',s); };

    Read the article

  • How to parse the AndroidManifest.xml file inside an .apk package

    - by jnorris
    This file appears to be in a binary XML format. What is this format and how can it be parsed programmatically (as opposed to using the aapt dump tool in the SDK)? This binary format is not discussed in the in the documentation here: http://developer.android.com/guide/topics/manifest/manifest-intro.html Note: I want to access this information from outside the Android environment, preferably from Java.

    Read the article

  • Setting new class variables inside a module

    - by Sean McCleary
    I have a plugin I have been working on that adds publishing to ActiveRecord classes. I extend my classes with my publisher like so: class Note < ActiveRecord::Base # ... publishable :related_attributes => [:taggings] end My publisher is structured like: module Publisher def self.included(base) base.send(:extend, ClassMethods) @@publishing_options = [] # does not seem to be available end module ClassMethods def publishable options={} include InstanceMethods @@publishing_options = options # does not work as class_variable_set is a private method # self.class_variable_set(:@@publishing_options, options) # results in: uninitialized class variable @@publishing_options in Publisher::ClassMethods puts "@@publishing_options: #{@@publishing_options.inspect}" # ... end # ... end module InstanceMethods # results in: uninitialized class variable @@publishing_options in Publisher::InstanceMethods def related_attributes @@publishing_options[:related_attributes] end # ... end end Any ideas on how to pass options to publishable and have them available as a class variable?

    Read the article

  • Inserting Row in Table inside Form tag autosubmitting in firefox/chrome

    - by user1861489
    I have a form that will have dynamic elements inserted with javascript and am experiencing some strange behavior. When I click the button to add another element to the table in the form, it adds the element but seems to to a form post immediately (without intending to submit the form yet) I have created a simplified example of the page that has the same behavior. the first table element is created on page load and subsequent elements are added when clicking on the button. this form works successfully in IE. does anyone have an idea of how to prevent this behavior? here is the code sample. <!DOCTYPE html> <html> <head> <title>Test Creating Form</title> <meta http-equiv="Content-type" content="text/html;charset=UTF-8"> <style type="text/css"> td{font-family:verdana;} </style> <script type="text/javascript"> var counter = 0; function makeTitle(title){ if(counter){ title += " " + counter; } counter++; var tbl = document.getElementById('tbl'); var tr = tbl.insertRow(-1) var td1 = tr.insertCell(-1); td1.innerHTML = title; } function load1(){ makeTitle('Primary Specimen'); } </script> </head> <body onload="load1();"> <form action="formtest.htm" method="post" name="testForm" id="testForm"> <table id="tbl" border="1"></table> <button onclick="makeTitle('Alternate Specimen')" id="clone" >Add Another Specimen</button> </form> </body> </html>

    Read the article

  • where are images stored inside programs?

    - by avon_verma
    i'm new to programs so bear with me For example, Firefox.. I go to the C/program files/mozilla/firefox folder ..but I don't see the images/buttons they used for the default theme of the program Also, photoshop and other programs: how are the buttons, images, and other media stored (not in a folder from what I see)? same thing when I made a simple program in visual c++, i don't see where the icon is located at? thanksvery much

    Read the article

  • ASP.NET Membership controls (can I see inside?)

    - by Paul Moss
    Hello, I am looking at ASP.NET membership controls (2008) and have been dropping them onto web pages to see how it all works. In some ASP.NET starter kit web site examples that I downloaded, I notice that between the asp:control tags I can see all the tags of the constituent parts like the textboxes, labels and buttons etc. However with the membership control that I am using in 2008 I do not see these other tags. Is this because the starter kit examples are from an older version or is it possible to expose these inner tags? It seems that this would make it possible to customize the controls. Thanks [email protected]

    Read the article

  • Adding on touch event to images inside gridview

    - by Steve
    I have a gridview where each item has a image and a textview (an app), i added the onItemClick to the gridview in order to launch the app, i also removed the orange selection and made selector in xml so when pressed the text would change to grey and on release it would return to white. My problem is that i need the image to apply an alpha value when pressed and restore the previous alpha on release i tested a lot of ways and none did worked correctly. I came close with the updated answer from the autor of the question: How to set alpha value for drawable in a StateListDrawable?, but some how the state pressed never gets called, i don´t know if this is because i am using the onitemClick to launch the app or not. Also i since i can´t define the alpha on imageview xml i don´t know what else to do Any help will be appreciated

    Read the article

  • Find Javascript Code inside String

    - by Ph.E
    Greetings friends, I am developing a web application that will allow the customer to enter a personalized message, which will then be converted to HTML. Well, the problem is that I can not allow the insertion of Javascript code. So I need a method that filters the text, searching for and remove it. I think the regular expressions to solve my problem, but I'm having difficulty building. Some of his friends could help me, or has already developed something for this. Thank you.

    Read the article

  • Sort std::vector by an element inside?

    - by user146780
    I currently have a std::vector which holds std::vector of double. I'd want to sort it by the second element of the double vectore. ex: instead of sorting by MyVec[0] or myvec[1] I wat it to sort myVec[0] and myvec[1] based on myvec[0][1] myvec[1][1]. Basically sort by a contained value, not the objects in it. so if myvec[0][1] is less than myvec[1][1] then myvec[0] and myvec[1] will swap. Thanks

    Read the article

  • Fork a process and send data to it inside Rails

    - by taro
    I'm making a Rails application. In the one action I need to spawn a long running process. This is not a problem. I can fork new process using spawn gem or some other. But some time after process has been spawned, user must be able to pass additional data to that process. Sure, I can fork process which will listen a UNIX socket, store socket address in the HTTP session and communicate with that process using drb protocol when user will require to pass new data to process. But I think it is not best solution and it will be a problem to deploy an application to the hosting. What is the easy way to do that?

    Read the article

  • declare decision structure inside of a System.out.println

    - by user2899249
    So I am working on an assignment where I have to have a print method in a constructor that displays a distance. I also have to have three separate get methods depending on what the input is in the demo class. My question is that I am trying to write the print method to contain a decision structure based on which get is used. public void prt() { DecimalFormat formatter = new DecimalFormat("#,##0.00"); System.out.println("The time it takes the sound to travel " + distance + " feet through air is " + if (getSpeedInAir() > 0) { formatter.format(getSpeedInAir()); } else if (getSpeedInWater() > 0) { formatter.format(getSpeedInWater()); } else if (getSpeedInSteel() > 0) { formatter.format(getSpeedInSteel()); } else "error";) } After trying to compile I am getting the following errors. Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Users\GlaDOS\Desktop\JavaStuffj Speed C:\Users\GlaDOS\Desktop\JavaStuffdel *.class C:\Users\GlaDOS\Desktop\JavaStuffjavac Speed.java Speed.java:43: error: illegal start of expression " feet through air is " + if (getSpeedInAir() 0) ^ Speed.java:43: error: ';' expected " feet through air is " + if (getSpeedInAir() 0) ^ Speed.java:43: error: not a statement " feet through air is " + if (getSpeedInAir() 0) ^ Speed.java:43: error: ';' expected " feet through air is " + if (getSpeedInAir() 0) ^ Speed.java:47: error: 'else' without 'if' else if (getSpeedInWater() > 0) ^ Speed.java:56: error: not a statement "error";) ^ Speed.java:56: error: illegal start of expression "error";) ^ 7 errors C:\Users\GlaDOS\Desktop\JavaStuffjava Speed Error: Could not find or load main class Speed Any help on why this is happening would be greatly appreciated.

    Read the article

  • GWT - Retrieve size of a widget inside an AbsolutePanel

    - by Garagos
    I need to set the size of an absolutePanel regarding to its child size, but the getOffset* methods return 0 because (i think) the child as not been displayed yet. A Quick example: AbsolutePanel aPanel = new AbsolutePanel(); HTML text = new HTML(/*variable lenght text*/); int xPosition = 20; // actually variable aPanel.add(text, xPosition, 0); aPanel.setSize(xPosition + text .getOffsetWidth() + "px", "50px"); // 20px 50px Is there a way to: retrieve the size of a widget that has not been displayed? be notified when a widget is displayed ?

    Read the article

  • Android Round Button and Spinner inside Activity Group

    - by vaishali
    I have a Spinner and 2 buttons in an Activity Group. I want to apply rounded corner to the buttons. I have created shape xml resource file for round button in Android. I have assigned this resource file as background to the button while creating the button in Layout. But the change is not reflected after executing the application. I have set the ContentView for that screen as : setContentView(LayoutInflater.from(getParent()).inflate(R.layout.textmessage,null)); This has to be done to make spinner work in an Activity Group. How can I make the Button as round corner in an Activity Group having Spinner? Any help would be appreciated. Thanks in Advance.

    Read the article

  • Creating a folder inside Mac OS App

    - by Negative Zero
    I want a an app that is "self-contained" (I don't know if i use the right word. "putting the app into trash bin will remove everything" is what I meant). But the app requires some resources to run. I usually put those resources into a folder. I want to move those resources into the App folder ( package contents). Can I do that? Is it a good practice to do that? When I test the app directly running from Xcode, the App runs fine. But if i run it from finder, the app will say fails to create resources folder because permission denied. I checked the app's folder permission - User(me) has read/write access. I am wondering what is causing this different behavior. The last option is to use Application Support folder, but I don't want to leave trails when user deletes the app. Can someone help me out here?

    Read the article

  • Parse text of element with empty element inside

    - by Mando
    I'm trying to convert an XHTML document that uses lots of tables into a semantic XML document in Python using xml.etree. However, I'm having some trouble converting this XHTML <TD> Textline1<BR/> Textline2<BR/> Textline3 </TD> into something like this <lines> <line>Textline1</line> <line>Textline2</line> <line>Textline3</line> </lines> The problem is that I don't know how to get the text after the BR elements.

    Read the article

  • accessing div inside the td using jquery

    - by azamsharp
    not sure why I find this so difficult. Here is the html code: <tr> <td>FirstName 9</td><td>LastName 9</td><td> <a href="#" id="linkSponsorMessage">View</a> </td><td> <div class="divSponsorMessage" style="display:none"> Greetings FirstName 9, LastName 9! </div> </td> </tr> I need to access the when click on the anchor link using JQuery. UPDATE: I got to work: $("#linkSponsorMessage").parent("td").next("td").children("div") But is there a better way!!!

    Read the article

  • How to avoid the linebreak inside a word (Static Layout

    - by Addev
    I'm trying to make a text as big as I can making it fit a Rect. basically I use a StaticLayout for pre-calculate the text size and make it fit the Rect's height: // Since the width is fixed for the StaticLayout it should only fit the height while (currentHeight>Rect.getHeight()){ size-=2; } textPaint.setTextSize(size); The problem is that if the Rect is very high, the exit condition is reached but breaking the words (see the capture). Is there a way for avoid this? Goal: Actual: Current code: textSize=MAX_TEXT_SIZE do { if (textSize < mMinTextSize) { Log.i(TAG, "Min reached"); textSize = mMinTextSize; textPaint.setTextSize(textSize); fits = true; } else { textPaint.setTextSize(textSize); StaticLayout layout = new StaticLayout(text, textPaint, targetWidth, Alignment.ALIGN_NORMAL, 1.0, 0, true); layout.draw(canvas); float heightRatio= (float) layout.getHeight() / (float) targetHeight; boolean fitsHeight = heightRatio<= 1f; if (fitsHeight) { fits = true; } else { textSize -= 2; } } Log.i(TAG, "textSize=" + textSize + " fits=" + fits); } while (!fits); thanks

    Read the article

  • IDENTITY_INSERT ON inside of cursor does not allow inserted id

    - by Mac
    I am trying to set some id's for a bunch of rows in a database where the id column is an identity. I've created a cursor to loop through the rows and update the ids with incrementing negative numbers (-1,-2,-3 etc). When I updated just one row turning on the IDENTITY_INSERT it worked fine but as soon as I try and use it in a cursor, it throws the following error. Msg 8102, Level 16, State 1, Line 22 Cannot update identity column 'myRowID'. DECLARE @MinId INT; SET @MinId = (SELECT MIN(myRowId) FROM myTable)-1; DECLARE myCursor CURSOR FOR SELECT myRowId FROM dbo.myTable WHERE myRowId > 17095 OPEN myCursor DECLARE @myRowId INT FETCH NEXT FROM myCursor INTO @myRowId WHILE (@@FETCH_STATUS <> -1) BEGIN SET IDENTITY_INSERT dbo.myTable ON; --UPDATE dbo.myTable --SET myRowId = @MinId --WHERE myRowId = @myRowId; PRINT (N'ID: ' + CAST(@myRowId AS VARCHAR(10)) + N' NewID: ' + CAST(@MinId AS VARCHAR(4))); SET @MinId = @MinId - 1; FETCH NEXT FROM myCursor INTO @myRowId END CLOSE myCursor DEALLOCATE myCursor GO SET IDENTITY_INSERT dbo.myTable OFF; GO Does anyone know what I'm doing wrong?

    Read the article

  • What happens inside the try block?

    - by dontWatchMyProfile
    Example: @try { // 1) do bad stuff that can throw an exception... // 2) do some more stuff // 3) ...and more... } @catch (NSException *e) { NSLog(@"Error: %@: %@", [e name], [e reason]); } If 1) throws an exception, is the block immediately canceled like a return in a function or a break in a loop? Or will 2) and 3) be processed no matter what happens in 1)?

    Read the article

  • Log your SQL in Rails application inside unit test

    - by Phuong Nguy?n
    I want to install a logger so that I can dump all executed SQL of my rails application. Problem is, such logger is associated with AbstractAdapter which initialized very soon under test mode, and thus cannot be set by my initializer code. I try to put ActiveRecord::Base.logger = MyCustomLogger.new(STDOUT) in the end of environment.rb like someone advised but it only works when being run in console environment (kicked by script/console), not when run under test mode. I wonder if there is any way to config such logger so that I will sure to be invoked under any environment (test, development, production, console)

    Read the article

  • Separating Variables Inside an Array

    - by Jake Avila Talledo
    Hey i have an array an I need to separate each value so it would be something like this $arry = array(a,b,c,d,e,f) $point1 = (SELECT distance FROM Table WHERE Origin = a AND Destination = b); $point2 = (SELECT distance FROM Table WHERE Origin = b AND Destination = c); $point3 = (SELECT distance FROM Table WHERE Origin = c AND Destination = d); $point4 = (SELECT distance FROM Table WHERE Origin = d AND Destination = e); $point5 = (SELECT distance FROM Table WHERE Origin = e AND Destination = f); $point6 = (SELECT distance FROM Table WHERE Origin = f AND Destination = g); $point7 = (SELECT distance FROM Table WHERE Origin = g AND Destination = f); $total_trav = $point1+$point2+$point3+$point4+$point5+$point6+$point7

    Read the article

< Previous Page | 52 53 54 55 56 57 58 59 60 61 62 63  | Next Page >