Search Results

Search found 3240 results on 130 pages for 'groupwise maximum'.

Page 65/130 | < Previous Page | 61 62 63 64 65 66 67 68 69 70 71 72  | Next Page >

  • Windows 7 Keyboard Repeat Rate and Delay are Reset on Resume from Standby / Sleep

    - by Synetech inc.
    I always keep my keyboard repeat rate at the maximum and the delay at the minimum for optimal keyboard responsiveness. Under Windows 7 however, I have found that the rate and delay are reset to the defaults (ie the one’s that are set with a fresh Windows installation) whenever the system resumes from sleep and requires opening the keyboard control panel applet (which already shows the desired settings) and manually setting them again by pressing Enter. I have seen a couple of posts in the Microsoft support forums, but no solutions. Does anyone know of a way to fix this?

    Read the article

  • wmp12 refuses to convert files when syncing

    - by Carbonara
    I have quite a large music collection of MP3s at 320kbps and some WMA files at various bitrates. I'm trying to sync some of them to my HTC Desire and am quickly running out of space. WMP12 has options to set, per device you wish to sync, to auto convert to a lower bitrate whilst syncing. I have set this to auto convert files to a maximum bitrate of 192kbps, that way I can fit more music on the device but keep the files on my PC at the higher rate. See these screens to see that it's set up correctly. Only problem is, surprise surprise for a Microsoft product, it doesn't actually work. Any file that is greater than 192kbps, MP3 or WMA simply fails, doesn't get converted or copied to the device. The message in the sync log displays the rather unhelpful message "error" and that's it. Any help would be appreciated. I'm not really looking for alternative software solutions I'd like to get this working since that's what it's supposed to do.

    Read the article

  • Store and Encrypt data over the internet.

    - by sotsec
    I am trying to build a system where I will be able to access my files remotely. I want to setup an external hard drive or a NAS that I will access over the internet, and I want every file that is stored on that system to be encrypted. Could you please suggest me what is the best way of doing that? Or if you have any knowledge, what is the best way to access your files remotely with maximum safety? but the same time the space that the files are allocated is protected against theft(encryption) etc. thank you

    Read the article

  • Hosting solution for sensitive client data

    - by Mark
    Hello, We are developing a web application that will deal with highly sensitive (financial) data of clients (audience is medium to large sized businesses). Clients will be under scrutiny from regulators & auditors and, as such, we will be too. More importantly to give clients a level of comfort our application and related hosting arrangement should instill a lot of confidence with them. We are looking into using a cloud based service like Linode, Amazon EC2, etc. To allow for maximum flexibility We are keen on putting everything on virtual servers and avoiding having to buy our own hardware. Does a cloud based service make sense for our particular scenario? If not what type of hosting should we consider? If so what should we look out for? Thanks!

    Read the article

  • NAS device for distributed team

    - by user5959
    We are a distributed team spread across 5 locations. We have a shared drive (1 TB data) at our former location that we are currently accessing via Hamachi VPN. Our shared drive is a network folder on a Windows Server located at one of our locations. The current connection speed is terrible. The upload speed at the current location of the shared drive is very slow. We looking for a NAS device that we can host at another location with better upload speed that all of us can access. I am looking for a NAS device that has these features: Minimal Maintenance as we do not have dedicated IT resources Access data on the device from multiple locations. Ability to create network drive (On Windows Computers Map Network Drive) Upload data from random client computers without having to install software. (Right now, we use LogMeIn Rescue's file manager) Ability handle slow or dropped connections when transferring files (Maximum size 1.5 GB)

    Read the article

  • Can Remote Desktop connect only 2 monitors when the client has 3 or 4 monitors connected?

    - by user12931
    I have three monitors (all 1920x1200) connected to my desktop and I would like to RDP into another computer (running Windows Server 2003) and use only two of my three monitors. The main monitor is used for notification from the LAN like email, build status, etc. I've tried modifying the .rdp file to have a higher resolution (i.e. 3840x1200 ) which sort of works but the bits per pixel goes down to 8 and you have to manually resize the window which means that you need to change it to around 3840x1150. If I supply /span to the commandline it gives me a bit more than 3840 spanned across the three monitors (is there perhaps a limitation of say 4096 for the maximum resolution?). WORKAROUND: Connect twice to the same computer. Here's an interesting post from Microsoft: http://blogs.msdn.com/b/rds/archive/2009/08/21/remote-desktop-connection-7-for-windows-7-windows-xp-windows-vista.aspx

    Read the article

  • Triple head DVI KVM

    - by cat pants
    I am trying to run a Linux desktop and Windows desktop simultaneously with a KVM for maximum productivity. Also running three monitors. I need a KVM that can do 3x DVI @ 1920x1080 + 2x usb (mouse and keyboard) + toslink for two machines. What would you suggest? I ask on here because I have searched quite a bit and have yet to find a KVM with these requirements. (I would be open to something like modifying 3x regular KVMs to control them with one button or similar) Thanks! (I tried posting this question earlier, but it was closed as being "not related to computer hardware or software" ... is a KVM not related to computer hardware or software? I'm pretty sure it is. kvm-switch has been tagged 100 times on here for example.)

    Read the article

  • 2 GB of memory in 1 GB system is a problem?

    - by daveslab
    Hi folks, I just installed 2 1 Gig sticks into my friend's machine, thinking that it would take all the 2 GBs. Unfortunately, according to Dell's website, it says the maximum amount of memory accessible to the machine is arbitrarily set to 1 GB! The system indeed reports having 1 GB of memory accessible to it, but I'm worried that having 2 GB in there might break something. Are my fears reasonable? Should I buy two 512 MB sticks instead? Thanks for any help!

    Read the article

  • Open table cache in MySQL

    - by vvanscherpenseel
    I have my open table cache set to 1800 and I have a total of 1112 tables. MySQL Tuning Primer reports that 100% of my table cache is used yet my table cache hit rate is 5%. I understand that this happens due to concurrent connections all opening tables. I think I should raise the cache limit. I understand that the cache size is limited by the file descriptor limit of my operating system, but are there any other practical limitations I should be aware of? Searching Google or this very website yields mostly posts explaining the connection-factor or come up with indecisive answers. My question: can I safely increase the open table cache limit? Is there a maximum?

    Read the article

  • Two 24' displayed vertically in Ubuntu

    - by QuinnBaetz
    I just got two 24' inch monitors, and want them to display vertically side by side. I got one to but can't figure out the command to get them both vertical and displaying. xorg.conf: Section "Monitor" Identifier "Configured Monitor" EndSection Section "Screen" Identifier "Default Screen" Monitor "Configured Monitor" Device "Configured Video Device" SubSection "Display" Virtual 3840 1200 EndSubSection EndSection Section "Device" Identifier "Configured Video Device" EndSection xrandr: Screen 0: minimum 320 x 200, current 3840 x 1200, maximum 3840 x 1200 VGA connected 1920x1200+0+0 (normal left inverted right x axis y axis) 519mm x 324mm 1920x1200 60.0*+ 1600x1200 60.0 1280x1024 75.0 60.0 1152x864 75.0 1024x768 75.0 60.0 800x600 75.0 60.3 640x480 75.0 59.9 720x400 70.1 TMDS-1 connected 1920x1200+1920+0 (normal left inverted right x axis y axis) 518mm x 324mm 1920x1200 60.0*+ 1600x1200 60.0 1280x1024 75.0 60.0 1152x864 75.0 1024x768 75.0 60.0 800x600 75.0 60.3 640x480 75.0 59.9 720x400 70.1 any clue on the command to make them vertical? Thanks!

    Read the article

  • How to avoid loop limitation in a openvz container?

    - by mat.viguier
    On a openVZ containing Deb7 I need to lock the maximum size of a folder, which is used to upload on a php based web server. The directory is synced, so I have to lock the maxsize. MAXSIZE should be upgradable by adding some physical disk later ... I want to use a file as a block device for a file system. So I have done : dd if=/dev/zero of=/disk2/filesystem.dat bs=1M count=100 Then, I made the filesystem on it mkfs.ext4 filesystem.dat Then I tried to mount it : mkdir /opt/filesystem ; mount /disk2/filesystem.dat /opt/filesystem My OpenVZ (it is on a VPS) has no loop module in the kernerl. So I got Could not find any loop device as usual under OpenVz So i think I have to use FUSE, but I really do not know HOW .... Any idea on locking the size of directory under OpenVZ ?

    Read the article

  • Windows 8 won't load as it has to

    - by MichaelHefner
    I have successfully installed Windows 8 about eight months ago, and all went well. Only the last change I made ??is to set Startmenu8, to get a more normal for the Windows look. Yesterday, my computer screen went dark blue and the mouse does not seem to work. I changed the battery and reboot. But all I get is my desktop, taskbar, and not ikony.Programmy not appear at the bottom, but do not open the maximum so I can not use them. I have a Dell desktop and run the diagnostics on the F12 at startup. All right in line with this. I want to return to the previous item, but can not get in Windows, to do it. Any suggestions gratefully received.

    Read the article

  • Why Virtualbox VDI doubles the space of the VM hard disk?

    - by logoff
    I have one Xubuntu 12.10 64 bit Virtualbox VM on a Windows 7 64 bit host. It has one dynamic allocated hard disk with VDI format with maximum capacity of 20GB. If I use a command df -h in the VM I get that 5.3GB are in use in th main partition. I have only 2 partitions, one for the ext4 hard disk and another with 512MB of swap. I have no snapshots. The VDI file of this VM has 10.7GB. It is normal this difference of space? It is caused because the VDI format?

    Read the article

  • Too Much Swapping, even though RAM is 2/3 Empty

    - by indyaah
    I have a VPS with 9GB RAM, 300GB HDD, 3 GB Swap, 7 Cores. The OS is CentOS 5.7 Final. I have postgres9.0 running on my machine, with proper tuning done (at least by book/wiki of PostgreSQL). What happens is most of the times when some complex query run (by complex I mean select with maximum 3 Joins), eventhough 66% of my RAM is unused there is ~99% swapping is happening. Plus it screws up my disk IO which is most of the time reaching ~100% and slows down everything else. (I tend to believe something's wrong with my disk.) I dont understand the reason of this much of swapping happening. Is it because of context switching?? Most of the time my processors are idle, while the IO wait goes upto 30% during pick times. Would appreciate if some can shed some light on it. Thanks.

    Read the article

  • Does Asus F8SV supports 1920*1080 resolution through DVI output? [closed]

    - by Col
    Devices: Asus F8Sv Laptop (Windows 7 ultimate, GeForce 8600m GT, display driver is 301.42, detected and downloaded from nvidia.com, VGA and DVI output interface) Gateway 23 inches LCD monitor (VGA, DVI-D with HDCP, and HDMI input) 18 pins DVI cable, VGA cable, both new. Problems: When connect laptop to monitor by VGA, resolution is automatically adapted to 1920*1080; but when using DVI connection, resolution on monitor is fixed to 1024*768, which is lower than my laptop default 1280*800. The maximum resolution in windows control panel is only 1024*768, while the Nvidia control panel provides options 1920*1080p and 1920*1080i, but clicking apply button does not work, the resolution just can not change. Possibly reason I guess: GeForce 8600m GT does not support 1920*1080 resolution through DVI outputs. Can anyone confirm it or give the real reason? edit: Problem solved by buying a HDMI to DVI-D adapter. Using this adapter and a HDMI cable, I can now enjoy 1080p movie.

    Read the article

  • Using external monitor and screen resolution?

    - by Johnydep
    it might sound very basic question but i need some help. I have lenovo Ideapad y560p which offers a maximum resolution of 1366px x 768px. Now i am planning to buy an external monitor, and i short listed some FULL HD resolution monitors, but it is my understanding that even with FULL HD, i would only achieve the best resolution my laptop supports. Is it true? And also if this is the case, should i really go for an HD monitor or settle down with a lower resolution version? 2ndly, is there any way to increase resolution with simple upgrade? or it is not possible without voiding the warranty??

    Read the article

  • Wait for linux machine to be rebooted

    - by Theo
    I have a small script to install on my remote machine an update. I would like to reboot the machine remotely and if it is rebooted, continue with some more commands. What I currently do is: ssh root@myMachine << COMMANDS_ISSUED ###... Tasks init 6 COMMANDS_ISSUED sleep 180s ssh root@myMachine << POST_REBOOT_COMMANDS ###.... More stuff POST_REBOOT_COMMANDS Is there a more elegant way to do it? Like pinging the machine all 5 seconds up to a maximum of 4 minutes? I play with a few linux machines which have different boot up times and if my script would continue immediately after reboot, this could safe quite some time for me. (Note: I don't want to parallelize execution over all machines as I want to see for each machine if everything worked fine)

    Read the article

  • SWFupload adding extra extension?

    - by st4ck0v3rfl0w
    Hi Everyone, I've been struggling with this for a half day and can't seem to figure out why SWFupload is adding an extra extension to my uploads? (e.g. burer.jpg.jpg) I've reviewed the below code a thousand times and can't figure out why my files (whether png, gif or jpg) get an added .jpg extension? <?php $POST_MAX_SIZE = ini_get('post_max_size'); $unit = strtoupper(substr($POST_MAX_SIZE, -1)); $multiplier = ($unit == 'M' ? 1048576 : ($unit == 'K' ? 1024 : ($unit == 'G' ? 1073741824 : 1))); if ((int)$_SERVER['CONTENT_LENGTH'] > $multiplier*(int)$POST_MAX_SIZE && $POST_MAX_SIZE) { header("HTTP/1.1 500 Internal Server Error"); // This will trigger an uploadError event in SWFUpload echo "POST exceeded maximum allowed size."; exit(0); } // Settings $save_path = "/home/images/"; $upload_name = "image"; $max_file_size_in_bytes = 2147483647; // 2GB in bytes $extension_whitelist = array("jpg", "gif", "png", "jpeg"); // Allowed file extensions $valid_chars_regex = '.A-Z0-9_ !@#$%^&()+={}\[\]\',~`-'; // Characters allowed in the file name (in a Regular Expression format) // Other variables $MAX_FILENAME_LENGTH = 260; $file_name = ""; $file_extension = ""; $uploadErrors = array( 0=>"There is no error, the file uploaded successfully", 1=>"The uploaded file exceeds the upload_max_filesize directive in php.ini", 2=>"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form", 3=>"The uploaded file was only partially uploaded", 4=>"No file was uploaded", 6=>"Missing a temporary folder" ); // Validate the upload if (!isset($_FILES[$upload_name])) { HandleError("No upload found in \$_FILES for " . $upload_name); exit(0); } else if (isset($_FILES[$upload_name]["error"]) && $_FILES[$upload_name]["error"] != 0) { HandleError($uploadErrors[$_FILES[$upload_name]["error"]]); exit(0); } else if (!isset($_FILES[$upload_name]["tmp_name"]) || !@is_uploaded_file($_FILES[$upload_name]["tmp_name"])) { HandleError("Upload failed is_uploaded_file test."); exit(0); } else if (!isset($_FILES[$upload_name]['name'])) { HandleError("File has no name."); exit(0); } // Validate the file size (Warning: the largest files supported by this code is 2GB) $file_size = @filesize($_FILES[$upload_name]["tmp_name"]); if (!$file_size || $file_size > $max_file_size_in_bytes) { HandleError("File exceeds the maximum allowed size"); exit(0); } if ($file_size <= 0) { HandleError("File size outside allowed lower bound"); exit(0); } // Validate file name (for our purposes we'll just remove invalid characters) $file_name = preg_replace('/[^'.$valid_chars_regex.']|\.+$/i', "", $_FILES[$upload_name]['name']); if (strlen($file_name) == 0 || strlen($file_name) > $MAX_FILENAME_LENGTH) { HandleError("Invalid file name"); exit(0); } // Validate file extension $path_info = pathinfo($_FILES[$upload_name]['name']); $file_extension = $path_info["extension"]; $is_valid_extension = false; foreach ($extension_whitelist as $extension) { if (strcasecmp($file_extension, $extension) == 0) { $is_valid_extension = true; break; } } if (!$is_valid_extension) { HandleError("Invalid file extension"); exit(0); } if (!@move_uploaded_file($_FILES[$upload_name]["tmp_name"], $save_path.$file_name)) { HandleError("File could not be saved."); exit(0); } HandleError($_FILES[$upload_name]['name']); exit(0); function HandleError($message) { echo $message; } ?>

    Read the article

  • How can I bind the nested viewmodels to properties of a control

    - by Robert
    I used Microsoft's Chart Control of the WPF toolkit to write my own chart control. I blogged about it here. My Chart control stacks the yaxes in the chart on top of each other. As you can read in the article this all works quite well. Now I want to create a viewmodel that controls the data and axes in the chart. So far I'm able to add axes to the chart and show them in the chart. But I have a problem when I try to add the lineseries because it has one DependentAxis and one InDependentAxis property. I don't know how to assign the proper xAxis and yAxis controls to it. Below you see part of the LineSeriesViewModel. It has a nested XAxisViewModel and YAxisViewModel property. public class LineSeriesViewModel : ViewModelBase, IChartComponent { XAxisViewModel _xAxis; public XAxisViewModel XAxis { get { return _xAxis; } set { _xAxis = value; RaisePropertyChanged(() => XAxis); } } //The YAxis Property look the same } The viewmodels all have their own datatemplate. The xaml code looks like this: <UserControl.Resources> <DataTemplate x:Key="xAxisTemplate" DataType="{x:Type l:YAxisViewModel}"> <chart:LinearAxis x:Name="yAxis" Orientation="Y" Location="Left" Minimum="0" Maximum="10" IsHitTestVisible="False" Width="50" /> </DataTemplate> <DataTemplate x:Key="yAxisTemplate" DataType="{x:Type l:XAxisViewModel}"> <chart:LinearAxis x:Name="xAxis" Orientation="X" Location="Bottom" Minimum="0" Maximum="100" IsHitTestVisible="False" Height="50" /> </DataTemplate> <DataTemplate DataType="{x:Type l:LineSeriesViewModel}"> <!--Binding doesn't work on the Dependent and IndependentAxis! --> <!--YAxis XAxis and Series are properties of the LineSeriesViewModel --> <l:FastLineSeries DependentAxis="{Binding Path=YAxis}" IndependentAxis="{Binding Path=XAxis}" ItemsSource="{Binding Path=Series}"/> </DataTemplate> <Style TargetType="ItemsControl"> <Setter Property="ItemsPanel"> <Setter.Value> <ItemsPanelTemplate> <!--My stacked chart control --> <l:StackedPanel x:Name="stackedPanel" Width="Auto" Height="Auto" Background="LightBlue"> </l:StackedPanel> </ItemsPanelTemplate> </Setter.Value> </Setter> </Style> </UserControl.Resources> <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ClipToBounds="True"> <!-- View is an ObservableCollection of all axes and series--> <ItemsControl x:Name="chartItems" ItemsSource="{Binding Path=View}" Focusable="False"> </ItemsControl> </Grid> This code works quite well. When I add axes they get drawn. But the DependentAxis and InDependentAxis of the lineseries control stay null, so the series doesn't get drawn. How can I bind the nested viewmodels to the properties of a control?

    Read the article

  • "The Controls collection cannot be modified because the control contains code blocks"

    - by Daniel P
    I am trying to create a simple user control that is a slider. When I add a AjaxToolkit SliderExtender to the user control I get this (*&$#()@# error: Server Error in '/' Application. The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %). Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %). Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [HttpException (0x80004005): The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %).] System.Web.UI.ControlCollection.Add(Control child) +8677431 AjaxControlToolkit.ScriptObjectBuilder.RegisterCssReferences(Control control) in d:\E\AjaxTk-AjaxControlToolkit\Release\AjaxControlToolkit\ExtenderBase\ScriptObjectBuilder.cs:293 AjaxControlToolkit.ExtenderControlBase.OnLoad(EventArgs e) in d:\E\AjaxTk-AjaxControlToolkit\Release\AjaxControlToolkit\ExtenderBase\ExtenderControlBase.cs:306 System.Web.UI.Control.LoadRecursive() +50 System.Web.UI.Control.LoadRecursive() +141 System.Web.UI.Control.LoadRecursive() +141 System.Web.UI.Control.LoadRecursive() +141 System.Web.UI.Control.LoadRecursive() +141 System.Web.UI.Control.LoadRecursive() +141 System.Web.UI.Control.LoadRecursive() +141 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627 Version Information: Microsoft .NET Framework Version:2.0.50727.3074; ASP.NET Version:2.0.50727.3074 I have tried putting a placeholder in the user control and adding the textbox and slider extender to the placeholder programmatically and I still get the error. Here is the simple code: <table cellpadding="0" cellspacing="0" style="width:100%"> <tbody> <tr> <td></td> <td> <asp:Label ID="lblMaxValue" runat="server" Text="Maximum" CssClass="float_right" /> <asp:Label ID="lblMinValue" runat="server" Text="Minimum" /> </td> </tr> <tr> <td style="width:60%;"> <asp:CheckBox ID="chkOn" runat="server" /><asp:Label ID="lblPrefix" runat="server" />:&nbsp;<asp:Label ID="lblSliderValue" runat="server" />&nbsp;<asp:Label ID="lblSuffix" runat="server" /> </td> <td style="text-align:right;width:40%;"> <asp:TextBox ID="txtSlider" runat="server" Text="50" style="display:none;" /> <ajaxToolkit:SliderExtender ID="seSlider" runat="server" BehaviorID="seSlider" TargetControlID="txtSlider" BoundControlID="lblSliderValue" Orientation="Horizontal" EnableHandleAnimation="true" Length="200" Minimum="0" Maximum="100" Steps="1" /> </td> </tr> </tbody> What is the problem? Thanks in advance. Dan

    Read the article

  • Flex chart not displaying right values along x axis.

    - by Shah Al
    I don't know of any better way to ask this question. If the below code is run (i know the cData sections are not visible in the preview, something causes it to be ignored). The result does not represent the data correctly. 1. Flex ignores missing date 24 aug for DECKER. 2. It wrongly associates 42.77 to 23-Aug instead of 24-AUG. Is there a way in flex, where the x-axis is a union of all available points ? The below code is entirely from : Adobe website link I have only commented 2 data points. //{date:"23-Aug-05", close:45.74}, and //{date:"24-Aug-05", close:150.71}, <?xml version="1.0"?> [Bindable] public var SMITH:ArrayCollection = new ArrayCollection([ {date:"22-Aug-05", close:41.87}, //{date:"23-Aug-05", close:45.74}, {date:"24-Aug-05", close:42.77}, {date:"25-Aug-05", close:48.06}, ]); [Bindable] public var DECKER:ArrayCollection = new ArrayCollection([ {date:"22-Aug-05", close:157.59}, {date:"23-Aug-05", close:160.3}, //{date:"24-Aug-05", close:150.71}, {date:"25-Aug-05", close:156.88}, ]); [Bindable] public var deckerColor:Number = 0x224488; [Bindable] public var smithColor:Number = 0x884422; ]] <mx:horizontalAxisRenderers> <mx:AxisRenderer placement="bottom" axis="{h1}"/> </mx:horizontalAxisRenderers> <mx:verticalAxisRenderers> <mx:AxisRenderer placement="left" axis="{v1}"> <mx:axisStroke>{h1Stroke}</mx:axisStroke> </mx:AxisRenderer> <mx:AxisRenderer placement="left" axis="{v2}"> <mx:axisStroke>{h2Stroke}</mx:axisStroke> </mx:AxisRenderer> </mx:verticalAxisRenderers> <mx:series> <mx:ColumnSeries id="cs1" horizontalAxis="{h1}" dataProvider="{SMITH}" yField="close" displayName="SMITH" > <mx:fill> <mx:SolidColor color="{smithColor}"/> </mx:fill> <mx:verticalAxis> <mx:LinearAxis id="v1" minimum="40" maximum="50"/> </mx:verticalAxis> </mx:ColumnSeries> <mx:LineSeries id="cs2" horizontalAxis="{h1}" dataProvider="{DECKER}" yField="close" displayName="DECKER" > <mx:verticalAxis> <mx:LinearAxis id="v2" minimum="150" maximum="170"/> </mx:verticalAxis> <mx:lineStroke> <mx:Stroke color="{deckerColor}" weight="4" alpha="1" /> </mx:lineStroke> </mx:LineSeries> </mx:series> </mx:ColumnChart> <mx:Legend dataProvider="{myChart}"/>

    Read the article

  • Python: Improving long cumulative sum

    - by Bo102010
    I have a program that operates on a large set of experimental data. The data is stored as a list of objects that are instances of a class with the following attributes: time_point - the time of the sample cluster - the name of the cluster of nodes from which the sample was taken code - the name of the node from which the sample was taken qty1 = the value of the sample for the first quantity qty2 = the value of the sample for the second quantity I need to derive some values from the data set, grouped in three ways - once for the sample as a whole, once for each cluster of nodes, and once for each node. The values I need to derive depend on the (time sorted) cumulative sums of qty1 and qty2: the maximum value of the element-wise sum of the cumulative sums of qty1 and qty2, the time point at which that maximum value occurred, and the values of qty1 and qty2 at that time point. I came up with the following solution: dataset.sort(key=operator.attrgetter('time_point')) # For the whole set sys_qty1 = 0 sys_qty2 = 0 sys_combo = 0 sys_max = 0 # For the cluster grouping cluster_qty1 = defaultdict(int) cluster_qty2 = defaultdict(int) cluster_combo = defaultdict(int) cluster_max = defaultdict(int) cluster_peak = defaultdict(int) # For the node grouping node_qty1 = defaultdict(int) node_qty2 = defaultdict(int) node_combo = defaultdict(int) node_max = defaultdict(int) node_peak = defaultdict(int) for t in dataset: # For the whole system ###################################################### sys_qty1 += t.qty1 sys_qty2 += t.qty2 sys_combo = sys_qty1 + sys_qty2 if sys_combo > sys_max: sys_max = sys_combo # The Peak class is to record the time point and the cumulative quantities system_peak = Peak(time_point=t.time_point, qty1=sys_qty1, qty2=sys_qty2) # For the cluster grouping ################################################## cluster_qty1[t.cluster] += t.qty1 cluster_qty2[t.cluster] += t.qty2 cluster_combo[t.cluster] = cluster_qty1[t.cluster] + cluster_qty2[t.cluster] if cluster_combo[t.cluster] > cluster_max[t.cluster]: cluster_max[t.cluster] = cluster_combo[t.cluster] cluster_peak[t.cluster] = Peak(time_point=t.time_point, qty1=cluster_qty1[t.cluster], qty2=cluster_qty2[t.cluster]) # For the node grouping ##################################################### node_qty1[t.node] += t.qty1 node_qty2[t.node] += t.qty2 node_combo[t.node] = node_qty1[t.node] + node_qty2[t.node] if node_combo[t.node] > node_max[t.node]: node_max[t.node] = node_combo[t.node] node_peak[t.node] = Peak(time_point=t.time_point, qty1=node_qty1[t.node], qty2=node_qty2[t.node]) This produces the correct output, but I'm wondering if it can be made more readable/Pythonic, and/or faster/more scalable. The above is attractive in that it only loops through the (large) dataset once, but unattractive in that I've essentially copied/pasted three copies of the same algorithm. To avoid the copy/paste issues of the above, I tried this also: def find_peaks(level, dataset): def grouping(object, attr_name): if attr_name == 'system': return attr_name else: return object.__dict__[attrname] cuml_qty1 = defaultdict(int) cuml_qty2 = defaultdict(int) cuml_combo = defaultdict(int) level_max = defaultdict(int) level_peak = defaultdict(int) for t in dataset: cuml_qty1[grouping(t, level)] += t.qty1 cuml_qty2[grouping(t, level)] += t.qty2 cuml_combo[grouping(t, level)] = (cuml_qty1[grouping(t, level)] + cuml_qty2[grouping(t, level)]) if cuml_combo[grouping(t, level)] > level_max[grouping(t, level)]: level_max[grouping(t, level)] = cuml_combo[grouping(t, level)] level_peak[grouping(t, level)] = Peak(time_point=t.time_point, qty1=node_qty1[grouping(t, level)], qty2=node_qty2[grouping(t, level)]) return level_peak system_peak = find_peaks('system', dataset) cluster_peak = find_peaks('cluster', dataset) node_peak = find_peaks('node', dataset) For the (non-grouped) system-level calculations, I also came up with this, which is pretty: dataset.sort(key=operator.attrgetter('time_point')) def cuml_sum(seq): rseq = [] t = 0 for i in seq: t += i rseq.append(t) return rseq time_get = operator.attrgetter('time_point') q1_get = operator.attrgetter('qty1') q2_get = operator.attrgetter('qty2') timeline = [time_get(t) for t in dataset] cuml_qty1 = cuml_sum([q1_get(t) for t in dataset]) cuml_qty2 = cuml_sum([q2_get(t) for t in dataset]) cuml_combo = [q1 + q2 for q1, q2 in zip(cuml_qty1, cuml_qty2)] combo_max = max(cuml_combo) time_max = timeline.index(combo_max) q1_at_max = cuml_qty1.index(time_max) q2_at_max = cuml_qty2.index(time_max) However, despite this version's cool use of list comprehensions and zip(), it loops through the dataset three times just for the system-level calculations, and I can't think of a good way to do the cluster-level and node-level calaculations without doing something slow like: timeline = defaultdict(int) cuml_qty1 = defaultdict(int) #...etc. for c in cluster_list: timeline[c] = [time_get(t) for t in dataset if t.cluster == c] cuml_qty1[c] = [q1_get(t) for t in dataset if t.cluster == c] #...etc. Does anyone here at Stack Overflow have suggestions for improvements? The first snippet above runs well for my initial dataset (on the order of a million records), but later datasets will have more records and clusters/nodes, so scalability is a concern. This is my first non-trivial use of Python, and I want to make sure I'm taking proper advantage of the language (this is replacing a very convoluted set of SQL queries, and earlier versions of the Python version were essentially very ineffecient straight transalations of what that did). I don't normally do much programming, so I may be missing something elementary. Many thanks!

    Read the article

  • Why does C# thread die?

    - by JackN
    This is my 1st C# project so I may be doing something obviously improper in the code below. I am using .NET, WinForms (I think), and this is a desktop application until I get the bugs out. UpdateGui() uses Invoke((MethodInvoker)delegate to update various GUI controls based on received serial data and sends a GetStatus() command out the serial port 4 times a second. Thread Read() reads the response from serial port whenever it arrives which should be near immediate. SerialPortFixer is a SerialPort IOException Workaround in C# I found at http://zachsaw.blogspot.com/2010/07/serialport-ioexception-workaround-in-c.html. After one or both threads die I'll see something like The thread 0x1288 has exited with code 0 (0x0). in the debug code output. Why do UpdateGui() and/or Read() eventually die? public partial class UpdateStatus : Form { private readonly byte[] Command = new byte[32]; private readonly byte[] Status = new byte[32]; readonly Thread readThread; private static readonly Mutex commandMutex = new Mutex(); private static readonly Mutex statusMutex = new Mutex(); ... public UpdateStatus() { InitializeComponent(); SerialPortFixer.Execute("COM2"); if (serialPort1.IsOpen) { serialPort1.Close(); } try { serialPort1.Open(); } catch (Exception e) { labelWarning.Text = LOST_COMMUNICATIONS + e; labelStatus.Text = LOST_COMMUNICATIONS + e; labelWarning.Visible = true; } readThread = new Thread(Read); readThread.Start(); new Timer(UpdateGui, null, 0, 250); } static void ProcessStatus(byte[] status) { Status.State = (State) status[4]; Status.Speed = status[6]; // MSB Status.Speed *= 256; Status.Speed += status[5]; var Speed = Status.Speed/GEAR_RATIO; Status.Speed = (int) Speed; ... } public void Read() { while (serialPort1 != null) { try { serialPort1.Read(Status, 0, 1); if (Status[0] != StartCharacter[0]) continue; serialPort1.Read(Status, 1, 1); if (Status[1] != StartCharacter[1]) continue; serialPort1.Read(Status, 2, 1); if (Status[2] != (int)Command.GetStatus) continue; serialPort1.Read(Status, 3, 1); ... statusMutex.WaitOne(); ProcessStatus(Status); Status.update = true; statusMutex.ReleaseMutex(); } catch (Exception e) { Console.WriteLine(@"ERROR! Read() " + e); } } } public void GetStatus() { const int parameterLength = 0; // For GetStatus statusMutex.WaitOne(); Status.update = false; statusMutex.ReleaseMutex(); commandMutex.WaitOne(); if (!SendCommand(Command.GetStatus, parameterLength)) { Console.WriteLine(@"ERROR! SendCommand(GetStatus)"); } commandMutex.ReleaseMutex(); } private void UpdateGui(object x) { try { Invoke((MethodInvoker)delegate { Text = DateTime.Now.ToLongTimeString(); statusMutex.WaitOne(); if (Status.update) { if (Status.Speed > progressBarSpeed.Maximum) { Status.Speed = progressBarSpeed.Maximum; } progressBarSpeed.Value = Status.Speed; labelSpeed.Text = Status.Speed + RPM; ... } else { labelWarning.Text = LOST_COMMUNICATIONS; labelStatus.Text = LOST_COMMUNICATIONS; labelWarning.Visible = true; } statusMutex.ReleaseMutex(); GetStatus(); }); } catch (Exception e) { Console.WriteLine(@"ERROR! UpdateGui() " + e); } } }

    Read the article

  • creating a tooltip for a line drawn on cartesiandatacanvas in flex

    - by Guru
    I am trying to draw a line on cartesiandatacanvas. While I am able to draw lines easily using the canvas.moveTo and canvas.lineTo methods, I cannot provide a tooltip to the line if I use that functionality. I have tried creating a label(when ever I draw a line) and adding a tooltip to it but since I show the lines in a 10*10 grid both vertical and horizontal there is a overlap and it is confusing. So now I am trying to create a line object that extends shape or UIComponent. I cannot add this object to canvas using the addChild method it does not work. The addDataChild method works but it messes with the positioning of the line. Can someone help with a solution to this. Simply put I want to draw lines on a datacanvas and add tooltips to them. Here is my code for the line object: package model { import flash.display.CapsStyle; import flash.display.JointStyle; import flash.display.LineScaleMode; import mx.core.UIComponent; public class Line extends UIComponent { public var x1:Number; public var x2:Number; public var y1:Number; public var y2:Number; public var color:Number; public function Line(x1:Number, y1:Number, x2:Number, y2:Number,color:Number) { super(); this.graphics.lineStyle(4, color, 1, true, LineScaleMode.NORMAL, CapsStyle.ROUND, JointStyle.MITER, 1 ); this.graphics.moveTo(x1,y1); this.graphics.lineTo(x2,y2); } } } Here is a sample MXML that has a canvas and tries to use the line object above: <?xml version="1.0" encoding="utf-8"?> <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="init()"> <mx:Script> <![CDATA[ import model.Line; import mx.charts.chartClasses.CartesianCanvasValue; private var accidImage:Image = new Image(); public function init():void { var line:Line = new Line(10,10,40,40,0XFF0000); // canvas.addChild(line); *Does not Work* canvas.addDataChild(line,10,10,null,null,null,null); } ]]> </mx:Script> <mx:Panel x="60" y="53" width="517" height="472" layout="absolute"> <mx:PlotChart x="48" y="10" id="plotchart1"> <mx:series> <mx:PlotSeries displayName="Series 1" yField=""/> </mx:series> <mx:annotationElements> <mx:CartesianDataCanvas id="canvas" includeInRanges="true"/> </mx:annotationElements> <mx:verticalAxis> <mx:LinearAxis id="axis11" minimum="0" maximum="100" interval="10" padding="10"/> </mx:verticalAxis> <mx:horizontalAxis> <mx:LinearAxis id="axis21" minimum="0" maximum="100" interval="10" padding="10"/> </mx:horizontalAxis> </mx:PlotChart> <mx:Legend dataProvider="{plotchart1}"/> </mx:Panel> </mx:WindowedApplication>

    Read the article

  • How to use objects as modules/functors in Scala?

    - by Jeff
    Hi. I want to use object instances as modules/functors, more or less as shown below: abstract class Lattice[E] extends Set[E] { val minimum: E val maximum: E def meet(x: E, y: E): E def join(x: E, y: E): E def neg(x: E): E } class Calculus[E](val lat: Lattice[E]) { abstract class Expr case class Var(name: String) extends Expr {...} case class Val(value: E) extends Expr {...} case class Neg(e1: Expr) extends Expr {...} case class Cnj(e1: Expr, e2: Expr) extends Expr {...} case class Dsj(e1: Expr, e2: Expr) extends Expr {...} } So that I can create a different calculus instance for each lattice (the operations I will perform need the information of which are the maximum and minimum values of the lattice). I want to be able to mix expressions of the same calculus but not be allowed to mix expressions of different ones. So far, so good. I can create my calculus instances, but problem is that I can not write functions in other classes that manipulate them. For example, I am trying to create a parser to read expressions from a file and return them; I also was trying to write an random expression generator to use in my tests with ScalaCheck. Turns out that every time a function generates an Expr object I can't use it outside the function. Even if I create the Calculus instance and pass it as an argument to the function that will in turn generate the Expr objects, the return of the function is not recognized as being of the same type of the objects created outside the function. Maybe my english is not clear enough, let me try a toy example of what I would like to do (not the real ScalaCheck generator, but close enough). def genRndExpr[E](c: Calculus[E], level: Int): Calculus[E]#Expr = { if (level > MAX_LEVEL) { val select = util.Random.nextInt(2) select match { case 0 => genRndVar(c) case 1 => genRndVal(c) } } else { val select = util.Random.nextInt(3) select match { case 0 => new c.Neg(genRndExpr(c, level+1)) case 1 => new c.Dsj(genRndExpr(c, level+1), genRndExpr(c, level+1)) case 2 => new c.Cnj(genRndExpr(c, level+1), genRndExpr(c, level+1)) } } } Now, if I try to compile the above code I get lots of error: type mismatch; found : plg.mvfml.Calculus[E]#Expr required: c.Expr case 0 = new c.Neg(genRndExpr(c, level+1)) And the same happens if I try to do something like: val boolCalc = new Calculus(Bool) val e1: boolCalc.Expr = genRndExpr(boolCalc) Please note that the generator itself is not of concern, but I will need to do similar things (i.e. create and manipulate calculus instance expressions) a lot on the rest of the system. Am I doing something wrong? Is it possible to do what I want to do? Help on this matter is highly needed and appreciated. Thanks a lot in advance. After receiving an answer from Apocalisp and trying it. Thanks a lot for the answer, but there are still some issues. The proposed solution was to change the signature of the function to: def genRndExpr[E, C <: Calculus[E]](c: C, level: Int): C#Expr I changed the signature for all the functions involved: getRndExpr, getRndVal and getRndVar. And I got the same error message everywhere I call these functions and got the following error message: error: inferred type arguments [Nothing,C] do not conform to method genRndVar's type parameter bounds [E,C genRndVar(c) Since the compiler seemed to be unable to figure out the right types I changed all function call to be like below: case 0 => new c.Neg(genRndExpr[E,C](c, level+1)) After this, on the first 2 function calls (genRndVal and genRndVar) there were no compiling error, but on the following 3 calls (recursive calls to genRndExpr), where the return of the function is used to build a new Expr object I got the following error: error: type mismatch; found : C#Expr required: c.Expr case 0 = new c.Neg(genRndExpr[E,C](c, level+1)) So, again, I'm stuck. Any help will be appreciated.

    Read the article

< Previous Page | 61 62 63 64 65 66 67 68 69 70 71 72  | Next Page >