Search Results

Search found 32 results on 2 pages for 'bravo'.

Page 1/2 | 1 2  | Next Page >

  • Putting a base in the middle

    - by PSteele
    From Eric Lippert's Blog: Here’s a crazy-seeming but honest-to-goodness real customer scenario that got reported to me recently. There are three DLLs involved, Alpha.DLL, Bravo.DLL and Charlie.DLL. The classes in each are: public class Alpha // In Alpha.DLL {   public virtual void M()   {     Console.WriteLine("Alpha");   } } public class Bravo: Alpha // In Bravo.DLL { } public class Charlie : Bravo // In Charlie.DLL {   public override void M()   {     Console.WriteLine("Charlie");     base.M();   } } Perfectly sensible. You call M on an instance of Charlie and it says “Charlie / Alpha”. Now the vendor who supplies Bravo.DLL ships a new version which has this code: public class Bravo: Alpha {   public override void M()   {     Console.WriteLine("Bravo");     base.M();   } } The question is: what happens if you call Charlie.M without recompiling Charlie.DLL, but you are loading the new version of Bravo.DLL? The customer was quite surprised that the output is still “Charlie / Alpha”, not “Charlie / Bravo / Alpha”. Read the full post for a very interesting discussion of the design of C#, the CLR, method resolution and more. Technorati Tags: .NET,C#,CLR

    Read the article

  • Need help limiting a join in Transact-sql

    - by MsLis
    I'm somewhat new to SQL and need help with query syntax. My issue involves 2 tables within a larger multi-table join under Transact-SQL (MS SQL Server 2000 Query Analyzer) I have ACCOUNTS and LOGINS, which are joined on 2 fields: Site & Subset. Both tables may have multiple rows for each Site/Subset combination. ACCOUNTS: | LOGINS: SITE SUBSET FIELD FIELD FIELD | SITE SUBSET USERID PASSWD alpha bravo blah blah blah | alpha bravo foo bar alpha charlie blah blah blah | alpha bravo bar foo alpha charlie bleh bleh blue | alpha charlie id ego delta bravo blah blah blah | delta bravo john welcome delta foxtrot blah blah blah | delta bravo jane welcome | delta bravo ken welcome | delta bravo barbara welcome I want to select all rows in ACCOUNTS which have LOGIN entries, but only 1 login per account. DESIRED RESULT: SITE SUBSET FIELD FIELD FIELD USERID PASSWD alpha bravo blah blah blah foo bar alpha charlie blah blah blah id ego alpha charlie bleh bleh blue id ego delta bravo blah blah blah jane welcome I don't really care which row from the login table I get, but the UserID and Password have to correspond. [Don't return invalid combinations like foo/foo or bar/bar] MS Access has a handy FIRST function, which can do this, but I haven't found an equivalent in TSQL. Also, if it makes a difference, other tables are joined to ACCOUNTS, but this is the only use of LOGINS in the structure. Thank you very much for any assistance.

    Read the article

  • E-learning, VPN décentralisé et voitures connectées gagnent le concours de start-ups de l'Epitech : bravo aux jeunes développeurs

    E-learning, VPN décentralisé et voitures connectées gagnent le concours 2012 de start-ups de l'Epitech Créées par de jeunes développeurs Chaque année, l'Epitech organise un concours de création d'entreprise (baptisé EIP) auquel participent ses étudiants en 4ème et 5ème année. Le but est de leur mettre le pied à l'étrier et de leur faire toucher du doigt tous les impératifs (marketing, communication, partenariat, etc.) qu'ils seront amenés à gérer dans le monde du travail et des affaires. A la clef, en moyenne 15% des étudiants deviennent de « vrais » entrepreneurs. Pour l'école il s'agit évidemment d'une formidable vitrine pour rappeler que l'esprit d'initiative est au coeur de sa pédagogi...

    Read the article

  • How to rebase onto a private branch with conflicts in gerrit/git?

    - by edwardmlyte
    Aim: I want to rebase commit G from "bravo", onto commit F from "alpha". From this: G bravo / D--E--F alpha / A--B--C mainline To this: G bravo / D--E--F alpha / A--B--C mainline "alpha" has been successfully rebased onto the latest mainline work. I cherry-pick "alpha" onto C. And when I cherry-pick "bravo", it comes up with all the merge conflicts. Once I fix those, if I do commit --amend The commit message just has all the information for alpha, whereas I'd expect the information for bravo. So I tried again after hard resetting to C, doing pull (as oppose to cherry-pick) for alpha and then pull bravo. Fixed the conflicts and just ran: commit The commit message just lists it as a merge and has merge information. Though the commit succeeds, I can't push this to gerrit as it says I don't have the rights to push merges. When I've read about rebase, it's always just to mainline, but I want to rebase private branches. Where am I going wrong?

    Read the article

  • ruby xmpfilter on windows

    - by dreftymac
    Has anyone out there ever gotten xmpfilter to work on windows? xmpfilter "unterminated string meets end of file" is the error. The only Google hit is in Japanese: google://xmpfilter "unterminated string meets end of file" http://www.unkar.org/read/pc12.2ch.net/tech/1249687283 For background, the desired feature from xmpfilter is to get automatic "eval" annotations of Ruby sourcecode: Before: a = "bravo alpha charlie" # => b = a.split # => b.sort! # => After: a = "bravo alpha charlie" # => "bravo alpha charlie" b = a.split # => ["bravo", "alpha", "charlie"] b.sort! # => ["alpha", "bravo", "charlie"]

    Read the article

  • How to Elegantly convert switch+enum with polymorphism

    - by Kyle
    I'm trying to replace simple enums with type classes.. that is, one class derived from a base for each type. So for example instead of: enum E_BASE { EB_ALPHA, EB_BRAVO }; E_BASE message = someMessage(); switch (message) { case EB_ALPHA: applyAlpha(); case EB_BRAVO: applyBravo(); } I want to do this: Base* message = someMessage(); message->apply(this); // use polymorphism to determine what function to call. I have seen many ways to do this which all seem less elegant even then the basic switch statement. Using dyanimc_pointer_cast, inheriting from a messageHandler class that needs to be updated every time a new message is added, using a container of function pointers, all seem to defeat the purpose of making code easier to maintain by replacing switches with polymorphism. This is as close as I can get: (I use templates to avoid inheriting from an all-knowing handler interface) class Base { public: template<typename T> virtual void apply(T* sandbox) = 0; }; class Alpha : public Base { public: template<typename T> virtual void apply(T* sandbox) { sandbox->applyAlpha(); } }; class Bravo : public Base { public: template<typename T> virtual void apply(T* sandbox) { sandbox->applyBravo(); } }; class Sandbox { public: void run() { Base* alpha = new Alpha; Base* bravo = new Bravo; alpha->apply(this); bravo->apply(this); delete alpha; delete bravo; } void applyAlpha() { // cout << "Applying alpha\n"; } void applyBravo() { // cout << "Applying bravo\n"; } }; Obviously, this doesn't compile but I'm hoping it gets my problem accross.

    Read the article

  • MYSQL Merging 2 results into 1 table

    - by AlphaRomeo69
    Im building a c# program and am currently stuck at fetching data from MYSQL database and bind them to a grid view. I had been researching for a few days now but to no avail. I have 4 table in the database. table 1 - alpha table 2 - bravo table 3 - charlie table 4 - delta attributes of alpha (id, type, user, role ) attributes of bravo (id, type, date, user) attributes of charlie (id,type, cat, doneby, comment) atttibutes of delta (id,type, cat, doneby) * the pk of alpha and bravo is (id) * the pk of charlie and delta is (id, type) i did a query1 before by inner joinning alpha, bravo and charlie which leads to the sucessful result of (id, type, date, user, role, cat, doneby, comment) and i also did a query2 before by inner joinning alpha, bravo and delta which leads to the sucessful result of (id, type, date, user, role, cat, doneby) Right now, im trying to built a query3 which will merge the result from query1 and query2 together. the result of my attempts leads to (id, type, date, user, role, cat, doneby, comment,id, type, date, user, role, cat, doneby) As i do not want the repeated columns, I would like to seek advice on how to get the result to become like the one below by placing the records as a new tuple in the result table. (id, type, date, user, role, cat, doneby, comment) Thanks! P.S: the PK would not pose a problem due to (id, type)

    Read the article

  • how to templatize partial template specializations?

    - by Kyle
    I'm not even sure what title to give this question; hopefully the code will demonstrate what I'm trying to do: #include <string> #include <list> using namespace std; template<typename A> class Alpha { public: A m_alpha_a; }; template<typename B> class Bravo { public: B m_bravo_b; }; template<> class Alpha<string> { public: string m_alpha_string; }; template<typename B> template<> class Alpha<Bravo<B> > { public: Bravo<B> m_bravo_class; // Line A }; int main() { Alpha<int> alpha_int; alpha_int.m_alpha_a= 4; Alpha<string> alpha_string; alpha_string.m_alpha_string = "hi"; Alpha<Bravo<int> > alpha_bravo_int; alpha_bravo_int.m_bravo_class.m_bravo_b = 9; }; I want to write a specialization for Alpha<A> when A is of any type Bravo<B>, but the compiler says invalid explicit specialization before ‘’ token enclosing class templates are not explicitly specialized (Referring to // Line A.) What's the correct syntax to do what I want?

    Read the article

  • Why upgrade from LTS to a X.10 version

    - by Roberto Bravo
    recently in an OMGubuntu's article i saw some comments about the reason of the selection of ubuntu 12.10 over 12.04 LTS for the new System76's All in One. One of the comments said more or less "Why using 12.10 with 1.5 years of support over the 5 years the LTS offer?". Until now i thought the X.10 version was more complete, but with this point of view of the LTS, the LTS will in some moment be more complete than 12.10 i guess. Should i stick with the LTS or upgrade to 12.10 and why?

    Read the article

  • postfix relaying all mail through office365 problems

    - by amrith
    This is a rather long question with a long list of things tried and travails so please bear with me. The summary is this. I am able to relay email from ubuntu through office365 using postfix; the configuration works. It only works as one of the users; more specifically the user who authenticates against office365 is the only valid "from" More details follow. I have a machine in Amazon's cloud on which I run a bunch of jobs and would like to have statuses mailed over to me. I use office365 at work so I want to relay mail through office365. I'm most familiar with postfix so I used that as the MTA. Configuration is ubuntu 12.04LTS; I've installed postfix and mail-utils. For this example, let me say my company is "company.com" and the machine in question (through an elastic IP and a DNS entry) is called "plaything.company.com". hostname is set to "plaything.company.com", so is /etc/mailname On plaything, I have the following users registered alpha, bravo, and charlie. I have the following configuration files. alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases append_dot_mydomain = no biff = no config_directory = /etc/postfix inet_interfaces = all inet_protocols = ipv4 mailbox_size_limit = 0 mydestination = plaything.company.com, localhost.company.com, , localhost myhostname = plaything.company.com mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 myorigin = /etc/mailname readme_directory = no recipient_delimiter = + relayhost = [smtp.office365.com]:587 sender_canonical_maps = hash:/etc/postfix/sender_canonical smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_sasl_security_options = noanonymous smtp_sasl_tls_security_options = noanonymous smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache smtp_use_tls = yes smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtpd_use_tls = yes As the machine is called plaything.company.com I went through the exercise of registering all the appropriate DNS entries to make office365 recognize that I owned plaything.company.com and allowed me to create a user called [email protected] in office365. In office365, I setup [email protected] as having another email address of [email protected]. Then, I made the following sender_canonical [email protected] [email protected] I created a sasl_passwd file that reads: smtp.office365.com [email protected]:123456password123456 let's just say that the password for [email protected] is 1234...456 With all this setup, login as alpha and mail [email protected] Cc: Subject: test test and the whole thing works wonderfully. email gets sent off by postfix, TLS works like a champ, authenticates as daemon@... and [email protected] in Office365 gets an email message. The issue comes up when logged in as bravo to the machine. sender is [email protected] and office365 says: status=bounced (host smtp.office365.com[132.245.12.25] said: 550 5.7.1 Client does not have permissions to send as this sender (in reply to end of DATA command)) this is because I'm trying to send mail as bravo@... and authenticating with office365 as daemon@.... The reason it works with alpha@... is because in office365, I setup [email protected] as having another email address of [email protected]. In Postfix Relay to Office365, Miles Erickson answers the question thusly: Don't send mail to Office365 as a user from your Office365-hosted e-mail domain. Use a subdomain instead, e.g. [email protected] instead of [email protected]. It wouldn't hurt to set up an SPF record for services.mydomain.com or whatever you decide to use. Don't authenticate against mail.messaging.microsoft.com as an Office365 user. Just connect on port 25 and deliver the mail to your domain as any foreign SMTP agent would do. OK, I've done #1, I have those records on DNS but for the most part they are not relevant once Office365 recognizes that I own the domain. Here are those records: CNAME records: - msoid.plaything.company.com - autodiscover.plaything.company.com MX record: - plaything.company.com (plaything-company-com.mail.protection.outlook.com) TXT record: - plaything.company.com (v=spf1 include:spf.protection.outlook.com -all) I've tried #2 but no matter what I do, office365 just blows away the connection with "not authenticated". I can try even a simple telnet to port 25 and attempt to send and it doesn't work. 250 BY2PR01CA007.outlook.office365.com Hello [54.221.245.236] 530 5.7.1 Client was not authenticated Connection closed by foreign host. Is there someone out there who has this kind of a configuration working where multiple users on a linux machine are able to relay mail using postfix through office365? There has to be someone out there doing this who can tell me what is wrong with my setup ...

    Read the article

  • What is the proper use of boost::fusion::push_back?

    - by Kyle
    // ... snipped includes for iostream and fusion ... namespace fusion = boost::fusion; class Base { protected: int x; public: Base() : x(0) {} void chug() { x++; cout << "I'm a base.. x is now " << x << endl; } }; class Alpha : public Base { public: void chug() { x += 2; cout << "Hi, I'm an alpha, x is now " << x << endl; } }; class Bravo : public Base { public: void chug() { x += 3; cout << "Hello, I'm a bravo; x is now " << x << endl; } }; struct chug { template<typename T> void operator()(T& t) const { t->chug(); } }; int main() { typedef fusion::vector<Base*, Alpha*, Bravo*, Base*> Stuff; Stuff stuff(new Base, new Alpha, new Bravo, new Base); fusion::for_each(stuff, chug()); // Mutates each element in stuff as expected /* Output: I'm a base.. x is now 1 Hi, I'm an alpha, x is now 2 Hello, I'm a bravo; x is now 3 I'm a base.. x is now 1 */ cout << endl; // If I don't put 'const' in front of Stuff... typedef fusion::result_of::push_back<const Stuff, Alpha*>::type NewStuff; // ... then this complains because it wants stuff to be const: NewStuff newStuff = fusion::push_back(stuff, new Alpha); // ... But since stuff is now const, I can no longer mutate its elements :( fusion::for_each(newStuff, chug()); return 0; }; How do I get for_each(newStuff, chug()) to work? (Note: I'm only assuming from the overly brief documentation on boost::fusion that I am supposed to create a new vector every time I call push_back.)

    Read the article

  • The eval(base64_decode()) virus has infected a server. Would removing executable permissions help solve the issue?

    - by Bravo.I
    The eval(base64_decode()) has infected a server. This is a PHP virus that uses the eval function in PHP and replicates itself to all the PHP files on the system as far as I'm certain. Would removing executable permissions help solve the problem?! Please answer really fast, and also, if you've got any better ideas on how to stop this virus.. I'm all ears. The virus has replicated itself to several folders in the directory and most of the other folders are actually several other websites...

    Read the article

  • jquery ajax post not working with .load in codeigniter

    - by bravo
    i wish to .load multiple views result with jquery ajax the original code (js) $(document).ready(function(){ $("#uid").change( function(){ var uid=$("#uid").val(); $.ajax({ type: "POST", url: "<?= site_url('sp_profile/ajax_userdetail') ?>", dataType: "json", data: "uid="+uid, cache:false, success: function(data){ $("#content").html(data); } }); return false; }); }); this return only one result in what if i want to load 3 results like in <div id="content"></div> <div id="content1"></div> <div id="content2"></div> content could be userid content2 could be user first name content3 could be user last name my js should using .load instead of html right? let me know if i'm wrong. success: function(data){ $("#content").load("<?= site_url('sp_profile/ajax_userdetail')?>"); $("#content2").load("<?= site_url('sp_profile/ajax_userdetail')?>"); $("#content3").load("<?= site_url('sp_profile/ajax_userdetail')?>"); } i stuck with this thing for whole day.. please anyone show me the right way to do the controller and js code.

    Read the article

  • $where in mongodb web shell not working

    - by Bravo
    i have the below set of test documents which i inserted in to the mongodb and when i use to query the db using the $where get the below exception Error: database error: $where query, but no script engine Any idea why the $where clause not working test data : db.things.save({ "_id" : 1, "domainName" : "test11.com", "hosting" : "hostgator.com" }) db.things.save({ "_id" : 2, "domainName" : "test2.com", "hosting" : "aws.amazon.com"}) db.things.save({ "_id" : 3, "domainName" : "test3.com", "hosting" : "aws.amazon.com" }) db.things.save({ "_id" : 4, "domainName" : "test4.com", "hosting" : "hostgator.com" }) db.things.save({ "_id" : 5, "domainName" : "test5.com", "hosting" : "aws.amazon.com" }) db.things.save({ "_id" : 6, "domainName" : "test6.com", "hosting" : "cloud.google.com" }) db.things.save({ "_id" : 7, "domainName" : "test7.com", "hosting" : "aws.amazon.com" }) db.things.save({ "_id" : 8, "domainName" : "test8.com", "hosting" : "hostgator.com" }) db.things.save({ "_id" : 9, "domainName" : "test9.com", "hosting" : "cloud.google.com" }) db.things.save({ "_id" : 10, "domainName" : "test10.com", "hosting" : "godaddy.com" }) query used : db.things.find( { $where: "this.domainName == 'test11.com'" } );

    Read the article

  • Describe repeating XML nodes in W3C XML Schema?

    - by NotMyName
    I have an XML document like: <Root> <Bravo /> <Alpha /> <Charlie /> <Charlie /> <Delta /> <Foxtrot /> <Charlie /> </Root> The order of the nodes does not matter. Each node may appear zero or one times, except for Charlie. Charlie may appear zero, one, or arbitrarily many times. The straightforward way to express this in XSD is: <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="Root"> <xsd:complexType> <xsd:all> <xsd:element name="Alpha" minOccurs="0" maxOccurs="1" /> <xsd:element name="Bravo" minOccurs="0" maxOccurs="1" /> <xsd:element name="Charlie" minOccurs="0" maxOccurs="unbounded" /> <xsd:element name="Delta" minOccurs="0" maxOccurs="1" /> <xsd:element name="Echo" minOccurs="0" maxOccurs="1" /> <xsd:element name="Foxtrot" minOccurs="0" maxOccurs="1" /> </xsd:all> </xsd:complexType> </xsd:element> </xsd:schema> But this does not work, because xsd:all does not allow for maxOccurs greater than 1. Since I cannot use xsd:all, what should I use?

    Read the article

  • How do I use price data in one table for a calculation that is stored in another table?

    - by shane
    I'm still leanring PHP/MySQL but have learned quite a bit thanks to codies on StackOverflow. I'm trying to setup a sort of room reservations system using two tables: SETUP: Room price table: Has, prices for a type room a client may want to rent as well as the dates (day of week) they wish to use it. Pricing varies based on day of the week and per room. I've setup a different table for each room type as each room type carries different pricing for each day of the week. So, There is an Alpha room table, Bravo room, etc. Within Alpha table are headers for the days of the week with pricing pre-entered into the rows. Client info table: Has the name, address, date of room use, etc data for the specific client. EXAMPLE: Alpha-room price table: Sun = $100; Mon = $200; Tue=$300 and so on. Bravo-room price table: Sun = $100; Mon = $200; Tue=$300 and so on. Client data table: ClientName; date-of-room-use; address; day_subtotal; grand_total. QUESTION: I'm trying to find PHP code that will: look at the date of room use in the client data table, look up the associated cost for that date in the specific room pricing table, record that unit cost in the day subtotal of the client data table and sum a grand total in the grand total row of the client data table (assuming the room may be used more than one day by the customer). I know there's something to do with join but I'm finding it difficult to grasp the concept and, if someone can demonstrate using this example, I think I will have a better understanding of how to work this sort of transaction. Thank you ALL in advance for your suggestions or alternatvie approaches.

    Read the article

  • Send array of string using tcp

    - by user2798455
    I'm not sure if this is possible but here it goes. Usually I send strings like this... Connection.IOHandler.WriteLn('alpha'); Connection.IOHandler.WriteLn('bravo'); Connection.IOHandler.WriteLn('charley'); //and so on.. But what if I want to send it in just one go, just send it all at once. Maybe I could put it on an array of strings then send the array. someStr : array[1..3] of string = ('alpha','bravo','charley');//this could be more ... StrListMem := TMemoryStream.Create; try StrListMem.WriteBuffer(someStr[0], Length(someStr)); StrListMem.Position:=0; Connection.IOHandler.Write(StrListMem, 0, True); finally StrListMem.Free; end; I just have no idea how to this right, maybe somebody can give an example? and how the receiver(client) will read it.

    Read the article

  • International Radio Operators Alphabet in F# &amp; Silverlight &ndash; Part 1

    - by MarkPearl
    So I have been delving into F# more and more and thought the best way to learn the language is to write something useful. I have been meaning to get some more Silverlight knowledge (up to now I have mainly been doing WPF) so I came up with a really simple project that I can actually use at work. Simply put – I often get support calls from clients wanting new activation codes. One of our main app’s was written in VB6 and had its own “security” where it would require about a 45 character sequence for it to be activated. The catch being that each time you reopen the program it would require a different character sequence, which meant that when we activate clients systems we have to do it live! This involves us either referring them to a website, or reading the characters to them over the phone and since nobody in the office knows the IROA off by heart we would come up with some interesting words to represent characters… 9 times out of 10 the client would type in the wrong character and we would have to start all over again… with this app I am hoping to reduce the errors of reading characters over the phone by treating it like a ham radio. My “Silverlight” application will allow for the user to input a series of characters and the system will then generate the equivalent IROA words… very basic stuff e.g. Character Input – abc Words Generated – Alpha Bravo Charlie After listening to Anders Hejlsberg on Dot Net Rocks Show 541 he mentioned that he felt many applications could make use of F# but in an almost silo basis – meaning that you would write modules that leant themselves to Functional Programming in F# and then incorporate it into a solution where the front end may be in C# or where you would have some other sort of glue. I buy into this kind of approach, so in this project I will use F# to do my very intensive “Business Logic” and will use Silverlight/C# to do the front end. F# Business Layer I am no expert at this, so I am sure to get some feedback on way I could improve my algorithm. My approach was really simple. I would need a function that would convert a single character to a string – i.e. ‘A’ –> “Alpha” and then I would need a function that would take a string of characters, convert them into a sequence of characters, and then apply my converter to return a sequence of words… make sense? Lets start with the CharToString function let CharToString (element:char) = match element.ToString().ToLower() with | "1" -> "1" | "5" -> "5" | "9" -> "9" | "2" -> "2" | "6" -> "6" | "0" -> "0" | "3" -> "3" | "7" -> "7" | "4" -> "4" | "8" -> "8" | "a" -> "Alpha" | "b" -> "Bravo" | "c" -> "Charlie" | "d" -> "Delta" | "e" -> "Echo" | "f" -> "Foxtrot" | "g" -> "Golf" | "h" -> "Hotel" | "i" -> "India" | "j" -> "Juliet" | "k" -> "Kilo" | "l" -> "Lima" | "m" -> "Mike" | "n" -> "November" | "o" -> "Oscar" | "p" -> "Papa" | "q" -> "Quebec" | "r" -> "Romeo" | "s" -> "Sierra" | "t" -> "Tango" | "u" -> "Uniform" | "v" -> "Victor" | "w" -> "Whiskey" | "x" -> "XRay" | "y" -> "Yankee" | "z" -> "Zulu" | element -> "Unknown" Quite simple, an element is passed in, this element is them converted to a lowercase single character string and then matched up with the equivalent word. If by some chance a character is not recognized, “Unknown” will be returned… I know need a function that can take a string and can parse each character of the string and generate a new sequence with the converted words… let ConvertCharsToStrings (s:string) = s |> Seq.toArray |> Seq.map(fun elem -> CharToString(elem)) Here… the Seq.toArray converts the string to a sequence of characters. I then searched for some way to parse through every element in the sequence. Originally I tried Seq.iter, but I think my understanding of what iter does was incorrect. Eventually I found Seq.map, which applies a function to every element in a sequence and then creates a new collection with the adjusted processed element. It turned out to be exactly what I needed… To test that everything worked I created one more function that parsed through every element in a sequence and printed it. AT this point I realized the the Seq.iter would be ideal for this… So my testing code is below… let PrintStrings items = items |> Seq.iter(fun x -> Console.Write(x.ToString() + " ")) let newSeq = ConvertCharsToStrings("acdefg123") PrintStrings newSeq Console.ReadLine()   Pretty basic stuff I guess… I hope my approach was right? In Part 2 I will look into doing a simple Silverlight Frontend, referencing the projects together and deploying….

    Read the article

  • How do I add a column that displays the number of distinct rows to this query?

    - by Fake Code Monkey Rashid
    Hello good people! I don't know how to ask my question clearly so I'll just show you the money. To start with, here's a sample table: CREATE TABLE sandbox ( id integer NOT NULL, callsign text NOT NULL, this text NOT NULL, that text NOT NULL, "timestamp" timestamp with time zone DEFAULT now() NOT NULL ); CREATE SEQUENCE sandbox_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER SEQUENCE sandbox_id_seq OWNED BY sandbox.id; SELECT pg_catalog.setval('sandbox_id_seq', 14, true); ALTER TABLE sandbox ALTER COLUMN id SET DEFAULT nextval('sandbox_id_seq'::regclass); INSERT INTO sandbox VALUES (1, 'alpha', 'foo', 'qux', '2010-12-29 16:51:09.897579+00'); INSERT INTO sandbox VALUES (2, 'alpha', 'foo', 'qux', '2010-12-29 16:51:36.108867+00'); INSERT INTO sandbox VALUES (3, 'bravo', 'bar', 'quxx', '2010-12-29 16:52:36.370507+00'); INSERT INTO sandbox VALUES (4, 'bravo', 'foo', 'quxx', '2010-12-29 16:52:47.584663+00'); INSERT INTO sandbox VALUES (5, 'charlie', 'foo', 'corge', '2010-12-29 16:53:00.742356+00'); INSERT INTO sandbox VALUES (6, 'delta', 'foo', 'qux', '2010-12-29 16:53:10.884721+00'); INSERT INTO sandbox VALUES (7, 'alpha', 'foo', 'corge', '2010-12-29 16:53:21.242904+00'); INSERT INTO sandbox VALUES (8, 'alpha', 'bar', 'corge', '2010-12-29 16:54:33.318907+00'); INSERT INTO sandbox VALUES (9, 'alpha', 'baz', 'quxx', '2010-12-29 16:54:38.727095+00'); INSERT INTO sandbox VALUES (10, 'alpha', 'bar', 'qux', '2010-12-29 16:54:46.237294+00'); INSERT INTO sandbox VALUES (11, 'alpha', 'baz', 'qux', '2010-12-29 16:54:53.891606+00'); INSERT INTO sandbox VALUES (12, 'alpha', 'baz', 'corge', '2010-12-29 16:55:39.596076+00'); INSERT INTO sandbox VALUES (13, 'alpha', 'baz', 'corge', '2010-12-29 16:55:44.834019+00'); INSERT INTO sandbox VALUES (14, 'alpha', 'foo', 'qux', '2010-12-29 16:55:52.848792+00'); ALTER TABLE ONLY sandbox ADD CONSTRAINT sandbox_pkey PRIMARY KEY (id); Here's the current SQL query I have: SELECT * FROM ( SELECT DISTINCT ON (this, that) id, this, that, timestamp FROM sandbox WHERE callsign = 'alpha' AND CAST(timestamp AS date) = '2010-12-29' ) playground ORDER BY timestamp DESC This is the result it gives me: id this that timestamp ----------------------------------------------------- 14 foo qux 2010-12-29 16:55:52.848792+00 13 baz corge 2010-12-29 16:55:44.834019+00 11 baz qux 2010-12-29 16:54:53.891606+00 10 bar qux 2010-12-29 16:54:46.237294+00 9 baz quxx 2010-12-29 16:54:38.727095+00 8 bar corge 2010-12-29 16:54:33.318907+00 7 foo corge 2010-12-29 16:53:21.242904+00 This is what I want to see: id this that timestamp count ------------------------------------------------------------- 14 foo qux 2010-12-29 16:55:52.848792+00 3 13 baz corge 2010-12-29 16:55:44.834019+00 2 11 baz qux 2010-12-29 16:54:53.891606+00 1 10 bar qux 2010-12-29 16:54:46.237294+00 1 9 baz quxx 2010-12-29 16:54:38.727095+00 1 8 bar corge 2010-12-29 16:54:33.318907+00 1 7 foo corge 2010-12-29 16:53:21.242904+00 1 EDIT: I'm using PostgreSQL 9.0.* (if that helps any).

    Read the article

  • Does any know fix/cause of USB drives that lose connection

    - by Burch Kealey
    I have been having significant problems trying to copy files to a USB drive (G0-Flex 1.5 tb) No matter what I use to try to copy the files (python code, Windows copy and paste or Drobo Copy utility) I ultimately get a failure. The failure is always some indication that the device is not ready or able to be written to. I am pretty sure the problem is that the drive is losing its connection. I have done everything I can find so far including setting the USB Root hub to never turn off the power, I updated some usb drivers etc. I have found references to this problem primarily with Win7-64 bit. I have also had USB connection problems with other devices- we kept losing a connection to our Bravo Disc Publisher when we went to Win7 and finally bought a newer model and have not had problems since. Any pointers about diagnosing and or understanding the problem would be appreciated.

    Read the article

  • Find Files That Contain Both Words in Notepad++

    - by SethO
    In Notepad++ (v5.9), I want to search for files which contain two words. For example, I would like to find all text files in a directory that have both Alpha and Bravo in the file. They may not be next to each other and they may have multiple occurrences of either. I just want to find the files that have at least one instance of each. Is there a way to structure this search without resorting to Regular Expressions? Thanks for the advice.

    Read the article

  • Using XNA's XML content pipeline to read arrays of objects with different subtypes

    - by Mcguirk
    Using XNA's XML content importer, is it possible to read in an array of objects with different subtypes? For instance, assume these are my class definitions: public abstract class MyBaseClass { public string MyBaseData; } public class MySubClass0 : MyBaseClass { public int MySubData0; } public class MySubClass1 : MyBaseClass { public bool MySubData1; } And this is my XML file: <XnaContent> <Asset Type="MyBaseClass[]"> <Item> <!-- I want this to be an instance of MySubClass0 --> <MyBaseData>alpha</MyBaseData> <MySubData0>314</MySubData0> </Item> <Item> <!-- I want this to be an instance of MySubClass1 --> <MyBaseData>bravo</MyBaseData> <MySubData1>true</MySubData1> </Item> </Asset> </XnaContent> How do I specify that I want the first Item to be an instance of MySubclass0 and the second Item to be an instance of MySubclass1?

    Read the article

  • Doctorii in bancuri

    - by interesante
    Un medic citeste in birou un ziar. Intra o pacienta si incepe sa-si ridice fusta. Medicul priveste si spune: "Mai sus!" si citeste mai departe. Ea ridica fusta mai sus. El ii repeta: "Mai sus!" si iarasi se intoarce la ziar. Ea il asculta si ridica fusta si mai sus. Atunci el ii spune: "Domnisoara, ginecologul e mai sus!".Medicul catre pacient: - Aveti o boala contagioasa extrem de rara. O sa fiti mutat intr-o camera separata si acolo veti minca numai pizza si clatite. - Si astea ma vor ajuta sa ma fac bine? - Nu, dar asta-i singura mincare care incape pe sub usaMai multe bancuri de acest fel pe un blog amuzant pentru toti.Buna ziua! - Buna ziua, domnule politist! - Dumneata, tinere domn, pe gheata asta conduci cu 70 km pe ora? Vrei sa ajungi la spital? - Da! - Bravo, frumos raspuns! Esti smecher? - Nu! Sunt doctor!

    Read the article

  • Being rocked...

    - by ZacHarlan
    After almost four and half years, I finally escaped from the world of telemarketing.     I'm now at a place that writes really good code, values testing, does routine code reviews, collaborates with each other so continuously and effectively somebody should make a documentary about it!   Today alone, I had two really smart and well respected developers go line by line through my code and show me how to make it better.  Seriously, people pay really good money for something like this and they don't get near the quality of feedback as I got!     +1 for me finally getting to a point in my career where i get to work with some of the best of the best in the software world!   I've been rocked by the fact that places like this actually exist.     I've been Rocked by the sheer size, complexity and simplicity of our website.     Most importantly I've been ROCKED by the fact that this many smart people check their egos at the door, gel together and look for ways to make software better than how they found it.  This is how to grow a business with tech... hire great people and watch them go!   Seriously, bravo.

    Read the article

  • How can I avoid floating the same content twice?

    - by Randall Bohn
    My Kynetx app uses float_html() to put up a box full of content. rule float_box { select when pageview ".*" pre { content = << <div id='messagebox'> <h3>Floating Message Box</h3> <ul id='my_list'></ul> </div> >>; } float_html("absolute","top:25px","right:20px",content); } rule fill_box { select when pageview ".*" foreach ["alpha","bravo","charlie"] setting (list_item) append("#my_list", "<li>#{list_item}</li>"); } The app (a421x27) is used from a bookmarklet. If you click the bookmarklet twice on the same page you get double content. Is there any way to detect that the box is already on the screen and reuse it?

    Read the article

1 2  | Next Page >