Search Results

Search found 25579 results on 1024 pages for 'complex event processing'.

Page 78/1024 | < Previous Page | 74 75 76 77 78 79 80 81 82 83 84 85  | Next Page >

  • Complex data ordering...

    - by Povylas
    Hi, I have one tables ids in an array and they are ordered in the way I want and I have to select data from another table using those ids and in a order they are listen in the array. Pretty confusing but I was thinking of two solutions giving ORDER BY parameter the array but I do not know if that possible and another is to get all the necessary data and then turn it to array (mysql_fetch_assoc) then compare those two and somehow order the new array using the ids array. But I also do not know how to do this... Any ideas?

    Read the article

  • antlr line after line processing

    - by pawloch
    I'm writing simple language in ANTLR, and I'd like to write shell where I can put line of code, hit ENTER and have it executed, enter another line, and have it executed. I have already written grammar which execute all alines of input at one. Example input: int a,b,c; string d; string e; d=\"dziala\"; a=4+7; b=a+33; c=(b/11)*2; grammar Kalkulator; options { language = Java; output=AST; ASTLabelType=CommonTree; } tokens { NEG; } @header { package lab4; } @lexer::header { package lab4; } line : (assignment | declaration)* EOF ; declaration : type^ IDENT (','! IDENT)* ';'! ; type : 'int' | 'string' ; assignment : IDENT '='^ expression ';'! ; term : IDENT | INTEGER | STRING_LITERAL | '('! expression ')'! ; unary : (( negation^ | '+'! ))* term ; negation : '-' -> NEG ; mult : unary ( ('*'^ | '/'^) unary )* ; exp2 :mult ( ('-'^ | '+'^) mult)* ; expression : exp2 ('&'^ exp2)* ; fragment LETTER : ('a'..'z'|'A'..'Z'); fragment DIGIT : '0'..'9'; INTEGER : DIGIT+; IDENT : LETTER (LETTER | DIGIT)* ; WS : (' ' | '\t' | '\n' | '\r' | '\f')+ {$channel=HIDDEN;}; STRING_LITERAL : '\"' .* '\"'; and: tree grammar Evaluator; options { language = Java; tokenVocab = Kalkulator; ASTLabelType = CommonTree; } @header { package lab4; import java.util.Map; import java.util.HashMap; } @members { private Map<String, Object> zmienne = new HashMap<String, Object>(); } line returns [Object result] : (declaration | assignment { result = $assignment.result; })* EOF ; declaration : ^(type ( IDENT { if("string".equals($type.result)){ zmienne.put($IDENT.text,""); //add definition } else{ zmienne.put($IDENT.text,0); //add definition } System.out.println($type.result + " " + $IDENT.text);//write output } )* ) ; assignment returns [Object result] : ^('=' IDENT e=expression) { if(zmienne.containsKey($IDENT.text)) {zmienne.put($IDENT.text, e); result = e; System.out.println(e); } else{ System.out.println("Blad: Niezadeklarowana zmienna"); } } ; type returns [Object result] : 'int' {result="int";}| 'string' {result="string";} ; expression returns [Object result] : ^('+' op1=expression op2=expression) { result = (Integer)op1 + (Integer)op2; } | ^('-' op1=expression op2=expression) { result = (Integer)op1 - (Integer)op2; } | ^('*' op1=expression op2=expression) { result = (Integer)op1 * (Integer)op2; } | ^('/' op1=expression op2=expression) { result = (Integer)op1 / (Integer)op2; } | ^('%' op1=expression op2=expression) { result = (Integer)op1 \% (Integer)op2; } | ^('&' op1=expression op2=expression) { result = (String)op1 + (String)op2; } | ^(NEG e=expression) { result = -(Integer)e; } | IDENT { result = zmienne.get($IDENT.text); } | INTEGER { result = Integer.parseInt($INTEGER.text); } | STRING_LITERAL { String t=$STRING_LITERAL.text; result = t.substring(1,t.length()-1); } ; Can I make it process line-by-line or is that easier to make it all again?

    Read the article

  • database transaction rollback processing in PHP

    - by user198729
    try { $con->beginTransaction(); $this->doSave($con); $con->commit(); } catch (Exception $e) { $con->rollBack(); throw $e; } The code above is quite standard an approach to deal with transactions, but my question is:what if $con->rollBack() also fails? It may cause db lock,right?If so,what's the perfect way to go?

    Read the article

  • Handle complex options with Boost's program_options

    - by R S
    I have a program that generates graphs using different multi-level models. Each multi-level model consists of a generation of a smaller seed graph (say, 50 nodes) which can be created from several models (for example - for each possible edge, choose to include it with probability p). After the seed graph generation, the graph is expanded into a larger one (say 1000 nodes), using one of another set of models. In each of the two stages, each model require a different number of parameters. I would like to be have program_options parse the different possible parameters, according to the names of the models. For example, say I have two seed graphs models: SA, which has 1 parameters, and SB, which has two. Also for the expansion part, I have two models: A and B, again with 1 and 2 parameters, respectively. I would like to be able do something like: ./graph_generator --seed=SA 0.1 --expansion=A 0.2 ./graph_generator --seed=SB 0.1 3 --expansion=A 0.2 ./graph_generator --seed=SA 0.1 --expansion=B 10 20 ./graph_generator --seed=SB 0.1 3 --expansion=B 10 20 and have the parameters parsed correctly. Is that even possible?

    Read the article

  • How to filter rows on a complex filter

    - by dan
    I have these rows in a table ID Name Price Delivery == ==== ===== ======== 1 apple 1 1 2 apple 3 2 3 apple 6 3 4 apple 9 4 5 orange 4 6 6 orange 5 7 I want to have the price at the third delivery (Delivery=3) or the last price if there's no third delivery. It would give me this : ID Name Price Delivery == ==== ===== ======== 3 apple 6 3 6 orange 5 7 I don't necessary want a full solution but an idea of what to look for would be greatly appreciated.

    Read the article

  • Complex multiple join query across 3 tables

    - by Keir Simmons
    I have 3 tables: shops, PRIMARY KEY cid,zbid shop_items, PRIMARY KEY id shop_inventory, PRIMARY KEY id shops a is related to shop_items b by the following: a.cid=b.cid AND a.zbid=b.szbid shops is not directly related to shop_inventory shop_items b is related to shop_inventory c by the following: b.cid=c.cid AND b.id=c.iid Now, I would like to run a query which returns a.* (all columns from shops). That would be: SELECT a.* FROM shops a WHERE a.cid=1 AND a.zbid!=0 Note that the WHERE clause is necessary. Next, I want to return the number of items in each shop: SELECT a.*, COUNT(b.id) items FROM shops a LEFT JOIN shop_items b ON b.cid=a.cid AND b.szbid=a.zbid WHERE a.cid=1 GROUP BY b.szbid,b.cid As you can see, I have added a GROUP BY clause for this to work. Next, I want to return the average price of each item in the shop. This isn't too hard: SELECT a.*, COUNT(b.id) items, AVG(COALESCE(b.price,0)) average_price FROM shops a LEFT JOIN shop_items b ON b.cid=a.cid AND b.szbid=a.zbid WHERE a.cid=1 GROUP BY b.szbid,b.cid My next criteria is where it gets complicated. I also want to return the unique buyers for each shop. This can be done by querying shop_inventory c, getting the COUNT(DISTINCT c.zbid). Now remember how these tables are related; this should only be done for the rows in c which relate to an item in b which is owned by the respective shop, a. I tried doing the following: SELECT a.*, COUNT(b.id) items, AVG(COALESCE(b.price,0)) average_price, COUNT(DISTINCT c.zbid) FROM shops a LEFT JOIN shop_items b ON b.cid=a.cid AND b.szbid=a.zbid LEFT JOIN shop_inventory c ON c.cid=b.cid AND c.iid=b.id WHERE a.cid=1 GROUP BY b.szbid,b.cid However, this did not work as it messed up the items value. What is the proper way to achieve this result? I also want to be able to return the total number of purchases made in each shop. This would be done by looking at shop_inventory c and adding up the c.quantity value for each shop. How would I add that in as well?

    Read the article

  • Count the number of objects in an Image

    - by kunjaan
    I am investigating the possibility of image processing to identify certain objects and also count them in an image. I will be given a picture and I need to identify the number of boxes present in that image. Does anybody have any experience with any Machine Vision/ Image Processing libraries like ImageJ, Fiji, JAI, jMagick ,Java Vision Toolkit? Which do you think is best suited for the job? What do you guys suggest? If the APIs can be used from Java, it would be better. Thank you. Edit: I am dealing with warehouse brown boxes. Yes I am talking about regular photos. The source is usually a mobile phone picture.

    Read the article

  • Rails botches the SQL on a complex save

    - by Dan B
    Hi, I am doing something seemingly pretty easy, but Rails is messing up the SQL. I could just execute my own SQL, but the framework should be able to handle this. Here is the save I am trying to perform: w = WhipSenVote.find(:first, :conditions => ["whip_bill_id = ? AND whip_sen_id = ?", bill_id, k]) w.votes_no = w.votes_no - 1 w.save My generated SQL looks like this: SELECT * FROM "whip_sen_votes" WHERE (whip_bill_id = E'1' AND whip_sen_id = 7) LIMIT 1 And then: UPDATE "whip_sen_votes" SET "votes_yes" = 14, "updated_at" = '2009-11-13 19:55:54.807000' WHERE "id" = 15 The first select statement is correct, but as you can see, the Update SQL statement is pretty wrong, though the votes_yes value is correct. Any ideas? Thanks!

    Read the article

  • wget not completely processing the http call

    - by user578458
    Here is a wget command that executes a HTML / PHP stack report suite that is hosted by a third party - we don't have control over the PHP or HTML page wget --no-check-certificate --http-user=/myacc --http-password=mypass -O /tmp/myoutput.csv "https://myserver.mydomain.com/mymodule.php?myrepcode=9999&action=exportcsv&admin=myappuserid&password=myappuserpass&startdate=2011-01-16&enddate=2011-01-16&reportby=mypreferredview" All the elements are working perfectly: --http-user / --http-pass as offered by a browsers standard popup for username and password prompt -O /tmp/myoutput.csv - the output file of interest https://myserver.mydomain.com/mymodule.php?myrepcode=9999&action=exportcsv&admin=myappuserid&password=myappuserpass&startdate=2011-01-16&enddate=2011-01-16&reportby=mypreferredview" The file generated on the fly by the parameters myrepcode=9999 - a reference to the report in question action=exportcsv internally written in the function admin=myappuserid the third party operats SSL to access the site - then internal username and password stored in a database to access the functions of the site) password=myappuserpass startdate=2011-01-16 this and end data are parameters specific to the report 9999 enddate=2011-01-16 reportby=mypreferredview This is an option in the report that facilitates different levels of detail or aggregation The problem is that the reportby parameter is a radio button selection in a list of 5 selections (sure I enough the default is highest level of aggregation , I want the last one which is the most detailed) Here is a sample of the HTML page code for the options of reportby View by The Default My Least Preferred My Second Least Preferred My Third Least Preferred My Preferred No matter which of the reportby items I select in the wget statement - thedefault is always executed. Questions 1) Has anyone come across this notation in HTML (id=inputname[inputelement]) I spoke to a senior web developer and he has never seen this notation for inputs (id=inputname[inputelement]) - and w3schools do not appear familiar with this either based on an extensive search 2) Can a wget command select a none default radio item when executing the command ? This probably will be initially received with a "Use CURL" response- however the wget approach works very well in the limited environment I am operating in - particularly as I need to download 10000 of these such items. Thanks ahead of response

    Read the article

  • Dynamic form in PHP not processing correctly

    - by user1497265
    My last question regarding this suggested I incorporate AJAX with PHP. However, I really wanted to try PHP exclusively for this project, and I seem to have made it about 95% there. I just need help on this one issue. Here's a quick background. My project requires a dynamic form to be populated with a max limit of 10 questions. Each form contains one question, one question number, and a text field. Students would go on and answer the questions. This is all driven by a database table (obviously), and when a question gets answered correctly, it will close and the next question in line will appear. There will always be 10 questions on the page. Here's how the coding looks, and it works perfectly. <? $rt = mysql_query("SELECT * FROM The_Questions WHERE Status='Open' ORDER BY 'Number' LIMIT 10"); while ($row = mysql_fetch_array($rt)) { $number=$row[0]; $category = $row[1]; $question=$row[2]; $points=$row[4]; $_SESSION['number'] = $number; ?> <form action="processor.php" method="post" class="qForm"> <div class="questionCell"> <div class="question"><? echo $number; echo $question ?></div> <div class="answer">Answer: <input class="inputField" name="q1" type="text" size="40" maxlength="40" /> <input name="HHQuestion" value="Submit" type="submit" /></div> </div> </form> <? } ?> The questions appear as they should, in the correct order, and the correct limit. Everything seems to be looking fine until a question gets answered and gets processed through the processor.php action. First here's the code to the processor.php file: <?php session_start(); if(isset($_POST["HHQuestion"])){ $dbhost = 'localhost'; $dbname = 'localhost'; $dbuser = 'localhost'; $dbpass = 'localhost'; $conn = mysql_connect($dbhost, $dbuser, $dbpass); mysql_select_db($dbname, $conn); { $number1 = $_SESSION['number']; $answer=$_POST['q1']; $sql="SELECT * FROM The_Questions WHERE Number='$number1'"; $result=mysql_query($sql); $row=mysql_fetch_array($result); $question = $row[2]; echo $question .'<br>'; echo $number1.'<br>'; echo $answer; } } ?> This is NOT live yet, and for testing purposes I'm echoing the question, question number, and answer (as you can see). What's happening is that the $question and $number1 displays the last question in the array (the $answer displays correctly, meaning it displays whatever was written in the dynamic form). Can anyone tell me why that is? If I change the LIMIT number to 20, the processor.php action will display the 20th question and number, even if I was answering question 8, for example, in the dynamic form. Again, the dynamic forms are being displayed correctly, and are numbered correctly. For some unknown reason to me, the action - processor.php - is grabbing the last question in the array. Any ideas on what I'm doing wrong? I'm hoping it's a simple code change that I'm overlooking. Thanks in advance guys!

    Read the article

  • Exception during processing XSLT transformation!

    - by Artic
    I'm using this code to generate contents file. try { StreamResult result = new StreamResult(); TransformerFactory tf = TransformerFactory.newInstance(); Templates templ = tf.newTemplates(xsltSource); Transformer transf = templ.newTransformer(); for (String item: groups){ item = item.replaceAll(" ", "-").toLowerCase(); result.setOutputStream(new FileOutputStream(path+item+".html")); transf.clearParameters(); transf.setParameter("group", item); transf.transform(xmlSource, result); } } catch (TransformerConfigurationException e) { throw new SinkException(e.getMessage()); } catch (TransformerException e) { throw new SinkException(e.getMessage()); } But on second iteration I have an exception ERROR: javax.xml.transform.TransformerException: com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: Read error Cann't understand what is the reason?

    Read the article

  • Complex MySQL table select/join with pre-condition

    - by Howard
    Hello, I have the schema below CREATE TABLE `vocabulary` ( `vid` int(10) unsigned NOT NULL auto_increment, `name` varchar(255), PRIMARY KEY vid (`vid`) ); CREATE TABLE `term` ( `tid` int(10) unsigned NOT NULL auto_increment, `vid` int(10) unsigned NOT NULL default '0', `name` varchar(255), PRIMARY KEY tid (`tid`) ); CREATE TABLE `article` ( `aid` int(10) unsigned NOT NULL auto_increment, `body` text, PRIMARY KEY aid (`aid`) ); CREATE TABLE `article_index` ( `nid` int(10) unsigned NOT NULL default '0', `tid` int(10) unsigned NOT NULL default '0' ) INSERT INTO `vocabulary` values (1, 'vocabulary 1'); INSERT INTO `vocabulary` values (2, 'vocabulary 2'); INSERT INTO `term` values (1, 1, 'term v1 t1'); INSERT INTO `term` values (2, 1, 'term v1 t2 '); INSERT INTO `term` values (3, 2, 'term v2 t3'); INSERT INTO `term` values (4, 2, 'term v2 t4'); INSERT INTO `term` values (5, 2, 'term v2 t5'); INSERT INTO `article` values (1, ""); INSERT INTO `article` values (2, ""); INSERT INTO `article` values (3, ""); INSERT INTO `article` values (4, ""); INSERT INTO `article` values (5, ""); INSERT INTO `article_index` values (1, 1); INSERT INTO `article_index` values (1, 3); INSERT INTO `article_index` values (2, 2); INSERT INTO `article_index` values (3, 1); INSERT INTO `article_index` values (3, 3); INSERT INTO `article_index` values (4, 3); INSERT INTO `article_index` values (5, 3); INSERT INTO `article_index` values (5, 4); Example. Select term of a defiend vocabulary (with non-zero article index), e.g. vid=2 select a.tid, count(*) as article_count from term t JOIN article_index a ON t.tid = a.tid where t.vid = 2 group by t.tid; +-----+---------------+ | tid | article_count | +-----+---------------+ | 3 | 4 | | 4 | 1 | +-----+------------ Question: Select terms a. of a defiend vocabulary (with non-zero article index, e.g. vid=1 = term {1,2}) b. given that those terms are linked with articles which are linked with terms under vid=2, e.g. = {1}, term with tid=2 is excluded since no linkage to terms under vid=2 SQL: Any idea? Expected result: +-----+---------------+ | tid | article_count | +-----+---------------+ | 1 | 2 | +-----+---------------+

    Read the article

  • XSLT processing with Qt

    - by swegi
    Hi, I like to display some (X)HTML content in a Qt application using QtWebKit. The content should be generated from XML documents via XSLT. As I am new to Qt, my questions are as follows: 1) Can QtWebKit display XML documents with the xml-stylesheet element set? 2) Can Qt apply XSLT to an XML document and return the result as a string or write it to a file?

    Read the article

  • Processing data from an AJAX request

    - by Josh K
    I have a PHP API I'm working with that outputs everything as JSON. I need to call one of the API methods and parse it out using an AJAX request. I am using jQuery (though it shouldn't matter). When I make the request it errors out with a "parsererror" as the textStatus and a "Syntax Error: invalid label" when I make the request. Simplified code: $.ajax ({ type: "POST", url: "http://mydomain.com/api/get/userlist/"+mid, dataType: "json", dataFilter: function(data, type) { /* Here we assume and pray */ users = eval(data); alert(users[1].id); }, success: function(data, textStatus, XMLHttpRequest) { alert(data.length); // Should be an array, yet is undefined. }, error: function(XMLHttpRequest, textStatus, errorThrown) { alert(textStatus); alert(errorThrown); }, complete: function(XMLHttpRequest, textStatus) { alert("Done"); } }); If I leave off the eval(data) then everything works fine. Well, except for data still being undefined in success. Note that I'm taking an array of objects in PHP and then passing them out through json_encode. Would that make any difference? There has been no progress made on this. I'm willing to throw more code up if someone believes they can help. Here is the PHP side of things private function _get_user_colors($id) { $u = new User(); $u->get_where(array('id' => $id)); $bar = array(); $bar['user'] = $u->stored; foreach($user->colors as $color) { $bar['colors'][] = $color; } echo(json_encode($bar)); } I have had zero issues using this with other PHP based scripts. I don't know why Javascript would take issue with it.

    Read the article

  • AngularJS - Processing $http response in service

    - by bsreekanth
    I recently posted a detailed description of the issue I am facing here at SO. As I couldn't send an actual $http request, I used timeout to simulate asynchronous behavior. Data binding from my model to view is working correct, with the help of @Gloppy Now, when I use $http instead of $timeout (tested locally), I could see the asynchronous request was successful and data is filled with json response in my service. But, my view is not updating. updated Plunkr here

    Read the article

  • Jquery UI autocomplete event change

    - by Stenly.k
    Hi I got a problem with change event. By documntation there should be object ui.item After an item was selected; ui.item refers to the selected item. Always triggered after the close event. But when I try it ui.item is undefined :( I want unset s_town_id when input in autocomplete doesn't match with data from script. Thx for any help. <input id="s_town" type="text" name="s_town" /> <input type="text" id="s_town_id" name="s_town_id" /> $(function() { $("#s_town").autocomplete({ source: function(request, response) { $.ajax({ url: "/_system/_ajax/uiautocomplete.php", dataType: "json", data: { name: "s_town", term: request.term }, success: function(data) { response($.map(data, function(item) { return { label: item.whisper_name+ " [" + item.zip_code + " / " + item.lup_state + "]", value: item.whisper_name, id: item.whisper_id, zip_code: item.zip_code, lup_state: item.lup_state, stateid: item.stateid } })) } }) }, minLength: 2, select: function(event, ui) { $("#s_town_id").val(ui.item.id); }, change: function(event, ui) { // ui.item is undefined :( where is the problem? $("#s_town_id").val(ui.item.id); } }); });

    Read the article

  • Modal forms get in the way of processing

    - by Botax
    I’m working on an interface in VB6 to interact with a sound editor to automate certain tasks mainly using the editor’s object handles and activating them through SendMessage/PostMessage. In general it works OK, except that the editor has some dialog boxes that open in modal mode and freeze everything on the interface, including the timers. Is there a practical way to get these dialog boxes to open modeless or to interact with them from the interface after they pop up? I tried an MDI form, but it also freezes along with everything else. The only way to override the modal mode of these boxes is to launch an independent applet beforehand to address the dialog boxes with a timer, but the process is somewhat cumbersome. All I need to do with the dialog boxes is click the OK button or hit the return key.

    Read the article

  • Histrogram matching - image processing - c/c++

    - by Raj
    Hello I have two histograms. int Hist1[10] = {1,4,3,5,2,5,4,6,3,2}; int Hist1[10] = {1,4,3,15,12,15,4,6,3,2}; Hist1's distribution is of type multi-modal; Hist2's distribution is of type uni-modal with single prominent peak. My questions are Is there any way that i could determine the type of distribution programmatically? How to quantify whether these two histograms are similar/dissimilar? Thanks

    Read the article

  • How to properly manage a complex DB structure?

    - by errr
    Let's say you have several systems using the same DB - each uses several schemes (sometimes same as the other). This structure of these schemes is somewhat very big and complicated. Now, how could you possibly manage such scheme structure? Obviously using some sort of "configuration" - the simplest would be SQL scripts, but a more reasonable solution would be XMLs which can be easily converted into SQL, or some other readable solution (for example, JPA's XMLs or Annotations). This solution though, causes a problem where you can't really tell if your configuration matches the structure of the DB schemes exactly. You can't say if those two are synchronized. Why wouldn't they? Well, in such big structure there are going to be many changes, and you won't always remember to save/commit your configuration after you've altered the schemes, or maybe you did save/commit it, but eventually didn't altered anything in the schemes and forgot to undo the changes to the configuration. More than that, another problem (not caused by the configuration, but isn't addressed by it either) is versioning. I don't see any good way of managing the DB schemes versions (say our last alteration makes 3 systems crash - not good, how to "rollback"?). And thoughts? thx.

    Read the article

  • Casting complex class into a dataset?

    - by iTayb
    This is the class I'm trying to turn into a dataset: public class BookStore { private List<Book> booksList; } public class Book { private string name; private string imageurl; private string subject; private string author; private int level; private int year; private int rating; private List<string> booksellers; private List<decimal> bookprices; } There are proprieties, of course. How can I turn it into a dataset? Thank you very much.

    Read the article

  • Processing large (over 1 Gig) files in PHP using stream_filter_*

    - by mike
    $fp_src=fopen('file','r'); $filter = stream_filter_prepend($fp_src, 'convert.iconv.ISO-8859-1/UTF-8'); while(fread($fp_src,4096)){ ++$count; if($count%1000==0) print ftell($fp_src)."\n"; } When I run this the script ends up consuming ~ 200 MB of RAM after going through just 35MB of the file. Running it without the stream_filter zips right through with a constant memory footprint of ~10 MB. What gives?

    Read the article

  • Transmitting complex objects using TCP

    - by Rakesh K
    I have a client server application in which I need to transmit a user defined object from Client to Server using TCP connection. My object is of the following structure: class Conversation { private string convName, convOwner; public ArrayList convUsers; public string getConvName() { return this.convName; } public string getConvOwner() { return this.convOwner; } } Please help me how to transmit this object at from client and again de-serialize it into appropriate object at server side.

    Read the article

  • Processing a method after the view has loaded..

    - by Susanth
    Hi ! I have implemented a subview which is supposed to load immediately when I click a button in the parent view. After loading the subview(which is basically holding an activityindicator), the program is supposed to process a method(which gets data from a server, so takes time) in it. However, I am unable to do it. What happens now is, when I click the button on the parent view, it processes the method first and only after that does the subview load on screen. Why is this so? Is there any specific functions I could use to make my method load only after the view has loaded?

    Read the article

< Previous Page | 74 75 76 77 78 79 80 81 82 83 84 85  | Next Page >