Whats a simple way to repeat a line ?

i have this program where the user inputs a number and accordingly the question repeats .........any help i want to make it really simple.....i have to teach this to a bunch of students
i got this so far
import java.awt.*;
import hsa.Console;
public class Reporcassrd
static Console c = new Console (30,1000);
static public void main (String args[])
int num;
String sentence = "exampleexampleexample;
c.clear ();
c.setCursor (2,5);
c.print ("How many times do you want to repeat the sentence?:");
num = c.readint () ;
Message was edited by:
HALO2RING
Message was edited by:
HALO2RING

Please use code tags
for (int i = 0; i < num; i++) {
   // out put line how ever you want here.
}

Similar Messages

  • WPF: What is simple way to implement Tab control

    Our application uses WPF.
    One Window includes TabControl. Each tab header includes image and text.
    When the tab is selected, we need to show different image and text in different color.
    One way is to create a customized control which include image and textblock. And one of dependency property is "Select".
    When Select is true, use different image and set different Foreground for textblock.
    Our question, could we use style to achieve this? thx!
    JaneC

    >>Our question, could we use style to achieve this? thx!
    Yes, you could add a DataTrigger to the HeaderTemplate that binds to the IsSelected property of the TabItem and changes any properties of any element within the DataTemplate.
    Here is an example that changes the Foreground colour of a TextBlock from Red to Green and the Source of an Image from 1.png to 2.png when the TabItem is selected:
    <TabItem Header="1">
    <TabItem.HeaderTemplate>
    <DataTemplate>
    <StackPanel>
    <TextBlock x:Name="txt" Text="{Binding}" Foreground="Red"/>
    <Image x:Name="img" Source="1.png" Width="10" Height="10"/>
    </StackPanel>
    <DataTemplate.Triggers>
    <DataTrigger Binding="{Binding IsSelected, RelativeSource={RelativeSource AncestorType=TabItem}}" Value="True">
    <Setter TargetName="txt" Property="Foreground" Value="Green"/>
    <Setter TargetName="img" Property="Source" Value="2.png"/>
    </DataTrigger>
    </DataTemplate.Triggers>
    </DataTemplate>
    </TabItem.HeaderTemplate>
    <TextBlock>First...</TextBlock>
    </TabItem>
    Hope that helps.
    Please remember to mark helpful posts as answer to close your threads and then start a new thread if you have a new question.

  • Simple way to handle Exception in Biztalk 2013

    Hello Experts,
    I am working with lots of Orchestration in my Biztalk application, i am using Biztalk 2013.
    Can some one tell me what is simple way to chandle exception.
    I am having requirement to handle exception in 1 day....
    Thanks,
    Thanks and Regards, Nilesh Thakur.

    First thing One day is not enough to implement exception handling framework across your your solution. :-)
    But there are so many things you need to take care, like
    what you want to do with the exception messages
    Do you want to re-submit a message when it has failed in exception.
    how would you plan to test all these exception cases, you need to prepare all your test cases before you procced for the changes. 
    anyways,
    ESB Exception handling framework is the main candidate however you can use built-in throw exception shape in orchestration designer.
    There is an example
    A developers guide to handling exceptions in BizTalk Server 2006/2009/2010 , have a look, you will get your solution,
    All the best.
    Greetings,HTH
    Naushad Alam
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or
    Mark As Answer
    alamnaushad.wordpress.com

  • What is the best way to repeatedly load random commercials?

    Hi Everyone,
    Any help with the above question would be useful.  Here's my end goal: I want to display commercials on a screen at my wife's bakery.  The script should load one commercial, play it, then unload it, randomly load another, and so on.
    I am completely new to as3 and have unsuccessfully been following several online tutorials.  My first attempt had code in each commercial file (swf), that randomly called up another commercial, which in turn called up another file, and so on--but this became a memory hog and crashed the program after a few minutes.
    Since then I have created one main swf file that loads an xml file, which holds all the information for the commercials.  However, when the swf commercials are loaded according to the xml file, they don't play properly: when the first commercial finishes playing, the next one is already partially done.  Obviously it started playing earlier.  The swfs should unload and load the next according to a timer, with the length of the timer being different for each swf according to the xml data.  Even with this, the first swf didn't always stop when it should.  My code is getting complicated and the display looks sloppy.
    I think something like this should be a simple way to display media such as these commercials, but I still haven't found a working solution.  Now I'm wondering if I'm even approaching this wisely.
    Would it be better to convert the swf to flv and create an flv player that has 'continuous play' and 'shuffle' features?  Would it be better to convert each swf into movieclips and put them all into one swf?  (I like the manageability of using an external xml file; I will be adding and removing commercials frequently and want to keep this as simple as possible.)
    Please let me know what you think is the wisest approach and refer me to any relevant tutorials.
    Peace,
    Trevor

    Thanks again kglad,
    I followed your advice, but it is still not working properly.  Here's my problem:
    The external swfs continue playing in the background.  Consequently, the event "playcomplete" was dispatched not only at the end of the swf that is being shown, but also at the end of the looping, previously loaded swfs that are not visible; this made the next swf play before the one being shown finished.  That seemed easy enough to fix by adding stop(); to each external swf on the last frame.  I thought everything was fixed -- but those swfs must still be there and are hogging memory before they can be collected for garbage. I've developed a loop that continues to load swfs, taking more and more memory, eventually causing a crash.  So:
    After a swf is loaded, how do I completely remove it to free up memory?  I'll attach the code I'm using, but I've made some adjustments to your previous examples (using a string with a random number instead of an array, using different variable names, etc).  Would I still have this memory problem if I used an array?  I have tried to remove eventListeners, to use weak eventListeners, and to remove the loaded Child as best as I know how, but I need some guidance on memory management before I can use this.
    Peace,
    Trevor
    var swfLoader:Loader = new Loader();
    var klaesiSwfs:XMLList;
    var totalSwfs:Number;
    //var swfArray:Array = ["swfs/movie1.swf", "swfs/movie2.swf", "swfs/movie3.swf", "swfs/movie4.swf", "swfs/movie5.swf"];
    //loads xml//
    var klaesiXmlLoader:URLLoader = new URLLoader ();
    klaesiXmlLoader.load(new URLRequest("xml/swf_depot.xml"));
    klaesiXmlLoader.addEventListener(Event.COMPLETE, processXML, false, 0, true);
    //finds how many swfs are on xml//
    function processXML (e:Event):void{
         var klaesiXml:XML = new XML(e.target.data);
         klaesiSwfs=klaesiXml.ID;
         totalSwfs=klaesiSwfs.length();
         //trace ("Total is " + totalSwfs);
         loadRandomSwf();
         klaesiXmlLoader.removeEventListener(Event.COMPLETE, processXML)
         klaesiXmlLoader = null;
    //loads swfs//
    function loadRandomSwf():void {
         var num:Number = (Math.floor(Math.random() * totalSwfs) + 1);
         var swfName:String = "swfs/movie"+ num +".swf";
         var requestSwf:URLRequest = new URLRequest (swfName);
         swfLoader.load(requestSwf);
         addChild(swfLoader);
         swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, playComplete, false, 0, true);
    //listens for the end of each swf//
    function playComplete(e:Event){
         MovieClip(swfLoader.content).addEventListener("playNextCommercial", nextSwf, false, 0, true);
         swfLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE, playComplete)
    //removes old swf, starts new swf//
    function nextSwf(e:Event){
         MovieClip(swfLoader.content).removeEventListener(Event.COMPLETE, nextSwf);
         removeChild(swfLoader);
         loadRandomSwf();

  • Any simple way to do popup image view overlay in DW? Can't get pickachoose+fancybox+fluid working

    Hey all,
    Just wondering if anyone knows any simple ways to create a popup over lay window like what fancybox/lightbox/shadow box does and get it to work with a Dreamwever fluid grid site?
    I've got pikachoose+fancy box to run together perfectly in a plain html page, but when I bring that code into a Dreamweaver fluid grid site, the code doesn't work (well images don't cycle, and popover doesnt load when you click on the image link).
    I'm guessing it's a jquery conflict of some kind.
    Any help would be great, I can post the full code if someone is able to take a look. When I inspect the code in Google Chrome web inspector I get in the console:
    Uncaught TypeError: Cannot read property 'msie' of undefined jquery.fancybox-1.3.4.pack.js:18
    Uncaught TypeError: Object [object Object] has no method 'fancybox'
    Code below
    <!doctype html>
    <html class="">
    <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>-</title>
    <link href="boilerplate.css" rel="stylesheet" type="text/css">
    <link href="css/ce4.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" type="text/css" href="jquery.fancybox-1.3.4.css" media="screen" />
    <link type="text/css" href="styles/bottom.css" rel="stylesheet" />
    <script src="respond.min.js"></script>
    <script type="text/javascript" src=" https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js"></script>
    <script type="text/javascript" src="lib/jquery.pikachoose.js"></script>
    <script type="text/javascript" src="jquery.fancybox-1.3.4.pack.js"></script>
    <script language="javascript">
    $(document).ready(function (){
    var a = function(self){
    self.anchor.fancybox();
    $("#pikame").PikaChoose({hoverPause:true,  showCaption:false, text: {previous: "", next: "" }, buildFinished:a});
    </script>
    </head>
    <body>
    <div class="pikachoose">
    <ul id="pikame" >
    <!-- <li><a href="1.jpg"><img src="1.jpg"></a>-->   
    <li>
    <a href="images/1large.jpg">
    <img src="images/1small.jpg"/>
    </a>
    <span></span></li>
    etc... etc...
    Any help would be great

    I don't know what a pikachoose is, but Fancybox2 works in Fluid Layouts.  Copy & paste the following code into a new, blank document.
    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>HTML5, with Fancybox2 Viewer</title>
    <!--LATEST JQUERY CORE LIBRARY-->
    <script src="http://code.jquery.com/jquery-latest.min.js"></script>
    <!--FANCYBOX plugins-->
    <link href="http://cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.4/jquery.fancybox.css" rel="stylesheet" media="screen">
    <script src="http://cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.4/jquery.fancybox.pack.js"></script>
    <style>
    /**this styles image container**/
    #thumbs p {
    float:left;
    width: 180px;
    height: 12.5em;
    margin: 10px 0 0 20px;
    padding: 10px;
    border: 1px solid silver;
    /**rounded borders**/
    -moz-border-radius: 20px;
    -webkit-border-radius:20px;
    border-radius: 20px;
    /**this styles caption text**/
    font: italic 14px/1.5 Geneva, Arial, Helvetica, sans-serif;
    color: #666;
    text-align:center;
    /**recommend using same size images**/
    #thumbs img {
    width:  160px; /**adjust width to thumbnail**/
    height: 120px; /**adjust height to thumbnail**/
    margin-bottom: 1.5em;
    opacity: 0.75;
    #thumbs img:hover {opacity: 1.0}
    /**float clearing**/
    #thumbs:after {
    content:".";
    clear:left;
    font-size:0px;
    line-height:0;
    display:block;
    visibility:hidden;
    </style>
    </head>
    <body>
    <h1><a href="http://fancyapps.com/fancybox/">Fancybox2</a> Viewer with images</h1>
    <!--insert thumbnails with links to full size images below-->
    <div id="thumbs">
    <p><a class="fancybox" data-fancybox-group="gallery" href="http://placehold.it/400x320.jpg" title="optional captions"><img src="http://placehold.it/160x120.jpg" alt="Thumbnail 1" /></a> <br />
    Caption 1
    </p>
    <p><a class="fancybox" data-fancybox-group="gallery" href="http://placehold.it/400x320.jpg" title="optional captions"><img src="http://placehold.it/160x120.jpg" alt="Thumbnail 2" /></a> <br />
    Caption 2
    </p>
    <p><a class="fancybox" data-fancybox-group="gallery" href="http://placehold.it/400x320.jpg" title="optional captions"><img src="http://placehold.it/160x120.jpg" alt="Thumbnail 3" /></a> <br />
    Caption 3
    </p>
    <p><a class="fancybox" data-fancybox-group="gallery" href="http://placehold.it/400x320.jpg" title="optional captions"><img src="http://placehold.it/160x120.jpg" alt="Thumbnail 4" /></a> <br />
    Caption 4
    </p>
    <p><a class="fancybox" data-fancybox-group="gallery" href="http://placehold.it/400x320.jpg" title="optional captions"><img src="http://placehold.it/160x120" alt="Thumbnail 5" /></a> <br />
    Caption 5
    </p>
    <!--end thumbs--></div>
    <!--FancyBox function code-->
    <script>
    $(document).ready(function() {
         $('.fancybox).fancybox();
    </script>
    </body>
    </html>
    Nancy O.

  • IS THERE ANY SIMPLE WAY TO RETURN SPEED PERFORMANCE TO FACTORY SPEED AFTER ABOUT 3 YEARS OF RELATIVELY STANDARD USE?

    Everyone is often so quick to bash all these 'cleaning' utilities but rarely give any solutions.
    There's a lot of critiques and endless lists of what NOT to do to avoid performance problems.
    My Powerbook is 3 years old. It runs like molasses... SLOW.
    I'm not a computer geek, but I'm smart and understand quite a bit more than a newbie.
    Do I need a degree in computer engineering to fix/speed up my mac?
    Yes, I know, the cleaning utilities suck. But is it really true of all of them?
    I'm not totally convinced because there seems to be such a huge market for them.
    Sure, there's a huge market for bottled water too, so maybe they are just useless/marketing crap, but I really want to return to my original speed performance quickly and can't seem to find out if it's possible with a utility.
    I'm not willing to sit down for 3 hours and study line by line b.s. about how to fix it.
    I have no problem if it's not fixable. I've always assumed operating systems outgrow their hardware's capacity to keep up, and sell my old one for a new one, no prob.
    I don't care, really, but again, I'm curious if there is any quick, easy, user-friendly utility or method that I can use to return the speed performance I had as recently as a year ago? (I'd be satisfied with that).
    Anyone willing to bite on that? Anyone willing to not critique, complain, tell me what NOT to do and actually know a solution?
    IS THERE ANY SIMPLE WAY TO RETURN SPEED PERFORMANCE BACK TO (OR CLOSE TO) ORIGINAL FACTORY SPEED AFTER ABOUT 3 YEARS OF RELATIVELY STANDARD USE?
    The only thing I may have done outside of the norm was some video editing, but very little.

    Look for solutions here:
    https://discussions.apple.com/docs/DOC-3521
    https://discussions.apple.com/docs/DOC-3353
    Ciao.

  • Best way to add delay line and arpeggiator to multi instrument?

    I am using logic sequencer to drive external hardware, and have been making use of the arpeggiator and delay line objects in the environment.
    Apparently they have to be set up in loop cabling? Where the delay line runs into the multi instrument, which then in turn runs back into the delay line?
    If I set it up just like this, the delayed note is then fed back into the signal and feeds the delay line again so that an infinite delay is created, even if I have repeat only set to 1.
    I put the transformer in and if the note is of the original velocity it is sent to the delay line, all other velocities are brought down by -1 and those notes are sent just to drive the external equipment, not back into the delay line itself.
    My question is is this the simplest way for this configuration? Or is there a simpler way that I'm overlooking? If there is a simpler way my guess is it probably lies in the parameters of the transformer because I am somewhat unfamiliar with it.
    Thank you for your help.

    Hey thanks. I mean, this way actually works, which I am an enthusiastic about, because it took me awhile to figure it out, I am just thinking there might be a simpler way.
    Maybe I can try to explain a little bit more detail. I have an external sampler that can receive on 8 individual midi channels. Let's say I have a bass line sample on Midi Channel 1, and a Snare sample on Midi Channel 2, and I want to use the delay line to delay only the snare sample.
    I run the delay line into Instrument Track 2 in the environment. At this point, there would be no delay. Not until I run the multi instrument back into the delay line. (I suppose this makes sense, because the multi instrument would need to be in the signal path). Then, however, the note that is delayed is fed back into the delay line as well (the delayed note of the snare), and it in turn feeds the delay line again, and an infinite loop is created.
    If I put a transformer in there so that top condition is true the note at the original velocity is fed into the delay line (The original snare hit on beat 2 let's say). Then the delay line subtracts from the velocity by -1 or any number. (In reality this may or may not effect the sound, because the sound in the sampler may or may not respond to velocity. I can always have it play 'full on' whatever the velocity of the midi note.)
    Then all notes with subtracted velocities bypass the delay line, which should be the case, because they are never meant to be fed back into the delay line.
    That is a lot, I know, but I wanted to be as detailed as possible. I mean, it actually works! I am kind of surprised about that. I don't know if there is an easier way to achieve the same results. I am working with limited hardware equipment, and that seems to be the best way for me to set things up as far as synchronization issues are concerned. Might be an unusual set up, but it seems to give me the best results right now.
    Thanks for your help! All input is appreciated!

  • Simple way to make streight curve

    Is there any simple way to do a STREIGH CURVE (I add this especially to this image to show you - blue line) when we have that 2 points? Imagine that I have that vector picture below. And I select this two point (everything is round). I want now to click and have that path going streight (like blue line). How to do that automaticaly?
    Is there any?

    Nooo, I don't understand what I will have to do it. But if we talk about this, maybe you can tell me how to do?
    How to do it with Convert Anchor Point Tool excatly?
    Mike wrote that click on a point to retreact both handles. When I even do that (both handles) I got this:
    And like you see, it is still not a STREIGH LINE.
    I don't want this, I want that. Red lines show you what I want:
    Red lines I added after make a screenshot, only for your view.
    But that effect I got after click in a point. Because I even can't select my handle.
    What is a "handle", is a "path"? That you cald "handle"?I even can't click on path because I got this:
    What says: "please chose the Convert Anchor Point Tool on control point of the path".
    In different words: I can't understand Mike's method, so can you tell me what to do that Mike's methos work? This is not working for me but I am curious his way to do that. Thanks in advance.

  • Why isn't there a simpler way to initialize a subclass with its super class

    Let me explain my doubt with an example...
    public class Parent {
    �    public String parent;
    public class Child extends Parent{
    �    public String child;
    I've an instance of Parent p. I want to construct Child c, with the data in p.
    The only way that is provided by Java language seems to be, having a constructor in Child like
    public class Child extends Parent{
    �    public String child;
    �    public Child(Parent p){
    �    �    parent = p.parent;
    �    }
    The problem with this is there is lot of redundant assignment code.
    What I don't understand is why there is not a simpler way of doing this when a subclass is after all super class data + some other data(excuse me for not looking at the bahavior part of it)
    I'm looking for something as simple as Child c = p, which I know is wrong and know the reasons too.
    Yes, we can wrap Child over Parent to do this, but it necessitates repeating all the methods in Parent.
    Why is the language writers didn't provide a simple way of doing this? I should be missing something here...I'm just searching for an explanation. May be I'm asking a dumb question, but this bugs me a lot...
    Regards,
    Kothapalli.

    To answer DrClap, I'm demanding it now :-). Let me
    not suggest something that Mr.Gosling didn't think of;
    he should be having some reasons in not providing it.Because it's essentially impossible in the general case. One of the reasons you may be extending a class is to add new invariants to the superclass.
    eg- extend java.awt.Rectangle by BoundedRectangle - extra invariant that none of its corner points may be less than 0 or more than 100 in any dimension. (The rectangle must be entirely contained in the area (0,0)-(100,100))
    What would happen if you try to create a BoundedRectangle from a rectangle representing (50,50)-(150,150)? Complete invariant breakdown, with no generic way to handle it, or even recognise it.
    Actually, BIJ and sgabie are asking for it. Provide an
    automatic copy constructor. Every object should have
    an implicit copy constructor defined. From any
    subclass, I should be able to invoke
    super(parentClass). From the subclass, we can invoke
    super(parentClass) first and then go on to initialize the
    subclass data.
    I really don't know the implementation issues of this,
    but what I'm looking for is something like this. I'm just
    curious to know the implementation issues.Implementation issue #1: Classes that should not, under any circumstane, be copied.
    * eg 1- Singleton objects. If there's an automatic copy constructor, then multiple singletons can be created, making them essentially useless. This by extension kills the Typesafe Enum pattern also.
    * eg 2- Objects with extra information, such as java.sql.Connection - if you copied this, would the copy be using the same socket connection, or would another connection be required? What happens if opening another connection, and the JDBC driver requires the password to be entered for every new connection? If the wrong password is entered, what happens to the newly creating connection?
    Implementation issue #2: Copying implementation?
    * Already mentioned by RPWithey. The only guaranteed way to perform the copy would be with a shallow copy, which may end up breaking things.
    Why can't you write the copy constructor yourself? If it's a special case, it only has to be done once. If it's a recurring case, you could write a code generation tool to write them for you, along with most of the rest of the class.

  • What a horrible way to treat customers. I was due for updates on my phones and thought I should maybe check some other prices but have been with Verizon for 20 yrs so ended up there. I got 2 new IPhones 5s and the wife couldn't decide what she wanted so s

    What a horrible way to treat customers. I was due for updates on my phones and thought I should maybe check some other prices but have been with Verizon for 20 yrs so ended up there. I got 2 new IPhones 5s and the wife couldn’t decide what she wanted so she stayed with old phone but this locked me into a new 2 yr contract . Within a wk one of the new iPhones started turning on and of like 10 –15 times a day. Wk 2 it turned off and would not turn on again . It was my sons who was in college at the time so we talked and he took it in to a Verizon store where he was told I need to come in since the account was in my name. He was away from home , Verizon could see on account it was his phone they said it was not abused, they could not even turn it on , they sold me the phone give him another phone maybe even a loaner till he gets another. So now I need to go to store and explain to 3 different people this is my phone and my son has it and I need a new one. what a waste of time after about 2 hrs and talking to different people and yes they said there were notes on his account from other person he had talked to from different store. So I finally walk out with a receipt in hand and being told I would have a new phone in a couple days. As I sat in my vehicle thinking this is stupid I looked at my receipt and noticed it said droid on it so back into Verizon I went. The salesman said that’s what your son has on his account. My son had activated a friends old phone so he has one since VERIZON REFUSED to give him one. Another hr 3 people and yes they can see he had a new iPhone and notes on it from other store. Sometimes sorry just doesn't do it. I was now late for a appointment . Now I walk out and have been told I will get a new iPhone in the mail in about 2 wk Yes 2 wks   again I bought it there just give me a new one and you send old one back. I will also get a new droid that I have to send back because they said they cant cancel it  . In about 3 days I get the Droid and sent it back Verizon mistake and a waste of my time . After waiting over 2 wks and not receiving a new iPhone back to Verizon I went . I am now bitter at Verizon after doing 20 yrs of business with them. 3 people 1 hr later I was told it got delivered to my post office . I got the tracking num called the post office and they say o yes that was the droid. Go back in to Verizon another hr of explaining I walk out being told I will get a new iPhone in a couple of days, We’ll see . Once again I got the phone in your store just give me a new one . Do you realize how much of my time you have wasted ? do you care? O what is Your Policy ? How many Billion did you make last year ? I am Locked into a new 2 yr contract . Why don’t you just release me ? After 20 yrs do you think I will ever renew my contract ?

    Simple process. If an iPhone go to the Apple Store and not Verizon
    the phone from Verizon will be a refurbished device and not new unless under the 14 day worry free guarantee
    good luck

  • Best way to remove last line-feed in text file

    What is the best way to remove last line-feed in text file? (so that the last line of text is the last line, not a line-feed). The best I can come up with is: echo -n "$(cat file.txt)" > newfile.txt
    (as echo -n will remove all trailing newline characters)

    What is the best way to remove last line-feed in text file? (so that the last line of text is the last line, not a line-feed). The best I can come up with is: echo -n "$(cat file.txt)" > newfile.txt
    (as echo -n will remove all trailing newline characters)
    According to my experiments, you have removed all line terminators from the file, and replaced those between lines with a space.
    That is to say, you have turned a multi-line file into one long line with no line terminator.
    If that is what you want, and your files are not very big, then your echo statement might be all you need.
    If you need to deal with larger files, you could try using the 'tr' command, and something like
    tr '
    ' ' ' <file.txt >newfile.txt
    The only problem with this is, it will most likely give you a trailing space, as the last newline is going to be converted to a space. If that is not acceptable, then something else will have to be arranged.
    However, if you really want to maintain a multi-line file, but remove just the very last line terminator, that gets a bit more complicated. This might work for you:
    perl -ne '
    chomp;
    print "
    " if $n++ != 0;
    print;
    ' file.txt >newfile.txt
    You can use cat -e to see which lines have newlines, and you should see that the last line does not have a newline, but all the others still do.
    I guess if you really did mean to remove all newline characters and replace them with a space, except for the last line, then a modification of the above perl script would do that:
    perl -ne '
    chomp;
    print " " if $n++ != 0;
    print;
    ' file.txt >newfile.txt
    Am I even close to understanding what you are asking for?

  • Is there a (relatively simple) way to skip tracks with an iPod touch 5th gen using a physical button? I'm aware songs can be skipped on-screen without unlocking the iPod, but I'm looking for a method that doesn't require taking my eyes off the road.

    Is there a (relatively simple) way to skip tracks with an iPod touch 5th gen using a physical button? I'm aware songs can be skipped on-screen without unlocking the iPod, but I'm looking for a method that doesn't require taking my eyes off the road while driving. For that reason, I'm also not interested in adding in headphones or additional devices that have the desired button functions. Going both forward and back would be great but I would be pleased just to have a "sight-free" way to go forward.
    I've seen some mention here and there about ways to maybe change it so the volume buttons change tracks and holding the volume buttons changes the volume... but I don't know what's involved in that or if its even possible/recommended for a new 5th gen iPod. I think its a great device but its sadly lacking in music oriented functions and features... which is disappointing since music is why most people would bother getting one instead of some other "iDevice" :/

    Given that you cannot do what you have asked for, perhaps you simply need to find another solution to your root problem.
    Presumably, you want to skip to the next track because you don't want to hear the current one, and that is because...
    You don't like it.
    You've heard it recently and don't want to hear it now.
    Simply don't want to hear it at this time.
    For problem number 1. Don't put it on the iPod in the first place. (I know, obvious answer!)
    For problem number 2. How about playing from a Smart Playlist (initially created in your iTunes Library) which has only songs you've not played recently?
    For problem number 3. Hhhmmm! Create alternative Playlists for use in the car.
    As for going back to the start of the "now playing" track.... Well, if your Playlist has only songs that you really, really want to hear, then you'll be looking forward to that rather go back to the beginning of the current song.
    I'm not trying to be prescriptive, just giving you food for thought.
    (They are all cheaper options than buying a car which can control the iPod from the steering wheel.)

  • Simple way to insert data from one table

    Hi,
    I need to know a simple way on how to transfer the data from one table to another....
    First table xx_inv_tab1 has three columns col1, col2, col3 and where as second table xx_inv_tab2 has five columns col1, col2, col3, col4, col5.
    Here col2, col3, col4 are the same columns as in table1 xx_inv_tab1...
    Now I want to transfer first table data in to second table .... first column of second table holds a sequence, followed by the first table three columns data and followed with col4 and col5 which will hold NULL values....
    In my scenario, I have 70 - 75 columns in my first table which I want to move to second table which three new columns (one is sequence and other two has null values)...
    Any ideas if we make it in a simplest way rather saying insert into xx_inv_tab2 (col1, col2, col3 ............................................. col75) values (seq, col1, col2..........................col75, null, null)
    Help Appreciated..
    Thanks

    Easy
    untested
    insert into xx_inv_tab2 t2 (col1,col2,col3,col4)
    select yourSequence.nextval, t1.col1, t1.col2, t1.col3
    from xx_inv_tab1 t1
    ;Note that col5 does not need to be used, since you want to fill it with NULL.
    USe excel or sql developer to write you a list of column names, if you are to lazy to write all 75 columns by yourself.
    What might also work:
    untested
    insert into xx_inv_tab2 t2
    select yourSequence.nextval, t1.*, null
    from xx_inv_tab1 t1
    ;Edited by: Sven W. on Aug 31, 2012 4:41 PM

  • [SOLVED] I need a simple way to start/stop a virtualbox vm

    Hi,
      I need a very simple way to start a headless virtualbox vm on login, and cleanly save its state on system shutdown/reboot. I can't use solutions like vboxtool because my home directory is encrypted and only available after I login.
      I have written a simple script to do what I need:
    #!/bin/bash
    if VBoxManage startvm --type headless archdev > /dev/null 2>&1; then
    trap "VBoxManage controlvm archdev savestate > /dev/null 2>&1; exit" SIGINT SIGTERM
    while true;
    do
    sleep 10h
    done
    fi
      When I run this script in a interactive shell, all works as expected: It will successfully start the vm(archdev), and when I send SIGINT (using CTRL+C)  it will cleanly save the vm state. The problem I'm facing is that when I start this script as a background process(sufix it with a '&') it will successfully start, but it will fail to cleanly save state on shutdown, since it seems to  ignore signals send using 'kill' command(unless it is a SIGKILL). I highly appreciate an solution to this problem, by either explaining to me what is happening, or by providing an alternate one(as long it doesn't involve starting the vm with the system).
      Thanks in advance.
    Last edited by thiago (2011-09-04 14:54:44)

    cybertorture wrote:
    vboxmanage startvm --type headless VMNAME
    put this to start at login
    su -c 'vboxmanage controlvm VMNAME savestate' USERNAME
    put this to /etc/rc.local.shutdown
    Worked like a charm, thanks.

  • Simple way to export a report to PDF on demand in CR Server 2008?

    Hi,
    I have this intranet application written in JavaScript with smidgens of c# that I'm modifying for a client.  They've decided to purchase Crystal Server 2008 and they want their application to call Crystal Server 2008 and export a report to PDF to a folder on the intranet server.
    I've been beating my head against the wall trying to find a simple way to do this but I'm coming up blank.  Maybe my approach is wrong. 
    I've tried the .Net SDK (wssdk_net_samples_12) and apparently it's doesn't work... exactly.  I've been told they're going to get a working SDK for .Net > Crystal Server 2008 before the end of September(they hope).
    I've tried the URL reporting and it almost does what I'm looking for.  I can call a report directly using the URL... unfortunately it's wrapped in an HTML file and I can't figure out how to get just the PDF out of it.
    Does anyone know how I can do this? 
    I'm just looking to send some info to the Crystal Server 2008 and have it send back a PDF.
    Thanks in advance,
    J

    Hi Jason,
    This question might be better addressed on the .NET forum:
    .NET SDK Application Development
    -or-
    SAP Crystal Reports, version for Visual Studio
    I recommend that you post this question on that forum.
    Regards,
    Dan

Maybe you are looking for

  • Slow access on Network-folders

    Hello forum, I have a big problem with the speed of Indesign Server, when i try to access a Network path. The Server is running and gets a script via SOAP and everything is working well, except the speed. Within the script i open a document, which is

  • Can't create a function into database

    The function is : create or replace function Xgyh (pvc2Czy in varchar2, pnumYhid in number, pvc2Lfid in varchar2, pvc2Grzid in varchar2, pvc2Zbmid in varchar2, pvc2Bmid in varchar2) return number is intZxbz integer:=1;--返回值(1:正确,0:错误); numDxlb number

  • Accessing Close button in TitleWindow

    Hi all, I have a situation where I'm adding buttons to a TitleWindow chrome. They co-exist with the close button provided by the panel. I create classes for my button images and then I size the buttons to fit the image. I also set the styles for the

  • HT1386 I have been trying to sync my iPhone and its not syncing. I've synced it before but now it has gone away. How can I re-sync it? Please help.

    I have been trying to sync my iPhone and its not syncing. I've synced it before but now it has gone away. How can I re-sync it? Please help.

  • Export to Power Point

    Post Author: mmishkin CA Forum: Exporting Is there a way to export a crystal report and have it in powerpoint? I tried as a .pdf and then copy and pasting but it doesn't work. Any ideas?