Search Results

Search found 763 results on 31 pages for 'union'.

Page 18/31 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • How can I access a byte array as shorts in Java

    - by shellback3
    I have a an array of byte, size n, that really represents an array of short of size n/2. Before I write the array to a disk file I need to adjust the values by adding bias values stored in another array of short. In C++ I would just assign the address of the byte array to a pointer for a short array with a cast to short and use pointer arithmetic or use a union. How may this be done in Java - I'm very new to Java BTW.

    Read the article

  • LInq to sql query

    - by Mohit
    Hi, I have a sql query as follows: Declare @DivisionNo INT SET @DivisionNo = 5117 SELECT distinct CASE WHEN ISNULL([DivisionNo],'') < @DivisionNo THEN @DivisionNo ELSE [DivisionNo] END as DivisionNo --,[RecordID] ,[AcctCat] ,[AcctCatDesc] ,[CostCode] ,[CostCodeDesc] FROM [dbo].[vw_eSchdl_AcctCat_CostCode] WHERE DivisionNo = @DivisionNo UNION SELECT distinct CASE WHEN ISNULL([DivisionNo],'') < @DivisionNo THEN @DivisionNo ELSE [DivisionNo] END as DivisionNo --,[RecordID] ,[AcctCat] ,[AcctCatDesc] ,[CostCode] ,[CostCodeDesc] FROM [dbo].[vw_eSchdl_AcctCat_CostCode] WHERE AcctCat not in ( SELECT [AcctCat] FROM [dbo].[vw_eSchdl_AcctCat_CostCode] WHERE DivisionNo = @DivisionNo) How can I duplicate it using linq to sql? Thanks

    Read the article

  • How to access the CGColor property of UIColor in CGContextSetFillColorWithColor?

    - by Azeworai
    CGContextSetFillColorWithColor(g, [UIColor greyColor].CGColor); I'm trying to follow O'Reilly's iPhone Game Development book on page 73 Chapter 3 but I'm running into a compile error that states error: request for member 'CGColor' in something not a structure or union According to the book's errata page this is an unconfirmed errata in the book. I'm hoping that someone could help me replace that line of code to something that works. The example project can be downloaded from sourceforge at this link.

    Read the article

  • Passing values from UIButton to an UIActionSheet

    - by Michael
    I'm trying to send an ActionSheet a variable from a button. I can't use the tag property because its being used for something else. I've declared myIndexRow as an instance variable and have: NSInteger myIndexRow = indexPath.row; [deleteButton addTarget:self action:@selector(showDeleteSheet:) forControlEvents:UIControlEventTouchUpInside]; deleteButton.myIndexRow = myIndexRow; but I'm getting the 'Request for member 'myRow' is something not a structure or union' There is something obvious I am missing here.

    Read the article

  • How can I use a php array in a mysql search query?

    - by ThinkingInBits
    I was going to use the scuttle solution on: http://www.pui.ch/phred/archives/2005/04/tags-database-schemas.html for handling searches on my website. I was wondering how I could take the search input from a user and turn it into a single query. For instance, let's say a user inputted 'blue dogs' in their search query... How could I dynamically update the query to include ('blue', 'dogs') in union and intersection queries?

    Read the article

  • Is there a WPF equaivalent to System.Windows.Froms.Screen?

    - by dkackman
    I'm trying to create a WPF window that will encompass the entire Desktop working area. In WinForms I'd do this by getting the Union of all the bounds in System.Windows.Forms.Screen.AllScreens. Is there an equivalent type or other mechanism to get the bounds of the entire desktop in WPF or do I need to use the WinForms type?

    Read the article

  • Problem with computed column with NDBUnit

    - by jess
    Hi, I am loading data for tests in tables using xml and ndbunit.But,for a table having computed column,I am having problem.I get this error The column "xyz" cannot be modified because it is either a computed column or is the result of a UNION operator. I have modified the INSERT and UPDATE commands(removed the computed column) of sqladapter in xsd file,but still face the issue. thanks

    Read the article

  • Saving auto increment in MySQL

    - by oshafran
    Hello, I am trying to sync between 2 tables: I have active table where has auto_increment, and I have archive table with the same values. I would like both ID's to be unique (between the tables as well) - I mean, I would like to save auto incremenet, and if I UNION both table I still have uniqness. How can I do that? Is there a possibility to save auto increment when mysql is off?

    Read the article

  • standard rectangle class

    - by Neil G
    I have a project that has a GUI (written in QT) and a command-line version. I made use of the rectangle class included in QT: QRect. I would like to break the command-line version's dependency on QT, so I need a drop-in rectangle class that supports intersection and union. I could write one, but I'd prefer including one if possible. Any ideas?

    Read the article

  • mysql custom sorting first alpha then numeric using case when

    - by Nizzy
    How can you sort a query using ORDER BY CASE WHEN REGEXP? or other alternatives? I don't want to use UNION. Thank you mysql> SELECT `floor_id`, `floor_number` FROM `floors`; +----------+--------------+ | floor_id | floor_number | +----------+--------------+ | 1 | 4 | | 2 | 7 | | 3 | G | | 4 | 19 | | 5 | B | | 6 | 3 | | 7 | A | +----------+--------------+ Expected result: +----------+--------------+ | floor_id | floor_number | +----------+--------------+ | 7 | A | | 5 | B | | 3 | G | | 6 | 3 | | 1 | 4 | | 2 | 7 | | 4 | 19 | +----------+--------------+

    Read the article

  • SQL Update with row_number()

    - by user609511
    i m using SQL Server 2008 R2. i want to update my column CODE_DEST with increment number CODE_DEST RS_NOM null qsdf null sdfqsdfqsdf null qsdfqsdf what i want: CODE_DEST RS_NOM 1 qsdf 2 sdfqsdfqsdf 3 qsdfqsdf i have try this: update DESTINATAIRE_TEMP set CODE_DEST = TheId FROM (SELECT Row_Number() OVER (ORDER BY [RS_NOM]) as TheId from DESTINATAIRE_TEMP) not work because of ) and this With DESTINATAIRE_TEMP As ( SELECT ROW_NUMBER() OVER (ORDER BY [RS_NOM] DESC) AS RN FROM DESTINATAIRE_TEMP ) UPDATE DESTINATAIRE_TEMP SET CODE_DEST=RN because of union

    Read the article

  • C++ keeping a list of objects and calling a contructor through another function

    - by Nona Urbiz
    why isnt my object being created? When I do it like so, I am told error C2065: 'AllReferrals' : undeclared identifier as well as error C2228: left of '.push_back' must have class/struct/union. If I put the list initialization before the class I get error C2065: 'AllReferrals' : undeclared identifier. Thanks! #include <iostream> #include <fstream> #include <regex> #include <string> #include <list> #include <map> using namespace std; using namespace tr1; class Referral { public: string url; map<string, int> keywords; static bool submit(string url, string keyword, int occurrences) { //if(lots of things i'll later add){ Referral(url, keyword, occurrences); return true; //} //else // return false; } private: list<string> urls; Referral(string url, string keyword, int occurrences) { url = url; keywords[keyword] = occurrences; AllReferrals.push_back(this); } }; static list<Referral> AllReferrals; int main() { Referral::submit("url", "keyword", 1); cout << AllReferrals.size(); cout << "\n why does that ^^ say 0 (help me make it say one)?"; cout << "\n and how can i AllReferrals.push_back(this) from my constructor?"; cout << " When I do it like so, I am told error C2065: 'AllReferrals' : undeclared identifier"; cout << " as well as error C2228: left of '.push_back' must have class/struct/union."; cout << " If I put the list initialization before the class I get error C2065: 'AllReferrals' : undeclared identifier."; cout << "\n\n\t Thanks!"; getchar(); }

    Read the article

  • how do i get the sum of the 4th column

    - by every_answer_gets_a_point
    this statement will generate a 4 column table: SELECT shipped.badguy AS badguy, shipped.sdate AS LineDate, 'Delivery' AS Legend, -price*quantity AS amount FROM product JOIN shipped ON (product.id = shipped.product) UNION SELECT receipt.badguy, receipt.rdate,notes, amount FROM how do i get the total sum of the 4th of column of what the above generates?

    Read the article

  • C - How to use both aio_read() and aio_write().

    - by Slav
    I implement game server where I need to both read and write. So I accept incoming connection and start reading from it using aio_read() but when I need to send something, I stop reading using aio_cancel() and then use aio_write(). Within write's callback I resume reading. So, I do read all the time but when I need to send something - I pause reading. It works for ~20% of time - in other case call to aio_cancel() fails with "Operation now in progress" - and I cannot cancel it (even within permanent while cycle). So, my added write operation never happens. How to use these functions well? What did I missed? EDIT: Used under Linux 2.6.35. Ubuntu 10 - 32 bit. Example code: void handle_read(union sigval sigev_value) { /* handle data or disconnection */ } void handle_write(union sigval sigev_value) { /* free writing buffer memory */ } void start() { const int acceptorSocket = socket(AF_INET, SOCK_STREAM, 0); struct sockaddr_in addr; memset(&addr, 0, sizeof(struct sockaddr_in)); addr.sin_family = AF_INET; addr.sin_addr.s_addr = INADDR_ANY; addr.sin_port = htons(port); bind(acceptorSocket, (struct sockaddr*)&addr, sizeof(struct sockaddr_in)); listen(acceptorSocket, SOMAXCONN); struct sockaddr_in address; socklen_t addressLen = sizeof(struct sockaddr_in); for(;;) { const int incomingSocket = accept(acceptorSocket, (struct sockaddr*)&address, &addressLen); if(incomingSocket == -1) { /* handle error ... */} else { //say socket to append outcoming messages at writing: const int currentFlags = fcntl(incomingSocket, F_GETFL, 0); if(currentFlags < 0) { /* handle error ... */ } if(fcntl(incomingSocket, F_SETFL, currentFlags | O_APPEND) == -1) { /* handle another error ... */ } //start reading: struct aiocb* readingAiocb = new struct aiocb; memset(readingAiocb, 0, sizeof(struct aiocb)); readingAiocb->aio_nbytes = MY_SOME_BUFFER_SIZE; readingAiocb->aio_fildes = socketDesc; readingAiocb->aio_buf = mySomeReadBuffer; readingAiocb->aio_sigevent.sigev_notify = SIGEV_THREAD; readingAiocb->aio_sigevent.sigev_value.sival_ptr = (void*)mySomeData; readingAiocb->aio_sigevent.sigev_notify_function = handle_read; if(aio_read(readingAiocb) != 0) { /* handle error ... */ } } } } //called at any time from server side: send(void* data, const size_t dataLength) { //... some thread-safety precautions not needed here ... const int cancellingResult = aio_cancel(socketDesc, readingAiocb); if(cancellingResult != AIO_CANCELED) { //this one happens ~80% of the time - embracing previous call to permanent while cycle does not help: if(cancellingResult == AIO_NOTCANCELED) { puts(strerror(aio_return(readingAiocb))); // "Operation now in progress" /* don't know what to do... */ } } //otherwise it's okay to send: else { aio_write(...); } }

    Read the article

  • Is there a WPF equaivalent to System.Windows.Forms.Screen?

    - by dkackman
    I'm trying to create a WPF window that will encompass the entire Desktop working area. In WinForms I'd do this by getting the Union of all the bounds in System.Windows.Forms.Screen.AllScreens. Is there an equivalent type or other mechanism to get the bounds of the entire desktop in WPF or do I need to use the WinForms type?

    Read the article

  • How to refactor this MySQL code?

    - by Jader Dias
    SELECT * ( SELECT * FROM `table1` WHERE `id` NOT IN ( SELECT `id` FROM `table2` WHERE `col4` = 5 ) group by `col2` having sum(`col3`) > 0 UNION SELECT * FROM `table1` WHERE `id` NOT IN ( SELECT `id` FROM `table2` WHERE `col4` = 5 ) group by `col2` having sum(`col3`) = 0 ) t1; For readability and performance reasons, I think this code could be refactored. But how?

    Read the article

  • Why would you avoid C++ keywords in Java?

    - by Joshua Swink
    A popular editor uses highlighting to help programmers avoid using C++ keywords in Java. The following words are displayed using the same colors as a syntax error: auto delete extern friend inline redeclared register signed sizeof struct template typedef union unsigned operator Why would this be considered important?

    Read the article

  • PHP MySQL Select multiple tables

    - by Jordan Pagaduan
    Is it posibble to select 3 tables at a time in 1 database? Table 1: employee -- employee_id -- first_name -- last_name -- middle_name -- birthdate -- address -- gender -- image -- salary Table 2: logs -- log_id -- full_name -- employee_id -- date -- time -- status Table 2: logout -- log_id -- full_name -- employee_id -- date -- time -- status I wanted to get the value of employee table where $id of selected. Then the $id also get the value of log.time, log.date, logout.time, and logout.date. I already try using UNION but nothing happens.

    Read the article

  • O(log n) algorithm for merging lists and computing rank?

    - by Eternal Learner
    Given two sorted lists, each containing n real numbers, is there a O(log?n) time algorithm to compute the element of rank i (where i coresponds to index in increasing order) in the union of the two lists, assuming the elements of the two lists are distinct? I can think of using a Merge procedure to merge the 2 lists and then find the A[i] element in constant time. But the Merge would take O(n) time. How do we solve it in O(log n) time?

    Read the article

  • Sql Get months Name between two dates in a table

    - by user2219210
    My Table column (ID , startDate , EndDate ) I need to use this way with every row of the table : not with a specific value like : declare @start DATE = '2011-05-30' declare @end DATE = '2011-06-10' ;with months (date) AS ( SELECT @start UNION ALL SELECT DATEADD(month,1,date) from months where DATEADD(month,1,date)<= DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,@end)+1,0)) ) select Datename(month,date) from months it possible ??

    Read the article

  • Iterating through boost ptr_vector

    - by Ockonal
    Hello, I have a ptr_vector list of my own objects. Something like this: boost::ptr_vector<SomeClass> *list; list.push_back(new SomeClass()>; ... BOOST_FOREACH(SomeClass *tempObj, list) // [x] { tempObj->... } >‘boost::ptr_vector<SomeClass>*’ is not a class, struct, or union type

    Read the article

  • SQL query, select from 2 tables random

    - by klaus
    Hello all i have a problem that i just CANT get to work like i what it.. i want to show news and reviews (2 tables) and i want to have random output and not the same output here is my query i really hope some one can explain me what i do wrong SELECT anmeldelser.billed_sti , anmeldelser.overskrift , anmeldelser.indhold , anmeldelser.id , anmeldelser.godkendt FROM anmeldelser LIMIT 0,6 UNION ALL SELECT nyheder.id , nyheder.billed_sti , nyheder.overskrift , nyheder.indhold , nyheder.godkendt FROM nyheder ORDER BY rand() LIMIT 0,6

    Read the article

  • SQL to have one specific record at the top, all others below

    - by superdario
    Hey all, I am trying to put together a query that will display one specific record (found by the record's primary ID) at the top, and display all other records below it, sorted by date (I have "date_added" as one of the fields in the table, in addition to primary ID). I could do this with a UNION (first select would locate the record I want, and the other select would display all other records), but I'm wondering if is there perhaps a better way? I'm using Oracle, by the way.

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >