Daily Archives

Articles indexed Thursday April 29 2010

Page 8/119 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Haskell Parsec Numeration

    - by Martin
    I'm using Text.ParserCombinators.Parsec and Text.XHtml to parse an input like this: - First type A\n -- First type B\n - Second type A\n -- First type B\n --Second type B\n And my output should be: <h11 First type A\n</h1 <h21.1 First type B\n</h2 <h12 Second type A\n</h2 <h22.1 First type B\n</h2 <h22.2 Second type B\n</h2 I have come to this part, but I cannot get any further: title1= do{ ;(count 1 (char '-')) ;s <- many1 anyChar newline ;return (h1 << s) } title2= do{ ;(count 2 (char '--')) ;s <- many1 anyChar newline ;return (h1 << s) } text=do { ;many (choice [try(title1),try(title2)]) } main :: IO () main = do t putStr "Error: " print err Right x - putStrLn $ prettyHtml x This is ok, but it does not include the numbering. Any ideas? Thanks!

    Read the article

  • Using Twitter OAuth for automatic status update

    - by ebae
    I want my website to automatically post status updates to a particular twitter account using OAuth in PHP. I test this using a URL www.mysite.com/update_status but it asks me for "user name" and "password", which is fine when I am testing it. But my website will not be able to insert this user name and password before posting the status update. So the question is how can a website which is in the server, automatically post a status update to an account without user filling out the user name and password. Is there any way to bypass this? I tried saving oAuth tokens, but it's not working. Thank you for your answer in advance!

    Read the article

  • How do I make links in a TextView clickable?

    - by Richard
    I have the following TextView defined: <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/txtCredits" android:autoLink="web" android:id="@+id/infoTxtCredits" android:layout_centerInParent="true" android:linksClickable="true"></TextView> where @string/txtCredits is a string resource that contains Link text. Android is highlighting the links in the TextView, but they do not respond to clicks. Can someone tell me what I'm doing wrong? Do I have to set an onClickListener for the TextView in my activity for something as simple as this?

    Read the article

  • database design to speed up hibernate querying of large dataset

    - by paddydub
    I currently have the below tables representing a bus network mapped in hibernate, accessed from a Spring MVC based bus route planner I'm trying to make my route planner application perform faster, I load all the above tables into Lists to perform the route planner logic. I would appreciate if anyone has any ideas of how to speed my performace Or any suggestions of another method to approach this problem of handling a large set of data Coordinate Connections Table (INT,INT,INT)( Containing 50,000 Coordinate Connections) ID, FROMCOORDID, TOCOORDID 1 1 2 2 1 17 3 1 63 4 1 64 5 1 65 6 1 95 Coordinate Table (INT,DECIMAL, DECIMAL) (Containing 4700 Coordinates) ID , LAT, LNG 0 59.352669 -7.264341 1 59.352669 -7.264341 2 59.350012 -7.260653 3 59.337585 -7.189798 4 59.339221 -7.193582 5 59.341408 -7.205888 Bus Stop Table (INT, INT, INT)(Containing 15000 Stops) StopID RouteID COORDINATEID 1000100001 100 17 1000100002 100 18 1000100003 100 19 1000100004 100 20 1000100005 100 21 1000100006 100 22 1000100007 100 23 This is how long it takes to load all the data from each table: stop.findAll = 148ms, stops.size: 15670 Hibernate: select coordinate0_.COORDINATEID as COORDINA1_2_, coordinate0_.LAT as LAT2_, coordinate0_.LNG as LNG2_ from COORDINATES coordinate0_ coord.findAll = 51ms , coordinates.size: 4704 Hibernate: select coordconne0_.COORDCONNECTIONID as COORDCON1_3_, coordconne0_.DISTANCE as DISTANCE3_, coordconne0_.FROMCOORDID as FROMCOOR3_3_, coordconne0_.TOCOORDID as TOCOORDID3_ from COORDCONNECTIONS coordconne0_ coordinateConnectionDao.findAll = 238ms ; coordConnectioninates.size:48132 Hibernate Annotations @Entity @Table(name = "STOPS") public class Stop implements Serializable { @Id @GeneratedValue @Column(name = "COORDINATEID") private Integer CoordinateID; @Column(name = "LAT") private double latitude; @Column(name = "LNG") private double longitude; } @Table(name = "COORDINATES") public class Coordinate { @Id @GeneratedValue @Column(name = "COORDINATEID") private Integer CoordinateID; @Column(name = "LAT") private double latitude; @Column(name = "LNG") private double longitude; } @Entity @Table(name = "COORDCONNECTIONS") public class CoordConnection { @Id @GeneratedValue @Column(name = "COORDCONNECTIONID") private Integer CoordinateID; /** * From Coordinate_id value */ @Column(name = "FROMCOORDID", nullable = false) private int fromCoordID; /** * To Coordinate_id value */ @Column(name = "TOCOORDID", nullable = false) private int toCoordID; //private Coordinate toCoordID; }

    Read the article

  • "unbound identifier" errors in scheme

    - by user186909
    Hello: I'm using drscheme from: http://www.archlinux.org/packages/extra/x86_64/drscheme/ I'm trying to work with the sample code in my textbook, but I keep getting getting "unbound identifier" errors. Is it because the scheme interpreter is not configured correctly? or is the code just plain wrong? Here are a few examples: Input: #lang scheme (define (equalimp lis1 lis2) (COND ((NULL? lis1) (NULL? lis2)) ((NULL? lis2) '()) ((EQ? (CAR lis1) (CAR lis2)) (equalimp (CDR lis1) (CDR lis2))) (ELSE '()) )) Output: Welcome to DrScheme, version 4.2.5 [3m]. Language: scheme; memory limit: 128 MB. expand: unbound identifier in module in: COND Input: #lang scheme (define (quadratic_roots a b c) (LET ( (root_part_over_2a (/ (SQRT (- (* b b) (* 4 a c))) (* 2 a))) (minus_b_over_2a (/ (- 0 b) (* 2 a))) ) (DISPLAY (+ minus_b_over_2a root_part_over_2a)) (NEWLINE) (DISPLAY (- minus_b_over_2a root_part_over_2a)) )) Output: expand: unbound identifier in module in: LET Note: I tried using LET* because I read this: stackoverflow.com/ questions/946050/using-let-in-scheme but it produces the same error. Thanks !

    Read the article

  • psychic mode in kopete

    - by barraponto
    Is there a 'psychic mode' plugin for kopete? Psychic mode is a pidgin plugin that opens up the chat dialog as soon as someone starts talking with you, before message is sent. i'm looking for the same functionality in kopete.

    Read the article

  • PC to HDTV, Catalyst Control Center problem (Overscan)

    - by Eric
    I'm trying to get to the overscan slider in CCC but in the Desktops and Displays menu I can't right click the tv in the bottom left to bring up the configure option. If i hover the mouse over the tv it says TV, Disabled. How do i enable it? It's a Panasonic plasma hooked up to my pc using an HDMI to a Radeon HD 4870 X2 http://img38.imageshack.us/img38/4875/ati3r.jpg

    Read the article

  • How to delete recently created Google Contact?

    - by Preeti
    Hi, I am temporary creating one contact and immediatly after that i want to delete that contact. I am creating contact as follows: ContactEntry[] ContactEntry = new ContactEntry[2]; ContactEntry[0] = new ContactEntry(); ContactEntry[0].Title.Text = "Temp"; Uri feedUri = new Uri(ContactsQuery.CreateContactsUri("default")); ContactEntry createdEntry = (ContactEntry)obj_ContactService.Insert(feedUri, ContactEntry[0]); In order to delete above contact if i use: ContactEntry[0].Delete(); It is throwing Exception : "No Service object set". Note: I am using Google Apps API Ver 2 for .NET Thanx

    Read the article

  • What is prefered method to set consistence font-size and line height for website using em?

    - by metal-gear-solid
    What is the best method to set cross-browser consistence typography (font-size and line height) for whole site using em for Fixed width {Width:970px}, centered website? I usually get design from client with multiple font size and line heights at various places in design. for some good reason i still use em without getting nested element problem and font-size inconsistencies in IE and others. then after setting how to manage and update easily ,and how to calculate ems I want to set easily manageable font sizes and I want to set Line height manually (because it can be different for various places in design. And for which things we should define line-height or for which not? How to set font-size and line-height to get consistent result. and if i'm using em for font-sizing then should i also use bottom-margin of h1, p, li etc in em? HTML {} BODY {} P {} a {} ul li a {} ul li ul li a {} p img {float:left} td,th { }

    Read the article

  • Run python file -- what function is main?

    - by Jasie
    I have simple python script, 'first.py': #first.py def firstFunctionEver() : print "hello" firstFunctionEver() I want to call this script using : python first.py and have it call the firstFunctionEver(). But, the script is ugly -- what function can I put the call to firstFunctionEver() in and have it run when the script is loaded?

    Read the article

  • How to define function in a string in Android?

    - by androidNoob
    I have an event handler that I want to be connected to a button through xml. Basically, I want to define it as a string in my xml file, then use the property inspector to select the name of the handler for my button (the "on Click" property). How do I define a call to the function in the string?

    Read the article

  • How to encrypt/decrypt multiple strings in AES encryption??

    - by sebby_zml
    hello again everyone, i would like to know if i could encrypt two or more strings in AES encryption. let say, i want to encrypt username, password and nonce_value, can i use the following code? try{ String codeWord = username, password, nonceInString; String encryptedData = aseEncryptDecrypt.encrypt(codeWord); String decryptedData = aseEncryptDecrypt.decrypt(encryptedData); System.out.println("Encrypted : " + encryptedData); System.out.println("Decrypted : " + decryptedData); }catch (Throwable e) { // TODO Auto-generated catch block e.printStackTrace(); } thanks in advance. your suggestions and guidance will be very helpful for me.

    Read the article

  • How do you clear a CustomValidator Error on a Button click event?

    - by George
    I have a composite User control for entering dates: The CustomValidator will include server sided validation code. I would like the error message to be cleared via client sided script if the user alters teh date value in any way. To do this, I included the following code to hook up the two drop downs and the year text box to the validation control: <script type="text/javascript"> ValidatorHookupControlID("<%= ddlMonth.ClientID%>", document.getElementById("<%= CustomValidator1.ClientID%>")); ValidatorHookupControlID("<%= ddlDate.ClientID%>", document.getElementById("<%= CustomValidator1.ClientID%>")); ValidatorHookupControlID("<%= txtYear.ClientID%>", document.getElementById("<%= CustomValidator1.ClientID%>")); </script> However, I would also like the Validation error to be cleared when the user clicks the clear button. When the user clicks the Clear button, the other 3 controls are reset. To avoid a Post back, the Clear button is a regular HTML button with an OnClick event that resets the 3 controls. Unfortunately, the ValidatorHookupControlID method does not seem to work on HTML controls, so I thought to change the HTML Button to an ASP button and to Hookup to that control instead. However, I cannot seem to eliminate the Postback functionality associated by default with the ASP button control. I tried to set the UseSubmitBehavior to False, but it still submits. I tried to return false in my btnClear_OnClick client code, but the code sent to the browser included a DoPostback call after my call. btnClear.Attributes.Add("onClick", "btnClear_OnClick();") Instead of adding OnClick code, I tried overwriting it, but the DoPostBack code was still included in the final code that was sent to the browser. What do I have to do to get the Clear button to clear the CustomValidator error when clicked and avoid a postback? btnClear.Attributes.Item("onClick") = "btnClear_OnClick();"

    Read the article

  • Is there a way to set two C#.Net projects to trust one another?

    - by Eric
    I have two C#.NET projects in a single solution ModelProject and PluginProject. PlugInProject is a plug-in for another application, and consequently references its API. PlugInProject is used to extract data from the application it plugs into. ModelProject contains the data model of classes that are extracted by PlugInProject. The extracted data can be used independent of the application or the plug-in, which is why I am keeping PlugInProject separate from ModelProject. I want ModelProject to remain independent of PlugInProject, and the Applications API. Or in other words I want someone to be able to access the extracted data without needing access to PlugInProject, the application, or the application's API. The problem I'm running into though is PlugInProject needs to be able to create and modify classes in ModelProject. However, I'd prefer to not make these actions public to anyone using ModelProject. The extracted data should effectively be read-only, unless later modified by PlugInProject. How can I keep these projects separate but give PlugInProject exclusive access to ModelProject? Is this possible?

    Read the article

  • How to Force Aero Peek to Stay Up

    - by user26900
    Let's say I have a video running in an application. If I hover my mouse over the taskbar, it shows a little popup windows that diplays the video (aero peek). Sometimes I'm running a maximized window and I want to have this little screen always popped up. (Kind've like when your using the TV Guide menu, you still see a little clip of the video)

    Read the article

  • PHP Include Windows XP Notepad++ Editor - Nav Include Not Working - Nav Disappears

    - by Lorianna Sprague
    I am creating a website, and have a tabbed horizontal menu. In order to cut back on the number of files I have to edit when I have to make changes to the menu I want to put the navigation in a separate file that I can call using a PHP include statement. When I do this, however, the nav disappears entirely from the page. The rest of the content remains, and there are no error messages. I have been looking for answers for this for weeks, and have tried every version of the PHP include statement that I could find. None of them worked. This was the last attempt. I have the file "nav.php" in a folder named "includes" in a main dir called "testsite" I use Windows XP, use NotePad++ as my text editor, and have been testing in Firefox. I can't find an answer anywhere - any help would be appreciated. Lorianna

    Read the article

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