Search Results

Search found 8167 results on 327 pages for 'general tapioca'.

Page 188/327 | < Previous Page | 184 185 186 187 188 189 190 191 192 193 194 195  | Next Page >

  • bash tips needed for understanding how to escape characters in command-line

    - by Jesper Rønn-Jensen
    My knowledge of commandline bash is missing on a particular area: I constantly forget how to properly escape characters. Today I wanted to echo this string into a file: #!/bin/env bash python -m SimpleHTTPServer echo "#!/bin/env bash\npython -m SimpleHTTPServer" server.sh && chmod +x server.sh -bash: !/bin/env: event not found That's right: Remember to escape ! or bash will think it's a special bash event command. But I can't get the escaping right! \! yields \! in the echoed string, and so does \\!. Furthermore, \n will not translate to a line break. Do you have some general tips that makes it easier for me to understand escaping rules? To be very precise, I'll accept an answer which tells me which characters I should escape on the bash command line? Including how to correctly output newline and exclamation mark in my example.

    Read the article

  • how to extract elements from a list in python ?

    - by Stefano Borini
    I feel suddenly uneasy of not being able to perform this operation easily. It could be that I'm tired, or that there's really no way (google didn't help), but... if you have a list in python, and want to extract element at indices say 1, 2 and 5 into a new list, how do you do ? This is how I did it, but I'm not very satisfied >>> a [10, 11, 12, 13, 14, 15] >>> [x[1] for x in enumerate(a) if x[0] in [1,2,5]] [11, 12, 15] any better way ? more in general, given a tuple with indices, how to use this tuple to extract the corresponding elements from a list, eventually with duplication (e.g. tuple (1,1,2,1,5) produces [11,11,12,11,15] )

    Read the article

  • pubsub link with Project Rome

    - by itsadok
    I want to use Project Rome to create an RSS feed, using the code from the tutorial as base. I would like to add a pubsubhubbub discovery link, but there doesn't seem to be a general way to do so. I can use a Link object if I create an atom feed (which I don't want to limit myself to), or I can just add foreign markup, like this: // import org.jdom.Element Element element = new Element("link"); element.setAttribute("rel", "hub"); element.setAttribute("href", "https://myhub.example.com/endpoint"); feed.setForeignMarkup(Arrays.asList(element)); But it feels ugly. Is this really the best way to do this?

    Read the article

  • How should I handle pages that move to a new url with regards to search engines?

    - by Anders Juul
    Hi all, I have done some refactoring on a asp.net mvc application already deployed to a live web site. Among the refactoring was moving functionality to a new controller, causing some urls to change. Shortly after the various search engine robots start hammering the old urls. What is the right way to handle this in general? Ignore it? In time the SEs should find out that they get nothing but 400 from the old urls. Block old urls with robots.txt? Continue to catch the old urls, then redirect to new ones? Users navigating the site would never get the redirection as the urls are updated through-out the new version of the site. I see it as garbage code - unless it could be handled by some fancy routing? Other? As always, all comments welcome... Thanks, Anders, Denmark

    Read the article

  • Date and timezone using j2me

    - by joynes
    Hi everyone! I have a date string as input from an rss like: Wed, 23 Dec 2009 13:30:14 GMT I want to fetch only the time-part, but it should be correct according to the my timezone. Ie, in Sweden the output should be: 14:30:14 What is the best way? I want it to work with other RSS date formats as well if possible. Im using regexp right now but that is not very general. Im having a hard time finding any library or support for dates and timezones in j2me? /Br Johannes

    Read the article

  • Are there any widespread, modern Java coding conventions?

    - by brianegge
    Sun's "Code Conventions for the Java Programming Language" was last updated April 1999. Ten years later a lot has changed in the language, as well as general usage patterns. Are there more up to date, widely adopted standards? Most guidelines omit specifying file encoding and line endings. Sun recommends mixed tabs and spaces. The Eclipse IDE defaults to Eclipse's standard, which is tabs only. The Maven style guide is spaces only. Many style guides, such as JBoss, follow Sun's guidelines, but prefer K&R braces instead of OTBS. Each Apache project has it's own style guide, with slight differences between each one.

    Read the article

  • Dynamically generate XPath expression using XML data

    - by iHeartGreek
    Hi! I would like to dynamically create XPath expressions in an XSL determined by data in an XML file. (i.e. the XML data is "concatenated" to create an XPath expression). Example of XML data: AAA BBB CCC Example of how I would like the XPath expression to look like: //AAA | //BBB | //CCC And this dynamic generation needs to be done in an XSL file. I am fairly new to XSL (and family) and would appreciate some general direction on how to tackle this problem. Thanks!

    Read the article

  • iPhone - Bug using CADisplayLink and UIControls - bad to mix openGL and UIControls?

    - by Adam
    Having had problems using other methods, I've decided to stick with CADisplayLink to run my game loop. The animation is smooth now, but sometimes there's a problem where the buttons and other UI elements can't be used, can't be accessed by touch or changed programmatically. This includes UIButtons and UILabels. Has anyone encountered this before? Is it not a good idea in general to use interface builder and uicontrols on top of an OpenGL view? I've heard they don't play well together but haven't heard the reasons. Thanks!

    Read the article

  • Best practice to use MS Excel as a database

    - by Ying
    In office, it is popular to use MS Excel to store data. In most cases, the data is structured, which means it is suitable for a database. I know peole prefer MS Excel for it is easy to change the data structure and data value. So I have an idea to use MS Excel as a database IF people follow a general rule to store data. In other words, by a best practice to use MS Excel as a database. I have thought to use MS Access to store data, but it is expensive and not popular as MS Excel. I don't mind to buy such a solution, especially when it is for .Net platform. Any ideas or suggestions are welcome.

    Read the article

  • Django + Postgres: How to specify sequence for a field

    - by Giovanni Di Milia
    I have this model in django: class JournalsGeneral(models.Model): jid = models.AutoField(primary_key=True) code = models.CharField("Code", max_length=50) name = models.CharField("Name", max_length=2000) url = models.URLField("Journal Web Site", max_length=2000, blank=True) online = models.BooleanField("Online?") active = models.BooleanField("Active?") class Meta: db_table = u'journals_general' verbose_name = "Journal General" ordering = ['code'] def __unicode__(self): return self.name My problem is that in the DB (Postgres) the name of the sequence connected to jid is not journals_general_jid_seq as expected by Django but it has a different name. Is there a way to specify which sequence Django has to use for an AutoField? In the documentation I read I was not able to find an answer.

    Read the article

  • 'Generic' ViewModel

    - by Ian MacPherson
    Using EF 4, I have several subtypes of a 'Business' entity (customers, suppliers, haulage companies etc). They DO need to be subtypes. I am building a general viewmodel which calls into a service from which a generic repository is accessed. As I have 4 subtypes, it would be good to have a 'generic' viewmodel used for all of these. Problem is of course is that I have to call a specific type into my generic repository, for example: BusinessToRetrieve = _repository .LoadEntity<Customer>(o => o.CustomerID == customerID); It would be good to be able to call <SomethingElse>, somethingElse being one or other of the subtypes), otherwise I shall have to create 4 near identical viemodels, which seems a waste of course! The subtype entity name is available to the viewmodel but I've been unable to figure out how to make the above call convert this into a type. An issue with achieving what I want is that presumably the lambda expression being passed in wouldn't be able to resolve on a 'generic' call ?

    Read the article

  • Git and Mercurial - Compare and Contrast

    - by TM
    For a while now I've been using subversion for my personal projects. More and more I keep hearing great things about Git and Mercurial, and DVCS in general. I'd like to give the whole DVCS thing a whirl, but I'm not too familiar with either option. What are some of the differences between Mercurial and Git? Note that I'm not trying to find out which one is "best" or even which one I should start with. I'm mainly looking for key areas where they are similar and where they are different, because I am interested to know how they differ in terms of implementation and philosophy.

    Read the article

  • Following PHP coding of Wisdom

    - by justjoe
    i read some wisdom like this : Programmers are encouraged to be careful when using by-reference variables since they can negatively affect the readability and maintainability of the code. i make my own solution, such as give suffix such as _ref in every by-reference variables. so, if i have a variable named as $files_in_root, then i will add suffix and changes it name into $files_in_root_ref. As far my knowledge goes, this is a good solution. So, here come the question Is there any best-practice on choosing suffix for by-reference variable in PHP coder world ? Or do you have any ? In general, how do we sustain readability and maintainability on PHP project with more then 3000 line of code ? I hope PHP coder world has unwritten aggrement for first question, cause it will help spot a pattern on any source code.

    Read the article

  • Should one use < or <= in a for loop

    - by Eugene Katz
    If you had to iterate through a loop 7 times, would you use: for (int i = 0; i < 7; i++) or: for (int i = 0; i <= 6; i++) There are two considerations: performance readability For performance I'm assuming Java or C#. Does it matter if "less than" or "less than or equal to" is used? If you have insight for a different language, please indicate which. For readability I'm assuming 0-based arrays. UPD: My mention of 0-based arrays may have confused things. I'm not talking about iterating through array elements. Just a general loop. There is a good point below about using a constant to which would explain what this magic number is. So if I had "int NUMBER_OF_THINGS = 7" then "i <= NUMBER_OF_THINGS - 1" would look weird, wouldn't it.

    Read the article

  • Algorithm - Numbering for TOC (Table of Contents)

    - by belisarius
    I want to implement a VBA function to number Excel rows based upon the grouping depth of the row. But I think a general algorithm for generating TOCs is more interesting. The problem is: Given a list of "indented" lines such as One Two Three Four Five Six (the "indentation level" may be assumed to be known and part of the input data) To generate the following output: 1. One 1.1 Two 1.1.1 Three 1.1.1.1 Four 1.2 Five 2. Six Of course my code is up and running ... and also hidden under THWoS (The Heavy Weight of Shame)

    Read the article

  • Trilateration using 3 latitude and longitude points, and 3 distances

    - by nohat
    There exists an unknown target location (latitude and longitude co-ordinates). I have 3 latitude and longitude co-ordinate pairs and for each pair a distance in kilometers to the target location. How can I calculate the co-ordinates of the target location? For example, say I have the following data points 37.418436,-121.963477 0.265710701754km 37.417243,-121.961889 0.234592423446km 37.418692,-121.960194 0.0548954278262km What I'd like is what would the guts of the function that takes that as input and returns 37.417959,-121.961954 as output look like? I understand how to calculate the distance between two points, from http://www.movable-type.co.uk/scripts/latlong.html I understand the general principle that with three circles you get exactly one point of overlap. What I'm hazy on is the math needed to calculate that point with this input.

    Read the article

  • Generic Text Only printer driver mangles control codes

    - by Terry
    If an escape character (or most other characters < 0x20) is sent to the generic / text only printer it gets printed as a period. Using the code in the WinDDK is it possible to 'correct' this behaviour so that it passes it through unmodified? The general scenario for this is that some application ('user app') outputs a document to a windows printer. My application requires this data in plain text form and so what I do is run a generic / text only printer that talks to a virtual com port. This generally works fine except where the 'user app' outputs binary data to the print queue without using the correct mechanism (which seems to work fine on some printer drivers, such as the Epson POS ones, but not the generic / text only one). I've tried changing the print processor selection without success and also tried looking at the gtt files to see if I could readily map in these characters as though they were printable, but the minidriver tool won't let me do that. Any suggestions?

    Read the article

  • TeX on iPad compatible with Apple's policy?

    - by Yuji
    Hi, As a nerd, I think it would be nice to have a TeX editor on the iPad. But TeX is a Turing-complete language, and it is arguably a general-purpose compiler/interpreter. Does that make it unacceptable to the App Store? Furthermore, if somebody ports TeX compiler to javascript and runs inside WebKit, does it make acceptable to the App Store? FYI, here's the section of the developer's agreement: 3.3.2 An Application may not itself install or launch other executable code by any means, including without limitation through the use of a plug-in architecture, calling other frameworks, other APIs or otherwise. No interpreted code may be downloaded and used in an Application except for code that is interpreted and run by Apple's Published APIs and builtin interpreter(s).

    Read the article

  • Programming tests: are they relevant?

    - by BlackVoid
    Do online programming tests have any value (except for providing an evidence to potential employers) in terms of evaluating your knowledge, or a they too broad or too narrow in general? For examples, brainbench.com and similar websites. From my experience I have never found myself scoring particularly high, although I have many years of commercial experience and is doing great at work. These tests mostly refer to things I have never worked with (WebForms or ADO .Net, who works with ADO .Net directly anyway?), yet these tests claim to be C# tests. If you were hiring a programmer, would you consider online tests as an evidence of real skill?

    Read the article

  • ActiveX controls with old Delphi versions

    - by DamienD
    I'm testing a non visual ActiveX control based on a registered .ocx which I import into Delphi using the provided wizard. Then, I simply put the generated component on the main form of a new VCL application. Under old Delphi versions (D5 and D2007), when i launch the application, this raise an AV during the component initialization. with Delphi 2009 : no problem, the application starts smoothly. My questions are : Are there known enhancements of ActiveX management in recent Delphi versions which can explain this difference ? Can I suspect a bug in the ActiveX control, or can I consider the origin of the problem is from old Delphi versions ? I need to use this component (if tests OK) in D2007. Do you think that it is possible to correct the AV problem under D2007 by modifying the D2007 generated .tlb file (for example by trying to use the D2009 generated one) PS: the ActiveX control is not named, because my question is a general question about Delphi and ActiveX, not about a specific ActiveX control.

    Read the article

  • Is there a way to undo Mocha stubbing of any_instance in Test::Unit

    - by Craig Walker
    Much like this question, I too am using Ryan Bates's nifty_scaffold. It has the desirable aspect of using Mocha's any_instance method to force an "invalid" state in model objects buried behind the controller. Unlike the question I linked to, I'm not using RSpec, but Test::Unit. That means that the two RSpec-centric solutions there won't work for me. Is there a general (ie: works with Test::Unit) way to remove the any_instance stubbing? I believe that it's causing a bug in my tests, and I'd like to verify that.

    Read the article

  • OpenLayers: Raise event when map is zoomed or moved by user

    - by David Pfeffer
    I'm using OpenLayers to display OpenStreetMap maps. (Though, I'd assume this should be general enough to work for any map product...) I'm displaying some very sophisticated vector overlays, and the amount and resolution of the features I'm returning from the server via GeoJSON to overlay has proven too much for many computers. What I'd like to do now instead is to only send data befitting the resolution of the current zoom, and fitting the current view port. This should be relatively easy to do using the GetResolution and CalculateBounds methods on the Map object. However, I don't know when to call these methods because I can't find a way to register a function to be called when the user pans the map (changing the view port) or zooms the map (changing the resolution and view port). How can I get a callback when the user pans or zooms the map?

    Read the article

  • Appscript to write iTunes artwork

    - by Kartik Aiyer
    I'm trying to capture artwork from a pict file and embed into a track on iTunes using python appscript. I did something like this: imFile = open('/Users/kartikaiyer/temp.pict','r') data = imFile.read() it = app('iTunes') sel = it.current_track.get() sel.artworks[0].data_.set(data[513:]) I get an error OSERROR: -1731 MESSAGE: Unknown object Similar applescript code looks like this: tell application "iTunes" set the_artwork to read (POSIX file "/Users/kartikaiyer/temp.pict") from 513 as picture set data of artwork 1 of current track to the_artwork end tell I tried using ASTranslate but it never instantiates 'the_artwork' and then throws an error when there is a reference to the_artwork. Can anyone help. I'm new to appscript and python in general.

    Read the article

  • Using Django Admin for a custom database solution

    - by Prashanth Ellina
    A client wants to have a simple intranet application to manage his process. He runs a Quarry and wishes to track number of loads delivered per day and associated activities. Since I knew about Django's excellent Admin interface, I figured I could define the "Schema" in models.py and have Django Admin generate the forms. I did exactly that and the result is not bad at all. I've been able to customize the look and feel to suit the client's taste. Some questions: Is Django Admin the right choice for such a use-case? Will I run to problems in the future due to flexibility of the framework? Is there a better framework out there specifically designed for this use-case (general Database management for small businesses)? I prefer ones written in Python since I can hack it up to customize. Thanks!

    Read the article

  • Polymorphism in SQL database tables?

    - by Patrick Daryll Glandien
    I currently have multiple tables in my database which consist of the same 'basic fields' like: name character varying(100), description text, url character varying(255) But I have multiple specializations of that basic table, which is for example that tv_series has the fields season, episode, airing, while the movies table has release_date, budget etc. Now at first this is not a problem, but I want to create a second table, called linkgroups with a Foreign Key to these specialized tables. That means I would somehow have to normalize it within itself. One way of solving this I have heard of is to normalize it with a key-value-pair-table, but I do not like that idea since it is kind of a 'database-within-a-database' scheme, I do not have a way to require certain keys/fields nor require a special type, and it would be a huge pain to fetch and order the data later. So I am looking for a way now to 'share' a Primary Key between multiple tables or even better: a way to normalize it by having a general table and multiple specialized tables.

    Read the article

< Previous Page | 184 185 186 187 188 189 190 191 192 193 194 195  | Next Page >