Search Results

Search found 42712 results on 1709 pages for 'core text'.

Page 46/1709 | < Previous Page | 42 43 44 45 46 47 48 49 50 51 52 53  | Next Page >

  • Preserve "long" spaces in PDFBox text extraction

    - by Thilo
    I am using PDFBox to extract text from PDF. The PDF has a tabular structure, which is quite simple and columns are also very widely spaced from each-other This works really well, except that all kinds of horizontal space gets converted into a single space character, so that I cannot tell columns apart anymore (space within words in a column looks just like space between columns). I appreciate that a general solution is very hard, but in this case the columns are really far apart so that having a simple differentiation between "long spaces" and "space between words" would be enough. Is there a way to tell PDFBox to turn horizontal whitespace of more then x inches into something other than a single space? A proportional approach (x inch become y spaces) would also work.

    Read the article

  • Code/Approach Golf: Find row in text file with too many columns

    - by awshepard
    Given a text file that is supposed to contain 10 tab-delimited columns (i.e. 9 tabs), I'd like to find all rows that have more than 10 columns (more than 9 tabs). Each row ends with CR-LF. Assume nothing about the data, field widths, etc, other than the above. Comments regarding approach, and/or working code would be extremely appreciated. Bonus for printing line numbers of offending lines as well. Thanks in advance!

    Read the article

  • how best to set text alignment in a table

    - by ericslaw
    Does anyone know of a jquery plugin or snippet that will auto-text-align cells in a table based on content? Specifically, all table cells would be right justified unless there is a visible non-number related character in the cell, then it would be left justified. I'd like to use something like this regular expression to identify non-number related characters in a cell: /[^0-9% +-()]/ Is there a real simple way to accomplish this? I would think something like this: $("td:contains('[^0-9% +-()]')").addClass("left"); would do the trick, but I don't think 'contains' can take a regular expression.

    Read the article

  • awk / sed script to remove text

    - by radman
    Hi, I am currently needed of way to programmatically remove some text from Makefiles that I am dealing with. Now the problem is that (for whatever reason) the makefiles are being generated with link commands of -l<full_path_to_library>/<library_name> when they should be generated with -l<library_name>. So what I need is a script to find all occurrences of -l/ and then remove up to and including the next /. Example of what I'm dealing with -l/home/user/path/to/boost/lib/boost_filesystem I need it to be -lboost_filesystem As could be imagined this is a stop gap measure until I fix the real problem (on the generation side) but in the meantime it would be a great help to me if this could work and I am not too good with my awk and sed. Thanks for any help.

    Read the article

  • Populate FILE field with default text

    - by dclowd9901
    I'm trying to reutilize code that generates FILE fields for use when something is to be added to the database, and grayed out (and disabled) with data already in the database when the item in question is being edited or viewed in detail. However, I can't seem to get the text to fill the field. I'm using this: echo '<input type="file" name="small[]" value="' . $value_from_database . '" DISABLED><br>'; Am I missing anything? If not, are there any decent workarounds?

    Read the article

  • MySQL - How do I insert an additional where clause into this full-text search query

    - by Steven
    I want to add a WHERE clause to a full text search query (to limit to past 24 hours), but wherever I insert it I get Low Level Error. Is it possible to add the clause and if so, how? $query = "SELECT * WHERE story_time > time()-86400 AND MATCH (story_title) AGAINST ('".validate_input($_GET['q'])."' IN BOOLEAN MODE) AS Relevance FROM ".$config['db']['pre']."stories WHERE MATCH (story_title) AGAINST ('+".validate_input($_GET['q'])."' IN BOOLEAN MODE) HAVING Relevance > 0.2 ORDER BY Relevance DESC, story_time DESC LIMIT ".validate_input(($_GET['page']-1)*10).",10";

    Read the article

  • vb.net add text to form without interaction

    - by user228058
    I have a winform project which lists all the files in a specified folder. It allows the user to select a new destination for each file, and when the user has chosen the destinations for all files that he would like to be moved, it moves the files, one by one. My next step is, I need to display a confirm form when the files are being moved, and add each file's name and destination to the confirm form as it is being moved. My question is: How can I add more text to the confirm form's controls after I already loaded it (using confirm.showdialog() from my other form, without any user interaction? I imagine that I need to do it from the original form, because it needs to display each one when it starts to move that file, but I'm open to any suggestions:) TIA

    Read the article

  • Refresh index of full text search

    - by David
    Hi, in SQL Server 2008, when setting up a full text search, it gives me an option to choose a time/day for it to re-populate the index, can I do this from code instead like C# code? if so how would I do it? Would I need to execute SQL code from C# to refresh the index? Also, say if I DONT re-populate the index and add some new records, by using the FTS query will the new records still come up? But slower? Or will they not come up at all unless i reindex?

    Read the article

  • Click to make body text larger | JavaScript

    - by Wayne
    Please note this is just an example: <img src="img/normal-font.png" onclick="javascript:document.body.style.fontSize = '13px';" /> &nbsp; <img src="img/medium-font.png" onclick="javascript:document.body.style.fontSize = '14px';" /> &nbsp; <img src="img/large-font.png"onclick="javascript:document.body.style.fontSize = '15px';" /> The body text does indeed enlarge if I choose one of them, but what I like to include is remembering what option you've chosen by reading cookies. In fact, I have no experience in creating cookies in JS, only in PHP. Could someone come up with an example of how to make cookies the simpliest way remembering my option, but whenever someone clicks another one, it should get rid of the cookie that was last set, e.g. Cookie value has 15px, then should update it or remove it with a new cookie with a new value of 13px and so on. Thanks :)

    Read the article

  • Javascript text Resize

    - by blackessej
    Without getting into the "should a text resizer be used or not" debate, I'd like some help with this...suffice to say that my clientele are from and older generation and may be sight impaired... My script isn't functioning, and I'm not sure why. It's not live yet, so here's what I'm working with: function fsize(size,unit,id){ var vfontsize = document.getElementById("#colleft"); if(vfontsize){ vfontsize.style.fontSize = size + unit; } } var textsize = 14; function changetextsize(up){ if(up){ textsize = parseFloat(textsize)+2; }else{ textsize = parseFloat(textsize)-2; } } I'm using onclick events to trigger the size changes. Thanks for your help!

    Read the article

  • Fail to save a managed object to core-data after its properties were updated.

    - by Tzur Gazit
    I have to trouble to create the object, but updating it fails. Here is the creation code: // Save data from pList to core data fro the first time - (void) saveToCoreData:(NSDictionary *)plistDictionary { // Create system parameter entity SystemParameters *systemParametersEntity = (SystemParameters *)[NSEntityDescription insertNewObjectForEntityForName:@"SystemParameters" inManagedObjectContext:mManagedObjectContext]; //// // GPS SIMULATOR //// NSDictionary *GpsSimulator = [plistDictionary valueForKey:@"GpsSimulator"]; [systemParametersEntity setMGpsSimulatorEnabled:[[GpsSimulator objectForKey:@"Enabled"] boolValue]]; [systemParametersEntity setMGpsSimulatorFileName:[GpsSimulator valueForKey:@"FileName"]]; [systemParametersEntity setMGpsSimulatorPlaybackSpeed:[[GpsSimulator objectForKey:@"PlaybackSpeed"] intValue]]; [self saveAction]; } During execution the cached copy is changed and then it is saved (or trying) to the database. Here is the code to save the changed copy: // Save data from pList to core data fro the first time - (void) saveSystemParametersToCoreData:(SystemParameters *)theSystemParameters { // Step 1: Select Data NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; NSEntityDescription *entity = [NSEntityDescription entityForName:@"SystemParameters" inManagedObjectContext:mManagedObjectContext]; [fetchRequest setEntity:entity]; NSError *error = nil; NSArray *items = [self.managedObjectContext executeFetchRequest:fetchRequest error:&error]; [fetchRequest release]; if (error) { NSLog(@"CoreData: saveSystemParametersToCoreData: Unresolved error %@, %@", error, [error userInfo]); abort(); } // Step 2: Update Object SystemParameters *systemParameters = [items objectAtIndex:0]; //// // GPS SIMULATOR //// [systemParameters setMGpsSimulatorEnabled:[theSystemParameters mGpsSimulatorEnabled]]; [systemParameters setMGpsSimulatorFileName:[theSystemParameters mGpsSimulatorFileName]]; [systemParameters setMGpsSimulatorPlaybackSpeed:[theSystemParameters mGpsSimulatorPlaybackSpeed]]; // Step 3: Save Updates [self saveAction]; } As to can see, I fetch the object that I want to update, change its values and save. Here is the saving code: - (void)saveAction { NSError *error; if (![[self mManagedObjectContext] save:&error]) { NSLog(@"ERROR:saveAction. Unresolved Core Data Save error %@, %@", error, [error userInfo]); exit(-1); } } The Persistent store method: - (NSPersistentStoreCoordinator *)persistentStoreCoordinator { if (mPersistentStoreCoordinator != nil) { return mPersistentStoreCoordinator; } NSString *path = [self databasePath]; NSURL *storeUrl = [NSURL fileURLWithPath:path]; NSError *error = nil; mPersistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]]; if (![mPersistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeUrl options:nil error:&error]) { NSLog(@"Unresolved error %@, %@", error, [error userInfo]); abort(); } return mPersistentStoreCoordinator; } There is no error but the sqLite file is not updated, hence the data is not persistent. Thanks in advance.

    Read the article

  • [perl] Efficient processing of large text

    - by jesper
    I have text file that contains over one million urls. I have to process this file in order to assign urls to groups, based on host address: { 'http://www.ex1.com' = ['http://www.ex1.com/...', 'http://www.ex1.com/...', ...], 'http://www.ex2.com' = ['http://www.ex2.com/...', 'http://www.ex2.com/...', ...] } My current basic solution takes about 600mb of RAM to do this (size of file is about 300mb). Could You provide some more efficient ways? My current solution simply reads line by line, extracts host address by regex and put url into hash.

    Read the article

  • Saving core data in a thread, how to ensure its done writing before quitting?

    - by Shizam
    So I'm saving small images to core data which take a really short amount of time to save, like .2 seconds but I'm doing it while the user is flipping through a scroll view so in order to improve responsiveness I'm moving the saving to a thread. This works great, everything gets saved and the app is responsive. However, there is one thing in the core-data + multithreading doco that worries me: "In Cocoa, only the main thread is not-detached. If you need to save on other threads, you must write additional code such that the main thread prevents the application from quitting until all the save operation is complete." Ok, how do you do that? It only needs to last ~ .2 seconds and its rarely going to happen since the chance of the app quitting as something is saving is very low. How do I run something on the main thread that'll prevent the app from quitting AND not block the gui? Thanks

    Read the article

  • Javascript or jquery replace text

    - by ngreenwood6
    I need to replace some text that is on the page within the body tag. I am using javascript but have jquery available if needed. I basically need to replace test® (test with the registered trademark) with TEST® or tests® with TESTS® and it could even be test with TEST® or tests with TESTS®. I am able to uppercase them but its not liking to work for me with the ® sign, it wants to put duplicates on ones that already have it. Basically anything on the page that has the word test or tests should be TEST® or TESTS® if it is plural. Any help is appreciated.

    Read the article

  • VBscript and CMD writing into a text file

    - by Effected
    I am writing a script that executes and write everything to the file here is example, I stored the complete command in the variable 'Command' , Command = "ftp ftp.xyz.com 21 " & vbCRLF and then executing it in command prompt, shell.Run "%comspec% /c FTP " & Command & " > " & E:/abc.txt, 0, TRUE but when this program execute it won't write anything to the text file because this is an incomplete command, this command on execution prompt user to input username and password of FTP, how can i do this , that my programm automatically input username and password when prompt and then write everything to file ?

    Read the article

  • Make text appear briefly in a JPanel

    - by Roo
    Hi, I am trying to make text appear briefly before it disappears. It would be along the lines of 1) Set color to black 2) wait x amount of seconds 3) set color to background color The method I call is repaint(), which then calls paintComponent(Graphics painter). repaint() is called only if I press the space-bar. I thought of trying repaint();Thread.sleep(1000);repaint(); (I do catch the Interrupt exception, just not shown), but it only calls paintComponent once per space-bar . Is there an easy way to do this or is this something that is a bit challenging?

    Read the article

  • does a git repository have its own local value for core.autocrlf that overrides the global one?

    - by Warren P
    As per this question, I understand that core.autocrlf=true in git will cause CRLF to LF translations. However when I type : git config core.autocrlf I see: false However, when I stage modified files that are already in the repo, I still get these warnings: Warning: CRLF will be replaced by LF in File1.X. The file will have its original line endings in your working directory. My guess is that the repo copy of the file is already set to "autocrlf=true". Questions: A. How do I query whether a file or git repo is already forcing AutoCrlf? B. How do I turn it autocrlf off?

    Read the article

  • Filtering Data in a Text File with Python

    - by YAS
    I'm new to Python (like Zygote new), and it's just to supplement another program but what I need is I have a text file that's a group of items for a game and it is formatted so: [1] Name=Blah Faction=Blahdiddly Cost=1000 [2] Name=Meh Faction=MehMeh Cost=2000 [3] Name=Lollypop Faction=Blahdiddly Cost=100 And I need to be able to find out what groups (the numbers in brackets) have matching values. So if I search Faction=Blahdiddly Group 1 & 3 will come up. I unfortunately have NO idea how to do this. Can anyone help?

    Read the article

  • Can I add a custom method to Core Data-generated classes?

    - by Andy
    I've got a couple of Core Data-generated class files that I'd like to add custom methods to. I don't need to add any instance variables. How can I do this? I tried adding a category of methods: // ContactMethods.h (my category on Core Data-generated "Contact" class) #import "Contact.h" @interface Contact (ContactMethods) -(NSString*)displayName; @end ... // ContactMethods.m #import "ContactMethods.h" @implementation Contact (ContactMethods) -(NSString*)displayName { return @"Some Name"; // this is test code } @end This doesn't work, though. I get a compiler message that "-NSManagedObject may not respond to 'displayName' " and sure enough, when I run the app, I don't get "Some Name" where I should be seeing it.

    Read the article

  • iOS Development: Can I store an array of integers in a Core Data object without creating a new table to represent the array?

    - by BeachRunnerJoe
    Hello. I'm using Core Data and I'm trying to figure out the simplest way to store an array of integers in one of my Core Data entities. Currently, my entities contain various arrays of objects that are more complex than a single number, so it makes sense to represent those arrays as tables in my DB and attach them using relationships. If I want to store a simple array of integers, do I need to create a new table with a single column and attach it using a one-to-many relationship? Or is there a more simple way? Thanks in advance for your wisdom!

    Read the article

  • How to place a symbol (path) relative to the far end of svg text?

    - by dugeen
    I'm working on a program which generates SVG maps. Some of the map items have captions which need a symbol after them (like a plane symbol for an airport caption). If I have a text element thus <text x="30" y="30">Pericles</text> I can place another bit of text at the next character position by saying <text x="30" y="30">Pericles <tspan>!</tspan></text> but I'd like to draw my own symbol at that position with a <path> element. What I'm doing at the moment is having the generating program guess the extent of the text from tables of font metrics etc, but this isn't accurate enough to place the symbol consistently. Is there any way round this - like specifying a <marker> to be used when drawing the text, and using a tspan with an invisible dash in it or something to get the marker placed?

    Read the article

  • Jquery .text() seems not to work on XML in IE7

    - by volder
    My PHP backend sends XML response to the client (ajax): <response> <code>0</code> <message>OK</message> </response> in the javascript I'm trying to get CODE value in this way: var errorCode = $('code', xml).text(); and then depending on errorCode value I do processing. It is working fine in all browsers I tested except IE7. Instead of CODE value - it is giving me the empty string. The problem is not in 0 value, because I tried to use 5 as a code for example - the result was the same. Any ideas, because I'm stuck with :(( Thanks.

    Read the article

  • Full Text Search MSSQL2008 show wrong display_item for Thai Language

    - by ensecoz
    I am working on MSSQL2008. My task is to investigate the issue that why FTS cannot find the right result for Thai. First, I am having the table which enable the FTS on the column 'ItemName' which is nvarchar. The Catalog is created with the Thai Language. Note that, Thai language is one of the language that doesn't separate the word by space so '????' '???' '????' are written like this in the sentence '???????????' In the table, there are many rows that include the word (????) for examples row#1 (ItemName: '???????????') On the webpage, I try to search for '????' but SQLServer cannot find it. So I try to investigate it by trying the following query in SQLServer select * from sys.dm_fts_parser(N'"???????????"', 1054, 0, 0) To see how the words are broken. The first one is the text to be break. The second parameter is specify that using Thai (WorkBreaker, so on). and here is the result: row#1 (display_item: '????', source_item: '???????????') row#2 (display_item: '????', source_item: '???????????') row#3 (display_item: '??', source_item: '???????????') Notice that the first and second row display the worng display_item '?' in the '????' isn't even Thai characters. '?' in '????' is not Thai charater either. So the question is where is those alien characters come from? I guess this i why I cannot search for '????' because the word breaker is mis-borken and keeping the wrong character in the indexes. Please help!

    Read the article

< Previous Page | 42 43 44 45 46 47 48 49 50 51 52 53  | Next Page >