Search Results

Search found 1576 results on 64 pages for 'separating axis theorem'.

Page 30/64 | < Previous Page | 26 27 28 29 30 31 32 33 34 35 36 37  | Next Page >

  • Perl like regex in Python

    - by anansi
    In Perl I would do something like this for taking different fields in a regexp, separating different fields by () and getting them using $ foreach $line (@lines) { $line =~ m/(.*?):([^-]*)-(.*)/; $field_1 = $1 $field_2 = $2 $field_3 = $3 } How could I do something like this in Python?

    Read the article

  • jquery nested sortable list

    - by Y.G.J
    i have this code $(document).ready(function() { $("#test-list").sortable({ items: "> li", handle : '.handle', axis: 'y', opacity: 0.6, update : function () { var order = $('#test-list').sortable('serialize'); $("#info").load("process-sortable.asp?"+order+"&id=catid&order=orderid&table=tblCats"); } }); $("#test-sub").sortable({ containment: "ul", items: "li", handle : '.handle', axis: 'y', opacity: 0.6, update : function () { var order = $('#test-list').sortable('serialize'); $("#info").load("process-sortable.asp?"+order+"&id=catid&order=orderid&table=tblCats"); } }); }); for this kind of UL <ul id="test-list"> <li></li> <li> <ul id="test-sub"> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> </ul> </li> <li></li> <li></li> <li></li> <li></li> </ul> but it can be changed dynamiclly... when i drag and drop the main li it is working when i do it with the childs it will drag the main one what is wrong?

    Read the article

  • DEVX Web chart control

    - by Minal
    i am using DEVX Webchart control.. Bind x-Axis values: <dxchartsui:WebChartControl ID="ChartOPCGraph" runat="server" Height="400px" Width="700px" ClientInstanceName="ChartOPCGraph" DiagramTypeName="XYDiagram"> <Diagram> <axisy> <gridlines visible="False"></gridlines> </axisy> </Diagram> <Titles> <cc1:ChartTitle Dock="Bottom" Font="Tahoma, 8pt" Text="Days" TextColor="Gray" Alignment="Center"> </cc1:ChartTitle> <cc1:ChartTitle Dock="Left" Font="Tahoma, 8pt" Text="% Payment made" TextColor="Gray" Alignment="Center"></cc1:ChartTitle> </Titles> </dxchartsui:WebChartControl> values are being populated from database. On x-axis only two number comes from database so i need to bind only these two values and rest of them must not be visible. For example i get 9 number from database and it binds 8.6,8.7,8.8,8.9,9,9.2,...... Need a quick reply..

    Read the article

  • Creating an MJPEG Viewer Iphone

    - by Tony
    Hey all, Im trying to make a MJPEG viewer in Objective C but I'm having a bunch of issues with it. First off, Im using AsyncSocket(http://code.google.com/p/cocoaasyncsocket/) which lets me connect to the host. Here's what I got so far NSLog(@"Ready"); asyncSocket = [[AsyncSocket alloc] initWithDelegate:self]; //http://kamera5.vfp.slu.se/axis-cgi/mjpg/video.cgi NSError *err = nil; if(![asyncSocket connectToHost:@"kamera5.vfp.slu.se" onPort:80 error:&err]) { NSLog(@"Error: %@", err); } then in the didConnectToHost method: - (void)onSocket:(AsyncSocket *)sock didConnectToHost:(NSString *)host port:(UInt16)port{ NSLog(@"Accepted client %@:%hu", host, port); NSString *urlString = [NSString stringWithFormat:@"http://kamera5.vfp.slu.se/axis-cgi/mjpg/video.cgi"]; NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease]; [request setURL:[NSURL URLWithString:urlString]]; [request setHTTPMethod:@"GET"]; //set headers NSString *_host = [NSString stringWithFormat:host]; [request addValue:_host forHTTPHeaderField: @"Host"]; NSString *KeepAlive = [NSString stringWithFormat:@"300"]; [request addValue:KeepAlive forHTTPHeaderField: @"Keep-Alive"]; NSString *connection = [NSString stringWithFormat:@"keep-alive"]; [request addValue:connection forHTTPHeaderField: @"Connection"]; //get response NSHTTPURLResponse* urlResponse = nil; NSError *error = [[NSError alloc] init]; NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&urlResponse error:&error]; NSString *result = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding]; NSLog(@"Response Code: %d", [urlResponse statusCode]); if ([urlResponse statusCode] >= 200 && [urlResponse statusCode] < 300) { NSLog(@"Response: %@", result); //here you get the response } } This calls the MJPEG stream, but it doesn't call it to get more data. What I think its doing is just loading the first chunk of data, then disconnecting. Am I doing this totally wrong or is there light at the end of this tunnel? Thanks!

    Read the article

  • FLEX: how to dynamically add LineSeries to CartesianChart

    - by Patrick
    hi, the LineSeries is not dynamically added to my CartesianChart... What's wrong in this code: ... private function chartComplete():void { var ls:LineSeries = new LineSeries(); ls.styleName = 'timeline'; ls.dataProvider = "{dataManager.tagViewTimelineModel.tags.getItemAt(0).yearPopularity}"; ls.yField = 'popularity'; //ls.s = "{new Stroke(0xCC33CC, 2)}"; AllChart.series[0] = ls; } ... <mx:CartesianChart id="AllChart" width="100%" height="100" creationComplete="chartComplete();"> <mx:horizontalAxis><mx:CategoryAxis id="horiz1" dataProvider="['1','2','3','4','5','6','7','8','9','10','11','23','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31']"/></mx:horizontalAxis> <mx:horizontalAxisRenderers><mx:AxisRenderer axis="{horiz1}"/></mx:horizontalAxisRenderers> <mx:verticalAxis><mx:LinearAxis id="vert1" /></mx:verticalAxis> <mx:verticalAxisRenderers><mx:AxisRenderer axis="{vert1}"/></mx:verticalAxisRenderers> <mx:series> <mx:AreaSeries id="timeArea" styleName="timeArea" name="A" dataProvider="{dataManager.tagViewTimelineModel.tags.getItemAt(2).yearPopularity}" areaStroke="{new Stroke(0x0033CC, 2)}" areaFill="{new SolidColor(0x0033CC, 0.5)}" /> </mx:series> </mx:CartesianChart> I can only see the TimeLine if I added it with MXML: <mx:LineSeries styleName="timeLine" dataProvider="{dataManager.tagViewTimelineModel.tags.getItemAt(0).yearPopularity}" yField="popularity" stroke="{new Stroke(0xCC33CC, 2)}" /> But I need to update the view, and add N lines so I cannot do it with MXML. thanks

    Read the article

  • cfchart ignores my scalefrom value

    - by Monte Chan
    Hi all, I have the following codes in my page. The style variable holds the custom style. <cfchart chartheight="450" chartwidth="550" gridlines="9" yaxistitle="Score" scalefrom="20" scaleto="100" style="#style#" format="png" > <cfchartseries query="variables.chart_query" type="scatter" seriescolor="##000000" itemcolumn="MyItem" valuecolumn="MyScore"/> </cfchart> Before I begin, please go to http://www.monteandjanicechan.com/chart_good.jpg. This is how I want my report to come up. On the x-axis, there will always be three items as long as at least one of them has values. If an item does not have any values (i.e. 2010), there would not be a marker in the chart. The problem occurs only when only one item has value. Please see http://www.monteandjanicechan.com/chart_bad.jpg. As you can see, 2008 and 2010 do not have any values; y-axis is now scaled from 0 to 100. I have tried setting one of the items (ex. 2008) a value of 0 or something off the chart; it would scale according to this off-the-chart value and the 2009 value. In short, I have to have at least two items with values between 20 and 100 in order for cfchart to scale from 20 to 100. My question is, how can I correct the issue so that cfchart would ALWAYS scale from 20 to 100? I am running CF9. Thanks in advance, Monte

    Read the article

  • implementing Ws-security within WCF proxy

    - by harrisonmeister
    Hi, I have imported an axis based wsdl into a VS 2008 project as a service reference. I need to be able to pass security details such as username/password and nonce values to call the axis based service. I have looked into doing it for wse, which i understand the world hates (no issues there) I have very little experience of WCF, but have worked how to physically call the endpoint now, thanks to SO, but have no idea how to set up the SoapHeaders as the schema below shows: <S:Envelope xmlns:S="http://www.w3.org/2001/12/soap-envelope" xmlns:ws="http://schemas.xmlsoap.org/ws/2002/04/secext"> <S:Header> <ws:Security> <ws:UsernameToken> <ws:Username>aarons</ws:Username> <ws:Password>snoraa</ws:Password> </ws:UsernameToken> </wsse:Security> ••• </S:Header> ••• </S:Envelope> Any help much appreciated Thanks, Mark

    Read the article

  • Unrecognised selector sent to instance uitableview

    - by ct2k7
    I'm getting error: Unrecognised selector sent to instance, upon inspection, I see there is an issue in this section of code, and more specifically: [self.tableView insertSubview:ovController.view aboveSubview:self.parentViewController.view]; - (void) searchBarTextDidBeginEditing:(UISearchBar *)theSearchBar { if(searching) return; //Add the overlay view. ovController = [[OverlayViewController alloc] initWithNibName:@"OverlayView" bundle:[NSBundle mainBundle]]; CGFloat yaxis = self.navigationController.navigationBar.frame.size.height; CGFloat width = self.view.frame.size.width; CGFloat height = self.view.frame.size.height; //Parameters x = origion on x-axis, y = origon on y-axis. CGRect frame = CGRectMake(0, yaxis, width, height); ovController.view.frame = frame; ovController.view.backgroundColor = [UIColor grayColor]; ovController.view.alpha = 0.5; ovController.rvController = self; [self.tableView insertSubview:ovController.view aboveSubview:self.parentViewController.view]; searching = YES; letUserSelectRow = NO; //self.tableView.scrollEnabled = NO; } Looks like there's an issue with tableview?

    Read the article

  • MATLAB only prints a part of my figure

    - by simonty
    I'm trying to print my figure in Matlab, but it keeps screwing up and I have no idea why. opslaan = figure(1); plot(1:handles.aantal,handles.nauw,'-r','LineWidth',1.5); xlabel(gca,sprintf('Framenummer (%g ms per frame)',60/handles.aantal)); ylabel(gca,'dB'); set(gca,'YGrid','on'); yAsMax = ceil( ceil(max(handles.nauw)) / 2) * 2; axis([0 handles.aantal 0 yAsMax]); pause(1); print -dpng image.png The first line is just plotting the data on my figure, then labeling x and y, turning on grid and caculating the y-axis like I want it. This all works great and Matlab shows it like I want it in the Figure window. When saving to .png / .jpeg / .eps it goes wrong and only prints the bottom left corner (473x355 pixels), the rest just disappeared. When exporting manually via File - Save As, it works correctly. Any help? Thanks!

    Read the article

  • Opengl Iphone SDK: How to tell if you're touching an object on screen?

    - by TheGambler
    First is my touchesBegan function and then the struct that stores the values for my object. I have an array of these objects and I'm trying to figure out when I touch the screen if I'm touching an object on the screen. I don't know if I need to do this by iterating through all my objects and figure out if I'm touching an object that way or maybe there is an easier more efficient way. How is this usually handled? -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ [super touchesEnded:touches withEvent:event]; UITouch* touch = ([touches count] == 1 ? [touches anyObject] : nil); CGRect bounds = [self bounds]; CGPoint location = [touch locationInView:self]; location.y = bounds.size.height - location.y; float xTouched = location.x/20 - 8 + ((int)location.x % 20)/20; float yTouched = location.y/20 - 12 + ((int)location.y % 20)/20; } typedef struct object_tag // Create A Structure Called Object { int tex; // Integer Used To Select Our Texture float x; // X Position float y; // Y Position float z; // Z Position float yi; // Y Increase Speed (Fall Speed) float spinz; // Z Axis Spin float spinzi; // Z Axis Spin Speed float flap; // Flapping Triangles :) float fi; // Flap Direction (Increase Value) } object;

    Read the article

  • ploting 3d graph in matlab?

    - by lytheone
    Hello, I am currently a begineer, and i am using matlab to do a data analysis. I have a a text file with data at the first row is formatted as follow: time;wave height 1;wave height 2;....... I have column until wave height 19 and rows total 4000 rows. Data in the first column is time in second. From 2nd column onwards, it is wave height elevation which is in meter. At the moment I like to ask matlab to plot a 3d graph with time on the x axis, wave elevation on the y axis, and wave elevation that correspond to wave height number from 1 to 19, i.e. data in column 2 row 10 has a let say 8m which is correspond to wave height 1 and time at the column 1 row 10. I have try the following: clear; filename='abc.daf'; path='C:\D'; a=dlmread([path '\' filename],' ', 2, 1); [nrows,ncols]=size(a); t=a(1:nrows,1);%define t from text file for i=(1:20), j=(2:21); end wi=a(:,j); for k=(2:4000), l=k; end r=a(l,:); But everytime i use try to plot them, the for loop wi works fine, but for r=a(l,:);, the plot only either give me the last time data only but i want all data in the file to be plot. Is there a way i can do that. I am sorry as it is a bit confusing but i will be very thankful if anyone can help me out. Thank you!!!!!!!!!!

    Read the article

  • Matlab Simulation: Point (symbol) Moving from start point to end point and back

    - by niko
    Hi, I would like to create an animation to demonstrate LDPC coding which is based on Sum-Product Algorithm So far I have created a graph which shows the connections between symbol nodes (left) and parity nodes (right) and would like to animate points travelling from symbol to parity nodes and back. The figure is drawn by executing the following method: function drawVertices(H) hold on; nodesCount = size(H); parityNodesCount = nodesCount(1); symbolNodesCount = nodesCount(2); symbolPoints = zeros(symbolNodesCount, 2); symbolPoints(:, 1) = 0; for i = 0 : symbolNodesCount - 1 ji = symbolNodesCount - i; scatter(0, ji) symbolPoints(i + 1, 2) = ji; end; parityPoints = zeros(parityNodesCount, 2); parityPoints(:, 1) = 10; for i = 0 : parityNodesCount - 1 ji = parityNodesCount - i; y0 = symbolNodesCount/2 - parityNodesCount/2; scatter(10, y0 + ji) parityPoints(i + 1, 2) = y0 + ji; end; axis([-1 11 -1 symbolNodesCount + 2]); axis off %connect vertices d = size(H); for i = 1 : d(1) for j = 1 : d(2) if(H(i, j) == 1) plot([parityPoints(i, 1) symbolPoints(j, 1)], [parityPoints(i, 2) symbolPoints(j, 2)]); end; end; end; So what I would like to do here is to add another method which takes start point (x and y) and end point as arguments and animates a travelling circle (dot) from start to end and back along the displayed lines. I would appreciate if anyone of you could show the solution or suggest any useful tutorial about matlab simulations. Thank you!

    Read the article

  • Opengl: fit a quad to screen, given the value of Z.

    - by hytparadisee
    Short Version of the question: I will put a quad. I know the width and height of the screen in window coordinates, i know the Z-coordinates of the quad in 3D. I know the FOVY, I know the aspect. The quad will be put along Z-axis, My camera doesn't move (placed at 0, 0, 0). I want to find out the width and height of the quad IN 3D COORDINATES that will fit exactly onto my screen. Long Version of the question: I would like to put a quad along the Z-axis at the specified offset Z, I would like to find out the width and height of the quad that will exactly fill the entire screen. I used to have a post on gamedev.net that uses a formula similar to the following: *dist = Z * tan ( FOV / 2 )* Now I can never find the post! Though it's similar, it is still different, because I remembered in that working formula, they do make use of screenWidth and screenHeight, which are the width and height of the screen in window coordinates. I am not really familiar with concepts like frustum, fov and aspect so that's why I can't work out the formula on my own. Besides, I am sure I don't need gluUnproject (I tried it, but the results are way off). It's not some gl calls, it's just a math formula that can find out the width and height in 3D space that can fill the entire screen, IF Z offset, width in window coordinates, and height in window coordinates, are known. Thanks all in advance.

    Read the article

  • getting service from wsdd via xpath not wroking

    - by subes
    Hi, I am trying to get the XPath "/deployment/service". Tested on this site: http://www.xmlme.com/XpathTool.aspx <?xml version="1.0" encoding="UTF-8" standalone="no"?> <deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org /axis/wsdd/providers/java"> <service name="kontowebservice" provider="java:RPC" style="rpc" use="literal"> <parameter name="wsdlTargetNamespace" value="http://strategies.spine"/> <parameter name="wsdlServiceElement" value="ExposerService"/> <parameter name="wsdlServicePort" value="kontowebservice"/> <parameter name="className" value="dmd4biz.container.webservice.konto.internal.KontoWebServiceImpl_WS"/> <parameter name="wsdlPortType" value="Exposer"/> <parameter name="typeMappingVersion" value="1.2"/> <operation xmlns:operNS="http://strategies.spine" xmlns:rtns="http://www.w3.org/2001/XMLSchema" name="expose" qname="operNS:expose" returnQName="exposeReturn" returnType="rtns:anyType" soapAction=""> <parameter xmlns:tns="http://www.w3.org/2001/XMLSchema" qname="in0" type="tns:anyType"/> </operation> <parameter name="allowedMethods" value="expose"/> <parameter name="scope" value="Request"/> </service> </deployment> I absolutely can't find out why it always tells me that my xpath does not match... This may be stupid, but am I missing something?

    Read the article

  • OpenMeetings + Python + Suds

    - by user366774
    Trying to integrate openmeetings with django website, but can't understand how properly configure ImportDoctor: (here :// replaced with __ 'cause spam protection) print url http://sovershenstvo.com.ua:5080/openmeetings/services/UserService?wsdl imp = Import('http__schemas.xmlsoap.org/soap/encoding/') imp.filter.add('http__services.axis.openmeetings.org') imp.filter.add('http__basic.beans.hibernate.app.openmeetings.org/xsd') imp.filter.add('http__basic.beans.data.app.openmeetings.org/xsd') imp.filter.add('http__services.axis.openmeetings.org') d = ImportDoctor(imp) client = Client(url, doctor = d) client.service.getSession() Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.6/site-packages/suds/client.py", line 539, in call return client.invoke(args, kwargs) File "/usr/lib/python2.6/site-packages/suds/client.py", line 598, in invoke result = self.send(msg) File "/usr/lib/python2.6/site-packages/suds/client.py", line 627, in send result = self.succeeded(binding, reply.message) File "/usr/lib/python2.6/site-packages/suds/client.py", line 659, in succeeded r, p = binding.get_reply(self.method, reply) File "/usr/lib/python2.6/site-packages/suds/bindings/binding.py", line 159, in get_reply resolved = rtypes[0].resolve(nobuiltin=True) File "/usr/lib/python2.6/site-packages/suds/xsd/sxbasic.py", line 63, in resolve raise TypeNotFound(qref) suds.TypeNotFound: Type not found: '(Sessiondata, http__basic.beans.hibernate.app.openmeetings.org/xsd, )' what i'm doing wrong? please help and sorry for my english, but you are my last chance to save position :( need webinars at morning (2.26 am now)

    Read the article

  • iphone - why is this flip animation using layers not working?

    - by Digital Robot
    I would like to make an animation that goes like this: imagine a picture sitting on a shelve. It drops from the shelve and as it falls it rotates along the horizontal axis and translates along the vertical axis. I would like to do this with perspective and the back side should be the image reversed, like the picture is a kind of slide. I have done this: CALayer* layer = myImageView.layer; layer.doubleSided = YES; CAKeyframeAnimation* animationTransform = [CAKeyframeAnimation animationWithKeyPath:@"transform"]; CATransform3D startTransform = CATransform3DIdentity; CATransform3D endTransform = CATransform3DTranslate (layer.transform, 0.0f, 200.0f, 0.0f); endTransform = CATransform3DRotate (endTransform, degreesToRadian(350.0f), 1.0f, 0.0f, 0.0f); endTransform.m34 = 1.0 / -500; NSArray *values = [NSArray arrayWithObjects: [NSValue valueWithCATransform3D:startTransform], [NSValue valueWithCATransform3D:endTransform], nil]; [animationTransform setValues:values]; NSArray *tempos = [NSArray arrayWithObjects: [NSNumber numberWithFloat:0.0f], [NSNumber numberWithFloat:0.7f], nil]; [animationTransform setKeyTimes:tempos]; NSArray *timing = [NSArray arrayWithObjects: [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut], nil]; [animationTransform setTimingFunctions:timing]; animationTransform.fillMode = kCAFillModeRemoved; animationTransform.removedOnCompletion = YES; animationTransform.repeatCount = 1; animationTransform.duration = 3.7f; animationTransform.cumulative = YES; the result of this has nothing to do with anything. The result is: the image translates down an inch on the screen and then up half inch. Then it disappears and appears at its starting position again. What am I missing? thanks

    Read the article

  • Combining two data sets and plotting in matlab

    - by bautrey
    I am doing experiments with different operational amplifier circuits and I need to plot my measured results onto a graph. I have two data sets: freq1 = [.1 .2 .5 .7 1 3 4 6 10 20 35 45 60 75 90 100]; %kHz Vo1 = [1.2 1.6 1.2 2 2 2.4 14.8 20.4 26.4 30.4 53.6 68.8 90 114 140 152]; %mV V1 = 19.6; Acm = Vo1/(1000*V1); And: freq2 = [.1 .5 1 30 60 70 85 100]; %kHz Vo1 = [3.96 3.96 3.96 3.84 3.86 3.88 3.88 3.88]; %V V1 = .96; Ad = Vo1/(2*V1); (I would show my plots but apparently I need more reps for that) I need to plot the equation, CMRR vs freq: CMRR = 20*log10(abs(Ad/Acm)); The size of Ad and Acm are different and the frequency points do not match up, but the boundaries of both of these is the same, 100Hz to 100kHz (x-axis). On the line of CMRR, Matlab says that Ad and Acm matrix dimensions do not agree. How I think I would solve this is using freq1 as the x-axis for CMRR and then taking approximated points from Ad according to the value on freq1. Or I could do function approximations of Ad and Acm and then do the divide operator on those. I do not know how I would code up this two ideas. Any other ideas would helpful, especially simpler ones. Thanks

    Read the article

  • coordination transform issue in Silverlight

    - by George2
    Hello everyone, I am using Silverlight 3.0 + .Net 3.5 + VSTS 2008 + C# to develop silverlight application based on ASP.Net. I am very confused about what are the function of "TranslateTransform" and "RenderTransformOrigin" in the following code snippet? BTW: I roughly understand RenderTransformOrigin means move an UI element in x-axis and y-axis by some offset, is that correct? Move the whole UI element? <Grid Margin="-1,0,100,0" x:Name="controlsContainer" Height="35" RenderTransformOrigin="0.5,0.5" VerticalAlignment="Bottom"> <Grid.RenderTransform> <TransformGroup> <ScaleTransform/> <SkewTransform/> <RotateTransform/> <TranslateTransform Y="0"/> </TransformGroup> </Grid.RenderTransform> <Rectangle Margin="0,0,0,0" Height="35" VerticalAlignment="Top" Fill="#97000000" Stroke="#00000000" RenderTransformOrigin="0.5,0.5"/> <VideoPlayer:mediaControl Height="35" Margin="1,0,0,0" HorizontalAlignment="Stretch" VerticalAlignment="Top" x:Name="mediaControls" Visibility="Visible"/> </Grid> thanks in advance, George

    Read the article

  • how to create static line in coreplot

    - by Rémi Bédard-Couture
    I am trying to make my control lines static so instead of being displayed as part of the graph(the control lines are moving with the graph), they would be displayed like an axis the app can only scroll horizontally i'm talking about the two red line and the green line(which i put over the x axis) this is how i do my lines: // Center line CPTScatterPlot *centerLinePlot = [[CPTScatterPlot alloc] init]; centerLinePlot.identifier = kCenterLine; CPTMutableLineStyle *lineStyle = [CPTMutableLineStyle lineStyle]; lineStyle.lineWidth = 2.0; lineStyle.lineColor = [CPTColor greenColor]; centerLinePlot.dataLineStyle = lineStyle; centerLinePlot.dataSource = self; [graph addPlot:centerLinePlot]; but maybe it has something to do with the displayed range: ////////ajuste la portion a voir if(data.Resultats.count>10) { plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(data.Resultats.count - 10) length:CPTDecimalFromDouble(10)]; } plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(RangeMin) length:CPTDecimalFromDouble(RangeMax-RangeMin)]; // Adjust visible ranges so plot symbols along the edges are not clipped CPTMutablePlotRange *xRange = [plotSpace.xRange mutableCopy]; CPTMutablePlotRange *yRange = [plotSpace.yRange mutableCopy]; //place l'axe x sur la ligne de controle pour voir les WorkOrders x.orthogonalCoordinateDecimal = CPTDecimalFromDouble(center); //x.orthogonalCoordinateDecimal = yRange.location; //y.orthogonalCoordinateDecimal = xRange.location; //x.visibleRange = xRange; //y.visibleRange = yRange; //x.gridLinesRange = yRange; //y.gridLinesRange = xRange; [xRange expandRangeByFactor:CPTDecimalFromDouble(1.15)];//1.05 [yRange expandRangeByFactor:CPTDecimalFromDouble(1.15)]; plotSpace.xRange = xRange; plotSpace.yRange = yRange;

    Read the article

  • set width of bars in matlab bar plot on logarithmic scale

    - by KatyB
    I am a bit confused on how to draw a bar graph for the following example: x_lims = [1000,10000;10000,100000;100000,1000000;1000000,10000000;10000000,... 100000000;100000000,1000000000;1000000000,10000000000;... 10000000000,100000000000;100000000000,1e12]; ex1 = [277422033.049038;24118536.4203188;2096819.03295482;... 182293.402068030;15905;1330;105;16;1]; Here, x_lims is the x axis limits for each individual bar and ex1 is the count. How can I plot these on a bar graph so that the width of each individual bar along the x axis is defined by the distance between x_lims(:,1) and x_lims(:,2) and the y value is defined by ex1? So far I have: bar(log10(x_lims(:,1)),log10(ex1)); set(gca,'Xtick',3:11,'YTick',0:9); set(gca,'Xticklabel',10.^get(gca,'Xtick'),... 'Yticklabel',10.^get(gca,'Ytick')); But I would like to (1) have the labels to be the same as if they were created using semilogx or semilogy e.g. 10^9, and (2) I would like to remove the space between the bars, for the first bar, for example, I would like to have it extend horizontally from 1000 to 10000 and then the second bar from 10000 to 100000, and so on. How can this be done?

    Read the article

  • Point covering problem

    - by Sean
    I recently had this problem on a test: given a set of points m (all on the x-axis) and a set n of lines with endpoints [l, r] (again on the x-axis), find the minimum subset of n such that all points are covered by a line. Prove that your solution always finds the minimum subset. The algorithm I wrote for it was something to the effect of: (say lines are stored as arrays with the left endpoint in position 0 and the right in position 1) algorithm coverPoints(set[] m, set[][] n): chosenLines = [] while m is not empty: minX = min(m) bestLine = n[0] for i=1 to length of n: if n[i][0] <= m and n[i][1] > bestLine[1] then bestLine = n[i] add bestLine to chosenLines for i=0 to length of m: if m <= bestLine[1] then delete m[i] from m return chosenLines I'm just not sure if this always finds the minimum solution. It's a simple greedy algorithm so my gut tells me it won't, but one of my friends who is much better than me at this says that for this problem a greedy algorithm like this always finds the minimal solution. For proving mine always finds the minimal solution I did a very hand wavy proof by contradiction where I made an assumption that probably isn't true at all. I forget exactly what I did. If this isn't a minimal solution, is there a way to do it in less than something like O(n!) time? Thanks

    Read the article

  • Determining two lines in MATLAB

    - by Sanyi
    Hi! I am making the game planarity in MATLAB, and i am stuck where the program have to determine that is there any lines that are in inscision with each other. Any ideas how could the program find the inscision points. Heres my source for the game: > clear; clc; a=1; b=10; x=floor(rand(5,1)*(b-a+1)+a); y=floor(rand(5,1)*(b-a+1)+a); fig1=figure; set(fig1,'Color','w','Position',[100 100 500 500]) plot(x,y,'o','MarkerSize',12,'MarkerFaceColor','r'); axis([0 11 0 11]); axis off grid on; hold on; FirstPlayerLines=[]; SecondPlayerLines=[]; for a1=1:+1:2 for a2=5:-1:2 plot([x(a1) x(a2)],[y(a1) y(a2)],'Color','black','LineWidth',3); end end waitforbuttonpress

    Read the article

  • Matlab Coin Toss Simulation

    - by user1772959
    I have to write some code in Matlab that simulates tossing a coin 150 times. I have to count how many times the coin lands on heads and create a vector that gives a running percentage of the heads. Then I have to make a table of the number of trials, random 'flips", and the running percentages of heads. I assume random "flips" means heads or tails for that trial. I also have to create a line graph with trials on the x-axis and probabilities (percentages) on the y-axis. I'm assuming the percentages are just the percentage of getting heads. Sorry if this post was long. I figure giving the details now will make it easier to see what I was trying to do with the code. I didn't create the table or plot yet because I'm not even sure how to code for the actual problem. NUM_TRIALS = 150; trials = 1:NUM_TRIALS; heads = 0; t = rand(NUM_TRIALS,1); for i = trials if (t < 0.5) heads = heads + 1; end z = zeros(NUM_TRIALS,1); percent_h = heads/trials; end

    Read the article

< Previous Page | 26 27 28 29 30 31 32 33 34 35 36 37  | Next Page >