Search Results

Search found 21 results on 1 pages for 'sampledata'.

Page 1/1 | 1 

  • Grabbing values from Expression.Blend.SampleData

    - by Mitchell Skurnik
    I am trying to figure out how to grab a value from Expression.Blend.SampleData. If my id is equal to a drop down for example, I can grab it by doing this: ((Expression.Blend.SampleData.MyDatabase.something)(MyDropDown.SelectedItem)).description; I need some way to place my own value where (MyDropDown.SelectedItem) is. Visual studio wants me to convert it a "Expression.Blend.SampleData.MyDatabase.something" format. I have tried a few ways to do this but I have been unsuccessful. Any Ideas? EDIT I am starting to think there is no way in Silverlight to do this

    Read the article

  • Help understanding how to make a bar chart using ggplot2

    - by celenius
    I'm trying to use the bar_geom function of ggplot2, but I can't understand how to use it. I've made a small sample of my code to show what I am trying to do: library(ggplot2) # sample data sampleData = data.frame( v1=c('a','b','c','d','e', 'f','g', 'h', 'i','j'), v2=c(1:10) ) sampleData$Names = data.frame( Names = paste(sampleData$v1, sampleData$v2, sep="") ) sampleData$Values = c(1:10) # make plot x = sampleData$Values y = sampleData$Names qplot( x, y, data = sampleData, geom="bar" ) I want sampleData$Names to be on the x-axis of my graph, labeling each bar and and sampleData$Values to scale the bar height. I want the y-axis to be specified as a range. I realize that I don't understand how ggplot2 functions as this small example does not work, yet my other example is generating a plot but I cannot specify a y-range as it considers the variables to be categorical.

    Read the article

  • random generator to obtain data from array not displaying

    - by Yang Jie Domodomo
    I know theres a better solution using arc4random (it's on my to-try-out-function list), but I wanted to try out using the rand() and stand(time(NULL)) function first. I've created a NSMutableArray and chuck it with 5 data. Testing out how many number it has was fine. But when I tried to use the button function to load the object it return me with object <sampleData: 0x9a2f0e0> - (IBAction)generateNumber:(id)sender { srand(time(NULL)); NSInteger number =rand()% ds.count ; label.text = [NSString stringWithFormat:@"object %@", [ds objectAtIndex:number] ]; NSLog(@"%@",label.text); } While I feel the main cause is the method itself, I've paste the rest of the code below just incase i made any error somewhere. ViewController.h #import <UIKit/UIKit.h> #import "sampleData.h" #import "sampleDataDAO.h" @interface ViewController : UIViewController @property (weak, nonatomic) IBOutlet UILabel *label; @property (weak, nonatomic) IBOutlet UIButton *onHitMePressed; - (IBAction)generateNumber:(id)sender; @property(nonatomic, strong) sampleDataDAO *daoDS; @property(nonatomic, strong) NSMutableArray *ds; @end ViewController.m #import "ViewController.h" @interface ViewController () @end @implementation ViewController @synthesize label; @synthesize onHitMePressed; @synthesize daoDS,ds; - (void)viewDidLoad { [super viewDidLoad]; daoDS = [[sampleDataDAO alloc] init]; self.ds = daoDS.PopulateDataSource; // Do any additional setup after loading the view, typically from a nib. } - (void)viewDidUnload { [self setLabel:nil]; [self setOnHitMePressed:nil]; [super viewDidUnload]; // Release any retained subviews of the main view. } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); } - (IBAction)generateNumber:(id)sender { srand(time(NULL)); NSInteger number =rand()% ds.count ; label.text = [NSString stringWithFormat:@"object %@", [ds objectAtIndex:number] ]; NSLog(@"%@",label.text); } @end sampleData.h #import <Foundation/Foundation.h> @interface sampleData : NSObject @property (strong,nonatomic) NSString * object; @end sampleData.m #import "sampleData.h" @implementation sampleData @synthesize object; @end sampleDataDAO.h #import <Foundation/Foundation.h> #import "sampleData.h" @interface sampleDataDAO : NSObject @property(strong,nonatomic)NSMutableArray*someDataArray; -(NSMutableArray *)PopulateDataSource; @end sampleDataDAO.m #import "sampleDataDAO.h" @implementation sampleDataDAO @synthesize someDataArray; -(NSMutableArray *)PopulateDataSource { someDataArray = [[NSMutableArray alloc]init]; sampleData * myData = [[sampleData alloc]init]; myData.object= @"object 1"; [someDataArray addObject:myData]; myData=nil; myData = [[sampleData alloc] init]; myData.object= @"object 2"; [someDataArray addObject:myData]; myData=nil; myData = [[sampleData alloc] init]; myData.object= @"object 3"; [someDataArray addObject:myData]; myData=nil; myData = [[sampleData alloc] init]; myData.object= @"object 4"; [someDataArray addObject:myData]; myData=nil; myData = [[sampleData alloc] init]; myData.object= @"object 5"; [someDataArray addObject:myData]; myData=nil; return someDataArray; } @end

    Read the article

  • Dynamicly set TextBlock's text binding

    - by Mitchell Skurnik
    I am attempting to write a multilingual application in Silverlight 4.0 and I at the point where I can start replacing my static text with dynamic text from a SampleData xaml file. Here is what I have: My Database <SampleData:something xmlns:SampleData="clr-namespace:Expression.Blend.SampleData.MyDatabase" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> <SampleData:something.mysystemCollection> <SampleData:mysystem ID="1" English="Menu" German="Menü" French="Menu" Spanish="Menú" Swedish="Meny" Italian="Menu" Dutch="Menu" /> </SampleData:something.mysystemCollection> </SampleData:something> My UserControl <UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="Something.MyUC" d:DesignWidth="1000" d:DesignHeight="600"> <Grid x:Name="LayoutRoot" DataContext="{Binding Source={StaticResource MyDatabase}}"> <Grid Height="50" Margin="8,20,8,0" VerticalAlignment="Top" d:DataContext="{Binding mysystemCollection[1]}" x:Name="gTitle"> <TextBlock x:Name="Title" Text="{Binding English}" TextWrapping="Wrap" Foreground="#FF00A33D" TextAlignment="Center" FontSize="22"/> </Grid> </Grid> </UserControl> As you can see, I have 7 languages that I want to deal with. Right now this loads the English version of my text just fine. I have spent the better part of today trying to figure out how to change the binding in my code to swap this out when I needed (lets say when I change the language via drop down). Any help would be great!

    Read the article

  • Oracle sample data problems

    - by Jay
    So, I have this java based data trasformation / masking tool, which I wanted to test out on Oracle 10g. The good part with Oracle 10g is that you get a load of sample schemas with half a million records in some. The schemas are : SH, OE, HR, IX and etc. So, I installed 10g, found out that the installation scripts are under ORACLE_HOME/demo/scripts. I customized these scripts a bit to run in batch mode. That solves one half of my requirement - to create source data for my testing my data transformation software. The second half of the requirement is that I create the same schemas under different names (TR_HR, TR_OE and so on...) without any data. These schemas would represent my target schemas. So, in short, my software would pick up data from a table in a schema and load it up in to the same table in a different schema. Now, I have two issues in creating my target schema and emptying it. I would like this in a batch job. But the oracle scripts you get, the sample schema names are not configurable. So, I tried creating a script, replacing OE with TR_OE, HR with TR_HR and so on. However, this approach is kind of irritating coz the sample schemas are kind of complicated in the way they are created; Oracle creates synonyms, views, materialized views, data types and lot of weird stuff. I would like the target schemas (TR_HR, TR_OE,...) to be empty. But some of the schemas have circular references, which would not allow me to delete data. The only work around seems to be removing certain foreign keys, deleting data and then adding the constraints back. Is there any easy way to all this, without all this fuss? I would need a complicated data set for my testing (complicated as in tables with triggers, multiple hierarchies.. for instance.. a child table that has children up to 5 levels, a parent table that refers to an IOT table and an IOT table that refers to a non-IOT table etc..). The sample schemas are just about perfect from a data set perspective. The only challenge I see is in automating this whole process of loading up the source schemas, and then creating the target schemas and emptying them. Appreciate your help and suggestions.

    Read the article

  • Where to find free-to-use, complex test databases?

    - by Jay
    I need a database for testing a data masking solution. Any database would do (Oracle/MSSQL flavor). I just need the schema / db definition. I have tools to generate data records. The magnitude of database I am looking should have 30 odd tables with 30 odd columns in each table - a HUGE database. Do freely available complex database /schema definitions exist on the internet? If yes, where do I find them?

    Read the article

  • swapping <div> ?

    - by kiran
    this is my sample code <div id="id-1"><div>sampledata</div><span>sampledata</span></div> <div id"id-2"><div>sampledata</div><div> smpledata</div></div> <div id"id-3"><div>sampledata</div><div> smpledata</div></div> <div id"id-3"><div>sampledata</div><div> smpledata</div></div> i'm having the id of only one div(for example id-3) . i want to swap that <div> with next <div>, since there is more than one <div> inside a <div> i cant use a next() . thanks in advance

    Read the article

  • Is it possible to inspect the contents of a Table Value Parameter via the debugger?

    - by Stephen Edmonds
    Does anyone know if it is possible to use the Visual Studio / SQL Server Management Studio debugger to inspect the contents of a Table Value Parameter passed to a stored procedure? To give a trivial example: CREATE TYPE [dbo].[ControllerId] AS TABLE( [id] [nvarchar](max) NOT NULL ) GO CREATE PROCEDURE [dbo].[test] @controllerData [dbo].[ControllerId] READONLY AS BEGIN SELECT COUNT(*) FROM @controllerData; END DECLARE @SampleData as [dbo].[ControllerId]; INSERT INTO @SampleData ([id]) VALUES ('test'), ('test2'); exec [dbo].[test] @SampleData; Using the above with a break point on the exec statement, I am able to step into the stored procedure without any trouble. The debugger shows that the @controllerData local has a value of '(table)' but I have not found any tool that would allow me to actual view the rows that make up that table.

    Read the article

  • C# LINQ question, Why need new here?

    - by 5YrsLaterDBA
    Why we need the new in the select statement on one of them? var runs = from sampleDataTable in db.SampleData from sampleInfoTable in db.SampleInfo where sampleDataTable.SampleInfo.SampleInfoId == sampleInfoTable.SampleInfoId select new {sampleDataTable.Timestamp, sampleDataTable.SampleDataId, sampleInfoTable.Lane} ; and var runs2 = from sampleDataTable in db.SampleData from sampleInfoTable in db.SampleInfo where sampleDataTable.SampleInfo.SampleInfoId == sampleInfoTable.SampleInfoId && sampleDataTable.Timestamp == timestamp select sampleInfoTable.Lane;

    Read the article

  • How do I detect whether the sample supplied by VideoSink.OnSample() is right-side up?

    - by Ken Smith
    We're currently using the Silverlight VideoSink to capture video from users' local webcams, kinda like so: protected override void OnSample(long sampleTime, long frameDuration, byte[] sampleData) { if (FrameShouldBeSubmitted()) { byte[] resampledData = ResizeFrame(sampleData); mediaController.SetVideoFrame(resampledData); } } Now, on most of the machines that we've tested, the video sample provided in the byte[] sampleData parameter is upside-down, i.e., if you try to take the RGBA data and turn it into, say, a WriteableBitmap, the bitmap will be upside-down. That's odd, but fairly easy to correct, of course -- you just have to reverse the array as you encode it. The problem is that at least on some machines (e.g., the single Macintosh in our test environment), the video sample provided is no longer upside-down, but right-side up, and hence, flipping the image actually results in an image that's received upside-down on the far side. I reported this to MS as a bug, but their (terse) response was that it was "As Designed". Further attempts at clarification have so far been ignored. Now, I'll grant that it's kinda entertaining to imagine the discussions behind this design decision: "OK, just to make it interesting, let's play the video rightside up on a Mac, but let's turn it upside down for Windows!" "Great idea!" "Yeah, that'll keep those developers guessing!" But beyond that, I can't find this, umm, "feature" documented anywhere, nor can I find any documentation on how one is supposed to be able to tell that a given video sample is upside down or rightside up. Any thoughts on how to tell this?

    Read the article

  • MVVM Project and Item Templates

    - by Timmy Kokke
    Intro This is the first in a series of small articles about what is new in Silverlight 4 and Expression Blend 4. The series is build around a open source demo application SilverAmp which is available on http://SilverAmp.CodePlex.com.   MVVM Project and Item Templates Expression Blend has got a new project template to get started with a Model-View-ViewModel project  easily. The template provides you with a View and a ViewModel bound together. It also adds the ViewModel to the SampleData of your project. It is available for both Silverlight and Wpf. To get going, start a new project in Expression Blend and select Silverlight DataBound Application from the Silverlight project type. In this case I named the project DemoTest1. The solution now contains several folders: SampleData; which contains a data to show in Blend ViewModels; starts with one file, MainViewModel.cs Views; containing MainView.xaml with codebehind used for binding with the MainViewModel class. and your regular App.xaml and MainPage.xaml The MainViewModel class contains a sample property and a sample method. Both the property and the method are used in the MainView control. The MainView control is a regular UserControl and is placed in the MainPage. You can continue on building your applicaition by adding your own properties and methods to the ViewModel and adding controls to the View. Adding Views with ViewModels is very easy too. The guys at Microsoft where nice enough to add a new Item template too: a UserControl with ViewModel. If you add this new item to the root of your solution it will add the .xaml file to the views folder and a .cs file to the ViewModels folder. Conclusion The databound Application project type is a great to get your MVVM based project started. It also functions a great source of information about how to connect it all together.   Technorati Tags: Silverlight,Wpf,Expression Blend,MVVM

    Read the article

  • d:DesignData issue, Visual Studio 2010 cant build after adding sample design data with Expression Bl

    - by Valko
    Hi, VS 2010 solution and Silverlight project builds fine, then: I open MyView.xaml view in Expression Blend 4 Add sample data from class (I use my class defined in the same project) after I add new sample design data with Expression blend 4, everything looks fine, you see the added sample data in the EB 4 fine, you also see the data in VS 2010 designer too. Close the EB 4, and next VS 2010 build is giving me this errors: Error 7 XAML Namespace http://schemas.microsoft.com/expression/blend/2008 is not resolved. C:\Code\source\...myview.xaml and: Error 12 Object reference not set to an instance of an object. ... TestSampleData.xaml when I open the TestSampleData.xaml I see that namespace for my class used to define sample data is not recognized. However this namespace and the class itself exist in the same project! If I remove the design data from the MyView.xaml: d:DataContext="{d:DesignData /SampleData/TestSampleData.xaml}" it builds fine and the namespace in TestSampleData.xaml is recognized this time?? and then if add: d:DataContext="{d:DesignData /SampleData/TestSampleData.xaml}" I again see in the VS 2010 designer sample data, but the next build fails and again I see studio cant find the namespace in my TestSampleData.xaml containing sample data. That cycle is driving me crazy. Am I missing something here, is it not possible to have your class defining sample design data in the same project you have the MyView.xaml view?? cheers Valko

    Read the article

  • Resolve sibling folder in JavaScript Function

    - by Jamen Chu
    Hi, I am trying to pass into an JavaScript function two paths for an XML and XSLT. It would appear that in the sample HTML below that the use of "../xsl/filename" does not work for me in the xslt() function. If I specify the path as being "./filename" though this does work. Does anyone know how I can work around this or find some way that I can specify a sibling folder without an absolute path reference? I would prefer not to have to change my file paths as my development environment is set up with the xslt's, sample data and source code structured in a particular way. Thanks in advance Jamen <html> <head> <title></title> <script type="text/javascript" src="../lib/jsunit/app/jsUnitCore.js"></script> <script type="text/javascript" src="../lib/jquery-1.2.3.js"></script> <script type="text/javascript" src="../lib/jquery.xslt.js"></script> </head> <body> <div id="bla"></div> <script type="text/javascript"> $('#bla').xslt("../sampledata/response1.xml", "../xslt/resultFormatter.xsl"); //function testjQuery() { // $('#bla').xslt("../sampledata/response1.xml", "../xslt/resultFormatter.xsl"); //} </script> </body> </html>

    Read the article

  • Finding the problem on a partially succeeded build

    - by Martin Hinshelwood
    Now that I have the Build failing because of a genuine bug and not just because of a test framework failure, lets see if we can trace through to finding why the first test in our new application failed. Lets look at the build and see if we can see why there is a red cross on it. First, lets open that build list. On Team Explorer Expand your Team Project Collection | Team Project and then Builds. Double click the offending build. Figure: Opening the Build list is a key way to see what the current state of your software is.   Figure: A test is failing, but we can now view the Test Results to find the problem      Figure: You can quite clearly see that the test has failed with “The device is not ready”. To me the “The Device is not ready” smacks of a System.IO exception, but it passed on my local computer, so why not on the build server? Its a FaultException so it is most likely coming from the Service and not the client, so lets take a look at the client method that the test is calling: bool IProfileService.SaveDefaultProjectFile(string strComputerName) { ProjectFile file = new ProjectFile() { ProjectFileName = strComputerName + "_" + System.DateTime.Now.ToString("yyyyMMddhhmmsss") + ".xml", ConnectionString = "persist security info=False; pooling=False; data source=(local); application name=SSW.SQLDeploy.vshost.exe; integrated security=SSPI; initial catalog=SSWSQLDeployNorthwindSample", DateCreated = System.DateTime.Now, DateUpdated = System.DateTime.Now, FolderPath = @"C:\Program Files\SSW SQL Deploy\SampleData\", IsComplete=false, Version = "1.3", NewDatabase = true, TimeOut = 5, TurnOnMSDE = false, Mode="AutomaticMode" }; string strFolderPath = "D:\\"; //LocalSettings.ProjectFileBasePath; string strFileName = strFolderPath + file.ProjectFileName; try { using (FileStream fs = new FileStream(strFileName, FileMode.Create)) { DataContractSerializer serializer = new DataContractSerializer(typeof(ProjectFile)); using (XmlDictionaryWriter writer = XmlDictionaryWriter.CreateTextWriter(fs)) { serializer.WriteObject(writer, file); } } } catch (Exception ex) { //TODO: Log the exception throw ex; return false; } return true; } Figure: You can see on lines 9 and 18 that there are calls being made to specific folders and disks. What is wrong with this code? What assumptions mistakes could the developer have made to make this look OK: That every install would be to “C:\Program Files\SSW SQL Deploy” That every computer would have a “D:\\” That checking in code at 6pm because the had to go home was a good idea. lets solve each of these problems: We are in a web service… lets store data within the web root. So we can call “Server.MapPath(“~/App_Data/SSW SQL Deploy\SampleData”) instead. Never reference an explicit path. If you need some storage for your application use IsolatedStorage. Shelve your code instead. What else could have been done? Code review before check-in – The developer should have shelved their code and asked another dev to look at it. Use Defensive programming – Make sure that any code that has the possibility of failing has checks. Any more options? Let me know and I will add them. What do we do? The correct things to do is to add a Bug to the backlog, but as this is probably going to be fixed in sprint, I will add it directly to the sprint backlog. Right click on the failing test Select “Create Work Item | Bug” Figure: Create an associated bug to add to the backlog. Set the values for the Bug making sure that it goes into the right sprint and Area. Make your steps to reproduce as explicit as possible, but “See test” is valid under these circumstances.   Figure: Add it to the correct Area and set the Iteration to the Area name or the Sprint if you think it will be fixed in Sprint and make sure you bring it up at the next Scrum Meeting. Note: make sure you leave the “Assigned To” field blank as in Scrum team members sign up for work, you do not give it to them. The developer who broke the test will most likely either sign up for the bug, or say that they are stuck and need help. Note: Visual Studio has taken care of associating the failing test with the Bug. Save… Technorati Tags: WCF,MSTest,MSBuild,Team Build 2010,Team Test 2010,Team Build,Team Test

    Read the article

  • Figuring our complex REST queries for SharePoint

    - by Sahil Malik
    SharePoint 2010 Training: more information A little while ago, I showed the REST query for a relatively complex query. Some readers have emailed me about how to figure out further queries, and especially for complex insert/delete/update scenarios. Well it is quite easy to figure out almost any query for SharePoint REST API. Okay, this is not just about SharePoint – you can apply what you read here for any REST API interface supported by Microsoft, like WCF data services. But, sometimes when you have many columns, or complex update operations, or are working with weird providers, it is tough to figure out the specific HTTP request you need to craft, error free, using REST. Well fear not, there is hope. As an example, what I did is, I created a SharePoint site at http://sp2010.winsmarts.internal/sampledata with 3 lists in it - 1. Artists (with one Column, Title) Read full article ....

    Read the article

  • How to set properties of a d:DesignInstance in XAML?

    - by Scott Bilas
    I'm using the new d:DesignInstance feature of the 4.0 series WPF tools. Works great! Only issue I'm having is: how can I set properties on the instance? Given something like this: <Grid d:DataContext="{d:DesignInstance plugin:SamplePendingChangesViewModel, IsDesignTimeCreatable=True}"/> How can I set properties on the viewmodel, aside from setting them in its default ctor or routing it through some other object initializer? I gave this a try but VS gives errors on compile "d:DataContext was not found": <Grid> <d:DataContext> <d:DesignInstance IsDesignTimeCreatable="True"> <plugin:SamplePendingChangesViewModel ActiveTagIndex="2"/> </d:DesignInstance> </d:DataContext> For the moment I'm going back to using a resource and 'd:DataContext={StaticResource SampleData}', where I can set the properties in the resource. Is there a way to do it via a d:DesignInstance?

    Read the article

  • C function changes behaviour depending on whether it has a call to printf in it

    - by Daniel
    I have a function that processes some data and finds the threshold that classifies the data with the lowest error. It looks like this: void find_threshold(FeatureVal* fvals, sampledata* data, unsigned int num_samples, double* thresh, double* err, int* pol) { //code to calculate minThresh, minErr, minPol omitted printf("minThresh: %f, minErr: %f, minPol: %d\n", minThresh, minErr, minPol); *thresh = minThresh; *err = minErr; *pol = minPol; } Then in my test file I have this: void test_find_threshold() { //code to set up test data omitted find_threshold(fvals, sdata, 6, &thresh, &err, &pol); printf("Expected 5 got %f\n", thresh); assert(eq(thresh, 5.0)); printf("Expected 1 got %d\n", pol); assert(pol == 1); printf("Expected 0 got %f\n", err); assert(eq(err, 0.0)); } This runs and the test passes with the following output: minThresh: 5.000000, minErr: 0.000000, minPol: 1 Expected 5 got 5.000000 Expected 1 got 1 Expected 0 got 0.000000 However if I remove the call to printf() from find_threshold, suddenly the test fails! Commenting out the asserts so that I can see what gets returned, the output is: Expected 5 got -15.000000 Expected 1 got -1 Expected 0 got 0.333333 I cannot make any sense of this whatsoever.

    Read the article

  • Changing colour of text in a textblock via a trigger

    - by Sike12
    Here is my Xaml <Window.Resources> <sampleData:MainWindow x:Key="DataSource"/> <DataTemplate x:Key="bobReferencer"> <TextBlock Text="{Binding Name}" > <TextBlock.Style> <Style TargetType="TextBlock"> <Style.Triggers> <DataTrigger Binding="{Binding HasErrors}" Value="true"> //what goes in here? </DataTrigger> </Style.Triggers> </Style> </TextBlock.Style> </TextBlock> </DataTemplate> </Window.Resources> Codebehind (the one xaml references) public class bob { public string Name { get; set; } public bool HasErrors { get; set; } Basically what i want to do is if the HasErrors is true then i want the Name to appear in Red via the trigger. But my xaml is not properly formed. Any suggestions on this? I also looked into this link but didn't help much. How can I change the Foreground color of a TextBlock with a Trigger?

    Read the article

  • Chester Devs Presentation and source code &ndash; &lsquo;Event Store - an introduction to a DSD for event sourcing and notifications&rsquo;

    - by Liam Westley
    Originally posted on: http://geekswithblogs.net/twickers/archive/2013/11/11/chester-devs-presentation-and-source-code-ndash-lsquoevent-store.aspxThank you everyone at Chester Devs Thanks to Fran Hoey and all the people from Chester Devs. It was a hard drive up and back but the enthusiasm of the audience, with some great questions does make it worthwhile. Presentation and source code My presentation, source code, Event Store runners and text files containing the various command line parameters used for curl is now available on GitHub; https://github.com/westleyl/ChesterDevs-EventStore. Don’t worry if you don’t have a GitHub account, you don’t need one, you can just click on the Download Zip button on the right hand menu to download all the files as a single ZIP file.  If all you want is the PowerPoint presentation, go to https://github.com/westleyl/ChesterDevs-EventStore/blob/master/Powerpoint/Huddle-EventStore.pptx, and click on the View Raw button. Downloading and installing Event Store and Tools Download Event Store http://download.geteventstore.com – I unzipped these files into C:\EventStore\v2.0.1 Download Curl from http://curl.haxx.se/download.html – I downloaded Win64 Generic (with SSL) and unzipped these files into C:\curl version 7.31.0 Running the tools I used in my presentation Demonstration 1 (running Event Store) You can use one of my Event Store runner command files to run the single node version of Event Store, using default ports of 2213 for HTTP and 1113  for TCP, and with a wildcard HTTP pattern.  Both take a single command line parameter to specify the location of the data and log files.  The runners assume the single node executable is located in C:\EventStore\v2.0.1, and will placed data files and logs beneath C:\EventStore\Data, i.e. RunEventStore.cmd TestData1 This will create data files in C:\EventStore\Data\TestData1\Data and log files in C:\EventStore\Data\TestData1\logs. If, when running Event Store you may see the following message, [03288,15,06:23:00.622] Failed to start http server Access is denied You will either need to run Event Store in an administrator console window, or you can use the netsh command to create a firewall permission to allow HTTP listening (this will need to be run, once, in an administrator console window), netsh http add urlacl url=http://*:2213/ user=liam You can always delete this later by running the delete; netsh http delete urlacl url=http://*:2213/ If you want to confirm that everything is running OK, open the management console in a browser by navigating to http://127.0.0.1:2213. If at any point you are asked for a user name and password use the default of ‘admin’/‘changeit’. Demonstration 2 (reading and adding data, curl) In my second demonstration I used curl directly from the console to read streams, write events and then read back those events. On GitHub I have included is a set of curl commands, CurlCommandLine.txt, and a sample data file, SampleData.json, to load an event into a DDDNorth3 stream. As there is not much data in the Event Store at this point I used the $stats-127.0.0.1:2113 which is a stream containing performance statistics for Event Store and is updated every 30 seconds (default). Demonstration 3 (projections) On GitHub I have included a sample projection, Projection-ByRoom.txt, which will create streams based on the room on which a session was held on the DDDNorth3 agenda. Browse to the management console, http://127.0.0.1:2213.  Click on Projections, New Projection, give it a name, Sessions-ByRoom, and copy in the JavaScript in the Projection-ByRoom.txt file.  Select Continuous, tick Emit Enabled and then click on Post. It should run immediately. You may by challenged for the administration login for the management console, if so use the default user name and password; 'admin'/'changeit'. Demonstration 4 (C# client) The final demonstration was the Visual Studio 2012 project using the Event Store client – referenced directly as C:\EventStore\v2.0.1\EventStore.ClientAPI.dll, although you can switch this to the latest Event Store client NuGet package. The source code provides a console app for viewing projections with the projection manager (HTTP connection), as well as containing a full set of data for the entire DDDNorth3 agenda.  It also deals with the strategy for reading newest events backwards to older events and ignoring older events that have been superseded. Resources Event Store home page: http://www.geteventstore.com/ Event Store source code on GitHub: https://github.com/eventstore/eventstore Event Store documentation on GitHub: https://github.com/eventstore/eventstore/wiki (includes index to @RobAshton’s blog series on Event Store at https://github.com/eventstore/eventstore/wiki#rob-ashton---projections-series) Event Store forum in Google Groups: https://groups.google.com/forum/?fromgroups#!forum/event-store TopShelf Windows service wrapper is available on github: https://gist.github.com/trbngr/5083266

    Read the article

  • DDD North 3 Presentation and source code &ndash; &lsquo;Event Store - an introduction to a DSD for event sourcing and notifications&rsquo;

    - by Liam Westley
    Originally posted on: http://geekswithblogs.net/twickers/archive/2013/10/15/ddd-north-3-presentation-and-source-code-ndash-lsquoevent-store.aspxThank you everyone at DDD North Thanks to all the people who helped organise the cracking conference that is DDD North 3, returning to Sunderland, and the great facilities at the University of Sunderland, and the fine drinks reception at Sunderland Software City.  The whole event wouldn’t be possible without the sponsors who ensured over 400 people were kept fed and watered so they could enjoy the impressive range of sessions. And lastly, a thank you to all those delegates who gave up their free time on a Saturday to spend a day dashing between lecture rooms, including a late change to my room which saw 40 people having to brave a journey between buildings in the fine drizzle. The enthusiasm from the delegates always helps recharge my geek batteries. Presentation and source code My presentation, source code, Event Store runners and text files containing the various command line parameters used for curl is now available on GitHub; https://github.com/westleyl/DDDNorth3-EventStore. Don’t worry if you don’t have a GitHub account, you don’t need one, you can just click on the Download Zip button on the right hand menu to download all the files as a single ZIP file.  If all you want is the PowerPoint presentation, go to https://github.com/westleyl/DDDNorth3-EventStore/blob/master/Powerpoint/DDDNorth-EventStore.pptx, and click on the View Raw button. Downloading and installing Event Store and Tools Download Event Store http://download.geteventstore.com – I unzipped these files into C:\EventStore\v2.0.1 Download Curl from http://curl.haxx.se/download.html – I downloaded Win64 Generic (with SSL) and unzipped these files into C:\curl version 7.31.0 Running the tools I used in my presentation Demonstration 1 (running Event Store) You can use one of my Event Store runner command files to run the single node version of Event Store, using default ports of 2213 for HTTP and 1113  for TCP, and with a wildcard HTTP pattern.  Both take a single command line parameter to specify the location of the data and log files.  The runners assume the single node executable is located in C:\EventStore\v2.0.1, and will placed data files and logs beneath C:\EventStore\Data, i.e. RunEventStore.cmd TestData1 This will create data files in C:\EventStore\Data\TestData1\Data and log files in C:\EventStore\Data\TestData1\logs. If, when running Event Store you may see the following message, [03288,15,06:23:00.622] Failed to start http server Access is denied You will either need to run Event Store in an administrator console window, or you can use the netsh command to create a firewall permission to allow HTTP listening (this will need to be run, once, in an administrator console window), netsh http add urlacl url=http://*:2213/ user=liam You can always delete this later by running the delete; netsh http delete urlacl url=http://*:2213/ If you want to confirm that everything is running OK, open the management console in a browser by navigating to http://127.0.0.1:2213. If at any point you are asked for a user name and password use the default of ‘admin’/‘changeit’.   Demonstration 2 (reading and adding data, curl) In my second demonstration I used curl directly from the console to read streams, write events and then read back those events. On GitHub I have included is a set of curl commands, CurlCommandLine.txt, and a sample data file, SampleData.json, to load an event into a DDDNorth3 stream. As there is not much data in the Event Store at this point I used the $stats-127.0.0.1:2113 which is a stream containing performance statistics for Event Store and is updated every 30 seconds (default). Demonstration 3 (projections) On GitHub I have included a sample projection, Projection-ByRoom.txt, which will create streams based on the room on which a session was held on the DDDNorth3 agenda. Browse to the management console, http://127.0.0.1:2213.  Click on Projections, New Projection, give it a name, Sessions-ByRoom, and copy in the JavaScript in the Projection-ByRoom.txt file.  Select Continuous, tick Emit Enabled and then click on Post. It should run immediately. You may by challenged for the administration login for the management console, if so use the default user name and password; 'admin'/'changeit'.   Demonstration 4 (C# client) The final demonstration was the Visual Studio 2012 project using the Event Store client – referenced directly as C:\EventStore\v2.0.1\EventStore.ClientAPI.dll, although you can switch this to the latest Event Store client NuGet package. The source code provides a console app for viewing projections with the projection manager (HTTP connection), as well as containing a full set of data for the entire DDDNorth3 agenda.  It also deals with the strategy for reading newest events backwards to older events and ignoring older events that have been superseded. Resources Event Store home page: http://www.geteventstore.com/ Event Store source code on GitHub: https://github.com/eventstore/eventstore Event Store documentation on GitHub: https://github.com/eventstore/eventstore/wiki (includes index to @RobAshton’s blog series on Event Store at https://github.com/eventstore/eventstore/wiki#rob-ashton---projections-series) Event Store forum in Google Groups: https://groups.google.com/forum/?fromgroups#!forum/event-store TopShelf Windows service wrapper is available on github: https://gist.github.com/trbngr/5083266

    Read the article

1