Daily Archives

Articles indexed Thursday May 6 2010

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

  • filter to reverse lines of a text file

    - by Greg Hewgill
    I'm writing a small shell script that needs to reverse the lines of a text file. Is there a standard filter command to do this sort of thing? My specific application is that I'm getting a list of Git commit identifiers, and I want to process them in reverse order: git log --pretty=oneline work...master | grep -v DEBUG: | cut -d' ' -f1 | reverse The best I've come up with is to implement reverse like this: ... | cat -b | sort -rn | cut -f2- This uses cat to number every line, then sort to sort them in descending numeric order (which ends up reversing the whole file), then cut to remove the unneeded line number. The above works for my application, but may fail in the general case because cat -b only numbers nonblank lines. Is there a better, more general way to do this?

    Read the article

  • Android Layout + Programming

    - by MD
    I'm trying to create a "scrollable" layout in Android. Even using developers.android.com, though, I feel a little bit lost at the moment. I'm somewhat new to Java, but not so much that I feel I should be having these issues--being new to Android is the bigger problem right now. The layout I'm trying to create should scroll in a sort of a "grid". I THINK what I'm looking for is the Gallery view, but I'm really lost as to how to implement it at the moment. I want it to "snap" to center the frame, like in the actual Gallery application. Essentially, if I had a photo gallery of 9 pictures, the idea is to scroll between them up/down AND side to side, in a 3x3 manner. Doesn't need to dynamically adjust, or anything like that, I just want a grid I can scroll through. I'm also not asking for anyone to give me explicit code for it--I'm trying to learn, more than anything. But pointing me in the right direction for helpful layout programming resources would be greatly appreciated, and confirming if it's a Gallery view I'm looking for would also be really helpful. Thanks in advance.

    Read the article

  • Generate Javadoc for interfaces only?

    - by ipkiss
    Hi, I am finding a way to write a script that I can generate javadoc for my program's Interfaces only (not for public classes). I have tried Eclipse built-in tool and even JAutodoc tool but have not been successful yet. Does anyone have some ideas, please? Thanks.

    Read the article

  • Stream a file to the HTTP response in Pylons

    - by Evgeny
    I have a Pylons controller action that needs to return a file to the client. (The file is outside the web root, so I can't just link directly to it.) The simplest way is, of course, this: with open(filepath, 'rb') as f: response.write(f.read()) That works, but it's obviously inefficient for large files. What's the best way to do this? I haven't been able to find any convenient methods in Pylons to stream the contents of the file. Do I really have to write the code to read a chunk at a time myself from scratch?

    Read the article

  • css div positioning question

    - by SoulieBaby
    Hi all, I have three divs with the following css: div#container { width: 780px; } div#photos { width: 780px; height: 300px; } div#content { position: relative; top: -106px; width: 780px; } <div id="container"> <div id="photos">photos are here</div> <div id="content">content goes here, but sits slightly on top of the photos layer content goes here, but sits slightly on top of the photos layer content goes here, but sits slightly on top of the photos layer content goes here, but sits slightly on top of the photos layer content goes here, but sits slightly on top of the photos layer content goes here, but sits slightly on top of the photos layer content goes here, but sits slightly on top of the photos layer content goes here, but sits slightly on top of the photos layer content goes here, but sits slightly on top of the photos layer content goes here, but sits slightly on top of the photos layer content goes here, but sits slightly on top of the photos layer content goes here, but sits slightly on top of the photos layer content goes here, but sits slightly on top of the photos layer content goes here, but sits slightly on top of the photos layer content goes here, but sits slightly on top of the photos layer content goes here, but sits slightly on top of the photos layer</div> </div> My problem is that because I've set the content layer to be top:-106px there's a big gap underneith, when I wanted the "container" div to end immediately after the "content" div. I tried setting margin-bottom: -106px on the "container" div but that didn't change the height of the "container" div.. The "content" div will have varied height as it's obviously for text, etc. Is there any way of making this work? Thanks in advance :)

    Read the article

  • How to know the formatting of Excel Cell

    - by Sathish
    Is it possible to figure out the Format of Excel cell i know there is .NumberFormat but it returns the formatting but not the type... basically i need to know if it is custom then it should return custom and if it is currency it should return Currency or any other datatype Please help me

    Read the article

  • Convert Line breaks to html break for all field getters in Symfony project

    - by Ben
    I am working on a Symfony project and I currently have this: <?php echo preg_replace('/\n/','<br />', $review->getComments()); ?> and would very much like to be able to make all getters add html line breaks so i don't have to pepper my code with preg_replace. the $object-getFieldname methods are work automatically so I am looking to extend this somewhere to globally add a new method. What is the best approach here?

    Read the article

  • SQLAuthority News SQL Server 2008 R2 Hosted Trial

    This is a bit old news but for me but it will new for many of you know. SQLPASS, Dell, Microsoft and MaximumASP has come together and build hosted environment for free to all of us to use and experiment with. Register now to try out up to seven labs: SQL Server 2008 R2 [...]...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • SQLAuthority News WirelessRouterSecurityandAttachedDevicesComplexPassword

    In the last four days (April 21-24), I have received calls from friends who told me that they have got strange emails from me. To my surprise, I did not send them any emails. I was not worried until my wife complained that she was not able to find one of the very important folders [...]...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Microsoft Advisory Services Engagement Scenario - BizTalk Server Solutions Design

    982880 ... Microsoft Advisory Services Engagement Scenario - BizTalk Server Solutions DesignThis RSS feed provided by kbAlerz.com.Visit kbAlertz.com to subscribe. It's 100% free and you'll be able to recieve e-mail or RSS updates for the technologies you pick from the Microsoft Knowledge Base....Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Microsoft Advisory Services Engagement Scenario - BizTalk Server Performance Issues

    982896 ... Microsoft Advisory Services Engagement Scenario - BizTalk Server Performance IssuesThis RSS feed provided by kbAlerz.com.Visit kbAlertz.com to subscribe. It's 100% free and you'll be able to recieve e-mail or RSS updates for the technologies you pick from the Microsoft Knowledge Base....Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • JPA Entity Manager resource handling

    - by chiragshahkapadia
    Every time I call JPA method its creating entity and binding query. My persistence properties are: <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/> <property name="hibernate.cache.provider_class" value="net.sf.ehcache.hibernate.SingletonEhCacheProvider"/> <property name="hibernate.cache.use_second_level_cache" value="true"/> <property name="hibernate.cache.use_query_cache" value="true"/> And I am creating entity manager the way shown below: emf = Persistence.createEntityManagerFactory("pu"); em = emf.createEntityManager(); em = Persistence.createEntityManagerFactory("pu").createEntityManager(); Is there any nice way to manage entity manager resource instead create new every time or any property can set in persistence. Remember it's JPA. See below binding log every time : 15:35:15,527 INFO [AnnotationBinder] Binding entity from annotated class: * 15:35:15,527 INFO [QueryBinder] Binding Named query: * = * 15:35:15,527 INFO [QueryBinder] Binding Named query: * = * 15:35:15,527 INFO [QueryBinder] Binding Named query: 15:35:15,527 INFO [QueryBinder] Binding Named query: 15:35:15,527 INFO [QueryBinder] Binding Named query: 15:35:15,527 INFO [QueryBinder] Binding Named query: 15:35:15,527 INFO [QueryBinder] Binding Named query: 15:35:15,527 INFO [QueryBinder] Binding Named query: 15:35:15,527 INFO [QueryBinder] Binding Named query: 15:35:15,527 INFO [EntityBinder] Bind entity com.* on table * 15:35:15,542 INFO [HibernateSearchEventListenerRegister] Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled. 15:35:15,542 INFO [NamingHelper] JNDI InitialContext properties:{} 15:35:15,542 INFO [DatasourceConnectionProvider] Using datasource: 15:35:15,542 INFO [SettingsFactory] RDBMS: and Real Application Testing options 15:35:15,542 INFO [SettingsFactory] JDBC driver: Oracle JDBC driver, version: 9.2.0.1.0 15:35:15,542 INFO [Dialect] Using dialect: org.hibernate.dialect.Oracle10gDialect 15:35:15,542 INFO [TransactionFactoryFactory] Transaction strategy: org.hibernate.transaction.JDBCTransactionFactory 15:35:15,542 INFO [TransactionManagerLookupFactory] No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recomm ended) 15:35:15,542 INFO [SettingsFactory] Automatic flush during beforeCompletion(): disabled 15:35:15,542 INFO [SettingsFactory] Automatic session close at end of transaction: disabled 15:35:15,542 INFO [SettingsFactory] JDBC batch size: 15 15:35:15,542 INFO [SettingsFactory] JDBC batch updates for versioned data: disabled 15:35:15,542 INFO [SettingsFactory] Scrollable result sets: enabled 15:35:15,542 INFO [SettingsFactory] JDBC3 getGeneratedKeys(): disabled 15:35:15,542 INFO [SettingsFactory] Connection release mode: auto 15:35:15,542 INFO [SettingsFactory] Default batch fetch size: 1 15:35:15,542 INFO [SettingsFactory] Generate SQL with comments: disabled 15:35:15,542 INFO [SettingsFactory] Order SQL updates by primary key: disabled 15:35:15,542 INFO [SettingsFactory] Order SQL inserts for batching: disabled 15:35:15,542 INFO [SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory 15:35:15,542 INFO [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory 15:35:15,542 INFO [SettingsFactory] Query language substitutions: {} 15:35:15,542 INFO [SettingsFactory] JPA-QL strict compliance: enabled 15:35:15,542 INFO [SettingsFactory] Second-level cache: enabled 15:35:15,542 INFO [SettingsFactory] Query cache: enabled 15:35:15,542 INFO [SettingsFactory] Cache region factory : org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge 15:35:15,542 INFO [RegionFactoryCacheProviderBridge] Cache provider: net.sf.ehcache.hibernate.SingletonEhCacheProvider 15:35:15,542 INFO [SettingsFactory] Optimize cache for minimal puts: disabled 15:35:15,542 INFO [SettingsFactory] Structured second-level cache entries: disabled 15:35:15,542 INFO [SettingsFactory] Query cache factory: org.hibernate.cache.StandardQueryCacheFactory 15:35:15,542 INFO [SettingsFactory] Statistics: disabled 15:35:15,542 INFO [SettingsFactory] Deleted entity synthetic identifier rollback: disabled 15:35:15,542 INFO [SettingsFactory] Default entity-mode: pojo 15:35:15,542 INFO [SettingsFactory] Named query checking : enabled 15:35:15,542 INFO [SessionFactoryImpl] building session factory 15:35:15,542 INFO [SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configured 15:35:15,542 INFO [UpdateTimestampsCache] starting update timestamps cache at region: org.hibernate.cache.UpdateTimestampsCache 15:35:15,542 INFO [StandardQueryCache] starting query cache at region: org.hibernate.cache.StandardQueryCache

    Read the article

  • Which way is more effective?

    - by Danny Chen
    I have a huge IEnumerable(suppose the name is myItems), which way is more effective? Solution 1: Filter it first then ForEach. Array.ForEach(myItems.Where(FILTER-IT-HERE).ToArray(),MY-ACTION); Solution 2: Do RETURN in MY-ACTION if the item is not up to the mustard. Array.ForEach(myItems.ToArray(),MY-ACTION-WITH-FILTER); Is one of them always better than another? Or any other good suggestions? Thanks in advance.

    Read the article

  • turning open source software into a consulting business ?

    - by sofreakinghigh
    just some general and specific questions about running a business which uses open source software and sells training, services, and other value added solutions utilizing the open source asset(s). 1) how much modification do you need to make to an existing open source software/framework to give a new brand ? open source (GPLv3) branding issues here.... for ex) Mambo and Joomla, i think they are pretty much same ? but they have different labels. 2) Is there a disadvantage of promoting open source software/framework/suite in hopes of selling value added services and solutions on top of the Open source asset ? 3) can Open source assets be marketing point for lowered Total Ownership Cost and transparency ? meaning, clients will not be using some mysterious, opaque proprietary asset ? 4) is competition fierce? cost of developing software is non existing because you are using an open source asset. barrier to entry is minimal ??

    Read the article

  • ExceptionPolicy.HandleException does not install Event Source for Logging in Registry if XBAP run ou

    - by Neo
    I am using the Logging Application Block (of Microsoft Enterprise Library) to log exceptions in the Event Viewer that occur in my WPF XBAP application. If I run the XBAP in the debugger from Visual Studio, an Event Source entry for my application is automatically created in the Registry at: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\MyApp This occurs at the point ExceptionPolicy.HandleException() is called. However, if I run the XBAP outside of the IDE directly from the file system or from its published location, the Registry entry isn't added. Therefore, no logging takes place. I can only assume this is a security issue with running XBAP applications and they do not have access to write to the Registry. Is this a setting within my project? Any idea on why this might be happening? Any help much appreciated.

    Read the article

  • Dynamic Collapsable Flow Chart Online

    - by Simon
    Been looking through a number of other related posts relating to flowchart software. I have been asked to put together a document outlining some of the typical problems our users encounter with our software product. What I would like to do, is create an interactive/online flowchart that lets users choose from 4-5 overall headings on whats wrong. Then for this to dynamically expand more choices on pinpointing the problem, and so on and so on, until they can get a resolution to their problem. The key thing that I have not been able to find in some of the flowchart software out there, is having the click + expand element. - I dont want all options to appear to the end-user in a huge flow chart as it will distract away from their specific issue. - I want them to be able to click away and go down a specific avenue that will end up giving them some good things to try, based on their decisions/clicks. I was originally thinking of perhaps putting something in Flex or Silverlight (ideally someone would have a template out there) but am now thinking of taking advantage of 3rd party (ideally free) software. This will need to be hosted in a browser. Any ideas?

    Read the article

  • Segmentation fault in strcpy

    - by Alien01
    consider the program below char str[5]; strcpy(str,"Hello12345678"); printf("%s",str); When run this program gives segmentation fault. But when strcpy is replaced with following, program runs fine. strcpy(str,"Hello1234567"); So question is it should crash when trying to copy to str any other string of more than 5 chars length. So why it is not crashing for "Hello1234567" and only crashing for "Hello12345678" ie of string with length 13 or more than 13. This program was run on 32 bit machine .

    Read the article

  • PHP retrieve external program data

    - by kaykun
    Hi, what I want to do is have a PHP script run a program and have it retrieve data somehow from it. For instance the program would parse data from a file and return the data for the PHP script to display. So far I know to call exec("Program.exe"); but would I have to make it create a file with the data then have the PHP script call fopen and get it that way? Is there a better way to do it? Thanks

    Read the article

  • NSKeyedArchiver on NSArray has large size overhead

    - by redguy
    I'm using NSKeyedArchiver in Mac OS X program which generates data for iPhone application. I found out that by default, resulting archives are much bigger than I expected. Example: NSMutableArray * ar = [NSMutableArray arrayWithCapacity:10]; for (int i = 0; i < 100000; i++) { NSString * s = [NSString stringWithFormat:@"item%06d", i]; [ar addObject:s]; } [NSKeyedArchiver archiveRootObject:ar toFile: @"NSKeyedArchiver.test"]; This stores 10 * 100000 = 1M bytes of useful data, yet the size of the resulting file is almost three megabytes. The overhead seems to be growing with number of items in the array. In this case, for 1000 items, the file was about 22k. "file" reports that it is a "Apple binary property list" (not the XML format). Is there an simple way to prevent this huge overhead? I wanted to use the NSKeyedArchiver for the simplicity it provides. I can write data to my own, non-generic, binary format, but that's not very elegant. Also, aggregating the data into large chunks and feeding these to the NSKeyedArchiver should work, but again, that kinda beats the point of using simple&easy&ready to use archiver. Am I missing some method call or usage pattern that would reduce this overhead?

    Read the article

  • What is 0x10 in decimal?

    - by Omar Abid
    I have the following code: SN.get_Chars(5) SN is a string so this should give the 5th Char Ok! Now i have another code but : SN.get_Chars(0x10) I wonder what 0x10 is? Is it a number? If it's so, then what is it in decimal notation?

    Read the article

  • Populate data and submit on external page

    - by joey m
    Hi, Is is possible to populate data on an external website (example mail.yahoo.com) and subsequently submit the page by using javascript executed from my own webpage? Or is there another way to do this. I am trying to figure out how to do an autologin function into external website. Thanks.

    Read the article

  • Syntax Error in MySql StoredProc

    - by karthik
    I am using the below stored proc in mysql to generate the insert statements. I am getting the following error : Script line: 4 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\’”\’,',’ifnull(‘,column_name,’,””)’,',\’”\’)')) INTO @S' at line 12 What would be the syntax problem in that ? DELIMITER $$ DROP PROCEDURE IF EXISTS `InsGen` $$ CREATE DEFINER=`root`@`localhost` PROCEDURE `InsGen`(in_db varchar(20),in_table varchar(20),in_file varchar(100)) BEGIN declare Whrs varchar(500); declare Sels varchar(500); declare Inserts varchar(2000); declare tablename varchar(20); set tablename=in_table; select tablename; # Comma separated column names – used for Select select group_concat(concat(‘concat(\’”\’,',’ifnull(‘,column_name,’,””)’,',\’”\’)')) INTO @Sels from information_schema.columns where table_schema=’test’ and table_name=tablename; # Comma separated column names – used for Group By select group_concat(‘`’,column_name,’`') INTO @Whrs from information_schema.columns where table_schema=’test’ and table_name=tablename; #Main Select Statement for fetching comma separated table values set @Inserts=concat(“select concat(‘insert into “, in_db,”.”,tablename,” values(‘,concat_ws(‘,’,”,@Sels,”),’);’) from “, in_db,”.”,tablename,” group by “,@Whrs, ” INTO OUTFILE ‘”, in_file ,”‘”); PREPARE Inserts FROM @Inserts; EXECUTE Inserts; END $$ DELIMITER ;

    Read the article

  • BizTalk Flat File Failed Message Routing

    - by alram
    I have found some broken threads across the web where people claim to be able to use receive shapes in an orchestration with XLANGMessage types to receive flat file schema files that could not be assembled into a specific xsd. I've attempted to set the messagetype in the receive shape as Microsoft.XLANGS.BaseTypes.XLANGMessage, but this basetype is not serializable. This then causes a build error. Is there an object type that can capture both XmlDocuments of well formed xml messages as well as malformed xml and non-assembled flat files?

    Read the article

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