Search Results

Search found 1742 results on 70 pages for 'combine'.

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

  • What happens when we combine RAII and GOTO ?

    - by Robert Gould
    I'm wondering, for no other purpose than pure curiosity (because no one SHOULD EVER write code like this!) about how the behavior of RAII meshes with the use of Goto (lovely idea isn't it). class Two { public: ~Two() { printf("2,"); } }; class Ghost { public: ~Ghost() { printf(" BOO! "); } }; void foo() { { Two t; printf("1,"); goto JUMP; } Ghost g; JUMP: printf("3"); } int main() { foo(); } When running the following code in VS2005 I get the following output: 1,2,3 BOO! However I imagined, guessed, hoped that 'BOO!' wouldn't actually appear as the Ghost should have never been instantiated (IMHO, because I don't know the actual expected behavior of this code). Any Guru out there knows what's up? Just realized that if I instantiate an explicit constructor for Ghost the code doesn't compile... class Ghost { public: Ghost() { printf(" HAHAHA! "); } ~Ghost() { printf(" BOO! "); } }; Ah, the mystery ...

    Read the article

  • How to combine multiple uiBinder-based widgets?

    - by jprusakova
    I need to insert a [number of] uiBinder-based widgets into another one, at a particular spot. The inserted widget has a somewhat complicated layout, so I am trying to define it in HTML. referencePanel.add(...) fails with NoSuchElement exception. reference.getElement().toSource returns "undefined". Any suggestions on how to do that? public class AppUIDemo extends Composite { @UiTemplate("AppUIDemo.ui.xml") interface AppUIDemoUiBinder extends UiBinder<Widget, AppUIDemo> { } @UiTemplate("ReferenceUI.ui.xml") interface ReferenceUIUiBinder extends UiBinder<Widget, ReferenceUI> { } private static AppUIDemoUiBinder uiBinder = GWT .create(AppUIDemoUiBinder.class); private static ReferenceUIUiBinder refUIBinder = GWT .create(ReferenceUIUiBinder.class); @UiField HTMLPanel referencePanel; public AppUIDemo() { initWidget(uiBinder.createAndBindUi(this)); ReferenceUI reference = new ReferenceUI(refUIBinder); referencePanel.add(reference, reference.getElement().getId()); } } public class ReferenceUI extends Composite { interface ReferenceUIUiBinder extends UiBinder<Widget,ReferenceUI> { } private static ReferenceUIUiBinder uiBinder = GWT .create(ReferenceUIUiBinder.class); public ReferenceUI() { initWidget(uiBinder.createAndBindUi(this)); } public CreditReferenceUI(final UiBinder<Widget, CreditReferenceUI> binder) { initWidget(binder.createAndBindUi(this)); } }

    Read the article

  • Combine Search Bar and URL Bar into One (WebView)

    - by Jay Bush
    So I'm in the midst of updating my Web Browser app for iOS devices, from the ground up, and I'm trying to implement some more convenient features. One feature that seems to be really popular now, that I have been getting a lot of requests for, is the combination of a Google Search bar and a URL bar in one, like that of the Chrome application. Below is a screenshot of the Google Chrome app, and as you can see, they've made it so you can either enter in a search query like "apple ipad" and it will return a Google search page of 'Apple iPad', or you can enter in a URL "http://apple.com/ipad/" and it will load that URL. I have looked all over the internet, but all I could find were tutorials on how to Search Google with value of the UITextField. I have a feeling that the best way to do this is to probably make a 'check'. Like if the entered value contains 'http://' 'www.' '.com' or no spaces, then load it as a URL, if not then load it in a Google Search page, and then have the webview load up the Google Search page. If anybody could show me to the right direction, that would be great, or even supplying me with some code would be even greater. :) Thanks! If anyone needs part of the code, just ask.

    Read the article

  • How to combine 2 linq statments with groupby clause into 1

    - by AG.
    Hello Friends, I was wondering if i can consolidate below 2 linq statments into 1 statment. I am sure it should be possible, but various attempts i am unable to manage. var prevProvisionsBySubBook = (from provision in prevProvisions group provision by provision.SubBook into subBookGrouping select new { Key = subBookGrouping.Key, Value = subBookGrouping.Sum(t => t.ProvisionUSD) }); var currentProvisionsBySubBook = (from provision in currentProvisions group provision by provision.SubBook into subBookGrouping select new { Key = subBookGrouping.Key, Value = subBookGrouping.Sum(t => t.ProvisionUSD) }); var adjustmentChangeBySubBook = (from current in currentProvisionsBySubBook select new { Key = current.Key, Value = current.Value - (prevProvisionsBySubBook.Any() ? prevProvisionsBySubBook.Where(t => t.Key == current.Key).Single().Value : 0) }); any help would be apprecaited.

    Read the article

  • Can't combine "LINQ Join" with other tables

    - by FullmetalBoy
    The main problem is that I recieve the following message: "base {System.SystemException} = {"Unable to create a constant value of type 'BokButik1.Models.Book-Author'. Only primitive types ('such as Int32, String, and Guid') are supported in this context."}" based on this LinQ code: IBookRepository myIBookRepository = new BookRepository(); var allBooks = myIBookRepository.HamtaAllaBocker(); IBok_ForfattareRepository myIBok_ForfattareRepository = new Bok_ForfattareRepository(); var Book-Authors = myIBok_ForfattareRepository.HamtaAllaBok_ForfattareNummer(); var q = from booknn in allBooks join Book-Authornn in Book-Authors on booknn.BookID equals Book-Authornn.BookID select new { booknn.title, Book-AuthorID }; How shall I solve this problem to get a class instance that contain with property title and Book-AuthorID? // Fullmetalboy I also have tried making some dummy by using "allbooks" relation with Code Samples from the address http://www.hookedonlinq.com/JoinOperator.ashx. Unfortunately, still same problem. I also have taken account to Int32 due to entity framework http://msdn.microsoft.com/en-us/library/bb896317.aspx. Unfortunatley, still same problem. Using database with 3 tables and one of them is a many to many relationship. This database is used in relation with entity framework Book-Author Book-Author (int) BookID (int) Forfattare (int) Book BookID (int) title (string) etc etc etc

    Read the article

  • Struts2 combine with domain specific servlet

    - by Dewfy
    I have struts2 web application. Right now I need embed with help of iframe some functionality from stand-alone servlet. But according to following rule, servlet is never get calling. <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> Unfortunately I cannot change it to /prefix/* So does anybody know how to resolve it? Thanks in advance!

    Read the article

  • Combine SQL statement

    - by ninumedia
    I have 3 tables (follows, postings, users) follows has 2 fields - profile_id , following_id postings has 3 fields - post_id, profile_id, content users has 3 fields - profile_id, first_name, last_name I have a follows.profile_id value of 1 that I want to match against. When I run the SQL statement below I get the 1st step in obtaining the correct data. However, I now want to match the postings.profile_id of this resulting set against the users table so each of the names (first and last name) are displayed as well for all the listed postings. Thank you for your help! :) Ex: SELECT * FROM follows JOIN postings ON follows.following_id = postings.profile_id WHERE follows.profile_id = 1

    Read the article

  • ASP.NET MVC - Combine Json result with ViewResult

    - by elado
    Can I return a Json result that contains also a rendered view? I need it to return the new ID of a submitted form along with its HTML and some other properties. Also that can be helpful when I need to return two (or more) view results from one action inside a Json object. Thanks!

    Read the article

  • How to combine a list of choices to determine which select statement

    - by Larry
    I have a mysql db and am using php 5.2 What I am trying to do is offer a list of options for a person to select (only 1). The chosen option will cause a select, update, or delete statement to be ran. The results of the statement do not need to be shown, although, showing the old and then the new would be nice (no problems with that part tho'.). Pseudo-Code: Assign $choice = 0 Check the value of $choice // This way, if it = 100, we do a break Select a Choice:<br> 1. Adjust Status Value (+60) // $choice = 1<br> 2. Show all Ships <br> // $choice = 2 3. Show Ships in Port <br> // $choice = 3 ... 0. $choice="100" // if the value =100, quit this part Use either case (switch) or if/else statements to run the users choice1 If the choice is 1, then run the "Select" statement with the variable of $sql1 -- "SELECT .... If the choice is 2, then run the "Select" statement with the variable of $sql2 --- SELECT * FROM Ships If the choice is 3, then run the "Select" statement with the variable of $sql3 <br> .... If the choice is 0, then we are done. I figured the (3) statements would be assigned in php as: $sql1="...". $sql2="SELECT * FROM Ships" $sql3="SELECT * FROM Ships WHERE nPort="1" My idea was to use the switch statement, but got lost on it. :( I would like the options to be available over and over again, until a variable ($choice) is selected. In which case, this particular page is done and goes back to the "Main Menu"? The coding and display, if I use it, I can do. Just not sure how to write the way to select which one I want. It is possible that I would run all of the queries, and other times, only one, so that is why I would like the choice. An area I get confused in is the proper forms to use such as -- ' ' " " and ...?? Not sure the # of options I will end up with, but it will be more than 5 but less than 20 / page. So if I get the system down for 2-3 choices, I can replicate it for as many as I may need. And, as always, if a better way exists, I am willing to try it. Thanks again... Larry

    Read the article

  • How to combine query strings in PHP

    - by incrediman
    Given a url, and a query string, how can I get the url resulting from the combination of the query string with the url? I'm looking for functionality similar to .htaccess's qsa. I realize this would be fairly trivial to implement completely by hand, however are there built-in functions that deal with query strings which could either simplify or completely solve this? Example input/result sets: Url="http://www.example.com/index.php/page?a=1" QS ="?b=2" Result="http://www.example.com/index.php/page?a=1&b=2" - Url="page.php" QS ="?b=2" Result="page.php?b=2"

    Read the article

  • combine lines from 2 prints to single line and insert into mysql database

    - by bleomycin
    Hello everyone i currently have this: import feedparser d = feedparser.parse('http://store.steampowered.com/feeds/news.xml') for i in range(10): print d.entries[i].title print d.entries[i].date How would i go about making it so that the title and date are on the same line? Also it doesn't need to print i just have that in there for testing, i would like to dump this output into a mysql db with the title and date, any help is greatly appreciated!

    Read the article

  • How to combine apache requests?

    - by Bruce
    To give you the situation in abstract: I have an ajax client that often needs to retrieve 3-10 static documents from the server. Those 3-10 documents are selected by the client out of about 100 documents in total. I have no way of knowing in advance which 3-10 documents the client will require. Additionally, those 100 documents are generated from database content, and so change over time. It seems messy to me to have to make 10 ajax requests for 10 separate documents. My first thought was to write a jsp that could use the include action. ie in pseudo code for (param in params){ jsp:include page="[param]" } But it turns out the tomcat doesn't just include the html resource, it recompiles it, generating a class file every time, which also seems wasteful. Does any one know of a neat solution for combining apache requests to static files to make one request, rather than several, but without the overhead of, for example, tomcat generating extra class files for each static file and regenerating them each time the static file changes? Thanks! Hopefully my question is clear - it's a bit long-winded.

    Read the article

  • How to combine several movieclips into one scene?

    - by NKelly
    Hi everyone, I'm creating a website that allows kids to designs a tshirt. I will have four section, colour, graphic, text and print. I have created these sections on demos and they are all working. I now need to properly create them all on one movie clip. I'm having problems with it, when i select the chosen tshirt colour and move onto the graphic section the shirt is white again and hasnt came through blue. Its the same for every section, when I select a grahic they dont come through either etc when I click the next button it refreshs the page. Does anyone know how to create this kind of design on one movie clip using different frames and so that the colour etc transfers onto each new page? PLEASE HELP!!!

    Read the article

  • T-SQL Query, combine columns from multiple rows into single column

    - by Shayne
    I have seeen some examples of what I am trying to do using COALESCE and FOR XML (seems like the better solution). I just can't quite get the syntax right. Here is what I have (I will shorten the fields to only the key ones): Table Fields ------ ------------------------------- Requisition ID, Number IssuedPO ID, Number Job ID, Number Job_Activity ID, JobID (fkey) RequisitionItems ID, RequisitionID(fkey), IssuedPOID(fkey), Job_ActivityID (fkey) I need a query that will list ONE Requisition per line with its associated Jobs and IssuedPOs. (The requisition number start with "R-" and the Job Number start with "J-"). Example: R-123 | "PO1; PO2; PO3" | "J-12345; J-6780" Sure thing Adam! Here is a query that returns multiple rows. I have to use outer joins, since not all Requisitions have RequisitionItems that are assigned to Jobs and/or IssuedPOs (in that case their fkey IDs would just be null of course). SELECT DISTINCT Requisition.Number, IssuedPO.Number, Job.Number FROM Requisition INNER JOIN RequisitionItem on RequisitionItem.RequisitionID = Requisition.ID LEFT OUTER JOIN Job_Activity on RequisitionItem.JobActivityID = Job_Activity.ID LEFT OUTER JOIN Job on Job_Activity.JobID = Job.ID LEFT OUTER JOIN IssuedPO on RequisitionItem.IssuedPOID = IssuedPO.ID

    Read the article

  • how to combine the related version in group by

    - by randeepsp
    select count(a),b,c from APPLE join MANGO on (APPLE.link=MANGO.link) join ORANGE on (APPLE.link=ORANGE.link) where id='camel' group by b,c; the column b gives values like 1.0 1.0,R 1.0,B 2.0 2.0,B 2.0,R 3.0,C 3.0,R is there a way to modify the above quer so that all 1.0 and 1.0,R and 1.0,B are merged as 1.0 and 2.0,2.0,B are merged as 2.0 and same way for 3.0 and 4.0

    Read the article

  • How to write a JOIN statement to combine data from disparate tables

    - by Amarundo
    I have the following 2 procedures that I use as my source for a report. As of now, I'm presenting 2 different tables in my SQL Server Reporting Services 2008 R2 report, because it doesn't let me put them together as they belong to 2 different data sets. I want to present them in a single table, but I have not been successful trying to use JOIN here. How do I do that? NOTE: cName in IAgentQueueStats corresponds to UserId in AgentActivityLog. /*** Aggregate values for Call Center Agents for calls, talk and hold time ***/ /*** The detail/row values is per 30-minute interval ***/ ALTER PROCEDURE [dbo].[sp_IAgentQueueStats_OnlyCalls_Grouped] @p_StartDate datetime, @p_EndDate datetime, @p_Agents varchar(8000) AS SELECT [cName] ,sum([nAnswered]) SumNAnswered ,sum([nAnsweredAcd]) SumNAnsweredAcd ,sum([tTalkAcd]) SumTTalkAcd ,sum([nHoldAcd]) SumNHoldAcd ,sum([tHoldAcd]) SumTHoldAcd ,sum([tAcw]) SumTAcw FROM [I3_IC].[dbo].[IAgentQueueStats] WHERE dIntervalStart between @p_StartDate and DATEADD(s, 86400-1, @p_EndDate) AND CHARINDEX ( cName ,@p_Agents)> 0 AND cReportGroup <> '*' AND cHKey3 = '*' and cHKey4 ='*' AND nEnteredAcd > 0 AND cReportGroup <> 'CCFax Email' GROUP BY cName And here is the second one: /*** Aggregate values for Call Center Agents for status/activity time ***/ /*** The detail/row values is per start-time/end-time ***/ ALTER PROCEDURE [dbo].[sp_AgentActivity_Grouped] @p_StartDate datetime, @p_EndDate datetime, @p_Agents varchar(8000) AS SELECT [UserId],[StatusCategory],SUM([StateDuration]) [StatusDuration] FROM ( SELECT [UserId] ,[StatusGroup] ,[StatusKey] , CASE [StatusKey] WHEN 'Available' THEN 'Productive' WHEN 'Follow Up' THEN 'Productive' WHEN 'Campaign Call' THEN 'Productive' WHEN 'Awaiting Callback' THEN 'Productive' WHEN 'In a Meeting' THEN 'Not Your Fault' WHEN 'Project Work' THEN 'Not Your Fault' WHEN 'At a Training Session'THEN 'Not Your Fault' WHEN 'System Issues' THEN 'Not Your Fault' WHEN 'Test' THEN 'Not Your Fault' WHEN 'At Lunch' THEN 'Non Productive' WHEN 'Available, Forward' THEN 'Non Productive' WHEN 'Available, Follow-Me' THEN 'Non Productive' WHEN 'At Play' THEN 'Non Productive' WHEN 'AcdAgentNotAnswering' THEN 'Non Productive' WHEN 'Do Not Disturb' THEN 'Non Productive' WHEN 'Available, No ACD' THEN 'Non Productive' WHEN 'Away from desk' THEN 'Non Productive' ELSE [StatusKey] END StatusCategory ,stateduration FROM [I3_IC].[dbo].[AgentActivityLog] WHERE [StatusDateTime] between @p_StartDate and DATEADD(s, 86400-1, @p_EndDate) AND CHARINDEX ( [UserId] ,@p_Agents)> 0 AND [StatusKey] not in ('Gone Home','Out of the Office','On Vacation','Out of Town') ) a GROUP BY [UserId],[StatusCategory] ORDER BY [UserId], [StatusCategory] desc BTW, if I take some time to comment/reply on your posts, it's not lack of interest, but of understanding...

    Read the article

  • How to combine two separate unrelated Git repositories into one with single history timeline

    - by Antony
    I have two unrelated (not sharing any ancestor check in) Git repositories, one is a super repository which consists a number of smaller projects (Lets call it repository A). Another one is just a makeshift local Git repository for a smaller project (lets call it repository B). Graphically, it would look like this A0-B0-C0-D0-E0-F0-G0-HEAD (repo A) A0-B0-C0-D0-E0-F0-G0-HEAD (remote/master bare repo pulled & pushed from repo A) A1-B1-C1-D1-E1-HEAD (repo B) Ideally, I would really like to merge repo B into repo A with a single history timeline. So it would appear that I originally started project in repo A. Graphically, this would be the ideal end result A0-A1-B1-B0-D1-C0-D0-E0-F0-G0-E1-H(from repo B)-HEAD (new repo A) A0-A1-B1-B0-D1-C0-D0-E0-F0-G0-E1-H(from repo B)-HEAD (remote/master bare repo pulled & pushed from repo A) I have been doing some reading with submodules and subtree (Pro Git is a pretty good book by the way), but both of them seem to cater solution towards maintaining two separate branch with sub module being able to pull changes from upstream and subtree being slightly less headache. Both solution require additional and specialized git commands to handle check ins and sync between master and sub tree/module branch. Both solution also result in multiple time-lines (with --squash you even get 3 timelines with subtree). The closest solution from SO seems to talk about "graft", but is that really it? The goal is to have a single unified repository where I can pull/push check-ins, so that there are no more repo B, just repo A in the end.

    Read the article

  • JQuery: Combine multiple pages into one

    - by k_wave
    I am developing an application by using phonegap and jQuery Mobile. Phonegap recommends a single document structure. As 5 divs or more in a document are pretty unclear, I'm trying to split up my pages (the div's) into multiple documents. As soon as phonegap loads the app, I want to insert these documents into the index.html. function loadPage(external_document) { var docname=external_document+".html"; $.get(docname, function(data) { console.log(docname+" loading"); $("body").append($(data).find("body")); $("head").append($(data).find("head")); console.log(docname+" loaded"); }); } document.addEventListener("deviceready", function(){ loadPage("DialogCredentials"); }, false); DialogCredentials.html <html> <head> <script type="text/javascript" src="js/DialogCredentials.js"></script> </head> <body> <div data-role="page" id="dlg_credentials"> <div data-role="header"><h1>Login</h1></div> <div data-role="content"> ... </div> </div><!-- /page --> </body> </html> As soon as the loadPage gets executed there should be a <div id="dlg_credentials"… and the corresponding javascript tag in the dom of my main document. But it isn't. There are no errors shown in the web inspector. So what am I doing wrong here?

    Read the article

  • Easy way to combine php code (lame question)

    - by alekseygr
    Hi, I have vary easy and LAME question. I have code: <?php if (function_exists("insert_audio_player")) {insert_audio_player("[audio:|titles=]"} ?> This code outputs audio player to my page in wordpress. I need to call custom field inside this code. My custom field code is: <?php print_custom_field('tc_filename'); ?> Something like: <?php if (function_exists("insert_audio_player")) {insert_audio_player("[audio:<?php print_custom_field('tc_filename'); ?>|titles=<?php print_custom_field('tc_title'); ?>]"} ?> How can I call for second code inside first? Thx.

    Read the article

  • i try to combine GUI with class - no success

    - by Gold
    hi i made a class that make registration to my WinCE program. how i can from the class draw pannel + textbox, and catch the enter press from the textbox ? i try to do this: TextBox tb=new TextBox(); tb.Location=new Point(10,10); Panel pn=new Panel(); pn.Dock=DockStyle.Fill; pn.Controls.Add(tb); this.Controls.Add(pn); but i got error in: this.Controls.Add(pn); is there any simple sample code for this ? thank's in advance

    Read the article

  • Java combine parents of two large inheritance chains

    - by Soylent Green
    I have two parent classes in a huge project, let's say ClassA and ClassB. Each class has many subclasses, which in turn have many subclasses, which in turn have many subclasses, etc. My task is to "marry" these two "families" so that both inherit from a SINGLE parent. I need to essentially make ClassA and ClassB one class (parent) to both of their combined subclasses (children). ClassA and ClassB both currently implement Serializable. I am currently trying to make both inheritance chains inherit from ClassA, and then copy all functions and data members from ClassB into ClassA. This is tedious, and I think a terrible solution. What would be the CORRECT way to solve this problem?

    Read the article

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