Search Results

Search found 150 results on 6 pages for 'roberto bravo'.

Page 5/6 | < Previous Page | 1 2 3 4 5 6  | Next Page >

  • Having Latest Tests Results info in the notified email with Hudson

    - by Roberto
    I have a project with a lot of tests failing, so it would be great for me to receive by email the number of failed tests compare from the latest build. What i need is just the info that appears in the project's page by the test results link: Latest Test Result (10 failures / -2) Is this possible? I've already tried the email-ext plugin, but it is not telling me that info (I can have the list of failing tests with output etc., but I really just need that info above). Any ideas?

    Read the article

  • Does the jQuery .unbind() method only work on jQuery created events?

    - by Roberto Sebestyen
    I am trying to unbind all event handlers for all elements that are inside a particular container. Like a DIV. But those events have been bound/registered not using jQuery. Some are bound the manual way with onclick="...." or using regular native JavaScript. But when i do something like this $('#TheDivContainer').find('div,td,tr,tbody,table').unbind(); It does not appear to work. Which leads me to believe that the .unbind() only works if the events have been originally bound by jQuery. Is that true? Is there another way of unbinding all events from a group of elements ? Thanks!

    Read the article

  • How to check if there is an active session in a JSF page?

    - by Roberto de Santis
    Hi, there is a way to check if there is an active session directly in jsf page? I have try this but it doesn't work: <p:ajaxStatus onerror="#{session == null ? 'idleDialog.show();' : null}" thank you in advance @Update I have see that onerror isn't fired even if viewExpiredException occurr. @Update 1 Ok i have implemented something that may work: <h:form> <p:idleMonitor timeout="10000" idleListener="#{idleMonitorController.idleListener}" onidle="sessionPoll.stop();idleDialog.show();"/> </h:form> <p:dialog header="Sessione scaduta per inattività" widgetVar="idleDialog" modal="true" width="400"> <h:outputText value="Sessione scaduta" /> <h:button value="Ripristina Sessione" onclick="idleDialog.hide();sessionPoll.start();" /> </p:dialog> <h:form prependId="false"> <p:poll widgetVar="sessionPoll" interval="1"/> </h:form> and this is the listner: public void idleListener(IdleEvent event) { System.out.println("aaaa"); final HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest(); request.getSession(false).invalidate(); } now the only problem is that the session.invalidate doesn't work

    Read the article

  • Very different IO performance in C/C++

    - by Roberto Tirabassi
    Hi all, I'm a new user and my english is not so good so I hope to be clear. We're facing a performance problem using large files (1GB or more) expecially (as it seems) when you try to grow them in size. Anyway... to verify our sensations we tryed the following (on Win 7 64Bit, 4core, 8GB Ram, 32 bit code compiled with VC2008) a) Open an unexisting file. Write it from the beginning up to 1Gb in 1Mb slots. Now you have a 1Gb file. Now randomize 10000 positions within that file, seek to that position and write 50 bytes in each position, no matter what you write. Close the file and look at the results. Time to create the file is quite fast (about 0.3"), time to write 10000 times is fast all the same (about 0.03"). Very good, this is the beginnig. Now try something else... b) Open an unexisting file, seek to 1Gb-1byte and write just 1 byte. Now you have another 1Gb file. Follow the next steps exactly same way of case 'a', close the file and look at the results. Time to create the file is the faster you can imagine (about 0.00009") but write time is something you can't believe.... about 90"!!!!! b.1) Open an unexisting file, don't write any byte. Act as before, ramdomizing, seeking and writing, close the file and look at the result. Time to write is long all the same: about 90"!!!!! Ok... this is quite amazing. But there's more! c) Open again the file you crated in case 'a', don't truncate it... randomize again 10000 positions and act as before. You're fast as before, about 0,03" to write 10000 times. This sounds Ok... try another step. d) Now open the file you created in case 'b', don't truncate it... randomize again 10000 positions and act as before. You're slow again and again, but the time is reduced to... 45"!! Maybe, trying again, the time will reduce. I actually wonder why... Any Idea? The following is part of the code I used to test what I told in previuos cases (you'll have to change someting in order to have a clean compilation, I just cut & paste from some source code, sorry). The sample can read and write, in random, ordered or reverse ordered mode, but write only in random order is the clearest test. We tryed using std::fstream but also using directly CreateFile(), WriteFile() and so on the results are the same (even if std::fstream is actually a little slower). Parameters for case 'a' = -f_tempdir_\casea.dat -n10000 -t -p -w Parameters for case 'b' = -f_tempdir_\caseb.dat -n10000 -t -v -w Parameters for case 'b.1' = -f_tempdir_\caseb.dat -n10000 -t -w Parameters for case 'c' = -f_tempdir_\casea.dat -n10000 -w Parameters for case 'd' = -f_tempdir_\caseb.dat -n10000 -w Run the test (and even others) and see... // iotest.cpp : Defines the entry point for the console application. // #include <windows.h> #include <iostream> #include <set> #include <vector> #include "stdafx.h" double RealTime_Microsecs() { LARGE_INTEGER fr = {0, 0}; LARGE_INTEGER ti = {0, 0}; double time = 0.0; QueryPerformanceCounter(&ti); QueryPerformanceFrequency(&fr); time = (double) ti.QuadPart / (double) fr.QuadPart; return time; } int main(int argc, char* argv[]) { std::string sFileName ; size_t stSize, stTimes, stBytes ; int retval = 0 ; char *p = NULL ; char *pPattern = NULL ; char *pReadBuf = NULL ; try { // Default stSize = 1<<30 ; // 1Gb stTimes = 1000 ; stBytes = 50 ; bool bTruncate = false ; bool bPre = false ; bool bPreFast = false ; bool bOrdered = false ; bool bReverse = false ; bool bWriteOnly = false ; // Comsumo i parametri for(int index=1; index < argc; ++index) { if ( '-' != argv[index][0] ) throw ; switch(argv[index][1]) { case 'f': sFileName = argv[index]+2 ; break ; case 's': stSize = xw::str::strtol(argv[index]+2) ; break ; case 'n': stTimes = xw::str::strtol(argv[index]+2) ; break ; case 'b':stBytes = xw::str::strtol(argv[index]+2) ; break ; case 't': bTruncate = true ; break ; case 'p' : bPre = true, bPreFast = false ; break ; case 'v' : bPreFast = true, bPre = false ; break ; case 'o' : bOrdered = true, bReverse = false ; break ; case 'r' : bReverse = true, bOrdered = false ; break ; case 'w' : bWriteOnly = true ; break ; default: throw ; break ; } } if ( sFileName.empty() ) { std::cout << "Usage: -f<File Name> -s<File Size> -n<Number of Reads and Writes> -b<Bytes per Read and Write> -t -p -v -o -r -w" << std::endl ; std::cout << "-t truncates the file, -p pre load the file, -v pre load 'veloce', -o writes in order mode, -r write in reverse order mode, -w Write Only" << std::endl ; std::cout << "Default: 1Gb, 1000 times, 50 bytes" << std::endl ; throw ; } if ( !stSize || !stTimes || !stBytes ) { std::cout << "Invalid Parameters" << std::endl ; return -1 ; } size_t stBestSize = 0x00100000 ; std::fstream fFile ; fFile.open(sFileName.c_str(), std::ios_base::binary|std::ios_base::out|std::ios_base::in|(bTruncate?std::ios_base::trunc:0)) ; p = new char[stBestSize] ; pPattern = new char[stBytes] ; pReadBuf = new char[stBytes] ; memset(p, 0, stBestSize) ; memset(pPattern, (int)(stBytes&0x000000ff), stBytes) ; double dTime = RealTime_Microsecs() ; size_t stCopySize, stSizeToCopy = stSize ; if ( bPre ) { do { stCopySize = std::min(stSizeToCopy, stBestSize) ; fFile.write(p, stCopySize) ; stSizeToCopy -= stCopySize ; } while (stSizeToCopy) ; std::cout << "Creating time is: " << xw::str::itoa(RealTime_Microsecs()-dTime, 5, 'f') << std::endl ; } else if ( bPreFast ) { fFile.seekp(stSize-1) ; fFile.write(p, 1) ; std::cout << "Creating Fast time is: " << xw::str::itoa(RealTime_Microsecs()-dTime, 5, 'f') << std::endl ; } size_t stPos ; ::srand((unsigned int)dTime) ; double dReadTime, dWriteTime ; stCopySize = stTimes ; std::vector<size_t> inVect ; std::vector<size_t> outVect ; std::set<size_t> outSet ; std::set<size_t> inSet ; // Prepare vector and set do { stPos = (size_t)(::rand()<<16) % stSize ; outVect.push_back(stPos) ; outSet.insert(stPos) ; stPos = (size_t)(::rand()<<16) % stSize ; inVect.push_back(stPos) ; inSet.insert(stPos) ; } while (--stCopySize) ; // Write & read using vectors if ( !bReverse && !bOrdered ) { std::vector<size_t>::iterator outI, inI ; outI = outVect.begin() ; inI = inVect.begin() ; stCopySize = stTimes ; dReadTime = 0.0 ; dWriteTime = 0.0 ; do { dTime = RealTime_Microsecs() ; fFile.seekp(*outI) ; fFile.write(pPattern, stBytes) ; dWriteTime += RealTime_Microsecs() - dTime ; ++outI ; if ( !bWriteOnly ) { dTime = RealTime_Microsecs() ; fFile.seekg(*inI) ; fFile.read(pReadBuf, stBytes) ; dReadTime += RealTime_Microsecs() - dTime ; ++inI ; } } while (--stCopySize) ; std::cout << "Write time is " << xw::str::itoa(dWriteTime, 5, 'f') << " (Ave: " << xw::str::itoa(dWriteTime/stTimes, 10, 'f') << ")" << std::endl ; if ( !bWriteOnly ) { std::cout << "Read time is " << xw::str::itoa(dReadTime, 5, 'f') << " (Ave: " << xw::str::itoa(dReadTime/stTimes, 10, 'f') << ")" << std::endl ; } } // End // Write in order if ( bOrdered ) { std::set<size_t>::iterator i = outSet.begin() ; dWriteTime = 0.0 ; stCopySize = 0 ; for(; i != outSet.end(); ++i) { stPos = *i ; dTime = RealTime_Microsecs() ; fFile.seekp(stPos) ; fFile.write(pPattern, stBytes) ; dWriteTime += RealTime_Microsecs() - dTime ; ++stCopySize ; } std::cout << "Ordered Write time is " << xw::str::itoa(dWriteTime, 5, 'f') << " in " << xw::str::itoa(stCopySize) << " (Ave: " << xw::str::itoa(dWriteTime/stCopySize, 10, 'f') << ")" << std::endl ; if ( !bWriteOnly ) { i = inSet.begin() ; dReadTime = 0.0 ; stCopySize = 0 ; for(; i != inSet.end(); ++i) { stPos = *i ; dTime = RealTime_Microsecs() ; fFile.seekg(stPos) ; fFile.read(pReadBuf, stBytes) ; dReadTime += RealTime_Microsecs() - dTime ; ++stCopySize ; } std::cout << "Ordered Read time is " << xw::str::itoa(dReadTime, 5, 'f') << " in " << xw::str::itoa(stCopySize) << " (Ave: " << xw::str::itoa(dReadTime/stCopySize, 10, 'f') << ")" << std::endl ; } }// End // Write in reverse order if ( bReverse ) { std::set<size_t>::reverse_iterator i = outSet.rbegin() ; dWriteTime = 0.0 ; stCopySize = 0 ; for(; i != outSet.rend(); ++i) { stPos = *i ; dTime = RealTime_Microsecs() ; fFile.seekp(stPos) ; fFile.write(pPattern, stBytes) ; dWriteTime += RealTime_Microsecs() - dTime ; ++stCopySize ; } std::cout << "Reverse ordered Write time is " << xw::str::itoa(dWriteTime, 5, 'f') << " in " << xw::str::itoa(stCopySize) << " (Ave: " << xw::str::itoa(dWriteTime/stCopySize, 10, 'f') << ")" << std::endl ; if ( !bWriteOnly ) { i = inSet.rbegin() ; dReadTime = 0.0 ; stCopySize = 0 ; for(; i != inSet.rend(); ++i) { stPos = *i ; dTime = RealTime_Microsecs() ; fFile.seekg(stPos) ; fFile.read(pReadBuf, stBytes) ; dReadTime += RealTime_Microsecs() - dTime ; ++stCopySize ; } std::cout << "Reverse ordered Read time is " << xw::str::itoa(dReadTime, 5, 'f') << " in " << xw::str::itoa(stCopySize) << " (Ave: " << xw::str::itoa(dReadTime/stCopySize, 10, 'f') << ")" << std::endl ; } }// End dTime = RealTime_Microsecs() ; fFile.close() ; std::cout << "Flush/Close Time is " << xw::str::itoa(RealTime_Microsecs()-dTime, 5, 'f') << std::endl ; std::cout << "Program Terminated" << std::endl ; } catch(...) { std::cout << "Something wrong or wrong parameters" << std::endl ; retval = -1 ; } if ( p ) delete []p ; if ( pPattern ) delete []pPattern ; if ( pReadBuf ) delete []pReadBuf ; return retval ; }

    Read the article

  • Under *nix, how can I find a string within a file within a directory ?

    - by roberto
    Hi all. I'm using ubuntu linux, and I use bash from with a terminal emulator every day for many tasks. I would like to know how to find a string or a substring within a file that is within a particular directory. If I was knew the file which contained my target substring, I would just cat the file and pipe it through grep, thus: cat file | grep mysubstring But in this case, the pesky substring could be anywhere within a known directory. How do I hunt down my substring ?

    Read the article

  • Using resources with the same name in Xcode

    - by Roberto
    Is there a way to add multiple resources with the same name to an Xcode project and have 1 of them take priority over the others? Example: I added 2 files, both called icon.png, to an Xcode project. They are on different folders in the file system (Folder1/icon.png and Folder2/icon.png) and on different groups in Xcode. Is there a way to tell Xcode to have Folder2/icon.png take priority over Folder1/icon.png? And if only 1 icon.png exists, then use that one. Thanks. EDIT (2010-12-23): You can have multiple files with the same name in an Xcode project even if they are not in separate folder references, but they are in separate groups. Once compiled, the app bundle (which will be flat with no folders in it), will only have one copy of the file (icon.png). How do you pick which copy of the file to use? I was told that you can do this for BlackBerry. It works something like this: The compiler will go down the list of files in the project and start adding them to the app bundle. If it sees a duplicate, it will overwrite it (or not), so the files at the bottom (or at the top) will have higher precedence and will be the final bundle.

    Read the article

  • query on custom field via webservice

    - by Roberto Parrotto
    I customized the content of Defect in my Rally workspace adding a new custom field. This custom field is of type string, its name is CustomTest and its display name is CustomAttribute. I added the value "test" on a defect, but I can't create a working query on that custom field (I'm developing in Java and using the ws api for rally). the query I tried are String query8 = "(CustomAttribute = \"test\")"; String query9 = "(CustomAttribute = \"test\")";

    Read the article

  • C# ToolTip will not re-appear after first use.

    - by Roberto Sebestyen
    I have a Forms C# application where I would like to use a toolTip on one of the text boxes. I Initialize the tool-tip in the constructor of the Form class, and it works the first time. So when I hover over the text box with my mouse it works, but once the toolTip times out and it goes away, it does not re-appear when I move my mouse away and back onto the control. I would expect it to come back and I'm wondering what I'm doing wrong. Here is how I initialize the tooltip: myTip = new ToolTip(); myTip.ToolTipIcon = ToolTipIcon.Info; myTip.IsBalloon = true; myTip.ShowAlways = true; myTip.SetToolTip(txtMyTextBox,"My Tooltip Text");

    Read the article

  • Adding International support in Erlang Web 1.4

    - by Roberto Aloi
    I'm trying to add international support for a website based on the Erlang Web 1.4. I would like to have a couple of links on every page (the notorious Country flags) that allow the user to set his language session variable. What I have right now is a link like: <li><a href="/session/language/en">English</a></li> Where, in the session controller I do: language(Args) -> LanguageId = proplists:get_value(id, Args), case language_is_supported(LanguageId) of false -> ok; true -> wpart:fset("session:lang", LanguageId) end, {redirect, "/"}. The problem is that, after setting the preferred language, I would like the user to be redirected to the page he was visiting before changing the language. In this case the "__path" variable doesn't help because it contains the language request and not the "previous" one. How could I resolve this situation? I'm probably using the wrong approach but I cannot thing to anything else right now.

    Read the article

  • p:commandButton update doesn't work in ui:include

    - by Roberto de Santis
    Hi guys. I want to update a part of a page by PPR. This is the part of page that i want to update: <h:panelGroup id="aggiungiAuto" rendered="#{!autoBean.operazioneOk}"> <ui:include src="../component/aggiungi_auto.xhtml"/> </h:panelGroup> While this is the commandButton present in aggiungi_auto.xhtml <p:commandButton value="Submit" update="growl aggiungiAuto aggiungiFoto" actionListener="#{autoBean.insert}"/> Any Idea?

    Read the article

  • How to strongly type properties in JavaScript that map to models in C# ?

    - by Roberto Sebestyen
    I'm not even sure if I worded the question right, but I'll try and explain as clearly as possible with an example: In the following example scenario: 1) Take a class such as this: public class foo { public string firstName {get;set;} public string lastName {get;set} } 2) Serialize that into JSON, pass it over the wire to the Browser. 3) Browser de-serializes this and turns the JSON into a JavaScript object so that you can then access the properties like this: var foo = deSerialize("*******the JSON from above**************"); alert(foo.firstName); alert(foo.lastName); What if now a new developer comes along working on this project decides that firstName is no longer a suitable property name. Lets say they use ReSharper to rename this property, since ReSharper does a pretty good job at finding (almost) all the references to the property and renaming them appropriately. However ReSharper will not be able to rename the references within the JavaScript code (#3) since it has no way of knowing that these also really mean the same thing. Which means the programmer is left with the responsibility of manually finding these references and renaming those too. The risk is that if this is forgotten, no one will know about this error until someone tests that part of the code, or worse, slip through to the customer. Back to the actual question: I have been trying to think of a solution to this to some how strongly type these property names when used in javascript, so that a tool like ReSharper can successfully rename ALL usages of the property? Here is what I have been thinking for example (This would obviously not work unless i make some kind of static properties) var foo = deSerialize("*******the JSON from above**************"); alert(foo.<%=foo.firstName.GetPropertyName()%>) alert(foo.<%=foo.lastName.GetPropertyName()%>) But that is obviously not practical. Does anyone have any thoughts on this? Thanks, and kudos to all of the talented people answering questions on this site.

    Read the article

  • Force to call virtual base function instead of the overriden one.

    - by Roberto Sebestyen
    In the following example "Test that v1 function was called" fails. Is there a way to force call the base implementation of "RunFunction" through an instance of "class V2" ?? class V1 { public virtual string RunFunction() { return "V1"; } } class V2 : V1 { public override string RunFunction() { return "V2"; } } [Test] public void TestCall() { var v1 = (V1)new V2(); var v2 = new V2(); Assert.IsTrue(v1.RunFunction() == "V1", "Test that v1 function was called"); Assert.IsTrue(v2.RunFunction() == "V2", "Test that v2 function was called"); }

    Read the article

  • static_cast from Derived* to void* to Base*

    - by Roberto
    I would like to cast a pointer to a member of a derived class to void* and from there to a pointer of the base class, like in the example below: #include <iostream> class Base { public: void function1(){std::cout<<"1"<<std::endl;} virtual void function2()=0; }; class Derived : public Base { public: virtual void function2(){std::cout<<"2"<<std::endl;} }; int main() { Derived d; void ptr* = static_cast<void*>(&d); Base* baseptr=static_cast<Base*>(ptr); baseptr->function1(); baseptr->function2(); } This compiles and gives the desired result (prints 1 and 2 respectively), but is it guaranteed to work? The description of static_cast I found here: http://en.cppreference.com/w/cpp/language/static_cast only mentions conversion to void* and back to a pointer to the same class (point 10).

    Read the article

  • Silverlight Cream for February 09, 2011 -- #1044

    - by Dave Campbell
    In this Issue: Vikas, Tony Champion, Peter Kuhn, Ollie Riches, Rich Griffin, Rob Eisenberg, Andrea Boschin, Rudi Grobler(-2-), Jesse Liberty, Dan Wahlin, Roberto Sonnino, Deborah Kurata. Above the Fold: Silverlight: "Silverlight double click event" Vikas WP7: "Logging in Silverlight and WP7 with MVVM Light" Tony Champion XNA: "XNA for Silverlight developers: Part 3 - Animation (transforms)" Peter Kuhn Shoutouts: Vikas deserves congratulations for passing the beta Silverlight 4 exam, but in the process he has a great list of resources to help you do the same: Exam 70-506 ( TS: Silverlight 4, Development ) From SilverlightCream.com: Silverlight double click event Vikas demonstrates 3 ways to come up with a double-click in Silverlight: Timer, Rx Framework, and Behavior with code for each. Logging in Silverlight and WP7 with MVVM Light Tony Champion is discussing logging... and since he finds himself doing it in every project, he's setting up an extensible solution he can reuse and is doing so with MVVMLight XNA for Silverlight developers: Part 3 - Animation (transforms) Peter Kuhn has part 3 of his XNA for WP7 series up at SilverlightShow. In this 3rd tutorial, Peter is discussing animation with Transformations.... remember... this is XNA! WP7Contrib: Location Push Model Ollie Riches posts from the WP7C and discusses how they provide an interface for location service by abstracting away the GeoCoordinateWatcher class and provide a clean push model using the IObservable as the return types for all variants. WP7 Contrib – When messaging becomes messy and services shine Rich Griffin pulls another post up from WP7C where he discusses swapping out using Service Styles rather than Messenger Styles... in his words "when we start getting friction trying to bend the framework api to do something that it was not really meant for its time to use something [that] solves the problem better" Herding Code 104: Rob Eisenberg on Caliburn Micro Rob Eisenberg is interviewed on the latest Herding Code, talking about his baby, Caliburn Micro, and tons of other stuff as well... just check out the list of links generated for this show. Windows Phone 7 - Part #4: The application lifecycle Andrea Boschin has part 4 of his WP7 tutorial series up at SilverlightShow... In this tutorial he does a complete run-down the the WP7 Application Life-Cycle Simple Error Reporting on WP7 Rudi Grobler has a code snippet up that, with the end-user's permission of course, emails problem reports back to you... very cool idea. Simple Error Reporting on WP7 REDUX Rudi Grobler demonstrates using the Coding4Fun toolkit to display an exception prompt to the user... and then possibly email the report to you..see Rudi's other post on that. Creating An Application Bar–Don’t Panic In his latest (number 31) WP7 From Scratch episode, Jesse Liberty takes on the ApplicationBar, and uses Blend to get the job done easier. Syncing Data with a Server using Silverlight and HTTP Polling Duplex Dan Wahlin revisits some older posts of his about Push technologies in Silverlight, and provides some great insight (and code) into Http Polling Duplex Quick WPF/Silverlight tips to make great videos of your apps Roberto Sonnino has some great tips on making awesome videos of your WPF or Silverlight app. Simple Silverlight MVVM Base Class Deborah Kurata has her take at a good MVVM base class as the subject of her latest post... good points and good code. Stay in the 'Light! Twitter SilverlightNews | Twitter WynApse | WynApse.com | Tagged Posts | SilverlightCream Join me @ SilverlightCream | Phoenix Silverlight User Group Technorati Tags: Silverlight    Silverlight 3    Silverlight 4    Windows Phone MIX10

    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

  • OCAD 2013, rassegna stampa&more

    - by claudiac.caramelli
    Vi segnaliamo un interessante articolo su ImpresaCity sull'Oracle Cloud Applications Day 2013: http://bit.ly/1eE3a5Q Roberto Bonino ci racconta come il Cloud si stia sempre di più diffondendo nelle aziende italiane e la visione degli esperti che sono intervenuti. E' stato anche aggiornato il canale youtube di Oracle Italia con due nuovi video registrati il 28 ottobre. Paola Provvisier ci racconta QUI la completezza delle soluzioni HCM, mentre Giovanni Ravasio, Country Leader di Oracle Applications Italia, insieme a Fabrizio Pessina (Boston Consulting Group) e a Paolo Daperno (Illycaffè), fanno QUI il punto della situazione sull'offerta Cloud di Oracle, sul panorama Cloud in Italia e perchè le aziende scelgono nuovi servizi per implementare e migliorare la propria realtà.

    Read the article

< Previous Page | 1 2 3 4 5 6  | Next Page >