Search Results

Search found 613 results on 25 pages for 'x ray'.

Page 12/25 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Making a view scrollable when keyboard active

    - by Dan Ray
    I have a view with half a dozen text fields and labels, and a button. I want it to be that when the keyboard pops up, the view becomes scrollable, so you can scroll the view up and see the bottom half of the fields without having to dismiss the keyboard to get to them. Just putting it inside a UIScrollView doesn't seem to do it.

    Read the article

  • error with redirect using listener JSF 2.0

    - by Ray
    I have a index.xhtml page <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets"> <f:view> <ui:insert name="metadata" /> <f:event type="preRenderView" listener="#{item.show}" /> <h:body></h:body> </f:view> </html> And in bean class with scope session this method public void show() throws IOException, DAOException { ExternalContext externalContext = FacesContext.getCurrentInstance() .getExternalContext(); //smth String rootPath = externalContext.getRealPath("/"); String realPath = rootPath + "pages\\template\\body\\list.xhtml"; externalContext.redirect(realPath); } i think that I should redirect to next page but I have "browser can't show page" and list.xhtml (if I do this page as welcome-page I haven't error, it means that error connected with redirect) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets"> <h:body> <ui:composition template="/pages/layouts/mainLayout.xhtml"> <ui:define name="content"> <h:form></h:form></ui:define></ui:composition> </h:body> </html> in consol i didn't have any error. in web.xml <welcome-file-list> <welcome-file>index.xhtml</welcome-file> </welcome-file-list> <servlet> <servlet-name>Faces Servlet</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>*.xhtml</url-pattern> </servlet-mapping> What can be the reason this problem?

    Read the article

  • Is there a faster way to parse through a large file with regex quickly?

    - by Ray Eatmon
    Problem: Very very, large file I need to parse line by line to get 3 values from each line. Everything works but it takes a long time to parse through the whole file. Is it possible to do this within seconds? Typical time its taking is between 1 minute and 2 minutes. Example file size is 148,208KB I am using regex to parse through every line: Here is my c# code: private static void ReadTheLines(int max, Responder rp, string inputFile) { List<int> rate = new List<int>(); double counter = 1; try { using (var sr = new StreamReader(inputFile, Encoding.UTF8, true, 1024)) { string line; Console.WriteLine("Reading...."); while ((line = sr.ReadLine()) != null) { if (counter <= max) { counter++; rate = rp.GetRateLine(line); } else if(max == 0) { counter++; rate = rp.GetRateLine(line); } } rp.GetRate(rate); Console.ReadLine(); } } catch (Exception e) { Console.WriteLine("The file could not be read:"); Console.WriteLine(e.Message); } } Here is my regex: public List<int> GetRateLine(string justALine) { const string reg = @"^\d{1,}.+\[(.*)\s[\-]\d{1,}].+GET.*HTTP.*\d{3}[\s](\d{1,})[\s](\d{1,})$"; Match match = Regex.Match(justALine, reg, RegexOptions.IgnoreCase); // Here we check the Match instance. if (match.Success) { // Finally, we get the Group value and display it. string theRate = match.Groups[3].Value; Ratestorage.Add(Convert.ToInt32(theRate)); } else { Ratestorage.Add(0); } return Ratestorage; } Here is an example line to parse, usually around 200,000 lines: 10.10.10.10 - - [27/Nov/2002:16:46:20 -0500] "GET /solr/ HTTP/1.1" 200 4926 789

    Read the article

  • jquery show/hide/toggle etc.

    - by Ray
    JQUERY: $("li h2").click(function() { $(this).toggleClass("active").siblings().removeClass("active"); $(this).next("div").slideToggle("fast").siblings("div").slideUp("fast"); }); HTML: <ul> <li> <h2>headingA</h2> <div>contentA</div> <h2>headingB</h2> <div>contentB</div> </li> </ul> NOTES: Bascially I'd want: when click on h2 show the div next to it and hide all others, not only show/hide toggle as well. thanks!

    Read the article

  • How to implement arrays in an interpreter?

    - by Ray
    I have managed to write several interpreters including Tokenizing Parsing, including more complicated expressions such as ((x+y)*z)/2 Building bytecode from syntax trees Actual bytecode execution What I didn't manage: Implementation of dictionaries/lists/arrays. I always got stuck with getting multiple values into one variable. My value structure (used for all values passed around, including variables) looks like this, for example: class Value { public: ValueType type; int integerValue; string stringValue; } Works fine with integers and strings, but how could I implement arrays? (From now on with array I mean arrays in my experimental language, not in C++) How can I fit the array concept into the Value class above? Is it possible? How should I make arrays able to be passed around just as you could pass around integers and strings in my language, using the class above? Accessing array elements or memory allocation wouldn't be the problem, I just don't know how to store them.

    Read the article

  • What is the naming convention in Python for variable and function names?

    - by Ray Vega
    Coming from a C# background the naming convention for variables and method names are usually either CamelCase or Pascal Case: // C# example string thisIsMyVariable = "a" public void ThisIsMyMethod() In Python, I have seen the above but I have also seen underscores being used: # python example this_is_my_variable = 'a' def this_is_my_function(): Is there a more preferable, definitive coding style for Python?

    Read the article

  • bool as object vs string as object testing equality

    - by Ray Pendergraph
    I am relatively new to C# and I noticed something interesting today that I guess I have never noticed or perhaps I am missing something. Here is an NUnit test to give an example: object boolean1 = false; object booloan2 = false; Assert.That(boolean1 == booloan2); This unit test fails, but this one passes: object string1 = "string"; object string2 = "string"; Assert.That(string1 == string2); I'm not that surprised in and of itself that the first one fails seeing as boolean1 and boolean2 are different references. But it is troubling to me that the first one fails and the second one passes. I read (on MSDN somewhere) that some magic was done to the String class to facilitate this. I think my question really is why wasn't this behavior replicated in bool? As a note... if the boolean1 and 2 are declared as "bool" then there is no problem. Does anyone know the reason for these differences or why it was implemented that way? Can anyone think of a situation where you would want to reference a bool object for anything except its value?

    Read the article

  • SQL Server Query Slow from PHP, but FAST from SQL Mgt Studio - WHY???

    - by Ray
    I have a fast running query (sub 1 sec) when I execute the query in SQL Server Mgt Studio, but when I run the exact same query in PHP (on the same db instace) using FreeTDS v8, mssql_query(), it takes much longer (70+ seconds). The tables I'm hitting have an index on a date field that I'm using in the Where clause. Could it be that PHP's mssql functions aren't utilizing the index? I have also tried putting the query inside a stored procedure, then executing the SP from PHP - the same results in time difference occurs. I have also tried adding a WITH ( INDEX( .. ) ) clause on the table where that has the date index, but no luck either. Here's the query: SELECT 1 History, h.CUSTNMBR CustNmbr, CONVERT(VARCHAR(10), h.ORDRDATE, 120 ) OrdDate, h.SOPNUMBE OrdNmbr, h.SUBTOTAL OrdTotal, h.CSTPONBR PONmbr, h.SHIPMTHD Shipper, h.VOIDSTTS VoidStatus, h.BACHNUMB BatchNmbr, h.MODIFDT ModifDt FROM SOP30200 h WITH (INDEX (AK2SOP30200)) WHERE h.SOPTYPE = 2 AND h.DOCDATE >= DATEADD(dd, -61, GETDATE()) AND h.VOIDSTTS = 0 AND h.MODIFDT = CONVERT(VARCHAR(10), DATEADD(dd, -1*@daysAgo, GETDATE()) , 120 ) ;

    Read the article

  • Generating 8000 text files from xml files

    - by Ray
    Hi all, i need to generate the same number of text files as the xml files i have. Within the text files, i need the title and maybe some other tags of it. I can generate text files with the elements i wanted but not all xml files can be generated. Only some of them are generated. Something might be wrong with my parser so help out please thanks. This is my code. Please have a look and give me suggestions. Thanks in advance. import java.io.File; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import org.w3c.dom.*; import java.io.*; public class AccessingXmlFile1 { public static void main(String argv[]) { try { //File file = new File("C:\\MyFile.xml"); // create a file that is really a directory File aDirectory = new File("C:/Documents and Settings/I2R/Desktop/test"); // get a listing of all files in the directory String[] filesInDir = aDirectory.list(); System.out.println(""+filesInDir.length); // sort the list of files (optional) // Arrays.sort(filesInDir); //////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////// // have everything i need, just print it now for ( int a=0; a<filesInDir.length; a++ ) { String xmlFile = filesInDir[a]; String newLine = System.getProperty("line.separator"); File file = new File(xmlFile); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); Document document = db.parse(file); document.getDocumentElement().normalize(); //System.out.println("Root element " + document.getDocumentElement().getNodeName()); NodeList node = document.getElementsByTagName("metadata"); System.out.println("Information of Xml File"); System.out.println(xmlFile.substring(0, xmlFile.length() - 4)); //////////////////////////////////////////////////////////////////////////////////// String titleStoreText = ""; String descriptionStoreText = ""; String collectionStoreText = ""; String textToWrite = ""; //////////////////////////////////////////////////////////////////////////////////// for (int i = 0; i < node.getLength(); i++) { Node firstNode = node.item(i); if (firstNode.getNodeType() == Node.ELEMENT_NODE) { Element element = (Element) firstNode; NodeList titleElementList = element.getElementsByTagName("title"); Element titleElement = (Element) titleElementList.item(0); NodeList title = titleElement.getChildNodes(); //////////////////////////////////////////////////////////////////////////////////// if(titleElement == null) titleStoreText = " There is no title for this file."+ newLine; else titleStoreText = titleStoreText+((Node) title.item(0)).getNodeValue() + newLine; //titleStoreText = titleStoreText+((Node) title.item(0)).getNodeValue()+ newLine; //////////////////////////////////////////////////////////////////////////////////// System.out.println("Title : " + titleStoreText); NodeList collectionElementList = element.getElementsByTagName("collection"); Element collectionElement = (Element) collectionElementList.item(0); NodeList collection = collectionElement.getChildNodes(); //////////////////////////////////////////////////////////////////////////////////// if(collectionElement == null) collectionStoreText = " There is no collection for this file."+ newLine; else collectionStoreText = collectionStoreText+((Node) collection.item(0)).getNodeValue() + newLine; //collectionStoreText = collectionStoreText+((Node) collection.item(0)).getNodeValue()+ newLine; //////////////////////////////////////////////////////////////////////////////////// System.out.println("Collection : " + collectionStoreText); NodeList descriptionElementList = element.getElementsByTagName("description"); Element descriptionElement = (Element) descriptionElementList.item(0); NodeList description = descriptionElement.getChildNodes(); //////////////////////////////////////////////////////////////////////////////////// if(descriptionElement == null) descriptionStoreText = " There is no description for this file."+ newLine; else descriptionStoreText = descriptionStoreText+((Node) description.item(0)).getNodeValue() + newLine; //descriptionStoreText = descriptionStoreText+((Node) description.item(0)).getNodeValue() + newLine; //////////////////////////////////////////////////////////////////////////////////// System.out.println("Description : " + descriptionStoreText); //////////////////////////////////////////////////////////////////////////////////// textToWrite = "=====Title=====" + newLine + titleStoreText + newLine + "=====Collection=====" + newLine + collectionStoreText + newLine + "=====Description=====" + newLine + descriptionStoreText;// + newLine + "=====Subject=====" + newLine + subjectStoreText; //////////////////////////////////////////////////////////////////////////////////// } } ///////////////////////////////////////////write to file part is here///////////////////////////////////////// Writer output = null; File file2 = new File(xmlFile.substring(0, xmlFile.length() - 4)+".txt"); output = new BufferedWriter(new FileWriter(file2)); output.write(textToWrite); output.close(); System.out.println("Your file has been written"); //////////////////////////////////////////////////////////////////////////////////// } } catch (Exception e) { e.printStackTrace(); } } }

    Read the article

  • Wait for all WPF animations to stop

    - by Ray
    Given a WPF window, which may or may not have animations, I'd like to wait until they are all done before continuing processing. Is there a generic way to do this. Currently I can do something like this: void WaitForAnimation(Storyboard storyboard) { WaitUntil(() => storyboard.GetCurrentState() == ClockState.Stopped); } But this assumes I know the storyboards or have some way of finding them. Is there a way of doing that?

    Read the article

  • JSF dynamic ui:include

    - by Ray
    In my app I have tutor and student as roles of user. And I decide that main page for both will be the same. But menu will be different for tutors and users. I made to .xhtml page tutorMenu.xhtml and student.xhtml. And want in dependecy from role include menu. For whole page I use layout and just in every page change content "content part" in ui:composition. In menu.xhtml <h:body> <ui:composition> <div class="menu_header"> <h2> <h:outputText value="#{msg['menu.title']}" /> </h2> </div> <div class="menu_content"> <?:if test="#{authenticationBean.user.role.roleId eq '2'}"> <ui:include src="/pages/content/body/student/studentMenu.xhtml"/> </?:if> <?:if test= "#{authenticationBean.user.role.roleId eq '1'}"> <ui:include src="/pages/content/body/tutor/tutorMenu.xhtml" /> </?:if> </div> </ui:composition> I know that using jstl my be not better solution but I can't find other. What is the best decision of my problem?

    Read the article

  • SSRS Dynamic Returning Dataset Collection Field in Expression

    - by Ray Clark
    I wrote a custom assembly to take a parameter value from the report and return a field from the dataset collection. My assembly returns the correct fields!name.value, but it shows me the string representation of it. How can I get it to resolve as the actual fields!name.value to display the actual data in the dataset? If I enter fields!name.value in manually it works fine showing me the value. If I resolve it with my custom code it display "fields!name.value" to me in the cell.

    Read the article

  • bulk update/delete entities of different kind in db.run_in_transaction

    - by Ray Yun
    Here goes pseudo code of bulk update/delete entities of different kind in single transaction. Note that Album and Song entities have AlbumGroup as root entity. class AlbumGroup: pass class Album: group = db.ReferenceProperty(reference_class=AlbumGroup,collection_name="albums") class Song: album = db.ReferenceProperty(reference_class=Album,collection_name="songs") def bulk_update_album_group(album_group): updated = [album_group] deleted = [] for album in album_group.albums: updated.append(album) for song in album.songs: if song.is_updated: updated.append(song) if song.is_deleted: deleted.append(song) db.put(updated) db.delete(deleted) a = AlbumGroup.all().filter("...").get() # bulk update/delete album group. for simplicity, album cannot be deleted. db.run_in_transaction(bulk_update_album_group,a) But I met a famous "Only Ancestor Queries in Transactions" error at the iterating reference properties like album.songs or album_group.albums. I guess ancestor() filter does not help because those entities are modified in memory. Should I not to iterate reference property in transaction function and always provide them as function parameters like def bulk_update_album_group(updated,deleted): ??? Is there any good coding pattern for this situation?

    Read the article

  • Problems encountered in changing a CRichEditCtrl selection color.

    - by dev ray
    I have written the following code after creating the CRichEditCtrl // 06112010 : The following code was added to highlight the textselection in black color instead of the default blue color of CRichEditCtrl. - 1311 { m_EditControl.SetSel(0,100); CHARFORMAT2 cf1; cf1.cbSize = sizeof(CHARFORMAT2); m_EditControl.GetSelectionCharFormat(cf1); cf1.dwMask = CFM_BACKCOLOR ; cf1.dwEffects &= ~CFE_AUTOBACKCOLOR; cf1.crBackColor = RGB(0,0,0); m_EditControl.SetSelectionCharFormat(cf1); m_EditControl.Invalidate(); } After this I am adding text, but the selection still comes in blue color instead of Black. Could someone please tell me what I am doing wrong?? Thanks, DeV

    Read the article

  • How can I launch an application as Administrator after a WiX MSI has completed?

    - by ray dey
    Hi there I want to launch an application with admin rights after I have completed an installation using a WiX based MSI. I can launch the application just fine, on XP but with Windows 7, it's an issue. The application has a manifest embedded in it that says it should run as administrator and I've changed the impersonate attribute in the Custom Action to "no". I can't change the execute attribute to deferred, as this only works before the InstallFinalize action and I need it after the user has clicked Finish in the MSI. This is my Custom Action: <CustomAction Id="LaunchApp" FileKey="App" ExeCommand="[Command Line Args]" Execute="immediate" Impersonate="no" Return="asyncNoWait" /> Any help on this would be appreciated. Thanks

    Read the article

  • Objective-C Definedness

    - by Dan Ray
    This is an agonizingly rookie question, but here I am learning a new language and framework, and I'm trying to answer the question "What is Truth?" as pertains to Obj-C. I'm trying to lazy-load images across the network. I have a data class called Event that has properties including: @property (nonatomic, retain) UIImage image; @property (nonatomic, retain) UIImage thumbnail; in my AppDelegate, I fetch up a bunch of data about my events (this is an app that shows local arts event listings), and pre-sets each event.image to my default "no-image.png". Then in the UITableViewController where I view these things, I do: if (thisEvent.image == NULL) { NSLog(@"Going for this item's image"); UIImage *tempImage = [UIImage imageWithData:[NSData dataWithContentsOfURL: [NSURL URLWithString: [NSString stringWithFormat: @"http://www.mysite.com/content_elements/%@_image_1.jpg", thisEvent.guid]]]]; thisEvent.image = tempImage; } We never get that NSLog call. Testing thisEvent.image for NULLness isn't the thing. I've tried == nil as well, but that also doesn't work.

    Read the article

  • Nested pound sign problem

    - by Ray Buechler
    I'm having an issue when I try to nest pound signs in my ColdFusion code. I keep getting the following error message: Invalid CFML construct found on line 57 at column 26. ColdFusion was looking at the following text: # Here is the code: <cfloop index="i" from="1" to="12"> <cfset needRecord.setNeed#i#(#form["need#i#"]#) /> </cfloop> If I run the loop outside the cfset tag like this: <cfloop index="i" from="1" to="12"> needRecord.setNeed#i#(#form["need#i#"]#) </cfloop> The code runs and generates what I would like to generate within the cfset tag. Any idea what I'm doing wrong? Any help would be greatly appreciated.

    Read the article

  • Complex nib is slow to load

    - by Dan Ray
    I'm looking for advice about a nib that's very slow to load. It's big and complex, with lots of subviews and doodads. When I fire my UINavController to push it, it's noticeably laggy (maybe almost a second) on my 3G. It sits there with the table cell selected and nothing else happening for long enough to make you wonder if it's broken. I wonder about pre-loading it in another thread while the user is on the previous view. I could probably fire the selector in the background with a delay in the previous view's viewDidAppear, and then keep it in a property until push time comes. Thoughts?

    Read the article

  • Synchronous HTTP Client with .NET sockets

    - by Ray Wits
    Does anyone know of any open source C# projects or some sample code that implement a synchronous HTTP client using sockets? I'm working on a project where I need a HTTP client using sockets. It can't use WebRequest or WebClient, nor can it use Asynchronous sockets. Don't ask. Also it would ideally be on .NET 2.0, yeah very cutting edge here. I figured the web would have tons of samples for this but suprisingly I couldn't find any. Probably because everyone is fortunate enough to use the built in APIs. If I don't find something I'll have to write it myself, which I don't really want to have to reinvent that wheel.

    Read the article

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