Daily Archives

Articles indexed Friday June 11 2010

Page 11/114 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Help needed with MySQL query to join data spanning multiple tables with data used as column names

    - by gurun8
    I need a little help putting together a SQL query that will give me the following resultsets: and The data model looks like this: The tricky part for me is that the columns to the right of the "Product" in the resultset aren't really columns in the database but rather key/value pairs spanned across the data model. Table data is as follows: My apologies in advance for the image heavy question and the image quality. This just seemed like the easiest way to convey the information. It'll probably take someone less time to write the query statement to achieve the results than it did for me to assemble this question. By the way, the "product_option" table image is truncated but it illustrated the general idea of the data structure. The MySQL server version is 5.1.45.

    Read the article

  • Building two executables in one project

    - by Rui Pacheco
    Hi, I've a project that must produce two executables: the main application and an executable that is called by a separate process. I've created the second file in Xcode and added a second target of type Cocoa Shell Tool. I can now build the second executable but when I try to build my project normally I get an error saying there's two executables present: ld: duplicate symbol _main in <path>/SecondExecutable.o and <path>/main.o (<path> was added by me to protect the innocent and their intelectual property). How can I configure Xcode to build both at the same time?

    Read the article

  • Can I fire a Text Changed Event for an asp.net Text Box before it loses focus?

    - by Xaisoft
    I have an asp.net TextBox in which I want to check if the text entered into the TextBox is > 0. It works once I tab out or click out of the TextBox, but if I keep focus on the TextBox, it won't fire the Text Changed Event, so I have the following scenario, I want to enable something if and only if the TextBox.Text.Length = 0. Now, if I put my caret in the TextBox and delete all the characters and then leave the caret in the TextBox so it still has focus and take my mouse and click a button, it will not do what it was supposed to do because it never fired the Text Changed Event. How would something like this be handled?

    Read the article

  • How do I increase the number of evaluation points in geom_smooth for ggplot2 in R

    - by Halpo
    I'm creating a plot and adding a basic loess smooth line to it. qplot(Age.GTS2004., X.d18O,data=deepsea, geom=c('point')) + geom_smooth(method="loess",se=T,span=0.01, alpha=.5, fill='light blue',color='navy') The problem is that the line is coming out really choppy. I need more evaluation point for the curve in certain areas. Is there a way to increase the number of evaluation points without having to reconstruct geom_smooth?

    Read the article

  • how do I take the URL and page title from a UITableView?

    - by nzsystem
    Hi I have an iPhone app that shows the user a UIWebView in the first view, what I am trying to do is allow the user to save what is essentially favorites to be saved and then displayed in a table view in the second view. To do this all i need is the page URL and also the Page Title to be saved to then populate the table view. Now here is the problem I am just starting to learn how to make iPhone apps and I have no clue what would be the best way to save it and how to get this information from the web view?

    Read the article

  • ListView OnItemClickListener Not Responding?

    - by GuyNoir
    I've looked everywhere for a solution to this, but I can't figure out how to implement it. My OnItemClickListener was disabled somehow on my ListView rows, because I have an ImageButton in the row layout, which takes over the focus. There have been numerous questions I've found, but none of them have gotten me anywhere. I've checked this question, but I couldn't really make heads or tails of it. I just need a way to get the rows clickable so that I can detect when a row is pressed. Long press and focus work fine.

    Read the article

  • Python: problem with tiny script to delete files

    - by Rosarch
    I have a project that used to be under SVN, but now I'm moving it to Mercurial, so I want to clear out all the .svn files. It's a little too big to do it by hand, so I decided to write a python script to do it. But it isn't working. def cleandir(dir_path): print "Cleaning %s\n" % dir_path toDelete = [] files = os.listdir(dir_path) for filedir in files: print "considering %s" % filedir # continue if filedir == '.' or filedir == '..': print "skipping %s" % filedir continue path = dir_path + os.sep + filedir if os.path.isdir(path): cleandir(path) else: print "not dir: %s" % path if 'svn' in filedir: toDelete.append(path) print "Files to be deleted:" for candidate in toDelete: print candidate print "Delete all? [y|n]" choice = raw_input() if choice == 'y': for filedir in toDelete: if os.path.isdir(filedir): os.rmdir(filedir) else: os.unlink(filedir) exit() if __name__ == "__main__": cleandir(dir) The print statements show that it's only "considering" the filedirs whose names start with ".". However, if I uncomment the continue statement, all the filedirs are "considered". Why is this? Or is there some other utility that already exists to recursively de-SVN-ify a directory tree?

    Read the article

  • How to figure out which record has been deleted in an effiecient way?

    - by janetsmith
    Hi, I am working on an in-house ETL solution, from db1 (Oracle) to db2 (Sybase). We needs to transfer data incrementally (Change Data Capture?) into db2. I have only read access to tables, so I can't create any table or trigger in Oracle db1. The challenge I am facing is, how to detect record deletion in Oracle? The solution which I can think of, is by using additional standalone/embedded db (e.g. derby, h2 etc). This db contains 2 tables, namely old_data, new_data. old_data contains primary key field from tahle of interest in Oracle. Every time ETL process runs, new_data table will be populated with primary key field from Oracle table. After that, I will run the following sql command to get the deleted rows: SELECT old_data.id FROM old_data WHERE old_data.id NOT IN (SELECT new_data.id FROM new_data) I think this will be a very expensive operation when the volume of data become very large. Do you have any better idea of doing this? Thanks.

    Read the article

  • how to reuse subquery result in mysql

    - by chris
    I'm doing a statistic job like this: SUM |COND1 |COND2 |... -------------------------- 100 |80 | 70 |... The SUM result is calculated from multiple tables, and the CONDs are subset of that. I wrote a sql like this: select tmp1.id,sum,cond1,cond2 as count from ( select id, count(*) as sum from table_1 group by table1.id) tmp1 left join ( select id, count(*) as cond1 from table1 where condition1 group by table1.id) tmp2 on tmp1.id=tmp2.id left join ( select id, count(*) as cond2 from table1 where condition2 group by table1.id) tmp3 on tmp1.id=tmp3.id the problem is that this is very poor efficiency, it will be better if i could use the result of tmp1, but i don't know how to do that. update: simplified the sql, what i mean is how to reuse the first select result of table_1

    Read the article

  • ORACLE SQL ROWNUM execution order

    - by iwan
    Dear expert, in Oracle SQL, there is a possible criteria called rownum. Can i confirm that rownum will be executed at last as just a limit for number of records return? or could it be executed first, before other WHERE SQL criteria (let's if we put rownum prior to the others)?

    Read the article

  • Php is stripping one letter "g" from my rtrim function but not other chars

    - by Chase
    I'm trying to trim some youtube URLs that I am reading in from a playlist. The first 3 work fine and all their URLs either end in caps or numbers but this one that ends in a lower case g is getting trimmed one character shorter than the rest. for ($z=0; $z <= 3; $z++) { $ythref2 = rtrim($tubeArray["feed"]["entry"][$z]["link"][0]["href"], '&feature=youtube_gdata'); The URL is http://www.youtube.com/watch?v=CuE88oVCVjg&feature=youtube_gdata .. and it should get trimmed down to .. http://www.youtube.com/watch?v=CuE88oVCVjg but instead it is coming out as http://www.youtube.com/watch?v=CuE88oVCVj. I think it may be the ampersand symbol but I am not sure.

    Read the article

  • How can I program ksh93 to use bash autocompletion?

    - by Norman Ramsey
    In a comment in response to a shell question, user tinkertim said that it was easy to hack ksh to use the bash autocompletion library. I would like nothing better than to use bash autocompletion with AT&T ksh93. How can this be done? ksh93 has a new release several times a year, so I am looking for a solution that does not involve modifying the source code. ksh93 can link new C modules dynamically and also is highly programmable (I run a ksh function at every keystroke), so modifying the source should not really be necessary. Note: I am not talking about filename autocompletion, which is easy to do in ksh. I'm talking about all the other yummy autocompletion stuff that bash does, like autocompletion options for nmh commands or autocompleting Mercurial commmands. Stuff like that.

    Read the article

  • XML Postback issue

    - by Mikey1980
    I have a script that is designed to parse XML postbacks from Ultracart, right now just dumps it into a MySQL table. The script works fine if I point it to a XML file on my localhost but using 'php://input' it doesn't seem to grabbing anything. My logs show apache returning 200 after the post so I have no idea what could be wrong or how to drill down the issue.. here's the code: $doc = new DOMDocument(); $doc->loadXML($page); $handle = fopen("test2/".time().".xml", "w+"); fwrite($handle,trim($page)); // it doesn't save this either :'( fclose(); require_once('includes/database.php'); $db = new Database('localhost', 'user', 'password', 'db_name'); $data = array(); $exports = $doc->getElementsByTagName("export"); foreach ($exports as $export) { $orders = $export->getElementsByTagName("order"); foreach($orders as $order) { $data['order_id'] = $order->getElementsByTagName("order_id")->item(0)->nodeValue; $data['payment_status'] = $order->getElementsByTagName("payment_status")->item(0)->nodeValue; $date_array = explode(" ",$order->getElementsByTagName("payment_date_time")->item(0)->nodeValue); if ($date_array[1] == 'JAN') { $date_array[1] = '01'; } if ($date_array[1] == 'FEB') { $date_array[1] = '02'; } if ($date_array[1] == 'MAR') { $date_array[1] = '03'; } if ($date_array[1] == 'APR') { $date_array[1] = '04'; } if ($date_array[1] == 'MAY') { $date_array[1] = '05'; } // converts Ultracart date to if ($date_array[1] == 'JUN') { $date_array[1] = '06'; } // MySQL date if ($date_array[1] == 'JUL') { $date_array[1] = '07'; } if ($date_array[1] == 'AUG') { $date_array[1] = '08'; } if ($date_array[1] == 'SEP') { $date_array[1] = '09'; } if ($date_array[1] == 'OCT') { $date_array[1] = '10'; } if ($date_array[1] == 'NOV') { $date_array[1] = '11'; } if ($date_array[1] == 'DEC') { $date_array[1] = '12'; } $data['payment_date'] = $date_array[2]."-".$date_array[1]."-".$date_array[0]; $data['payment_time'] = $date_array[3]; //... we'll skip this, there are 80 some elements $data['discount'] = $order->getElementsByTagName("discount")->item(0)->nodeValue; $data['distribution_center_code'] = $order->getElementsByTagName("distribution_center_code")->item(0)->nodeValue; } } } $db->insert('order_history',$data); } else die('ERROR: Token Check Failed!');

    Read the article

  • is mysql index useful on column 'state' when only doing bit-operations on the column?

    - by Geert-Jan
    I have a lot of domain entities (stored in mysql) which undergo lots of different operations. Each operation is executed from a different program. I need to keep (flow)-state for these entities which I implemented in as a long field 'flowstate' used as a bitset. to query mysql for entities which have undergone a certain operation I do something like: select * from entities where state >> 7 & 1 = 1 Indicating bit 7 (cooresponding to operation 7) has run. (<-- simplified) Anyway, I really didn't pay attention to the performance implications of this setup in the beginning, and I think I'm in a bit of trouble since queries as the above run pretty slow. What I'd like to know: Does an mysql index on 'flowstate' help at all? After all it's not a single value Mysql can quickly find using a binary sort or whatever. If it doesn't, are there any other things I could do to speed things up? . Are there special 'mask-indices' for fields with use-cases as the above? TIA, Geert-jan

    Read the article

  • Pass a range into a custom function from within a cell

    - by Luis
    Hi I'm using VBA in Excel and need to pass in the values from two ranges into a custom function from within a cell's formula. The function looks like this: Public Function multByElement(range1 As String, range2 As String) As Variant Dim arr1() As Variant, arr2() As Variant arr1 = Range(range1).value arr2 = Range(range2).value If UBound(arr1) = UBound(arr2) Then Dim arrayA() As Variant ReDim arrayA(LBound(arr1) To UBound(arr1)) For i = LBound(arr1) To UBound(arr1) arrayA(i) = arr1(i) * arr2(i) Next i multByElement = arrayA End If End Function As you can see, I'm trying to pass the string representation of the ranges. In the debugger I can see that they are properly passed in and the first visible problem occurs when it tries to read arr1(i) and shows as "subscript out of range". I have also tried passing in the range itself (ie range1 as Range...) but with no success. My best suspicion was that it has to do with the Active Sheet since it was called from a different sheet from the one with the formula (the sheet name is part of the string) but that was dispelled since I tried it both from within the same sheet and by specifying the sheet in the code. BTW, the formula in the cell looks like this: =AVERAGE(multByElement("A1:A3","B1:B3")) or =AVERAGE(multByElement("My Sheet1!A1:A3","My Sheet1!B1:B3")) for when I call it from a different sheet.

    Read the article

  • Rolling (slot machine style) nav bar in Flash or SwishMax

    - by decbrad
    Just wondering if anyone has an ideas on how this rolling (slot machine style) navigation bar was created. Maybe there's a Flash / SwishMax tutorial online somewhere? This effect is very hard to replicate because it animates very quickly onscreen, so any assistance to get me started would be great Here's a sample of what I am trying to achieve: http://osc4.template-help.com/wt_28854/menu.swf?button=1 Thanks in advance, Decbrad

    Read the article

  • Ubuntu Server running VNC

    - by xwapilot
    I have access to four computers: 1 Ubuntu Server desktop (Version 10.04) 1 Mac Mini (Snow Leopard) 1 Windows desktop (Windows 7) 1 Windows laptop (Windows Vista) The first three will always be on the home network. My goal is to SSH from the laptop into the server and be able, through VNC (or another remote desktop software), to control the windows and mac computers. The goal of this would be a slightly heightened network security over using VNC to directly access the mac or windows desktop. I have successfully used SSH to connect to the server, but have not been able to successfully implement the remote desktop connection. I would appreciate help doing so. Here's what I've done so far: As per instructions here: http://www.stuartellis.eu/articles/vnc-on-linux/ I installed the following: vnc4server – the main VNC server software vnc-java – enables access from Web browsers with Java support xvnc4viewer – a basic VNC viewer I then set up a password using the vncpasswd command. To attempt to connect to the mac, I followed directions I found in a thread at superuser. com and went to "System PreferencesSharing" and enabled "Screen Sharing". Subsequently, I tried entering the following commands into Ubuntu: vncviewer mac_ip_address::5904 vncviewer mac_ip_address:0 vncviewer mac_ip_address:1 They all returned the following: VNC Viewer Free Edition 4.1.1 for X - built Apr 9 2010 18:41:55 Copyright (C) 2002-2005 RealVNC Ltd. See http ://www .realvnc. com for information on VNC. vncviewer: unable to open display "" I'm sure I'm missing something important, but I'm not sure what it is. Do I need to have a GUI installed, or did that come with the vnc packages I installed?

    Read the article

  • norton ghost error in virtual box

    - by Nrew
    I'm trying out norton ghost on my virtual box guest os windows xp, dual boot with fedora 12. I've boot norton ghost iso. And tried to backup the partition where win xp and fedora is installed but I get this error. I'm backing it up on another virtual disk created through virtual box. What might be the cause of this error, and how to solve it.

    Read the article

  • Equivalent of describeType for Flex Component EVENTS

    - by Joshua
    Using "introspection" In Flex I can say: var classInfo:XML=describeType(SomeObject); Which will list for me the Accessors, Methods And Variables. (http://livedocs.adobe.com/flex/3/html/help.html?content=usingas_8.html) But what is the equivalent to programmatically inspect all of an object's possible EVENTS? (NOT JUST the events for which event listeners have been set, but to somehow step through a list of all VALID EVENTS for which event listeners may POTENTIALLY be set -- I realize that such lists are readily available online, and that's great for cases when I know the object's type at design type, but I require some way to inspect any given displayobject programmatically at runtime, and determine what events, if any, are or may be associated with it.)

    Read the article

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