Search Results

Search found 289 results on 12 pages for 'benjamin metz'.

Page 9/12 | < Previous Page | 5 6 7 8 9 10 11 12  | Next Page >

  • Perl code -need some understanding.

    - by benjamin button
    Hi i have a perl code below: foreach (@tmp_cycledef) { chomp; my ($cycle_code, $close_day, $first_date) = split(/\|/, $_,3); $cycle_code =~ s/^\s*(\S*(?:\s+\S+)*)\s*$/$1/; $close_day =~ s/^\s*(\S*(?:\s+\S+)*)\s*$/$1/; $first_date =~ s/^\s*(\S*(?:\s+\S+)*)\s*$/$1/; #print "$cycle_code, $close_day, $first_date\n"; $cycledef{$cycle_code} = [ $close_day, split(/-/,$first_date) ]; } the value of tmp_cycledef comes from output of an sql query: select cycle_code,cycle_close_day,to_char(cycle_first_date,'YYYY-MM-DD') from cycle_definition d order by cycle_code; can anybody tell me what exactly is happening inside the for loop? thanks in advance.

    Read the article

  • How do I check SQLite3 syntax?

    - by Benjamin Oakes
    Is there a way to check the syntax of a SQLite3 script without running it? Basically, I'm looking for the SQLite3 equivalent of ruby -c script.rb, perl -c script.pl, php --syntax-check script.php, etc. I've thought of using explain, but most of the scripts I'd like to check are kept around for reference purposes (and don't necessarily have an associated database). Using explain would also make it hard to use with something like Syntastic. (That is, I'm only wanting to check syntax, not semantics.)

    Read the article

  • Is there a chance that sending an email via a thread could ever fail to complete?

    - by Benjamin Dell
    I have a project where I send a couple of emails via a seperet thread, to speed up the process for the end-user. It works successfully, but i was just wondering whether there were any potfalls that i might not have considered? My greatest fear is that the user clicks a button, it says that the message has been sent (as it will have been sent to the thread for sending) but for some reason the thread might fail to send it. Are there any situations where a thread could be aborted prematurely? Please note, that i am not talking about network outages or obvious issues with an email recipient not existing. For simplicites sake please assume that the connect is up, the mail server alive and the recipient valid. Is it possible, for example, for the thread to abort prematurely if the user kills the browser before the thread has completed? This might be a silly question, but i just wanted to make sure i knew the full ramifications of using a thread in this manner. Thanks, in advance, for your help.

    Read the article

  • Ideas for designing an automated content tagging system needed

    - by Benjamin Smith
    I am currently designing a website that amongst other is required to display and organise small amounts of text content (mainly quotes, article stubs, etc.). I currently have a database with 250,000+ items and need to come up with a method of tagging each item with relevant tags which will eventually allow for easy searching/browsing of the content for users. A very simplistic idea I have (and one that I believe is employed by some sites that I have been looking to for inspiration (http://www.brainyquote.com/quotes/topics.html)), is to simply search the database for certain words or phrases and use these words as tags for the content. This can easily be extended so that if for example a user wanted to show all items with a theme of love then I would just return a list of items with words and phrases relating to this theme. This would not be hard to implement but does not provide very good results. For example if I were to search for the month 'May' in the database with the aim of then classifying the items returned as realting to the topic of Spring then I would get back all occurrences of the word May, regardless of the semantic meaning. Another shortcoming of this method is that I believe it would be quite hard to automate the process to any large scale. What I really require is a library that can take an item, break it down and analyse the semantic meaning and also return a list of tags that would correctly classify the item. I know this is a lot to ask and I have a feeling I will end up reverting to the aforementioned method but I just thought I should ask if anyone knew of any pre-existing solution. I think that as the items in the database are short then it is probably quite a hard task to analyse any meaning from them however I may be mistaken. Another path to possibly go down would be to use something like amazon turk to outsource the task which may produce good results but would be expensive. Eventually I would like users to be able to (and want to!) tag content and to vote for the most relevant tags, possibly using a gameification mechanic as motivation however this is some way down the line. A temporary fix may be the best thing if this were the route I decided to go down as I could use the rough results I got as the starting point for a more in depth solution. If you've read this far, thanks for sticking with me, I know I'm spitballing but any input would be really helpful. Thanks.

    Read the article

  • storing an integral value in a pointer variable while declaration

    - by benjamin button
    int main() { int *d=0; printf("%d\n",*d); return 0; } this works fine. >cc legal.c > ./a.out 0 if i change the statement int *d=0; to int *d=1; i see the error. cc: "legal.c", line 6: error 1522: Cannot initialize a pointer with an integer constant other than zero. so its obvious that it will allow only zero.i want to know what happens inside the memory when we do this int *d=0 which is making it valid syntax. I am just asking this out of curiosity!

    Read the article

  • Is there an equivalent for ActiveRecord#find_by equivalent for C#?

    - by Benjamin Manns
    I'm originally a C# developer (as a hobby), but as of late I have been digging into Ruby on Rails and I am really enjoying it. Right now I am building an application in C# and I was wondering if there is any collection implementation for C# that could match (or "semi-match") the find_by method of ActiveRecord. What I am essentially looking for is a list that would hold Rectangles: class Rectangle { public int Width { get; set; } public int Height { get; set; } public String Name { get; set; } } Where I could query this list and find all entries with Height = 10, Width = 20, or name = "Block". This was done with ActiveRecord by doing a call similar to Rectangle.find_by_name('Block'). The only way I can think of doing this in C# is to create my own list implementation and iterate through each item manually checking each item against the criteria. I fear I would be reinventing the wheel (and one of poorer quality). Any input or suggestions is much appreciated.

    Read the article

  • What production-ready SaaS (recurring billing) solutions are available for Rails?

    - by Benjamin Manns
    I am working on a software-as-a-service (SaaS) application and I am looking for a billing plugin of some sort that will manage my subscriptions, customers, and recurring billing. There is the RailsKits SaaS kit ($249.00), but I prefer to use open source software. I have also found maccman's saasy, but the phrase "At the moment this is alpha code - use at your own risk" makes me a tad bit nervous.

    Read the article

  • What's happening in this Perl foreach loop?

    - by benjamin button
    I have this Perl code: foreach (@tmp_cycledef) { chomp; my ($cycle_code, $close_day, $first_date) = split(/\|/, $_,3); $cycle_code =~ s/^\s*(\S*(?:\s+\S+)*)\s*$/$1/; $close_day =~ s/^\s*(\S*(?:\s+\S+)*)\s*$/$1/; $first_date =~ s/^\s*(\S*(?:\s+\S+)*)\s*$/$1/; #print "$cycle_code, $close_day, $first_date\n"; $cycledef{$cycle_code} = [ $close_day, split(/-/,$first_date) ]; } The value of tmp_cycledef comes from output of an SQL query: select cycle_code,cycle_close_day,to_char(cycle_first_date,'YYYY-MM-DD') from cycle_definition d order by cycle_code; What exactly is happening inside the for loop?

    Read the article

  • Is it possible to include JButton in a JTable?

    - by Benjamin Confino
    I have a JTable that stores the results of a database query, so far so good. What I want is for the last column in each table to have a clickible JButton that will open the edit screen for the object represented in that row, and that means the button will need to know the details of the first column in the table from its own row (the ID from the database). Any advice? I already tried just adding JButtons but they turned into Text when I tried to run it.

    Read the article

  • Preserving indentation when inserting HTML from MySQL

    - by Benjamin
    I am using MySQL and PHP to populate parts of a site, often with HTML stored in a TEXT field. I like to keep my HTML indented so that the source is neat and easy to read, for example: <body> <div> <p>Blahblah</p> </div> </body> However, when the HTML is pulled from MySQL, I end up with: <body> <div> <p>Blahblahblah</p> </div> </body> This is quite ugly when there is a large amount of HTML being inserted into a DIV that is significantly indented. How can I stop this from happening? FYI, I use wordwrap() to keep each line from being too long.

    Read the article

  • Use of the element iframe in xhtml 1.1

    - by Noel Benjamin DCosta
    Please, I am not a programmer, all I want to do is use iframes on my wordpress blog which is validating as xhtml 1.1. If I use the iframe I am not validating. I get the error element "iframe" undefined Amazon.com, widgets and astore links all come as framesets or iframes. Can someone help me please.

    Read the article

  • Upcasting without any added data fields.

    - by Benjamin Manns
    In my project I have a generic Packet class. I would like to be able to upcast to other classes (like LoginPacket or MovePacket). The base class contains a command and arguments (greatly simplified): public class Packet { public String Command; public String[] Arguments; } I would like to have be able to convert from Packet to LoginPacket (or any other) based on a check if Packet.Command == "LOGIN". The login packet would not contain any new data members, but only methods for accessing specific arguments. For example: public class LoginPacket : Packet { public String Username { get { return Arguments[0]; } set { Arguments[0] == value; } } public String Password { get { return Arguments[1]; } set { Arguments[1] == value; } } } It would be great if I could run a simple code that would cast from Packet to LoginPacket with something like LoginPacket _Login = (LoginPacket)_Packet;, but that throws a System.InvalidCastException. It seems like this would be an easy task, as no new data is included, but I can't figure out any other way than copying everything from the Packet class to a new LoginPacket class.

    Read the article

  • How to inline a function for only release build.

    - by Benjamin
    // common.h // This is foo funtion. It has a body. __inline void foo() { /* something */ } // a.cpp #include "common.h" // for foo function // Call foo // b.cpp #include "common.h" // for foo function // Call foo I would like to inline the foo function only when I build for release. -I dont want to inline functions for Debug build. I tried it but linker errors annoyed me. In this case, foo function's body is defined in common.h header file. so if I just do //common.h #if !defined(_DEBUG) __inline #endif void foo() { /* something */ } I will be met a link error in DEBUG build. Because two modules try to include common.h. I have no idea to solve it. Is it possible?

    Read the article

  • Reading web-service information from assembly app.config file

    - by Benjamin Ortuzar
    I have a plugin architecture solution written in .NET C# 3.5, where each plug-in is an assembly loaded by the main project. Each plug-in connects to a different web-service, so I would like to have the configuration of that plugin in its own plugin.dll.config file instead of having it in the app.config of the main project. I have been looking around and I saw that i could load from each class its own config file: // Get the application configuration file. System.Configuration.Configuration config = ConfigurationManager.OpenMappedExeConfiguration(fileMap,userLevel) I see how that would help me get the basic settings from the appSettings section, but I cant see a way to read the web-service information stored in the plugin.dll.config file. Any help on how to approach this situation is very welcome.

    Read the article

  • Command line CSV viewer?

    - by Benjamin Oakes
    Anyone know of a command-line CSV viewer for Linux/OS X? I'm thinking of something like less but that spaces out the columns in a more readable way. (I'd be fine with opening it with OpenOffice Calc or Excel, but that's way too overpowered for just looking at the data like I need to.) Having horizontal and vertical scrolling would be great.

    Read the article

  • Is it bad practice to change state inside of an if statement?

    - by Benjamin
    I wrote some code that looks similar to the following: String SKIP_FIRST = "foo"; String SKIP_SECOND = "foo/bar"; int skipFooBarIndex(String[] list){ int index; if (list.length >= (index = 1) && list[0].equals(SKIP_FIRST) || list.length >= (index = 2) && (list[0] + "/" + list[1]).equals(SKIP_SECOND)){ return index; } return 0; } String[] myArray = "foo/bar/apples/peaches/cherries".split("/"); print(skipFooBarIndex(myArray); This changes state inside of the if statement by assigning index. However, my coworkers disliked this very much. Is this a harmful practice? Is there any reason to do it?

    Read the article

  • Using tarantula to test a Rails app

    - by Benjamin Oakes
    I'm using Tarantula to test a Rails app I'm developing. It works pretty well, but I'm getting some strange 404s. After looking into it, Tarantula is following DELETE requests (destroy actions on controllers) throughout my app when it tests. Since Tarantula gets the index action first (and seems to keep a list of unvisited URLs), it eventually tries to follow a link to a resource which it had deleted... and gets a 404. Tarantula is right that the URL doesn't exist anymore (because it deleted the resource itself). However, it's flagging it as an error -- that's hardly the behavior I would expect. I'm basically just using the Rails scaffolding and this problem is happening. How do I prevent Tarantula doing this? (Or, is there a better way of specifying the links?) Updates: Still searching, but I found a relevant thread here: http://github.com/relevance/tarantula/issues#issue/3 Seems to be coming from relying on JS too much, in a way (see also http://thelucid.com/2010/03/15/rails-can-we-please-have-a-delete-action-by-default/)

    Read the article

  • sql query need a help.

    - by benjamin button
    If i have a table with two fields.customer id and order. let's say i have in total order ID 1,2,3,4 all the customer can have all the four orders.like below 1234 1 1234 2 1234 3 1234 4 3245 3 3245 4 5436 2 5436 4 you can see above that 3245 customer doesnt have order id 1 and 2. how could i print in the query output like 3245 1 3245 2 5436 1 5436 3 EDIT: i dont order table but i have list of order's like we can hard code it in the query(1,2,3,4) i dont have an orders table.

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12  | Next Page >