Search Results

Search found 17924 results on 717 pages for 'z order'.

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

  • Simple SELECT query problem...

    - by Povylas
    Hi, I have this MySql select query witch seams to have a bug but I am quit "green" so I simple can not see, so maybe you could help? Here is the query: SELECT node_id FROM rate WHERE node_id='".$cat_node_id_string."' LIMIT ".$node_count_star.",".$node_count_end." ORDER BY SUM(amount) GROUP BY node_id Thanks for help in advance...

    Read the article

  • Sorting string column containing numbers in SQL?

    - by Ish
    Dear Folks, I am trying to sort string column (containing numbers). // SELECT `name` FROM `mytable` ORDER BY `name` ASC +----------+ +-- name --+ +----------+ +-- a 1 ---+ +-- a 12 --+ +-- a 2 ---+ +-- a 3 ---+ You see natural sorting algorithm of Mysql is placing a 12 after a 1 (which is ok for most apps), But I have unique needs, so I want result should be sorted like this. +----------+ +-- name --+ +----------+ +-- a 1 ---+ +-- a 2 ---+ +-- a 3 ---+ +-- a 12 --+ Is it possible with just SQL, or I have to manipulate result-set at application level? Thanks for reading...

    Read the article

  • Method to sort MYSQL results by an arbitriary letter (ie, show all rows starting with F first)

    - by Buzz
    I have a column of states, and, depending on the query, I want to order by results by a particular state, then by id (Asc or Desc, depending). For instance, I might want to show all rows with state "HI", sorted by ID desc, and then all the other rows, sorted by id desc. I was hoping I could do this in one query, rather than getting all my favored state results, and then getting the rest. Can I?

    Read the article

  • Java Sorting "queue" list based on DateTime and Z Position (part of school project)

    - by Kuchinawa
    For a school project i have a list of 50k containers that arrive on a boat. These containers need to be sorted in a list in such a way that the earliest departure DateTimes are at the top and the containers above those above them. This list then gets used for a crane that picks them up in order. I started out with 2 Collection.sort() methods: 1st one to get them in the right XYZ order Collections.sort(containers, new Comparator<ContainerData>() { @Override public int compare(ContainerData contData1, ContainerData contData2) { return positionSort(contData1.getLocation(),contData2.getLocation()); } }); Then another one to reorder the dates while keeping the position in mind: Collections.sort(containers, new Comparator<ContainerData>() { @Override public int compare(ContainerData contData1, ContainerData contData2) { int c = contData1.getLeaveDateTimeFrom().compareTo(contData2.getLeaveDateTimeFrom()); int p = positionSort2(contData1.getLocation(), contData2.getLocation()); if(p != 0) c = p; return c; } }); But i never got this method to work.. What i got working now is rather quick and dirty and takes a long time to process (50seconds for all 50k): First a sort on DateTime: Collections.sort(containers, new Comparator<ContainerData>() { @Override public int compare(ContainerData contData1, ContainerData contData2) { return contData1.getLeaveDateTimeFrom().compareTo(contData2.getLeaveDateTimeFrom()); } }); Then a correction function that bumps top containers up: containers = stackCorrection(containers); private static List<ContainerData> stackCorrection(List<ContainerData> sortedContainerList) { for(int i = 0; i < sortedContainerList.size(); i++) { ContainerData current = sortedContainerList.get(i); // 5 = Max Stack (0 index) if(current.getLocation().getZ() < 5) { //Loop through possible containers above current for(int j = 5; j > current.getLocation().getZ(); --j) { //Search for container above for(int k = i + 1; k < sortedContainerList.size(); ++k) if(sortedContainerList.get(k).getLocation().getX() == current.getLocation().getX()) { if(sortedContainerList.get(k).getLocation().getY() == current.getLocation().getY()) { if(sortedContainerList.get(k).getLocation().getZ() == j) { //Found -> move container above current sortedContainerList.add(i, sortedContainerList.remove(k)); k = sortedContainerList.size(); i++; } } } } } } return sortedContainerList; } I would like to implement this in a better/faster way. So any hints are appreciated. :)

    Read the article

  • To connect Gstreamer with Qt in order to play a gstreamer video in the Qt Widget

    - by raggio
    I tried using phonon to play the video but could not succeed. Off-late came to know through the Qt forums that even the latest version of Qt does not support phonon. Thats when i started using Gstreamer.Any suggestions as to how to connect the Gstreamer window with the Qt widget?My aim is to play a video using Gstreamer on the Qt widget.So how do i link the gstreamer window and the Qt widget? I am successful in getting the Id of the widget through winid(). Further with the help of Gregory Pakosz, I have added the below 2 lines of code in my application - QApplication::syncX(); gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(sink), widget->winId()); However am not able to link the Qt widget with the gstreamer video window. This is what my sample code would look like :- int main(int argc, char *argv[]) { printf("winid=%d\n", w.winId()); gst_init (NULL,NULL); /* create a new bin to hold the elements */ bin = gst_pipeline_new ("pipeline"); /* create a disk reader */ filesrc = gst_element_factory_make ("filesrc", "disk_source"); g_assert (filesrc); g_object_set (G_OBJECT (filesrc), "location", "PATH_TO_THE_EXECUTABLE", NULL); demux = gst_element_factory_make ("mpegtsdemux", "demuxer"); if (!demux) { g_print ("could not find plugin \"mpegtsmux\""); return -1; } vdecoder = gst_element_factory_make ("mpeg2dec", "decode"); if (!vdecoder) { g_print ("could not find plugin \"mpeg2dec\""); return -1; } videosink = gst_element_factory_make ("xvimagesink", "play_video"); g_assert (videosink); /* add objects to the main pipeline */ gst_bin_add_many (GST_BIN (bin), filesrc, demux, vdecoder, videosink, NULL); /* link the elements */ gst_element_link_many (filesrc, demux, vdecoder, videosink, NULL); gst_element_set_state(videosink, GST_STATE_READY); QApplication::syncX(); gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(videosink), w.winId()); /* start playing */ gst_element_set_state (bin, GST_STATE_PLAYING); } Could you explain more in detail about the usage of gst_x_overlay_set_xwindow_id() wrt my context? Could i get any hint as to how i can integrate gstreamer under Qt? Please help me solve this problem

    Read the article

  • Advice on database design / SQL for retrieving data with chronological order

    - by Remnant
    I am creating a database that will help keep track of which employees have been on a certain training course. I would like to get some guidance on the best way to design the database. Specifically, each employee must attend the training course each year and my database needs to keep a history of all the dates on which they have attend the course in the past. The end user will use the software as a planning tool to help them book future course dates for employees. When they select a given employee they will see: (a) Last attendance date (b) Projected future attendance date(i.e. last attendance date + 1 calendar year) In terms of my database, any given employee may have multiple past course attendance dates: EmpName AttandanceDate Joe Bloggs 1st Jan 2007 Joe Bloggs 4th Jan 2008 Joe Bloggs 3rd Jan 2009 Joe Bloggs 8th Jan 2010 My question is what is the best way to set up the database to make it easy to retrieve the most recent course attendance date? In the example above, the most recent would be 8th Jan 2010. Is there a good way to use SQL to sort by date and pick the MAX date? My other idea was to add a column called ‘MostRecent’ and just set this to TRUE. EmpName AttandanceDate MostRecent Joe Bloggs 1st Jan 2007 False Joe Bloggs 4th Jan 2008 False Joe Bloggs 3rd Jan 2009 False Joe Bloggs 8th Jan 2010 True I wondered if this would simplify the SQL i.e. SELECT Joe Bloggs WHERE MostRecent = ‘TRUE’ Also, when the user updates a given employee’s attendance record (i.e. with latest attendance date) I could use SQL to: Search for the employee and set the MostRecent value to FALSE Add a new record with MostRecent set to TRUE? Would anybody recommended either method over the other? Or do you have a completely different way of solving this problem?

    Read the article

  • Matplotlib pick event order for overlapping artists

    - by Ajean
    I'm hitting a very strange issue with matplotlib pick events. I have two artists that are both pickable and are non-overlapping to begin with ("holes" and "pegs"). When I pick one of them, during the event handling I move the other one to where I just clicked (moving a "peg" into the "hole"). Then, without doing anything else, a pick event from the moved artist (the peg) is generated even though it wasn't there when the first event was generated. My only explanation for it is that somehow the event manager is still moving through artist layers when the event is processed, and therefore hits the second artist after it is moved under the cursor. So then my question is - how do pick events (or any events for that matter) iterate through overlapping artists on the canvas, and is there a way to control it? I think I would get my desired behavior if it moved from the top down always (rather than bottom up or randomly). I haven't been able to find sufficient enough documentation, and a lengthy search on SO has not revealed this exact issue. Below is a working example that illustrates the problem, with PathCollections from scatter as pegs and holes: import matplotlib.pyplot as plt import sys class peg_tester(): def __init__(self): self.fig = plt.figure(figsize=(3,1)) self.ax = self.fig.add_axes([0,0,1,1]) self.ax.set_xlim([-0.5,2.5]) self.ax.set_ylim([-0.25,0.25]) self.ax.text(-0.4, 0.15, 'One click on the hole, and I get 2 events not 1', fontsize=8) self.holes = self.ax.scatter([1], [0], color='black', picker=0) self.pegs = self.ax.scatter([0], [0], s=100, facecolor='#dd8800', edgecolor='black', picker=0) self.fig.canvas.mpl_connect('pick_event', self.handler) plt.show() def handler(self, event): if event.artist is self.holes: # If I get a hole event, then move a peg (to that hole) ... # but then I get a peg event also with no extra clicks! offs = self.pegs.get_offsets() offs[0,:] = [1,0] # Moves left peg to the middle self.pegs.set_offsets(offs) self.fig.canvas.draw() print 'picked a hole, moving left peg to center' elif event.artist is self.pegs: print 'picked a peg' sys.stdout.flush() # Necessary when in ipython qtconsole if __name__ == "__main__": pt = peg_tester() I have tried setting the zorder to make the pegs always above the holes, but that doesn't change how the pick events are generated, and particularly this funny phantom event.

    Read the article

  • Joomla "online-order" component for Joomla

    - by mIRU
    Hello Word :) Somebody can help me in finding an "online - ordering" component for joomla . That can contain the following function : Possibility of creating Form with pages like RS!Form Uploading Files Supporting Payment Gateways like PayPal , MasterCard , WebMoney , YandexMoney ,Money Bookers , Google Checkout ... more ) Saving data in database. A friendly control panel where admin can check statistics , income and expenditure, including offline transactions, and report on the data . A good example , for what I'm looking , is this component http://www.nbill.co.uk/ , but is to expensive and complicated . I'll be happy fore some links or advices :) . Thank a Lot ! for all who are trying to help me ! And sorry for my bad English :-)

    Read the article

  • callback execution order in jQuery getJSON

    - by lau
    I'm trying to implement a iGoogle like dashboard interface using widgets that get their content from other sites using JSONP calls. The problem is that if the first widget that calls the "$.ajax" takes 8 seconds to get the content back, it seems that the callbacks of the other widgets will only be called after the callback of the first widget gets executed. For the user experience, it would be better if the widgets could be displayed as soon as they get the content back from the remote sites, and not wait for those that were scheduled before to complete. Is there a way I can do that?

    Read the article

  • Higher-order type constructors and functors in Ocaml

    - by sdcvvc
    Can the following polymorphic functions let id x = x;; let compose f g x = f (g x);; let rec fix f = f (fix f);; (*laziness aside*) be written for types/type constructors or modules/functors? I tried type 'x id = Id of 'x;; type 'f 'g 'x compose = Compose of ('f ('g 'x));; type 'f fix = Fix of ('f (Fix 'f));; for types but it doesn't work. Here's a Haskell version for types: data Id x = Id x data Compose f g x = Compose (f (g x)) data Fix f = Fix (f (Fix f)) -- examples: l = Compose [Just 'a'] :: Compose [] Maybe Char type Natural = Fix Maybe -- natural numbers are fixpoint of Maybe n = Fix (Just (Fix (Just (Fix Nothing)))) :: Natural -- n is 2 -- up to isomorphism composition of identity and f is f: iso :: Compose Id f x -> f x iso (Compose (Id a)) = a

    Read the article

  • Cannot add Authorization field to HttpsUrlConnection in order to complete Basic authentication

    - by ES
    Hi, I'm using the Sun API HttpsURLConnection class, and have been trying for a day now to get it to send a simple request: URL url = new URL("https://thirdpartyserver.com/somelocation"); connection = (HttpsURLConnection)url.openConnection(); connection.setDoOutput(true); connection.setRequestMethod("POST"); if (doAuthorization) { Base64Converter converter = new Base64Converter(); connection.setRequestProperty("Authorization", "Basic " + converter.encode("username:password")); } OutputStreamWriter writer = new OutputStreamWriter(connection.getOutputStream()); writer.write("param1=100&param2=hello"); writer.flush(); writer.close(); I keep getting 401 from the third part server. When I look at the connection through the debugger, the method shows up as GET even though I set it to POST; the collection of request properties shows up as null. If I print the values out, the method shows up as POST, but the request parameters collection is still empty. I would love to be able to print the request and understand what's going on, but I could not figure out how to print the content of an output buffer. Any ideas? Thanks! ES

    Read the article

  • MySql order by problem

    - by Sergio
    Hello. I want to list messages that received specific user from other users group by ID's and ordered by last message received. If I use this query: SELECT MAX(id), fromid, toid, message FROM pro_messages WHERE toid=00003 GROUP BY fromid I do not get last message sent from user "fromid" to user "toid" but the first message sent. Can I do that in some other way or I need to do it with two queries or join tables? id - message id fromid - id of user who sent message toid - id of user who receive message (in this case user 00003)

    Read the article

  • Using bindings to control column order in a DataGrid

    - by DanM
    Problem I have a WPF Toolkit DataGrid, and I'd like to be able to switch among several preset column orders. This is an MVVM project, so the column orders are stored in a ViewModel. The problem is, I can't get bindings to work for the DisplayIndex property. No matter what I try, including the sweet method in this Josh Smith tutorial, I get: The DisplayIndex for the DataGridColumn with Header 'ID' is out of range. DisplayIndex must be greater than or equal to 0 and less than Columns.Count. Parameter name: displayIndex. Actual value was -1. Is there any workaround for this? I'm including my test code below. Please let me know if you see any problems with it. ViewModel code public class MainViewModel { public List<Plan> Plans { get; set; } public int IdDisplayIndex { get; set; } public int NameDisplayIndex { get; set; } public int DescriptionDisplayIndex { get; set; } public MainViewModel() { Initialize(); } private void Initialize() { IdDisplayIndex = 1; NameDisplayIndex = 2; DescriptionDisplayIndex = 0; Plans = new List<Plan> { new Plan { Id = 1, Name = "Primary", Description = "Likely to work." }, new Plan { Id = 2, Name = "Plan B", Description = "Backup plan." }, new Plan { Id = 3, Name = "Plan C", Description = "Last resort." } }; } } Plan Class public class Plan { public int Id { get; set; } public string Name { get; set; } public string Description { get; set; } } Window code - this uses Josh Smith's DataContextSpy <Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:WpfApplication1" xmlns:mwc="http://schemas.microsoft.com/wpf/2008/toolkit" Title="Main Window" Height="300" Width="300"> <Grid> <mwc:DataGrid ItemsSource="{Binding Plans}" AutoGenerateColumns="False"> <mwc:DataGrid.Resources> <local:DataContextSpy x:Key="spy" /> </mwc:DataGrid.Resources> <mwc:DataGrid.Columns> <mwc:DataGridTextColumn Header="ID" Binding="{Binding Id}" DisplayIndex="{Binding Source={StaticResource spy}, Path=DataContext.IdDisplayIndex}" /> <mwc:DataGridTextColumn Header="Name" Binding="{Binding Name}" DisplayIndex="{Binding Source={StaticResource spy}, Path=DataContext.NameDisplayIndex}" /> <mwc:DataGridTextColumn Header="Description" Binding="{Binding Description}" DisplayIndex="{Binding Source={StaticResource spy}, Path=DataContext.DescriptionDisplayIndex}" /> </mwc:DataGrid.Columns> </mwc:DataGrid> </Grid> </Window> Note: If I just use plain numbers for DisplayIndex, everything works fine, so the problem is definitely with the bindings. Update 5/1/2010 I was just doing a little maintenance on my project, and I noticed that when I ran it, the problem I discuss in this post had returned. I knew that it worked last time I ran it, so I eventually narrowed the problem down to the fact that I had installed a newer version of the WPF Toolkit (Feb '10). When I reverted to the June '09 version, everything worked fine again. So, I'm now doing something I should have done in this first place: I'm including the WPFToolkit.dll that works in my solution folder and checking it into version control. It's unfortunate, though, that the newer toolkit has a breaking change.

    Read the article

  • DIV overlap on top of submit order INPUT button not working right in IE7

    - by Lauren
    I created a test account at www.avaline.com: username: [email protected] pass:test02 I'll keep the account around so you can see what's going on with this submit button without going through the registration process (and needing to fill in a fake address, etc). If logging in doesn't work, you can create your own test account though. Make sure at least one item is in your shopping cart, hit "proceed to checkout", and check off "PayPal" as your payment method (this way the payment won't go through for testing purposes). Once you're on the "review and submit" page, in IE7 (at least), hover over the "pay with Paypal" button, and you'll see that the cursor is a hand when you hover over the text or the button border, but it's a regular arrow when you hover over the button part. If you try clicking on the arrow-cursor area, you'll get the error that you should see...but if you click on the hand-cursor area, you get redirected to the paypal page. In FF, the #hidSubm DIV covers the "Pay with Paypal" button. Why isn't it working in IE7?

    Read the article

  • custom listview adapter getView method being called multiple times, and in no coherent order

    - by edzillion
    I have a custom list adapter: class ResultsListAdapter extends ArrayAdapter<RecordItem> { in the overridden 'getView' method I do a print to check what position is and whether it is a convertView or not: @Override public View getView(int position, View convertView, ViewGroup parent) { System.out.println("getView " + position + " " + convertView); The output of this (when the list is first displayed, no user input as yet) 04-11 16:24:05.860: INFO/System.out(681): getView 0 null 04-11 16:24:29.020: INFO/System.out(681): getView 1 android.widget.RelativeLayout@43d415d8 04-11 16:25:48.070: INFO/System.out(681): getView 2 android.widget.RelativeLayout@43d415d8 04-11 16:25:49.110: INFO/System.out(681): getView 3 android.widget.RelativeLayout@43d415d8 04-11 16:25:49.710: INFO/System.out(681): getView 0 android.widget.RelativeLayout@43d415d8 04-11 16:25:50.251: INFO/System.out(681): getView 1 null 04-11 16:26:01.300: INFO/System.out(681): getView 2 null 04-11 16:26:02.020: INFO/System.out(681): getView 3 null 04-11 16:28:28.091: INFO/System.out(681): getView 0 null 04-11 16:37:46.180: INFO/System.out(681): getView 1 android.widget.RelativeLayout@43cff8f0 04-11 16:37:47.091: INFO/System.out(681): getView 2 android.widget.RelativeLayout@43cff8f0 04-11 16:37:47.730: INFO/System.out(681): getView 3 android.widget.RelativeLayout@43cff8f0 AFAIK, though I couldn't find it stated explicitly, getView() is only called for visible rows. Since my app starts with four visible rows at least the position numbers cycling from 0-3 makes sense. But the rest is a mess: Why is getview called for each row four times? Where are these convertViews coming from when I haven't scrolled yet? I did a bit of reseach, and without getting a good answer, I did notice that people were associating this issue with layout issues. So in case, here's the layout that contains the list: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="fill_parent" android:layout_width="fill_parent" android:orientation="vertical" > <TextView android:id="@+id/pageDetails" android:layout_width="fill_parent" android:layout_height="wrap_content" /> <ListView android:id="@+id/list" android:layout_width="fill_parent" android:layout_height="wrap_content" android:drawSelectorOnTop="false" /> </LinearLayout> and the layout of each individual row: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="108dp" android:padding="4dp"> <ImageView android:id="@+id/thumb" android:layout_width="120dp" android:layout_height="fill_parent" android:layout_alignParentTop="true" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:layout_marginRight="8dp" android:src="@drawable/loading" /> <TextView android:id="@+id/price" android:layout_width="wrap_content" android:layout_height="18dp" android:layout_toRightOf="@id/thumb" android:layout_alignParentBottom="true" android:singleLine="true" /> <TextView android:id="@+id/date" android:layout_width="wrap_content" android:layout_height="18dp" android:layout_alignParentBottom="true" android:layout_alignParentRight="true" android:paddingRight="4dp" android:singleLine="true" /> <TextView android:id="@+id/title" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textSize="17dp" android:layout_toRightOf="@id/thumb" android:layout_alignParentRight="true" android:layout_alignParentTop="true" android:paddingRight="4dp" android:layout_alignWithParentIfMissing="true" android:gravity="center" /> Thank you for your time

    Read the article

  • save xml object so that elements are in sorted order in saved xml file

    - by scot
    Hi , I am saving a xml document object and it is saved in a xml file as shown below . <author name="tom" book="Fun-II"/> <author name="jack" book="Live-I"/> <author name="pete" book="Code-I"/> <author name="jack" book="Live-II"/> <author name="pete" book="Code-II"/> <author name="tom" book="Fun-I"/> instead i want to sort the content in document object so that when i persist the object it is saved by grouping authors then book name as below: <author name="jack" book="Live-I"/> <author name="jack" book="Live-II"/> <author name="pete" book="Code-I"/> <author name="pete" book="Code-II"/> <author name="tom" book="Fun-I"/> <author name="tom" book="Fun-II"/> I use apache xml beans..any ideas on how to achieve this? thanks.

    Read the article

  • WPF: Drag/Drop to re-order grid and jiggle

    - by Echilon
    I need to implement a grid in WPF which has squares that can be dragged/dropped to be re-ordered, but I'm not sure the best way to do it. I was thinking using an ObservableCollection of squares and a UniFormGrid but although I have experience with both WPF and drag/drop, ideally I'd like to do a kind of 'jiggle' when before the user releases the mouse. Any suggestions on a good starting point?

    Read the article

  • After resizing label on tap on tableview cell tableview content order changes iphone sdk

    - by neha
    Hi all, In my application I'm dynamically resizing a label in cell as well as cell when a cell is tapped in uitableview, but after resizing the label in cell, the contents in the tableview are getting shifted means the cells contain different cell content after this tap, whereas this' not the case when I'm tapping the cell and expanding it without expanding the label in it. Can anybody please help? It's urgent. Thanks in advance.

    Read the article

  • Downloading Python 2.5.4 (from official website) in order to install it

    - by brilliant
    I was quite hesitant about whether I should post this question here on "StackOverflow" or on "SuperUser", but finally decided to post it here as Python is more a programming language rather than a piece of software. I've been recently using Python 2.5.4 that is installed on my computer, but at the moment I am not at home (and won't be for about two weeks from now), so I need to install the same version of Python on another computer. This computer has Windows XP installed – just like the one that I have at home. The reason why I need Python 2.5.4 is because I am using “Google App Engine”, and I was told that it only supports Python 2.5 However, when I went to the official Python page for the download, I discovered that certain things have changed, and I don’t quite remember where exactly from that site I had downloaded Python 2.5.4 on my computer at home. I found this page: http://www.python.org/download/releases/2.5.4/ Here is how it looks: (If you can’t see it here, please check it out at this address: http://brad.cwahi.net/some_pictures/python_page.jpg ) A few things here are not clear to me. It says: “For x86 processors: python-2.5.4.msi For Win64-Itanium users: python-2.5.4.ia64.msi For Win64-AMD64 users: python-2.5.4.amd64.msi” First of all, I don’t know what processor I am using – whether mine is “x86” or not; and also, I don’t know whether I am an “Win64-Itanium” or an “Win64-AMD64” user. Are Itanium and AMD64 also processors? Later it says: “Windows XP and later already have MSI; many older machines will already have MSI installed.” I guess, it is my case, but then I am totally puzzled as to which link I should click as it seems now that I don’t need those three previous links (as MSI is already installed on Windows XP), but there is no fourth link provided for those who use “Windows XP” or older machines. Of course, there are these words after that: “Windows users may also be interested in Mark Hammond's win32all package, available from Sourceforge.” but it seems to me that it is something additional rather than the main file. So, my question is simple: Where in the official Python website I can download Python 2.5.4, precisely, which link I should click?

    Read the article

  • Type error while trying to implement the (>>=) function in order to create a custom monad transforme

    - by CharlieP
    Hello, I'm trying to create a monad transformer for a future project, but unfortunately, my implementation of the Monad typeclasse's (=) function doesn't work. First of all, here is the underlying monad's implementation : newtype Runtime a = R { unR :: State EInfo a } deriving (Monad) Here, the implementation of the Monad typeclasse is done automatically by GHC (using the GeneralizedNewtypeDeriving language pragma). The monad transformer is defined as so : newtype RuntimeT m a = RuntimeT { runRuntimeT :: m (Runtime a) } The problem comes from the way I instanciate the (=) function of the Monad typeclasse : instance (Monad m) => Monad (RuntimeT m) where return a = RuntimeT $ (return . return) a x >>= f = runRuntimeT x >>= id >>= f The way I see it, the first >>= runs in the underlying m monad. Thus, runRuntimeT x >>= returns a value of type Runtime a (right ?). Then, the following code, id >>=, should return a value of type a. This value is the passed on to the function f of type f :: (Monad m) => a -> RuntimeT m b. And here comes the type problem : the f function's type doesn't match the type required by the (=) function. Jow can I make this coherent ? I can see why this doesn't work, but I can't manage to turn it into something functionnal. Thank you for you help, and do not hesitate to correct any flaws in my message, Charlie P.

    Read the article

  • stack.ToList() in .NET - order of elements?

    - by James M.
    When using the .ToList() extension method on a Stack<T>, is the result the same as popping each element and adding to a new list (reverse of what was pushed)? If so, is this because it really is iterating over each element, or does it store the elements in reverse internally and slip the array into a new List<T>?

    Read the article

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