Search Results

Search found 13889 results on 556 pages for 'results'.

Page 36/556 | < Previous Page | 32 33 34 35 36 37 38 39 40 41 42 43  | Next Page >

  • Linq merging results

    - by glenneroo
    I'm working with a list within a list. This is how I'm currently searching: var tags = from fd in BigList from tag in fd.Tags where tag.Id == selectedTag.Id || tag.Id == ID.TIMESTAMP select new { fd.Name, tag.Id, tag.Value }; I then iterate over the result-set and remembering when Timestamp pops up for the next entry, needless to say this is sloppy and I'm positive there's a better way using Linq, I just can't seem to find the syntax. Here's some sample output (Id indicates what type of data is stored inside e.g. a timestamp): Name | Id | Value -----|----|---------- 0000 | 1 | <timestamp> 0000 | 2 | 1.2 ... 9999 | 1 | <timestamp> 9999 | 2 | 6.3 I need all instances where Id = selectedTag.Id. I just want 1 list with Name, Id, Value and Timestamp, but the problem is my above attempt returns 2 entries for every item (1 for timestamp and 1 for the value). Is there a way to do this using Linq? Preferably using query syntax! :)

    Read the article

  • openquery giving differnt results

    - by Mithil Deshmukh
    I have 2 similar queries select * from openquery(powerschool, 'select * from TEACHERS where teachernumber is not null and schoolid=''1050'' and teacherloginid is not null order by teachernumber') and SELECT * from openquery(powerschool, 'SELECT NVL(teachernumber,'''') from TEACHERS where teachernumber is not null and schoolid=''1050'' and teacherloginid is not null order by teachernumber') The first one is giving me 182 rows while the second one gives me 83. What's wrong with the queries?

    Read the article

  • Using a Time Zone Conversion When Dynamically Generating Results

    - by John
    Hello, If I understand correctly, the code below converts $row["datesubmitted"] from one timezone to another. I would like to print the converted $row["datesubmitted"] dynamically in an HTML table. Is there a way that I can apply the conversion below for each row that is pulled from MySQL? I assume that I can't just plug $row["dt"] into the code since there is no field called "dt" in the MySQL that I am using. Thanks in advance, John $dt = new DateTime($row["datesubmitted"], $tzFrom); $dt->setTimezone($tzTo);

    Read the article

  • strange results with /fp:fast

    - by martinus
    We have some code that looks like this: inline int calc_something(double x) { if (x > 0.0) { // do something return 1; } else { // do something else return 0; } } Unfortunately, when using the flag /fp:fast, we get calc_something(0)==1 so we are clearly taking the wrong code path. This only happens when we use the method at multiple points in our code with different parameters, so I think there is some fishy optimization going on here from the compiler (Microsoft Visual Studio 2008, SP1). Also, the above problem goes away when we change the interface to inline int calc_something(const double& x) { But I have no idea why this fixes the strange behaviour. Can anyone explane this behaviour? If I cannot understand what's going on we will have to remove the /fp:fastswitch, but this would make our application quite a bit slower.

    Read the article

  • Using cProfile results with KCacheGrind

    - by Adam Luchjenbroers
    I'm using cProfile to profile my Python program. Based upon this talk I was under the impression that KCacheGrind could parse and display the output from cProfile. However, when I go to import the file, KCacheGrind just displays an 'Unknown File Format' error in the status bar and sits there displaying nothing. Is there something special I need to do before my profiling stats are compatible with KCacheGrind? ... if profile: import cProfile profileFileName = 'Profiles/pythonray_' + time.strftime('%Y%m%d_%H%M%S') + '.profile' profile = cProfile.Profile() profile.run('pilImage = camera.render(scene, samplePattern)') profile.dump_stats(profileFileName) profile.print_stats() else: pilImage = camera.render(scene, samplePattern) ... Package Versions KCacheGrind 4.3.1 Python 2.6.2

    Read the article

  • Mule ESB 3.2 Splitter destroys Enricher results

    - by Eddie
    Here is the snippet of my flow: <logger message="PRODUCT_ID = #[header:productID]" level="INFO" doc:name="Logger"/> <splitter evaluator="jxpath" expression="//*/BisacHeaderCodes" doc:name="Splitter"/> <logger message="PRODUCT_ID_POST_SPLITTER = #[header:productID]" level="INFO" doc:name="Logger"/> #[header:productID] was set up prior to Logger call. I tried #[variable:productID] and got the same result. When I run it, this is the out put I get: INFO 2012-04-05 23:12:47,865 [[bookinista_order_management].connector.http.mule.default.receiver.02] org.mule.api.processor.LoggerMessageProcessor: PRODUCT_ID = 72 ERROR 2012-04-05 23:12:47,871 [[bookinista_order_management].connector.http.mule.default.receiver.02] org.mule.exception.DefaultSystemExceptionStrategy: Caught exception in Exception Strategy: Expression Evaluator "header" with expression "outbound:productID" returned null but a value was required. org.mule.api.expression.RequiredValueException: Expression Evaluator "header" with expression "outbound:productID" returned null but a value was required. So, right before Splitter, I have a perfect value in my header, and right after Splitter, that value disappears! I understand that Splitter propagates only part of payloda, but shouldn't it leave headers and variables alone? Any ideas for a workaround?

    Read the article

  • Different Paramater Value Results In Slow Query

    - by alphadogg
    I have an sproc in SQL Server 2008. It basically builds a string, and then runs the query using EXEC(): SELECT * FROM [dbo].[StaffRequestExtInfo] WITH(nolock,readuncommitted) WHERE [NoteDt] < @EndDt AND [NoteTypeCode] = @RequestTypeO AND ([FNoteDt] >= @StartDt AND [FNoteDt] <= @EndDt) AND [FStaffID] = @StaffID AND [FNoteTypeCode]<>@RequestTypeC ORDER BY [LocName] ASC,[NoteID] ASC,[CNoteDt] ASC All but @RequestTypeO and @RequestTypeF are passed in as sproc parameters. The other two are built from a parameter into local variables. Normally, the query runs under one second. However, for one particular value of @StaffID, the execution plan is different and about 30x slower. In either case, the amount of data returned is generally the same, but execution time goes way up. I tried to recompile the sproc. I also tried to "copy" @StaffID into a local @LocalStaffID. Neither approach made any difference. Any ideas?

    Read the article

  • Echo mysql results in a loop?

    - by Roy D. Porter
    I am using turn.js to make a book. Every div within the 'deathnote' div becomes a new page. <div id="deathnote"> //starts book <div style="background-image:url(images/coverpage.jpg);"></div> //creates new page <div style="background-image:url(images/paper.jpg);"></div> //creates new page <div style="background-image:url(images/paper.jpg);"></div> //creates new page </div> //ends book What I am doing is trying to get 3 'content' (content being a name and cause of death) divs onto 1 page, and then generate a new page. So here is what i want: <div id="deathnote"> //starts book <div style="background-image:url(images/coverpage.jpg);"></div> //creates new page <div style="background-image:url(images/paper.jpg);"></div> //creates new page <div style="background-image:url(images/paper.jpg);"> //creates new page but leaves it open <div> CONTENT </div> <div> CONTENT </div> <div> CONTENT </div> </div> //ends the page </div> //ends book Seems simple enough, however the content is data from a MySQL DB, so i have to echo it in using PHP. Here is what i have so far <div id="deathnote"> <div style="background-image:url(images/coverpage.jpg);"></div> <div style="background-image:url(images/paper.jpg);"></div> <div style="background-image:url(images/paper.jpg);"></div> <div style="background-image:url(images/paper.jpg);"></div> <div style="background-image:url(images/paper.jpg);"></div> <div style="background-image:url(images/paper.jpg);"></div> <?php $pagecount = 0; $db = new mysqli('localhost', 'username', 'passw', 'DB'); if($db->connect_errno > 0){ die('Unable to connect to database [' . $db->connect_error . ']'); } $sql = <<<SQL SELECT * FROM `TABLE` SQL; if(!$result = $db->query($sql)){ die('There was an error running the query [' . $db->error . ']'); } //IGNORE ALL OF THE GARBAGE ABOVE. IT IS SIMPLE CONNECTING SCRIPT THAT I KNOW WORKS //THE METHOD I AM HAVING TROUBLE WITH IS BELOW $pagecount = 0; while($row = $result->fetch_assoc()){ //GETS THE VALUE (and makes sure it isn't nothing echo '<div style="background-image:url(images/paper.jpg);">'; //THIS OPENS A NEW PAGE while ($pagecount !== 3) { //KEEPS COUNT OF HOW MUCH CONTENT DIVS IS ON THE PAGE while($row = $result->fetch_assoc()){ //START A CONTENT DIV echo '<div class="content"><div class="name">' . $row['victim'] . '</div><div class="cod">' . $row['cod'] . '</div></div>'; //END A CONTENT DIV $pagecount++; //UP THE PAGE COUNT } } $pagecount=0; //PUT IT BACK TO 0 echo '</div>'; //END PAGE } $db->close(); ?> <div style="background-image:url(images/backpage.jpg);"></div> //BACK PAGE </div> At the moment i seem to be causing and infinite loop so the page won't load. The problem resides within the while loops. Any help is greatly appreciated. Thanks in advance guys. :)

    Read the article

  • Tableview with sections managed by fetched results controller

    - by Matthes
    Hi, I'm quite new to CoreData and need help with one issue. I have tableview which simply lists cities stored in SQLite db. City is defined by "cityId" and "name" attributes. Data are fetched using NSFetchedResultsController and everything works fine except that I can't figure out how to make FetchedResultsController to group cities by first letter of city names. When I supply "name" for sectionNameKeyPath argument of initWithFetchRequest:managedObjectContext:sectionNameKeyPath:cacheName: method, it creates section for each city, which is obviously something I don't want. I can't figure out how to create an expression which would make it work in way I need. thanks for any tips and/or advices on this Matthes

    Read the article

  • django: results in in_bulk style without IDs

    - by valya
    in django 1.1.1, Place.objects.in_bulk() does not work and Place.objects.in_bulk(range(1, 100)) works and returns a dictionary of Ints to Places with indexes - primary keys. How to avoid using range in this situation (and avoid using a special query for ids, I just want to get all objects in this dictionary format) >>> Place.objects.in_bulk() Traceback (most recent call last): File "<console>", line 1, in <module> File "/usr/lib/python2.5/site-packages/Django-1.1.1-py2.5.egg/django/db/models/manager.py", line 144, in in_bulk return self.get_query_set().in_bulk(*args, **kwargs) TypeError: in_bulk() takes exactly 2 arguments (1 given) >>> Place.objects.in_bulk(range(1, 100)) {1L: <Place: "??? ????">, 3L: <Place: "???????????? ?????">, 4L: <Place: "????????? "??????"">, 5L: <Place: "????????? "??????"">, 8L: <Place: "????????? "??????????????"">, 9L: <Place: "??????? ????????">, 10L: <Place: "????????? ???????">, 11L: <Place: "??????????????? ???">, 14L: <Place: "????? ????? ??????">}

    Read the article

  • two AES implementations generated different encryption results

    - by YCL
    I have an application that uses an opensource "libgcrypt" to encrypt/decrypt a data block (32 bytes). Now I am going to use Microsoft CryptAPI to replace it. My problem is that the libgcrypt and cryptApi approaches generate different ciphertext contents as I use the same AES-256 algoritjm in CFB mode, same key, and same IV, although the ciphertext can be decrypted by their own correspndingly. Could some tell me what is the problem? Thanks.

    Read the article

  • Consistent HashCode() and Equals() results, but inconsistent TreeMap.containsKey() result

    - by smessing
    I have the following object Node: private class Node implements Comparable<Node>(){ private String guid(); ... public boolean equals(Node o){ return (this == o); } public int hashCode(){ return guid.hashCode(); } ... } And I use it in the following TreeMap: TreeMap<Node, TreeSet<Edge>> nodes = new TreeMap<Node, TreeSet<Edge>>(); Now, the tree map is used in a class called Graph to store nodes currently in the graph, along with a set of their edges (from the class Edge). My problem is when I try to execute: public containsNode(n){ for (Node x : nodes.keySet()) { System.out.println("HASH CODE: "); System.out.print(x.hashCode() == n.hashCode()); System.out.println("EQUALS: "); System.out.print(x.equals(n)); System.out.println("CONTAINS: "); System.out.print(nodes.containsKey(n)); System.out.println("N: " + n); System.out.println("X: " + x); } } I sometimes get the following: HASHCODE: true EQUALS: true CONTAINS: false N: foo X: foo Anyone have an idea as to what I'm doing wrong? I'm still new to all this, so I apologize in advance if I'm overlooking something simple (I know hashCode() doesn't really matter for TreeMap, but I figured I'd include it).

    Read the article

  • How to exclude results with get_object_or_404?

    - by googletorp
    In Django you can use the exclude to create SQL similar to not equal. An example could be. Model.objects.exclude(status='deleted') Now this works great and exclude is very flexible. Since I'm a bit lazy, I would like to get that functionality when using get_object_or_404, but I haven't found a way to do this, since you cannot use exclude on get_object_or_404. What I want is to do something like this: model = get_object_or_404(pk=id, status__exclude='deleted') But unfortunately this doesn't work as there isn't an exclude query filter or similar. The best I've come up with so far is doing something like this: object = get_object_or_404(pk=id) if object.status == 'deleted': return HttpResponseNotfound('text') Doing something like that, really defeats the point of using get_object_or_404, since it no longer is a handy one-liner. Alternatively I could do: object = get_object_or_404(pk=id, status__in=['list', 'of', 'items']) But that wouldn't be very maintainable, as I would need to keep the list up to date. I'm wondering if I'm missing some trick or feature in django to use get_object_or_404 to get the desired result?

    Read the article

  • Conversion from C code to CudaC code I get unpredictable results

    - by Abhi
    include include include include define pi 3.14159265359 lo*lo*p-2*mu,freq=2.25*1e6,wavelength=(long double)lo/freq,dh=(long double)wavelength/ 30.0,dt=(long double)dh/(lo*1.5); (1000*dh)); (p*dh),lambdaplus2mudtbydh=(lambda+2*mu)*dt/dh,lambdadtbydh=lambda*dt/dh,dtmubydh=dt*mu/ dh; double**U,long double**V){ for(int k=0,l=0;k<=yno-1 && l<=yno;k++,l++){ U[i+1][l]+=dtbyrhodh*(X[i+1][l+1]-X[i+1][l]+Z[i+1][l]- Z[i][l]); [k+1]-Y[j][k+1]); } double**U,long double**V){ for(int k=0,l=0;k<=yno-1 && l<=yno;k++,l++){ U[i+1][k])+lambdadtbydh*(V[i+1][k+1]-V[i][k+1]); V[i][k+1])+lambdadtbydh*(U[i+1][k+1]-U[i+1][k]); U[j][l]); int main(){ clock_t start,end; long double time_taken; start=clock(); long double **X,**Y,**U,**V,**Z;int n=1; X=Make2DDoubleArray(xno+2,yno+2); Y=Make2DDoubleArray(xno+2,yno+2); Z=Make2DDoubleArray(xno+1,yno+1); U=Make2DDoubleArray(xno+2,yno+2); V=Make2DDoubleArray(xno+2,yno+2); for (n=1;n<=timesteps;n++){ } end=clock(); time_taken=(long double)(end-start)/CLOCKS_PER_SEC; printf("Time elapsed is %Lf\nGRID Size:%Lf*%Lf\nTime Steps Taken:%d\n",time_taken,(xno),floor(yno),n); return 0; }

    Read the article

  • Convert Google results object (pure js) to Python object

    - by colwilson
    So I'm trying to use Google Map suggest API to request place name suggestions. Unfortunately I can't find the docs for this bit. Here is an example URI: http://maps.google.com/maps/suggest?q=lon&cp=3&ll=55.0,-3.5&spn=11.9,1.2&hl=en&gl=uk&v=2 which returns: {suggestion:[{query:"London",... I want to use this in python (2.5). Now in proper JSON there would have been quotations around the keys like so: {"suggestion":[{"query":"London",... and I could have used simplejson or something, but as it is I'm a bit stuck. There are two possible solutions here; either I can get to the API code and find an option to return proper JSON, or I do that in python. Any ideas please.

    Read the article

  • ack misses results (vs. grep)

    - by techpeace
    I'm sure I'm misunderstanding something about ack's file/directory ignore defaults, but perhaps somebody could shed some light on this for me: mbuck$ grep logout -R app/views/ Binary file app/views/shared/._header.html.erb.bak.swp matches Binary file app/views/shared/._header.html.erb.swp matches app/views/shared/_header.html.erb.bak: <%= link_to logout_text, logout_path, { :title => logout_text, :class => 'login-menuitem' } %> mbuck$ ack logout app/views/ mbuck$ Whereas... mbuck$ ack -u logout app/views/ Binary file app/views/shared/._header.html.erb.bak.swp matches Binary file app/views/shared/._header.html.erb.swp matches app/views/shared/_header.html.erb.bak 98:<%= link_to logout_text, logout_path, { :title => logout_text, :class => 'login-menuitem' } %> Simply calling ack without options can't find the result within a .bak file, but calling with the --unrestricted option can find the result. As far as I can tell, though, ack does not ignore .bak files by default.

    Read the article

  • Query results with no reverse

    - by gruber
    Hi, Ive got table: UserA, UserB, numberOfConnections I would like to write query which returns me only rows that has no reverse I mean or example : for data : 1 2 10 1 3 10 1 5 10 1 6 10 2 6 10 2 5 10 5 1 10 5 2 10 3 1 10 it should return 1 2 10 1 3 10 1 5 10 1 6 10 2 6 10 2 5 10 rows: 5 1 10 5 2 10 3 1 10 arent valid because there are already corresponding 1 5 10 2 5 10 3 1 10 thanks for help bye

    Read the article

  • Use LINQ to SQL results inside SQL Server stored procedure

    - by ifwdev
    Note: I'm not trying to call a SQL Server stored proc using a L2SQL datacontext. I use LINQPad for some fairly complex "reporting" that takes L2SQL output saved to an Array and is processed further. For example, it's usually much easier to do multiple levels of grouping with LINQ to Objects instead of trying to optimize a T-SQL query to run in a reasonable amount of time. What would be the easiest way to take the end result of one of these "applications" and use that in a SQL Server 2008 stored proc? The idea is to use the data for a Reporting Services Report, rather than copying and pasting into Excel (manual labor). The reports need to be accessible on the report server (not using the Report Server control in an application). I could output CSV and read that somehow via command line exec, but that seems like a hack. Thanks for your help.

    Read the article

  • MySQL different versions other results.

    - by kuba
    hey, i have 2 version of mysql on windows 5.1.39-community and on linux 5.1.39-log i execute a query: SELECT `o`.`idOffer`, `o`.`offer_date`, `p`.`factory`, `c`.`short` AS `company`, `s`.`name` AS `subcategory`, `ct`.`name` AS `category`, count( (select count(1) from product where idProduct=idOffer group by idOffer) ) as b FROM `Offer` AS `o` LEFT JOIN `Product` AS `p` ON o.idOffer = p.idOffer LEFT JOIN `company` AS `c` ON o.company = c.id LEFT JOIN `Subcategory` AS `s` ON s.idSubcategory = o.idSubcategory LEFT JOIN `Category` AS `ct` ON ct.idCategory = s.idCategory WHERE (o.idOffer = p.idOffer) GROUP BY `o`.`idOffer` on windows it works as it suppose, but on linux it says: ERROR 1242 (21000): Subquery returns more than 1 row is it any way to get it worked on linux without any mysql updates/downgrades ?

    Read the article

  • IE jQuery ajax results in a stack overflow

    - by dave
    I have the following code that in IE gives me an error in jQuery for "open(G,M.url,M.async" $("#submitButton").click(function(){ $.ajax({ type: "POST", url: "http://url.com/postChat.php", data: "comment="+$("#userInput").val(), success: function(msg){ } }); }); Any ideas as to why this would happen in IE?

    Read the article

< Previous Page | 32 33 34 35 36 37 38 39 40 41 42 43  | Next Page >