Search Results

Search found 36970 results on 1479 pages for 'copying text'.

Page 10/1479 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • Flex Text height

    - by kevin
    How can you get the height of the Text component that's been created dynamically from ActionScript. For instance, if you have something like: var temp:Text = new Text; temp.width = 50; temp.text = "Simple text"; how to get height of temp?

    Read the article

  • text from a file turned into a variable?

    - by b3y4z1d
    If I made a program that stores strings on a text file using the "list"-function(#include ), and then I want to copy all of the text from that file and call it something(so I can tell the program to type in all of the text I copied somewhere by using that one variable to refer to the text), do I use a string,double,int or what do I declare that chunk of text as? I'm making the program using c++ in a simple console application.

    Read the article

  • Marquee Text When Text Overflows

    - by Mike Stanford
    Hi all, well heres my problem. Lets say i have 3 div tags, all are 100pixels wide: <--- DIV WIDTH ---> Text in div 1 Text in div two, it overflows Text in div three <--- DIV WIDTH ---> Now, currently i have this css for the divs: width:100px; overflow:hidden; What i want to do is if the text overflows, it scrolls like a marquee so all the text can be seen if you wait a little bit. But i only want the marquee to show if the text overflows. How would i do this? Thx, Tony

    Read the article

  • Why isn't TextBox.Text in WPF animatable?

    - by cplotts
    Ok, I have just run into something that is really catching me off-guard. I was helping a fellow developer with a couple of unrelated questions and in his project he was animating text into some TextBlock(s). So, I went back to my desk and recreated the project (in order to answer his questions), but I accidentally used TextBox instead of TextBlock. My text wasn't animating at all! (A lot of help, I was!) Eventually, I figured out that his xaml was using TextBlock and mine was using TextBox. What is interesting, is that Blend wasn't creating key frames when I was using TextBox. So, I got it to work in Blend using TextBlock(s) and then modified the xaml by hand, converting the TextBlock(s) into TextBox(es). When I ran the project, I got the following error: InvalidOperationException: '(0)' Storyboard.TargetProperty path contains nonanimatable property 'Text'. Well, it seems as if Blend was smart enough to know that ... and not generate the key frames in the animation (it would just modify the value directly on the TextBox). +1 for Blend. So, the question became: why isn't TextBox.Text animatable? The usual answer is that the particular property you are animating isn't a DependencyProperty. But, this isn't the case, TextBox.Text is a DependencyProperty. So, now I am bewildered! Why can't you animate TextBox.Text? Let me include some xaml to illustrate the problem. The following xaml works ... but uses TextBlock(s). <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="TextBoxTextQuestion.MainWindow" x:Name="Window" Title="MainWindow" Width="640" Height="480" > <Window.Resources> <Storyboard x:Key="animateTextStoryboard"> <StringAnimationUsingKeyFrames Storyboard.TargetProperty="(TextBlock.Text)" Storyboard.TargetName="textControl"> <DiscreteStringKeyFrame KeyTime="0:0:1" Value="Goodbye"/> </StringAnimationUsingKeyFrames> </Storyboard> </Window.Resources> <Window.Triggers> <EventTrigger RoutedEvent="FrameworkElement.Loaded"> <BeginStoryboard Storyboard="{StaticResource animateTextStoryboard}"/> </EventTrigger> </Window.Triggers> <Grid x:Name="LayoutRoot"> <StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center"> <TextBlock x:Name="textControl" Text="Hello" FontFamily="Calibri" FontSize="32"/> <TextBlock Text="World!" Margin="0,25,0,0" FontFamily="Calibri" FontSize="32"/> </StackPanel> </Grid> </Window> The following xaml does not work and uses TextBox.Text: <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="TextBoxTextQuestion.MainWindow" x:Name="Window" Title="MainWindow" Width="640" Height="480" > <Window.Resources> <Storyboard x:Key="animateTextStoryboard"> <StringAnimationUsingKeyFrames Storyboard.TargetProperty="(TextBox.Text)" Storyboard.TargetName="textControl"> <DiscreteStringKeyFrame KeyTime="0:0:1" Value="Goodbye"/> </StringAnimationUsingKeyFrames> </Storyboard> </Window.Resources> <Window.Triggers> <EventTrigger RoutedEvent="FrameworkElement.Loaded"> <BeginStoryboard Storyboard="{StaticResource animateTextStoryboard}"/> </EventTrigger> </Window.Triggers> <Grid x:Name="LayoutRoot"> <StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center"> <TextBox x:Name="textControl" Text="Hello" FontFamily="Calibri" FontSize="32"/> <TextBox Text="World!" Margin="0,25,0,0" FontFamily="Calibri" FontSize="32"/> </StackPanel> </Grid> </Window>

    Read the article

  • Tell me SQL Server Full-Text searcher is crazy, not me.

    - by Ian Boyd
    i have some customers with a particular address that the user is searching for: 123 generic way There are 5 rows in the database that match: ResidentialAddress1 ============================= 123 GENERIC WAY 123 GENERIC WAY 123 GENERIC WAY 123 GENERIC WAY 123 GENERIC WAY i run a FT query to look for these rows. i'll show you each step as i add more criteria to the search: SELECT ResidentialAddress1 FROM Patrons WHERE CONTAINS(Patrons.ResidentialAddress1, '"123*"') ResidentialAddress1 ========================= 123 MAPLE STREET 12345 TEST 123 MINE STREET 123 GENERIC WAY 123 FAKE STREET ... (30 row(s) affected) Okay, so far so good, now adding the word "generic": SELECT ResidentialAddress1 FROM Patrons WHERE CONTAINS(Patrons.ResidentialAddress1, '"123*"') AND CONTAINS(Patrons.ResidentialAddress1, '"generic*"') ResidentialAddress1 ============================= 123 GENERIC WAY 123 GENERIC WAY 123 GENERIC WAY 123 GENERIC WAY 123 GENERIC WAY (5 row(s) affected) Excellent. And now i'l add the final keyword that the user wants to make sure exists: SELECT ResidentialAddress1 FROM Patrons WHERE CONTAINS(Patrons.ResidentialAddress1, '"123*"') AND CONTAINS(Patrons.ResidentialAddress1, '"generic*"') AND CONTAINS(Patrons.ResidentialAddress1, '"way*"') ResidentialAddress1 ------------------------------ (0 row(s) affected) Huh? No rows? What if i query for just "way*": SELECT ResidentialAddress1 FROM Patrons WHERE CONTAINS(Patrons.ResidentialAddress1, '"way*"') ResidentialAddress1 ------------------------------ (0 row(s) affected) At first i thought that perhaps it's because of the *, and it's requiring that the root way have more characters after it. But that's not true: Searching for "123*" matches "123" Searching for "generic*" matches "generic" Books online says, The asterisk matches zero, one, or more characters What if i remove the * just for s&g: SELECT ResidentialAddress1 FROM Patrons WHERE CONTAINS(Patrons.ResidentialAddress1, '"way"') Server: Msg 7619, Level 16, State 1, Line 1 A clause of the query contained only ignored words. So one might think that you are just not allowed to even search for way, either alone, or as a root. But this isn't true either: SELECT * FROM Patrons WHERE CONTAINS(Patrons.*, '"way*"') AccountNumber FirstName Lastname ------------- --------- -------- 33589 JOHN WAYNE So sum up, the user is searching for rows that contain all the words: 123 generic way Which i, correctly, translate into the WHERE clauses: SELECT * FROM Patrons WHERE CONTAINS(Patrons.*, '"123*"') AND CONTAINS(Patrons.*, '"generic*"') AND CONTAINS(Patrons.*, '"way*"') which returns no rows. Tell me this just isn't going to work, that it's not my fault, and SQL Server is crazy. Note: i've emptied the FT index and rebuilt it.

    Read the article

  • Fade out text value inside of text field using jQuery

    - by Dwayne
    I am not entirely sure if this is possible or not, I am pretty knowledgeable when it comes to jQuery and JavaScript in general, but this one has me stumped. I've created a simple plugin that clears a text input on focus and then displays the default value if nothing has been entered. Is it possible to fade out just the text itself inside of the text input, and not the whole field itself? All attempts seem to result in the text field itself fading out and eventually hiding the element from view. I did come up with a solution of using spans containing the default value and absolutely positioning them over the text input, hiding and showing them depending if a user has entered any text or not. I would much rather a much straightforward approach if one exists.

    Read the article

  • How to store dynamic references to parts of a text

    - by Antoine L
    In fact, my question concerns an algorithm. I need to be able to attach annotations to certain parts of a text, like a word or a group of words. The first thing that came to me to do so is to store the position of this part (indexes) in the text. For instance, in the text 'The quick brown fox jumps over the lazy dog', I'd like to attach an annotation to 'quick brown fox', so the indexes of the annotation would be 4 - 14. But since the text is editable (other annotations could provoke a modification from text's author), the annoted part is likely to move (the indexes could change). In fact, I don't know how to update the indexes of the annoted part. What if the text becomes 'Everyday, the quick brown fox jumps over the lazy dog' ? I guess I have to watch every change of the text in the front-end application ? The front-end part of the application will be HTML with Javascript. I will be using PHP to develop the back-end part and every text and annotation will be stored in a database.

    Read the article

  • Prevent breaking of specified part of paragraph

    - by AntonAL
    For example, we have a paragraph: Quick brown fox jumps over the lazy dog How can i prevent breaking the part "the lazy" ? I means, that this string will be incorrect in my formatting: Quick brown fox jumps over the lazy dog But this one is correct: Quick brown fox jumps over the lazy dog My text is large and hitting "Shift+Enter" at some placed is ugly, because everything will crash, when text size will be changed ... Selecting the part "the lazy", right-click - "Prevent breaking" does not works Help!

    Read the article

  • Copying A Slide From One Presentation To Another

    - by Tim Murphy
    There are many ways to generate a PowerPoint presentation using Open XML.  The first way is to build it by hand strictly using the SDK.  Alternately you can modify a copy of a base presentation in place.  The third approach to generate a presentation is to build a new presentation from the parts of an existing presentation by copying slides as needed.  This post will focus on the third option. In order to make this solution a little more elegant I am going to create a VSTO add-in as I did in my previous post.  This one is going to insert Tags to identify slides instead of NonVisualDrawingProperties which I used to identify charts, tables and images.  The code itself is fairly short. SlideNameForm dialog = new SlideNameForm(); Selection selection = Globals.ThisAddIn.Application.ActiveWindow.Selection;   if(dialog.ShowDialog() == DialogResult.OK) { selection.SlideRange.Tags.Add(dialog.slideName,dialog.slideName); } Zeyad Rajabi has a good post here on combining slides from two presentations.  The example he gives is great if you are doing a straight merge.  But what if you want to use your source file as almost a supermarket where you pick and chose slides and may even insert them repeatedly?  The following code uses the tags we created in the previous step to pick a particular slide an copy it to a destination file. using (PresentationDocument newDocument = PresentationDocument.Open(OutputFileText.Text,true)) { PresentationDocument templateDocument = PresentationDocument.Open(FileNameText.Text, false);   uniqueId = GetMaxIdFromChild(newDocument.PresentationPart.Presentation.SlideMasterIdList); uint maxId = GetMaxIdFromChild(newDocument.PresentationPart.Presentation.SlideIdList);   SlidePart oldPart = GetSlidePartByTagName(templateDocument, SlideToCopyText.Text);   SlidePart newPart = newDocument.PresentationPart.AddPart<SlidePart>(oldPart, "sourceId1");   SlideMasterPart newMasterPart = newDocument.PresentationPart.AddPart(newPart.SlideLayoutPart.SlideMasterPart);   SlideIdList idList = newDocument.PresentationPart.Presentation.SlideIdList;   // create new slide ID maxId++; SlideId newId = new SlideId(); newId.Id = maxId; newId.RelationshipId = "sourceId1"; idList.Append(newId);   // Create new master slide ID uniqueId++; SlideMasterId newMasterId = new SlideMasterId(); newMasterId.Id = uniqueId; newMasterId.RelationshipId = newDocument.PresentationPart.GetIdOfPart(newMasterPart); newDocument.PresentationPart.Presentation.SlideMasterIdList.Append(newMasterId);   // change slide layout ID FixSlideLayoutIds(newDocument.PresentationPart);     //newPart.Slide.Save(); newDocument.PresentationPart.Presentation.Save(); } The GetMaxIDFromChild and FixSlideLayoutID methods are barrowed from Zeyad’s article.  The GetSlidePartByTagName method is listed below.  It is really one LINQ query that finds SlideParts with child Tags that have the requested Name. private SlidePart GetSlidePartByTagName(PresentationDocument templateDocument, string tagName) { return (from p in templateDocument.PresentationPart.SlideParts where p.UserDefinedTagsParts.First().TagList.Descendants <DocumentFormat.OpenXml.Presentation.Tag>().First().Name == tagName.ToUpper() select p).First(); } This is what really makes the difference from what Zeyad posted.  The most powerful thing you can have when generating documents from templates is a consistent way of naming items to be manipulated.  I will be show more approaches like this in upcoming posts. del.icio.us Tags: Office Open XML,Presentation,PowerPoint,VSTO,TagList

    Read the article

  • Is there a command-line utility app which can find a specific block of lines in a text file, and replace it?

    - by fred.bear
    UPDATE (see end of question) The text "search and replace" utility programs I've seen, seem to only search on a line-by-line basis... Is there a command-line tool which can locate one block of lines (in a text file), and replace it with another block of lines.? For example: Does the test file file contain this exact group of lines: 'Twas brillig, and the slithy toves Did gyre and gimble in the wabe: All mimsy were the borogoves, And the mome raths outgrabe. 'Beware the Jabberwock, my son! The jaws that bite, the claws that catch! Beware the Jubjub bird, and shun The frumious Bandersnatch!' I want this, so that I can replace multiple lines of text in a file and know I'm not overwriting the wrong lines. I would never replace "The Jabberwocky" (Lewis Carroll), but it makes a novel example :) UPDATE: ..(sub-update) My following comment about reasons when not use sed are only in the context of; don't push any tool too far beyond its design intent (I use sed quite often, and consider it to be invaluable.) I just now found an interesting web page about sed and when not to use it. So, because of all the sed answers, I"ll post the link.. it is part of the sed FAQ on sourceforge Also, I'm pretty sure there is some way diff can do the job of locating the block of text (once it's located, the replacement is quite straight foward; using head and tail) ... 'diff' dumps all the necessary data, but I haven't yet worked out how to filter it , ... (I'm still working on it)

    Read the article

  • Sending text messages from Raspberry Pi via email fails

    - by vgm64
    I'm using mailx on my raspberry pi to try to send text messages updates for event monitoring. My phone number: 9876543210 My phone's email-to-text gateway address: [email protected] I can 1) Send emails from my raspberry pi to various email addresses. mail -r [email protected] -s "My Subject" [email protected] < body.txt and off it goes and is successfully delivered. 2) Send emails from various email address (not on RPi) using mailx to the above phone-email address and have them delivered as text messages. However, when sending emails to [email protected] from the Raspberry Pi using mailx the emails seem to spiral into the void and are never heard of again (no errors, no undeliverable messages, nothing). Does anyone know what could be causing this to go awry? Something about the basic deployment of the mail server on the pi? EDIT Based on @kobaltz's suggestion, I used sendmail instead. This led to a hang, then an error that stated that I lacked a fully qualified domain name (FQDN). I then used this website's instructions to add a domain name to the RPi. To paraphrase: I have set the FQDN in /etc/hostname: my-host-name.my-domain.com and /etc/hosts: 127.0.0.1 localhost.localdomain localhost 192.168.0.5 my-host-name.my-domain.com my-host-name Then add to /etc/mail/sendmail.cf: MASQUERADE_AS(`my-domain.com') MASQUERADE_DOMAIN(`my-host-name.my-domain.com') FEATURE(`masquerade_entire_domain') FEATURE(`masquerade_envelope') I put this in /etc/mail/sendmail.cf, BEFORE the MAILER() lines, ran sendmailconfig, answered Yes to the questions about using the existing files, and restarted sendmail. Emails now have the proper domain name. Progress, however, I am now stuck at the following error: 354 Enter mail, end with "." on a line by itself >>> . 050 <[email protected]>... Connecting to mxx.cingularme.com. via esmtp... 050 421 Service not available 050 >>> QUIT 050 <[email protected]>... Deferred: 421 Service not available 250 2.0.0 q9U3ZESt021150 Message accepted for delivery [email protected]... Sent (q9U3ZESt021150 Message accepted for delivery) Closing connection to [127.0.0.1] >>> QUIT

    Read the article

  • Open source command line tools for indexing a large number of text files

    - by ergosys
    I'm looking for any open source command line tool or tools which will allow me to index and search a large number of plain text files. Approximate search would be a plus. The tool only needs to print the files that match, although some match context would be useful. A GUI tool isn't useful for my application, nor is anything that searches files one by one (grep for example). I'm basically targeting unix platforms (osx, linux, bsd). EDIT: I'm not interested in any sort of tool that is system-wide, or needs to run in the background. Basically, I want to build an index for a directory tree full of text files and then later be able to search against it. Preferably the index is one or a few files that I can specify the location of. Any ideas?

    Read the article

  • Text Editor that hilights all instances of selection for Mac

    - by jedierikb
    On Windows, I use Notepad++ which has the great feature of when I select a word, all instances of that word are also highlighted in the same document. I have found it very helpful for finding patterns in giant log files. I am wondering if there is a similar feature in a text editor on the Mac. I have looked into the documentation for TextWrangler and TextMate to no avail. Hopefully there is a way to do this so I can be more productive when working on a Mac. -- Note: in Notepad++ you do not have to do a keyboard shortcut to make this work... you just select some text and it does the highlighting for you automatically.

    Read the article

  • How to see ALT text in Firefox

    - by torbengb
    I know Mozilla thinks it's a bug that IE shows ALT text even after the image has loaded; while users think it's a bug that Firefox doesn't work exactly like IE. This disagreement is irrelevant to my question: How can I make my Firefox show the ALT tooltip when I hover the mouse over an image? Obviously XKCD is a bit tame without this essential functionality. I've tried the Firefox plugin Popup ALT Attribute but it doesn't work; after restarting the browser and hovering over an image with an ALT text, no tooltip appears. I reproduced this on several computers with several (Windows) OS versions.

    Read the article

  • Symbolic link to text editor (Sublime) on Mac

    - by Michael
    I'm following along with this tutorial on how to use Sublime text editor https://tutsplus.com/lesson/services-and-opening-sublime-from-the-terminal/ . It gives instructions to enter the following command to enable opening of Sublime in the terminal. ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" /bin/subl After creating that link, it says I should be able to do subl . to open all the files in a folder in Sublime. However, when I do it, it says -bash: subl: command not found My system says the file exists ln: /bin/subl: File exists Any idea what I can do?

    Read the article

  • Launch Sublime Text 2 from command line

    - by Erick
    I am trying to launch Sublime Text 2 via command line. I know it has already been done before here but I am having different constraints. I use the portable version of ST and store it into my Dropbox account. I guess you can see me coming here. I need to launch subtext on a relative path. So far it "kinda works" if I type in the command line subl file.txt it works I see the file content but if I type subl "file 2.txt" I do not have nothing it opens ST with something like c:\mydir\"file 2.txt". I guess the problem lies on the "%WORKINGDIR%\%1" of the script bellow. @ECHO OFF SET WORKINGDIR=%CD% cd /d %0\.. SET EXECDIR=%CD% cd %WORKINGDIR% START "Sublime text editor" "%EXECDIR%\sublimetext\sublime_text.exe" "%WORKINGDIR%\%1"

    Read the article

  • Text tagging/analysis tool for Mac

    - by Mark Porter
    I'm a doctoral student doing research in the humanities. As part of my research I have gathered together a lot of interview text. To analyse this data I want to be able to easily tag sections of text with keywords (the tags need to be able to overlap, and perhaps be organised hierarchically) and later be able to collate those sections from across multiple files. I need to be able to do this on a Mac. It feels like a simple task but I can't find any software for doing it that isn't either horribly clunky or a massive overkill worth hundreds of pounds. Is there any good software for doing this, or are there any good ways of doing it with other software?

    Read the article

  • Text editor for Mac that will open any file

    - by Dinah
    In Windows, every text editor I encountered allowed me to drag and drop any file type into it and it opened. Apparently, Mac app developers have a different philosophy because I can't find a simple free text editor for OS X that will do this. TextWrangler came highly recommended but it can't accomplish this simple feat. Can anyone suggest one? Edit apparently on at least some editors, there is a distinction between drag/drop in the document list area vs. the typing area. In addition to the accepted answer, this is one thing to be aware of. I still don't know why it doesn't work in TextEdit, but this is true for TextWrangler and Smultron.

    Read the article

  • What is a Windows text editor that will make it easy for me to have four text files open onscreen at once?

    - by Ascendant
    When brainstorming / planning I like to have four text files open onscreen at once: One for notes/stream of consciousness, one for action items to follow up on, one for a rough outline, etc.... What I'm looking for is an easy way to create / save four text files in this manner in Windows. Most importantly, I need the lines to wrap based on the width of the actual window itself. Not based on a ruler or document size (a la Word or WordPad) and not wrapping "manually only" (like Windows' built in Notepad application.) Also, I need the windows to have no, or at least, little, fluff at the top of each document (menubars, ribbons, etc.) On my Mac, I've found that the built-in TextEdit application is almost perfect for this. There's no header or ribbon taking up space for each document, and lines wrap when they hit the end of the window. I haven't had any luck finding a Windows application that works the same way.

    Read the article

  • Open file in local text editor from within an SSH connection

    - by Sam
    I'm not a vim guy. I'd like to be able to open log files in Sublime Text when in an SSH connection from within Terminal. Is there a way I could do this? I'm thinking there must be a command or something that could copy the file over to a temporary directory in OS X and then open it in Sublime Text, and when I save it, it'll copy back to the original location through SSH; similar to how FileZilla does it. I'm on Mac OS X MT. The server I SSH into is running Ubuntu. I'm using Terminal.

    Read the article

  • Insert text into a div from a poput form and rewrite the inserted text with javascript

    - by kuswantin
    So I read some related questions here before I asked, but can't find the answer to my problem. Hope some javascript master here can find this and bring the light to me. I created another button for nicEdit, a video button and wanted to insert some formatted text into the editor DIV (note: nicEdit has inline DIV, no iframe, no textarea). This is my button, recreated from the image button: var nicVideoOptions = { buttons : { 'video' : {name : __('Insert Video'), type : 'nicEditorVideoButton'} //, tags : ['VIDEO:'] }, iconFiles : {'video' : '../movie.png'} }; var nicEditorVideoButton = nicEditorAdvancedButton.extend({ addPane : function() { this.vi = this.ne.selectedInstance.selElm().parentTag('A'); this.addForm({ '' : {type : 'title', txt : 'Insert Video URL'}, 'href' : {type : 'text', txt : 'URL', 'value' : 'http://', style : {width: '150px'}} },this.vi); }, submit : function(e) { var vidVal = this.inputs['href'].value; if(vidVal == "" || vidVal == "http://") { alert("Enter the video url"); return false; } this.removePane(); if(!this.vi) { var tmp = 'javascript:nicVidTemp();'; this.ne.nicCommand("insertVideo",tmp); // still nothing works //this.vi = this.findElm('VIDEO:','href',tmp); //this.vi = this.setContent('[video:' + this.inputs['href'].value + ']'); //nicEditors.findEditor('edit-comment').setContent('<strong>Some HTML</strong> here'); //this.vi = this.setContent('<strong>Some HTML</strong> here'); insertAtCaret(this.ne.selectedInstance, vidVal); } if(this.vi) { // still nothing works //this.vi.setAttributes({ //vidVal : this.inputs['href'].value //}); //this.vi = this.setContent('[video:' + this.inputs['href'].value + ']'); //this.vi = this.setContent('<strong>Some HTML</strong> here'); } } }); nicEditors.registerPlugin(nicPlugin,nicVideoOptions); The button is there, the form poput like the image button, so it's okay. But can't insert the text into the DIV. The final output will be taken from this: ('[video:' + this.inputs['href'].value + ']') and displayed in the editor DIV as is: [video:http//some.com/video-url] As you see, I am blindly touching everything :) And this insertion is taken from: http://www.scottklarr.com/topic/425/how-to-insert-text-into-a-textarea-where-the-cursor-is/ function insertAtCaret(areaId,text) { var txtarea = document.getElementById(areaId); var scrollPos = txtarea.scrollTop; var strPos = 0; var br = ((txtarea.selectionStart || txtarea.selectionStart == '0') ? "ff" : (document.selection ? "ie" : false ) ); if (br == "ie") { txtarea.focus(); var range = document.selection.createRange(); range.moveStart ('character', -txtarea.value.length); strPos = range.text.length; } else if (br == "ff") strPos = txtarea.selectionStart; var front = (txtarea.value).substring(0,strPos); var back = (txtarea.value).substring(strPos,txtarea.value.length); txtarea.value=front+text+back; strPos = strPos + text.length; if (br == "ie") { txtarea.focus(); var range = document.selection.createRange(); range.moveStart ('character', -txtarea.value.length); range.moveStart ('character', strPos); range.moveEnd ('character', 0); range.select(); } else if (br == "ff") { txtarea.selectionStart = strPos; txtarea.selectionEnd = strPos; txtarea.focus(); } txtarea.scrollTop = scrollPos; } The flow: I click the button, a form popouts, fill the input text box, hit the query button and the text should appear in the editor DIV. I hope I can make myself clear. Any help would be very much appreaciated Thanks

    Read the article

  • Copying files to zfs mountpoint doesn't work - the files aren't actually copied to the other filesystem,

    - by user113904
    I have 3 x 4 TB disks in a NAS that I want to group together and access as if they were one whole 'unit' of some kind. I also have a 250GB disk containing the OS - this is full of films and tv shows currently. I thought zfs sounded good so I created a raidz zpool, after installing the ppa sudo zpool create store raidz /dev/sdb /dev/sdc /dev/sdd and set the mountpoint to /mnt/store sudo zfs set mountpoint=/mnt/store /store checked it was successful - I think it was sudo zfs list NAME USED AVAIL REFER MOUNTPOINT store 266K 7.16T 170K /mnt/store Then I wanted to move over a whole load of files from my home directory. I went to where the to-be-copied folder was (called media) and entered sudo cp -R * /mnt/store cp: cannot create directory `/mnt/store/media': No space left on device It seems like it's not copying over to the new filesystem I made (or thought I did). I've never really done this type of thing until a few days ago so may be running before I can walk... is this not the right way to copy files across? I've only used windows before so the idea of mountpoints is a bit mind boggling. I'm using XBMCbuntu 12 beta 2.0 which is based on 12.04. Will retry with normal Ubuntu 12.04 desktop to see if that's the problem. thanks for the help!

    Read the article

  • Preventing Users From Copying Text From and Pasting It Into TextBoxes

    Many websites that support user accounts require users to enter an email address as part of the registration process. This email address is then used as the primary communication channel with the user. For instance, if the user forgets her password a new one can be generated and emailed to the address on file. But what if, when registering, a user enters an incorrect email address? Perhaps the user meant to enter [email protected], but accidentally transposed the first two letters, entering [email protected]. How can such typos be prevented? The only foolproof way to ensure that the user's entered email address is valid is to send them a validation email upon registering that includes a link that, when visited, activates their account. (This technique is discussed in detail in Examining ASP.NET's Membership, Roles, and Profile - Part 11.) The downside to using a validation email is that it adds one more step to the registration process, which will cause some people to bail out on the registration process. A simpler approach to lessening email entry errors is to have the user enter their email address twice, just like how most registration forms prompt users to enter their password twice. In fact, you may have seen registration pages that do just this. However, when I encounter such a registration page I usually avoid entering the email address twice, but instead enter it once and then copy and paste it from the first textbox into the second. This behavior circumvents the purpose of the two textboxes - any typo entered into the first textbox will be copied into the second. Using a bit of JavaScript it is possible to prevent most users from copying text from one textbox and pasting it into another, thereby requiring the user to type their email address into both textboxes. This article shows how to disable cut and paste between textboxes on a web page using the free jQuery library. Read on to learn more! Read More >

    Read the article

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