Search Results

Search found 43274 results on 1731 pages for 'single line'.

Page 17/1731 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • get entire line with java.util.scanner.hasNext(regex)

    - by Hussain
    I'm doing something in Java that requires input to be matched against the pattern ^[1-5]$. I should have a while loop looping through each line of input, checking it against the pattern, and outputting an error message if it does not. Sudo code: while (regex_match(/^[^1-5]$/,inputLine)) { print ("Please enter a number between 1 and 5! "); getNextInputLine(); } I can use java.util.Scanner.hasMatch("^[^1-5]$"), but that will only match a single token, not the entire line. Any idea on how to make hasMatch match against the entire line? (Setting the delimiter to "\n" or "\0" doesn't work.)

    Read the article

  • Perl: print back to beginning of line

    - by Pmarcoen
    Okay, so what I'm trying to do is print out a percentage complete to my command line, now, I would like this to simply 'update' the number shown on the screen. So somehow go back to the beginning of the line and change it. For example the windows relog.exe command-line utility (which can convert a .blg file to a .csv file) does this. If you run it, it will display a percentage complete. Now this is probably written in C++. I don't know if this is possible in perl as well ?

    Read the article

  • How to animate the command line?

    - by The.Anti.9
    I have always wondered how people update a previous line in a command line. a great example of this is when using the wget command in linux. It creates an ASCII loading bar of sorts that looks like this: [======                    ] 37% and of course the loading bar moves and the percent changes, But it doesn't make a new line. I cannot figure out how to do this. Can someone point me in the right direction?

    Read the article

  • antlr line after line processing

    - by pawloch
    I'm writing simple language in ANTLR, and I'd like to write shell where I can put line of code, hit ENTER and have it executed, enter another line, and have it executed. I have already written grammar which execute all alines of input at one. Example input: int a,b,c; string d; string e; d=\"dziala\"; a=4+7; b=a+33; c=(b/11)*2; grammar Kalkulator; options { language = Java; output=AST; ASTLabelType=CommonTree; } tokens { NEG; } @header { package lab4; } @lexer::header { package lab4; } line : (assignment | declaration)* EOF ; declaration : type^ IDENT (','! IDENT)* ';'! ; type : 'int' | 'string' ; assignment : IDENT '='^ expression ';'! ; term : IDENT | INTEGER | STRING_LITERAL | '('! expression ')'! ; unary : (( negation^ | '+'! ))* term ; negation : '-' -> NEG ; mult : unary ( ('*'^ | '/'^) unary )* ; exp2 :mult ( ('-'^ | '+'^) mult)* ; expression : exp2 ('&'^ exp2)* ; fragment LETTER : ('a'..'z'|'A'..'Z'); fragment DIGIT : '0'..'9'; INTEGER : DIGIT+; IDENT : LETTER (LETTER | DIGIT)* ; WS : (' ' | '\t' | '\n' | '\r' | '\f')+ {$channel=HIDDEN;}; STRING_LITERAL : '\"' .* '\"'; and: tree grammar Evaluator; options { language = Java; tokenVocab = Kalkulator; ASTLabelType = CommonTree; } @header { package lab4; import java.util.Map; import java.util.HashMap; } @members { private Map<String, Object> zmienne = new HashMap<String, Object>(); } line returns [Object result] : (declaration | assignment { result = $assignment.result; })* EOF ; declaration : ^(type ( IDENT { if("string".equals($type.result)){ zmienne.put($IDENT.text,""); //add definition } else{ zmienne.put($IDENT.text,0); //add definition } System.out.println($type.result + " " + $IDENT.text);//write output } )* ) ; assignment returns [Object result] : ^('=' IDENT e=expression) { if(zmienne.containsKey($IDENT.text)) {zmienne.put($IDENT.text, e); result = e; System.out.println(e); } else{ System.out.println("Blad: Niezadeklarowana zmienna"); } } ; type returns [Object result] : 'int' {result="int";}| 'string' {result="string";} ; expression returns [Object result] : ^('+' op1=expression op2=expression) { result = (Integer)op1 + (Integer)op2; } | ^('-' op1=expression op2=expression) { result = (Integer)op1 - (Integer)op2; } | ^('*' op1=expression op2=expression) { result = (Integer)op1 * (Integer)op2; } | ^('/' op1=expression op2=expression) { result = (Integer)op1 / (Integer)op2; } | ^('%' op1=expression op2=expression) { result = (Integer)op1 \% (Integer)op2; } | ^('&' op1=expression op2=expression) { result = (String)op1 + (String)op2; } | ^(NEG e=expression) { result = -(Integer)e; } | IDENT { result = zmienne.get($IDENT.text); } | INTEGER { result = Integer.parseInt($INTEGER.text); } | STRING_LITERAL { String t=$STRING_LITERAL.text; result = t.substring(1,t.length()-1); } ; Can I make it process line-by-line or is that easier to make it all again?

    Read the article

  • Line graph disappears after new line is added

    - by tonystinge
    I am having trouble uploading a large .csv file to my HIGHCHART graph. I've been able to graph an 85KB up to 1486 lines by 9 (I) columns. Here is an example: TimeStamp Temp_1_01 Temp_1_02 Temp_2_01 Temp_2_02 Temp_3_01 Temp_3_02 Temp_4_01 Temp_4_02 5/15/2014, 3:25 408 487 63 84 67 91 63 78 5/15/2014 3:30 408 487 63 84 67 91 63 78 5/15/2014 3:35 407 489 63 84 67 91 63 78 5/15/2014 3:40 408 488 63 84 67 91 63 78 5/15/2014 3:44 408 488 63 84 67 91 63 78 ... 5/22/2014 9:40 483 421 0 93 76 95 72 89 When I add a new line the line graph disappears. Any suggestions? Here is the javascript: $.get('Dropbox/geo/sites/GC_Room/loveland.csv', function(data) { // Split the lines var lines = data.split('\n'); var i = 0; var csvData = []; // Iterate over the lines and add categories or series $.each(lines, function(lineNo, line) { csvData[i] = line.split(','); i = i + 1; }); var columns = csvData[0]; var categories = [], series = []; for(var colIndex=0,len=columns.length; colIndex<len; colIndex++) { //first row data as series's name var seriesItem= { data:[], name:csvData[0][colIndex] }; for(var rowIndex=1,rowCnt=csvData.length; rowIndex<rowCnt; rowIndex++) { //first column data as categories, if (colIndex == 0) { categories.push(csvData[rowIndex][0]); } else if(parseFloat(csvData[rowIndex][colIndex])) // <-- here { seriesItem.data.push(parseFloat(csvData[rowIndex][colIndex])); } }; //except first column if(colIndex>0)series.push(seriesItem); } // Create the chart var chart = new Highcharts.Chart( { chart: { alignTick: false, renderTo: 'LANE_METALS', type: 'line' }, title: { text: 'Monthly Average Temperature', x: -20 //center }, subtitle: { text: 'Source: LANE METALS', x: -20 }, xAxis: { categories: categories, labels: { step: 200, text: 'Time', }, tickWidth: 0 }, yAxis: { title: { text: 'Temperature (\xB0C)' }, min: 0 }, tooltip: { formatter: function() { return '<b>'+ this.series.name +'</b><br/>'+ this.x +': '+ this.y +'\xB0C'; } }, legend: { layout: 'vertical', //backgroundColor: '#FFFFFF', //floating: true, align: 'left', //x: 100, verticalAlign: 'top', //y: 70, borderWidth: 0 }, plotOptions: { area: { turboThreshold: 0, stacking: 'normal', lineColor: '#666666', lineWidth: 1, marker: { lineWidth: 1, lineColor: '#666666' } } }, series: series }); });

    Read the article

  • Single Sign On with adLDAP and apache (xampp 1.7.3)

    - by cvack
    I've successfully managed to connect to my Active Directory if I type in a username and password. To do this I'm using a PHP script called adLDAP. But I want my users to auto sign in if they are signed in on a computer connected to the Active Directory. If I understand things right, I need to use something called Single Sign On (SSO). I've tried searching for a tutorial on how to install this on a apache server running on windows 7, but with no luck. Could someone guide me in the right directions please? :)

    Read the article

  • Single-threaded apartment - cannot instantiate ActiveX control

    - by martin.malek
    I need to get information about applied CSS styles in HTML page. I used AxWebBrowser and iterate IHTMLDOMNode. I'm able to get all the data I need and move the code into my application. The problem is that this part is running inside of the background worker and I got exception when trying to instantiate the control. AxWebBrowser browser = new AxWebBrowser(); ActiveX control '8856f961-340a-11d0-a96b-00c04fd705a2' cannot be instantiated because the current thread is not in a single-threaded apartment. Is there any way how to solve this or other option than AxWebBrowser?

    Read the article

  • Hibernate: Parent/Child relationship in a single-table

    - by Dee
    I hardly see any pointer on the following problem related to Hibernate. This pertains to implementing inheritance using a single database table with a parent-child relationship to itself. For example: CREATE TABLE Employee ( empId BIGINT NOT NULL AUTO_INCREMENT, empName VARCHAR(100) NOT NULL, managerId BIGINT, CONSTRAINT pk_employee PRIMARY KEY (empId) ) Here, the managerId column may be null, or may point to another row of the Employee table. Business rule requires the Employee to know about all his reportees and for him to know about his/her manager. The business rules also allow rows to have null managerId (the CEO of the organisation doesn't have a manager). How do we map this relationship in Hibernate, standard many-to-one relationship doesn't work here? Example code would be appreciated.

    Read the article

  • Hibernate: Parent/Child relationship in a single-table

    - by Dee
    I hardly see any pointer on the following problem related to Hibernate. This pertains to implementing inheritance using a single database table with a parent-child relationship to itself. For example: CREATE TABLE Employee ( empId BIGINT NOT NULL AUTO_INCREMENT, empName VARCHAR(100) NOT NULL, managerId BIGINT, CONSTRAINT pk_employee PRIMARY KEY (empId) ) Here, the managerId column may be null, or may point to another row of the Employee table. Business rule requires the Employee to know about all his reportees and for him to know about his/her manager. The business rules also allow rows to have null managerId (the CEO of the organisation doesn't have a manager). How do we map this relationship in Hibernate, standard many-to-one relationship doesn't work here? Example code would be appreciated.

    Read the article

  • Delphi-5 single-file storage solution?

    - by pastacool
    Hi! Is there a Delphi-5 solution to easily integrate single-file storage into existing code? I would like to have files like Java *.jar or Openoffice document files which are zipped/compressed files and folders but with their own file extension. Edit: I know some ZIP capable components but in a nutshell I want to access files within the "container" and use normal file handling routines on them (eg. TStringList.SaveToFile). Any overhead about compress/uncompress should be handled by the component.

    Read the article

  • Single Sign on using Shibboleth

    - by user196614
    Hi, I have to implement Single Sign On in my .NET(3.5) project using Shibboleth. Detailed requirement goes this way: 1) I have developped a web application using .NET (3.5) named "abc.com". 2) There are some third party applications which will be launched from "abc.com" 3) If I have logged in to "abc.com" and now if I launch any of the supported third party applications then it should not ask for login information again. From last few days I have been reading Shibboleth from https://spaces.internet2.edu/display/SHIB2/Home I have also installed Identity provider (IdP) and Service Provide (SP) from https://spaces.internet2.edu/display/SHIB2/Installation Still I am unable to make out how my "abc.com", third party application and Shibboleth will fit into one picture? Can anyone please guide me?

    Read the article

  • Read line comments in INI file

    - by Dave Jarvis
    The parse_ini_file function removes comments in configuration files. What would you do to keep the comments that are associated with the next line? For example: [email] ; Verify that the email's domain has a mail exchange (MX) record. validate_domain = true Am thinking of using X(HT)ML and XSLT to transform the content into an INI file (so that the documentation and options can be single sourced). For example: <h1>email</h1> <p>Verify that the email's domain has a mail exchange (MX) record.</p> <dl> <dt>validate_domain</dt> <dd>true</dd> </dl> Any other ideas?

    Read the article

  • Generate all project dependencies in a single file using gcc -MM flag

    - by Jabez
    Hi all, I want to generate a single dependency file which consists of all the dependencies of source files using gcc -M flags through Makefile. I googled for this solution but, all the solutions mentioned are for generating multiple deps files for multiple objects. DEPS = make.dep $(OBJS): $(SOURCES) @$(CC) -MM $(SOURCEs) > $(DEPS) @mv -f $(DEPS) $(DEPS).tmp @sed -e 's|.$@:|$@:|' < $(DEPS).tmp > $(DEPS) @sed -e 's/.*://' -e 's/\\$$//' < $(DEPS).tmp | fmt -1 | \ sed -e 's/^ *//' -e 's/$$/:/' >> $(DEPS) @rm -f $(DEPS).tmp But it is not working properly. Please tell me where i'm making the mistake.

    Read the article

  • Calling a WCF from ASP.NET with same the single-signon user LogonUserIdentity

    - by Dennis Cheung
    I have a ASP.NET MVC page, which call WCF logic. The system is single-signon using NTML. Both the ASP page and the WCF will use the UserIdentity to get user login information. Other then NTML, I will also have a Form based authorization (with AD) in same system. The ASP page, is it simple and I can have it from HttpContext.Current.Request.LogonUserIdentity. However, it seem it is missing from the WCF which call by the ASP, not from browser. How to configure to pass the ID pass from the ASP to the WCF?

    Read the article

  • Showing same dfp ads in a single page web application

    - by mivaas19
    I have a single page web application which contains dfp ads. I have two dfp adunits that Iam firing and they are placed in between the content which is a list of articles for a particular category. When I click on another category,it just loads articles for different category(doesnt change the url in address bar) and triggers the same ads. So this is like triggering the ads on the same page. The ads dont show up the second time and this is because you cant use the same adunits on the same page. Since I cannot use the refresh function provided by dfp since my DOM is reconstructed everytime, is there any way I can do this?.

    Read the article

  • Cloud Apps and Single Sign-On (AD integration)

    - by Pablo Alvim
    I've been investigating some cloud vendors and the ability to implement single sign-on with them, especially when it comes to AD (Active Directory) integration. So far I've learned that with Azure this is possible through ADFS and the AppFabric Access Control offer. In AWS, since it is possible to create a VPN and see EC2 instances as a natural extension of a private datacenter, I believe implementing SSO would be rather simple (not sure if I'm right on this one... Please correct me if I'm wrong). With App Engine though, even though there is some documentation on AD synchronization (not full integration) for Google Apps, I'm struggling to find out whether AD integration would be possible... Is there any strategy for that? Any bit of information on cloud apps and AD integration will be appreciated!

    Read the article

  • Get a single element with PHP and XPath

    - by daliz
    Lots of tutorials around the net but none of them can explain me this: How do I select a single element (in a table, for example), having its absolute XPath? Example: I have this: /html/body/table/tbody/tr[2]/td[2]/table/tbody/tr/td/table[3]/tbody/tr/td/table/tbody/tr[3]/td/table/tbody/tr[4]/td[5]/span What's that PHP function to get the text of that element?! Really I could not find an answer. Found lots of guides and hints to get all the elements of the table, all the buttons of a form, etc, but not what I need. Thank you.

    Read the article

  • Regex: Use start of line/end of line signs (^ or $) in different context

    - by fgysin
    While doing some small regex task I came upon this problem. I have a string that is a list of tags that looks e.g like this: foo,bar,qux,garp,wobble,thud What I needed to do was to check if a certain tag, e.g. 'garp' was in this list. (What it finally matches is not really important, just if there is a match or not.) My first and a bit stupid try at this was to use the following regex: [^,]garp[,$] My idea was that before 'garp' there should either be the start of the line/string or a comma, after 'garp' there should be either a comma or the end of the line/string. Now, it is instantly obvious that this regex is wrong: Both ^ and $ change their behaviour in the context of the character class [ ]. What I finally came up with is the following: ^garp$|^garp,|,garp,|,garp$ This regex just handles the 4 cases one by one. (Tag at beginning of list, in the center, at the end, or as the only element of the list.) The last regex is somehow a bit ugly in my eyes and just for funs sake I'd like to make it a bit more elegant. Is there a way how the start of line/end of line characters (^ and $) can be used in the context of character classes?

    Read the article

  • read line by line the text file for make map in xna

    - by Mohammadali Najjar khodabakhsh
    i want to read a text file for build map; for example I have this map 0@0000000 0@0000000 0@0000000 000000000 000000000 000000000 000000000 I know I should use this : StreamReader reader = new StreamReader(Application.StartupPath+@"/TestMap.MMAP"); string line = reader.ReadToEnd(); reader.Close(); now for example I want read line 2 char "@". how can i do this? please help me. solve : Thank you (L.B AND user861114) at last my problem solve like this : string[,] item = new string[9, 7]; string[] line = File.ReadAllLines(Application.StartupPath + @"/TestMap.MMAP"); for (int j = 0; j < 7; j++) { for (int i = 0; i < 9; i++) { item[i, j] = line[j].Substring(i, 1); Console.WriteLine(i + " " + j + "=" + item[i, j]); } } thanks alot.

    Read the article

  • Java 1.5 Command Line Password Masking

    - by tathamr
    All, Our server is running Java 1.5 and I am having difficulty trying to mask user input from the command line. I am executing a jar file (java -jar my.jar) and am working through command line prompts via printlns. I cannot use Java Console. Thanks

    Read the article

  • HTML Strict increases line height...

    - by Ryano
    Hi Why does XHTML 1.0 Strict display a line height as appearing larger than a line height of the same value in XHTML 1.0 Transitional? This therefore pushing down content within table cells (i.e Hotmail in Firefox, Gmail in IE and Firefox). Has anyone else experienced this issue and know a way around it? Cheers

    Read the article

  • interactive lua: command line arguments

    - by mr calendar
    I wish to do lua prog.lua arg1 arg2 from the command line Inside prog.lua, I want to say, for instance print (arg1, arg2, '\n') Lua doesn't seem to have argv[1] etc and the methods I've seen for dealing with command line arguments seem to be immature and / or cumbersome. Am I missing something?

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >