Search Results

Search found 1118 results on 45 pages for 'bam converter'.

Page 2/45 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Flash-based Document Viewer/Converter (FlashPaper alternative, but with automated converter support)

    - by Mauricio
    Hey stackoverflow community, I am looking for a Document Viewer application that I can embed in a Flash/Flex application that supports Microsoft Office documents as well as PDF. I have looked into print2flash as a possibility, but their automated converter executable requires access to the files and directories. Does anyone know of other alternatives which would have .NET/Java/Other libraries to convert these files to a SWF that can do it based on the download stream, as opposed to the actual files? Thanks!

    Read the article

  • How to call/use a value converter inverted

    - by Soko
    Is it possible to use a converter the "wrong" way around? In other words: can I swap source and target? Here's an example: I created a simple IValueConverter called NullableDecimalToStringConverter which converts an input if "" into null and a number into decimal. I use it to bind a TextBox in my WPF view to a decimal? property in my ViewModel. In another context I'd like to convert a NullableDecimal into a String in the same way... Is it possible to simply use the existing NullableDecimalToStringConverter inverted? One method is to use the parameter of the converter to tell the converter which way it should convert. But is there a .NET build in way to do such a thing? Another way would be to build a base class with both conversion methods and two separate converter which call the base class methods...

    Read the article

  • Unhappy with performance of GBit Ethernet to Fiber converter

    - by Aaron Digulla
    I just bought a TP-Link MC200CM GBit Ethernet (1000-T) to Fiber (1000-SX) media converter. The device works but I'm unhappy with the performance: When connecting my computer over 1000-T (twisted pair, Cat 6, 18meters) with my server, I get a throughput of about 610MBit/s. If I replace the cable with two media converters, I'm left with about 310-315MBit/s (i.e. half the performance). My setup is like this: Computer <- GBit switch <- long cable <- GBit switch <- server Computer <- GBit switch <- MC200CM <- 30m fiber <- MC200CM <- GBit switch <- server Is there a way to improve the performance? Will another MC be faster? Or is that about as much as I can expect with the additional 2 converters?

    Read the article

  • iOrgSoft Video Converter for Mac

    - by terryhao
    [url=http://www.iorgsoft.com/Video-Converter-for-Mac/]video converter for mac[/url] IOrgSoft[url=http://www.iorgsoft.com/Video-Converter-for-Mac/]video converter for mac[/url] is an excellent video converting and editing software for Macintosh users. A built-in powerful video player, trimming, splitter/joiner/merger tools give you everything you need to manage your videos on mac. This mac converter supports many video formats like AVI, MP4, WMV, MPEG-1,2, YouTube(FLV), Limewire, Realplayer(RM,RMVB), Quicktime(MOV), MKV, MOD, TOD, ASF, 3GP, 3G2, AVCHD/M2TS/MTS/TS/TRP/TS, MXF, etc. Video Converter for Mac features a very clean user interface which makes this task a breeze. You can trim/clip any segments and optionally merge/join and sort them to create your personal movie, crop frame size to remove any unwanted area in the frame just like a pair of smart scissors and set the output video parameters such as video resolution, video frame rate, audio codec, video codec and video quality. Converted videos can be imported into imovie/itunes/FCE/FCP/QuickTime Pro or played on iPad, iPod touch, iPod classic, iPod nano, iPhone, iPhone 3GS, Apple TV, PSP, PS3, Creative Zen, iRiver PMP, Archos, mobile phones and other MP4/MP3 players. Video Converter for Mac makes video conversion easy. Free download now and have a try for yourself! [url=http://www.iorgsoft.com/Video-Editor-for-Mac/]Video Editor for Mac[/url] [url=http://www.iorgsoft.com/Mod-Converter/]mod converter[/url] [url=http://www.iorgsoft.com/Mod-Converter-for-Mac/]mod converter for mac[/url]

    Read the article

  • How to Watch Youtube Videos on PSP with iMoviesoft FLV Converter

    - by user312417
    Do you have worried about it? You can not watch Youtube videos anytime, anywhere.It is so boring on the way to work and home.How you want to be able to enjoy the wonderful Youtube Video on PSP that you can watch them on the way to home, home on bus. This artice will tell you about how to convert Youtube VIdeos to PSP Player, take "Alice.in.Wonderland" as an example, We can use iMoviesoft FLV Converter to convert it to PSP video file. iMoviesoft FLV Converter is a powerful FLV Converter which can convert FLV and YouTube Videos to almost any video formats, with excellent conversion speed and quality, such as converting FLV to MP4, FLV to AVI, FLV to WMV, FLV to MPEG etc. Furthermore, it can also easily convert video files to some popular audio formats, such as WMA, MP3, M4A, AAC, etc. You can convert FLV and YouTube videos to PSP, iPod, iPhone, Zune video player and other portable video players. After easy and wonderful conversion, you can fully enjoy videos on your PSP, iPod, iPhone and some other portable video players. Besides, you can also use it to join videos. Merge several videos into one output PSP video and enjoy them conveniently. You can also trim your favarite clips or remove the video black edges by [iMoviesoft FLV Converter. Hope to help every Video Enthusiasts.

    Read the article

  • C# Converter difficulties

    - by Petr
    Hi, I am trying to fill object[] with List<string> but I cannot figure out how to use ConvertAll. MSDN did not help me. At first I tried to create an instance of Converter but it looks like it expects delegate? Converter<string, object> conv = new Converter<string, object>(??); //why delegate? this.comboBox1.Items.AddRange(Form1.AnimalType.ConvertAll<object>(conv)); Thanks :)

    Read the article

  • Facelet selectOneMenu with POJOs and converter problem

    - by c0d3x
    Hi, I want to have a facelet page with a formular and a dropdown menu. With the dropdown menu the user shoul select a POJO of the type Lieferant: public class Lieferant extends AbstractPersistentWarenwirtschaftsObject { private String firma; public Lieferant(WarenwirtschaftDatabaseLayer database, String firma) { this(database, null, firma); } public Lieferant(WarenwirtschaftDatabaseLayer database, Long primaryKey, String firma) { super(database, primaryKey); this.firma = firma; } public String getFirma() { return firma; } @Override public String toString() { return getFirma(); } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((firma == null) ? 0 : firma.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Lieferant other = (Lieferant) obj; if (firma == null) { if (other.firma != null) return false; } else if (!firma.equals(other.firma)) return false; return true; } } Here is the facelet code that I wrote: <h:selectOneMenu> tag. This tag should display a list of POJOs (not beans) of the type Lieferant. Here is the facelet code: <h:selectOneMenu id="lieferant" value="#{lieferantenBestellungBackingBean.lieferant}"> <f:selectItems var="lieferant" value="#{lieferantenBackingBean.lieferanten}" itemLabel="#{lieferant.firma}" itemValue="#{lieferant.primaryKey}" /> <f:converter converterId="LieferantConverter" /> </h:selectOneMenu> Here is the refenrenced managed backing bean @ManagedBean @RequestScoped public class LieferantenBackingBean extends AbstractWarenwirtschaftsBackingBean { private List<Lieferant> lieferanten; public List<Lieferant> getLieferanten() { if (lieferanten == null) { lieferanten = getApplication().getLieferanten(); } return lieferanten; } } As far as I know, I need a custom converter, to swap beetween POJO and String representations of the Lieferant objects. Here is what the converter looks like: @FacesConverter(value="LieferantConverter") public class LieferantConverter implements Converter { @Override public Object getAsObject(FacesContext context, UIComponent component, String value) { long primaryKey = Long.parseLong(value); WarenwirtschaftApplicationLayer application = WarenwirtschaftApplication.getInstance(); Lieferant lieferant = application.getLieferant(primaryKey); return lieferant; } @Override public String getAsString(FacesContext context, UIComponent component, Object value) { return value.toString(); } } The page loads without any error. When I fill out the formular and submit it, there is an error message displayed on the page: Bestellung:lieferantenBestellungForm:lieferant: Validierungsfehler: Wert ist keine gültige Auswahl translated: validation error: value is not a valid selection Unfortunaltely it does not say which value it is talking about. The converter seems to work correctly. I found this similar question from stackoverflow and this article about selectOneMenu and converters, but I was not able to find the problem in my code. Why is List<SelectItem> used in the example from the second link. Gives the same error for me. Any help would be appreciated. Thanks in advance.

    Read the article

  • PDF Converter Elite Giveaway – Lets you create, convert and edit any type of PDF with ease

    - by Gopinath
    Are you looking for a PDF editing software that lets you create, edit and convert  any type of PDF with ease? Then here is a chance for you to win a lifetime free license of PDF Converter Elite software. Tech Dreams in partnership with pdfconverter.com  brings a giveaway contest exclusively for our readers. Continue reading to know the features of the application and giveaway contest details Adobe Acrobat  is the best software for creating, editing and converting PDF files, but you need spend a lot of money to buy it. PDF Converter Elite, which is priced at $100 has a rich set of features that satisfies most of your PDF management needs. Here is a quick run down of the feature of the application Create PDF files from almost every popular Windows file format – You can create a PDF  from almost 300 popular file formats supported by Windows. Want to convert a word document to PDF? It’s just a click away. How about converting Excels, PowerPoint presentations, text files, images, etc? Yes, with a single click you will be able to turn them to PDF Files. Convert PDF to Word, Excel, PowerPoint, Publisher, HTML – This is one of the best features i liked in this software. You can convert a PDF to any MS Office file format without loosing alignment and quality of the document. The converted documents looks exactly same as your PDF documents and you would be surprised to see near 100% layout replication in the converted document. I feel in love with the perfection at which the files are converted. Edit PDF files easily – You can rework with your PDF documents by inserting watermarks, numbers, headers, footers and more. Also you will be able to merge two PDF files, overlay pages, remove unwanted pages, split a single PDF in to multiple files. Secure PDF files by setting password – You can secure PDF files by limiting how others can use them – set password to open the documents, restrict various activities like printing, copy & paste, screen reading, form filling, etc.. If you are looking for an affordable PDF editing application then PDF Converter Elite is there for you. 10 x PDF Converter Elite Licenses Giveaway Here comes the details on wining a free single user license for our readers – we have 10 PDF Converter Elite single user licenses worth of $100 each. To win a license all you need to do is Like Tech Dreams Fan page on Facebook Tweet or Like this post – buttons are available just below the post heading in the top section of this page Finally drop a comment on how you would like to use PDF Converter Elite We will choose 10 winners through a lucky draw and the licenses will be sent to them in a personal email. Names of the winners will also be announced on Tech Dreams. So are you ready to grab a free copy of PDF Converter worth of $100?

    Read the article

  • XAML Converter ConvertBack

    - by MFH
    Is there a way to access the ConvertBack-Method of a Converter that implements IValueConverter directly from XAML? The basic situation is the following (relationsships): Route (1)<->(CN) Training (1)<->(CN) Kilometer The DataContext is set to a Training. From here I use the Convert-Method to access all my Kilometers. I also have a Converter from Route to IList<Training> and the ConvertBack would lookup the Route for a Training. But I seem to not be able to access that Method from XAML…

    Read the article

  • OpenWorld Session: BPM Analytics - Process Dashboards, BAM and Intelligent Optimization

    - by Ajay Khanna
    Blog Contributed by Payal Srivastava, Oracle Product Mamagement   Margin of error for the business is shrinking dramatically. Business needs to accomplish more with less i.e. minimal investment with quick ROI. Learn how you can leverage Oracle BPM suite and complementary technologies to create a robust analytics capability to provide visibility into operations to  C-level executives and Operational managers. We will talk about BPM analytics options available today that will not only enhance the visibility but allow you to intelligently optimize the business process at design time as well as run time.  The session will share some exciting this on our roadmap.  Come meet with the Oracle team members  from Product Development (Avinash Dabholkar , Eric Hsiao) and Product Management (Payal Srivastava) at the session. We would like to hear  your questions/comments about  our offering and roadmap. BPM Analytics: Process Dashboards, BAM and Intelligent Optimization, Moscone South 308, 10/3/12 @11:45am – CON 8598

    Read the article

  • The Developers Conference 2012: Presentation about CEP & BAM

    - by Ricardo Ferreira
    This year I had the pleasure again of being one of the speakers in the TDC ("The Developers Conference") event. I have spoken in this event for three years from now. This year, the main theme of the SOA track was EDA ("Event-Driven Architecture") and I decided to delivery a comprehensive presentation about one of my preferred personal subjects: Real-time using Complex Event Processing. The theme of the presentation was "Business Intelligence in Real-time using CEP & BAM" and I would like to share here the presentation that I have done. The material is in Portuguese since was an Brazilian event that happened in São Paulo. Once my presentation has a lot of videos, I decided to share the material as a Youtube video, so you can pause, rewind and play again how many times you want it. I strongly recommend you that before starting watching the video, you change the video quality settings to 1080p in High Definition.

    Read the article

  • C#/.NET Little Wonders: The Predicate, Comparison, and Converter Generic Delegates

    - by James Michael Hare
    Once again, in this series of posts I look at the parts of the .NET Framework that may seem trivial, but can help improve your code by making it easier to write and maintain. The index of all my past little wonders posts can be found here. In the last three weeks, we examined the Action family of delegates (and delegates in general), the Func family of delegates, and the EventHandler family of delegates and how they can be used to support generic, reusable algorithms and classes. This week I will be completing my series on the generic delegates in the .NET Framework with a discussion of three more, somewhat less used, generic delegates: Predicate<T>, Comparison<T>, and Converter<TInput, TOutput>. These are older generic delegates that were introduced in .NET 2.0, mostly for use in the Array and List<T> classes.  Though older, it’s good to have an understanding of them and their intended purpose.  In addition, you can feel free to use them yourself, though obviously you can also use the equivalents from the Func family of delegates instead. Predicate<T> – delegate for determining matches The Predicate<T> delegate was a very early delegate developed in the .NET 2.0 Framework to determine if an item was a match for some condition in a List<T> or T[].  The methods that tend to use the Predicate<T> include: Find(), FindAll(), FindLast() Uses the Predicate<T> delegate to finds items, in a list/array of type T, that matches the given predicate. FindIndex(), FindLastIndex() Uses the Predicate<T> delegate to find the index of an item, of in a list/array of type T, that matches the given predicate. The signature of the Predicate<T> delegate (ignoring variance for the moment) is: 1: public delegate bool Predicate<T>(T obj); So, this is a delegate type that supports any method taking an item of type T and returning bool.  In addition, there is a semantic understanding that this predicate is supposed to be examining the item supplied to see if it matches a given criteria. 1: // finds first even number (2) 2: var firstEven = Array.Find(numbers, n => (n % 2) == 0); 3:  4: // finds all odd numbers (1, 3, 5, 7, 9) 5: var allEvens = Array.FindAll(numbers, n => (n % 2) == 1); 6:  7: // find index of first multiple of 5 (4) 8: var firstFiveMultiplePos = Array.FindIndex(numbers, n => (n % 5) == 0); This delegate has typically been succeeded in LINQ by the more general Func family, so that Predicate<T> and Func<T, bool> are logically identical.  Strictly speaking, though, they are different types, so a delegate reference of type Predicate<T> cannot be directly assigned to a delegate reference of type Func<T, bool>, though the same method can be assigned to both. 1: // SUCCESS: the same lambda can be assigned to either 2: Predicate<DateTime> isSameDayPred = dt => dt.Date == DateTime.Today; 3: Func<DateTime, bool> isSameDayFunc = dt => dt.Date == DateTime.Today; 4:  5: // ERROR: once they are assigned to a delegate type, they are strongly 6: // typed and cannot be directly assigned to other delegate types. 7: isSameDayPred = isSameDayFunc; When you assign a method to a delegate, all that is required is that the signature matches.  This is why the same method can be assigned to either delegate type since their signatures are the same.  However, once the method has been assigned to a delegate type, it is now a strongly-typed reference to that delegate type, and it cannot be assigned to a different delegate type (beyond the bounds of variance depending on Framework version, of course). Comparison<T> – delegate for determining order Just as the Predicate<T> generic delegate was birthed to give Array and List<T> the ability to perform type-safe matching, the Comparison<T> was birthed to give them the ability to perform type-safe ordering. The Comparison<T> is used in Array and List<T> for: Sort() A form of the Sort() method that takes a comparison delegate; this is an alternate way to custom sort a list/array from having to define custom IComparer<T> classes. The signature for the Comparison<T> delegate looks like (without variance): 1: public delegate int Comparison<T>(T lhs, T rhs); The goal of this delegate is to compare the left-hand-side to the right-hand-side and return a negative number if the lhs < rhs, zero if they are equal, and a positive number if the lhs > rhs.  Generally speaking, null is considered to be the smallest value of any reference type, so null should always be less than non-null, and two null values should be considered equal. In most sort/ordering methods, you must specify an IComparer<T> if you want to do custom sorting/ordering.  The Array and List<T> types, however, also allow for an alternative Comparison<T> delegate to be used instead, essentially, this lets you perform the custom sort without having to have the custom IComparer<T> class defined. It should be noted, however, that the LINQ OrderBy(), and ThenBy() family of methods do not support the Comparison<T> delegate (though one could easily add their own extension methods to create one, or create an IComparer() factory class that generates one from a Comparison<T>). So, given this delegate, we could use it to perform easy sorts on an Array or List<T> based on custom fields.  Say for example we have a data class called Employee with some basic employee information: 1: public sealed class Employee 2: { 3: public string Name { get; set; } 4: public int Id { get; set; } 5: public double Salary { get; set; } 6: } And say we had a List<Employee> that contained data, such as: 1: var employees = new List<Employee> 2: { 3: new Employee { Name = "John Smith", Id = 2, Salary = 37000.0 }, 4: new Employee { Name = "Jane Doe", Id = 1, Salary = 57000.0 }, 5: new Employee { Name = "John Doe", Id = 5, Salary = 60000.0 }, 6: new Employee { Name = "Jane Smith", Id = 3, Salary = 59000.0 } 7: }; Now, using the Comparison<T> delegate form of Sort() on the List<Employee>, we can sort our list many ways: 1: // sort based on employee ID 2: employees.Sort((lhs, rhs) => Comparer<int>.Default.Compare(lhs.Id, rhs.Id)); 3:  4: // sort based on employee name 5: employees.Sort((lhs, rhs) => string.Compare(lhs.Name, rhs.Name)); 6:  7: // sort based on salary, descending (note switched lhs/rhs order for descending) 8: employees.Sort((lhs, rhs) => Comparer<double>.Default.Compare(rhs.Salary, lhs.Salary)); So again, you could use this older delegate, which has a lot of logical meaning to it’s name, or use a generic delegate such as Func<T, T, int> to implement the same sort of behavior.  All this said, one of the reasons, in my opinion, that Comparison<T> isn’t used too often is that it tends to need complex lambdas, and the LINQ ability to order based on projections is much easier to use, though the Array and List<T> sorts tend to be more efficient if you want to perform in-place ordering. Converter<TInput, TOutput> – delegate to convert elements The Converter<TInput, TOutput> delegate is used by the Array and List<T> delegate to specify how to convert elements from an array/list of one type (TInput) to another type (TOutput).  It is used in an array/list for: ConvertAll() Converts all elements from a List<TInput> / TInput[] to a new List<TOutput> / TOutput[]. The delegate signature for Converter<TInput, TOutput> is very straightforward (ignoring variance): 1: public delegate TOutput Converter<TInput, TOutput>(TInput input); So, this delegate’s job is to taken an input item (of type TInput) and convert it to a return result (of type TOutput).  Again, this is logically equivalent to a newer Func delegate with a signature of Func<TInput, TOutput>.  In fact, the latter is how the LINQ conversion methods are defined. So, we could use the ConvertAll() syntax to convert a List<T> or T[] to different types, such as: 1: // get a list of just employee IDs 2: var empIds = employees.ConvertAll(emp => emp.Id); 3:  4: // get a list of all emp salaries, as int instead of double: 5: var empSalaries = employees.ConvertAll(emp => (int)emp.Salary); Note that the expressions above are logically equivalent to using LINQ’s Select() method, which gives you a lot more power: 1: // get a list of just employee IDs 2: var empIds = employees.Select(emp => emp.Id).ToList(); 3:  4: // get a list of all emp salaries, as int instead of double: 5: var empSalaries = employees.Select(emp => (int)emp.Salary).ToList(); The only difference with using LINQ is that many of the methods (including Select()) are deferred execution, which means that often times they will not perform the conversion for an item until it is requested.  This has both pros and cons in that you gain the benefit of not performing work until it is actually needed, but on the flip side if you want the results now, there is overhead in the behind-the-scenes work that support deferred execution (it’s supported by the yield return / yield break keywords in C# which define iterators that maintain current state information). In general, the new LINQ syntax is preferred, but the older Array and List<T> ConvertAll() methods are still around, as is the Converter<TInput, TOutput> delegate. Sidebar: Variance support update in .NET 4.0 Just like our descriptions of Func and Action, these three early generic delegates also support more variance in assignment as of .NET 4.0.  Their new signatures are: 1: // comparison is contravariant on type being compared 2: public delegate int Comparison<in T>(T lhs, T rhs); 3:  4: // converter is contravariant on input and covariant on output 5: public delegate TOutput Contravariant<in TInput, out TOutput>(TInput input); 6:  7: // predicate is contravariant on input 8: public delegate bool Predicate<in T>(T obj); Thus these delegates can now be assigned to delegates allowing for contravariance (going to a more derived type) or covariance (going to a less derived type) based on whether the parameters are input or output, respectively. Summary Today, we wrapped up our generic delegates discussion by looking at three lesser-used delegates: Predicate<T>, Comparison<T>, and Converter<TInput, TOutput>.  All three of these tend to be replaced by their more generic Func equivalents in LINQ, but that doesn’t mean you shouldn’t understand what they do or can’t use them for your own code, as they do contain semantic meanings in their names that sometimes get lost in the more generic Func name.   Tweet Technorati Tags: C#,CSharp,.NET,Little Wonders,delegates,generics,Predicate,Converter,Comparison

    Read the article

  • a selective dual command binding converter in WPF?

    - by Jippers
    I'll start off and say I am not using the MVVM pattern for my WPF app. Please forgive me. Right now I have a data template with two buttons, each binds to a different command on the CLR object this data template represents. Both use the same command parameter. Here's an example of the buttons. <Button x:Name="Button1" Command="{Binding Path=Command1}" CommandParameter="{Binding Path=Text, ElementName=TextBox1}" /> <Button x:Name="Button2" Command="{Binding Path=Command2}" CommandParameter="{Binding Path=Text, ElementName=TextBox1}" /> I would like to refactor this into a single button that can perform either command based on a user setting like a boolean in Settings.settings. I don't have access to refactoring the CLR object itself. Also this is a Data Template there isn't codebehind for me to work with. My take is that a converter would be the best bet, but I don't know how I would put that together. The converter would need to take in the CommandParameter, as well as the DataContext so it knows which object to execute the Commands on. Can someone lend me a hand with this? Thanks in advance.

    Read the article

  • AMR to WAV converter in JAVA

    - by sohilvassa
    Hello friends Is there amr to wav , wav to amr converter available written java? i need to do conversion in realtime.So i need JAVA API for server. Looking for any of this option open sourced or free or paid. Thanks

    Read the article

  • How to develop an AAC converter for Linux?

    - by Arnab
    Hi, I am a beginner developer want to develop a MP3 to AAC converter for Linux. But I don't know how to start as I havn't done any development in Linux before. I am using Ubuntu 10.04. Can anyone tell me how to start and from where? What libraries do I need? Thanks

    Read the article

  • TemplateBinding with Converter - what is wrong?

    - by MartyIX
    I'm creating a game desk. I wanted to specify field size (one field is a square) as a attached property and with this data set value of ViewPort which would draw 2x2 matrix (and tile mode would do the rest of game desk). I'm quite at loss what is wrong because the binding doesn't work. Testing line in XAML for the behaviour I would like to have: <DrawingBrush Viewport="0,0,100,100" ViewportUnits="Absolute" TileMode="None"> The game desk is based on this sample of DrawingPaint: http://msdn.microsoft.com/en-us/library/aa970904.aspx (an image is here) XAML: <Window x:Class="Sokoban.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:Sokoban" Title="Window1" Height="559" Width="419"> <Window.Resources> <local:FieldSizeToRectConverter x:Key="fieldSizeConverter" /> <Style x:Key="GameDesk" TargetType="{x:Type Rectangle}"> <Setter Property="local:GameDeskProperties.FieldSize" Value="50" /> <Setter Property="Fill"> <Setter.Value> <!--<DrawingBrush Viewport="0,0,100,100" ViewportUnits="Absolute" TileMode="None">--> <DrawingBrush Viewport="{TemplateBinding local:GameDeskProperties.FieldSize, Converter={StaticResource fieldSizeConverter}}" ViewportUnits="Absolute" TileMode="None"> <DrawingBrush.Drawing> <DrawingGroup> <GeometryDrawing Brush="CornflowerBlue"> <GeometryDrawing.Geometry> <RectangleGeometry Rect="0,0,100,100" /> </GeometryDrawing.Geometry> </GeometryDrawing> <GeometryDrawing Brush="Azure"> <GeometryDrawing.Geometry> <GeometryGroup> <RectangleGeometry Rect="0,0,50,50" /> <RectangleGeometry Rect="50,50,50,50" /> </GeometryGroup> </GeometryDrawing.Geometry> </GeometryDrawing> </DrawingGroup> </DrawingBrush.Drawing> </DrawingBrush> </Setter.Value> </Setter> </Style> </Window.Resources> <StackPanel> <Rectangle Style="{StaticResource GameDesk}" Width="300" Height="150" /> </StackPanel> </Window> Converter and property definition: using System; using System.Collections.Generic; using System.Text; using System.Windows.Controls; using System.Windows; using System.Diagnostics; using System.Windows.Data; namespace Sokoban { public class GameDeskProperties : Panel { public static readonly DependencyProperty FieldSizeProperty; static GameDeskProperties() { PropertyChangedCallback fieldSizeChanged = new PropertyChangedCallback(OnFieldSizeChanged); PropertyMetadata fieldSizeMetadata = new PropertyMetadata(50, fieldSizeChanged); FieldSizeProperty = DependencyProperty.RegisterAttached("FieldSize", typeof(int), typeof(GameDeskProperties), fieldSizeMetadata); } public static int GetFieldSize(DependencyObject target) { return (int)target.GetValue(FieldSizeProperty); } public static void SetFieldSize(DependencyObject target, int value) { target.SetValue(FieldSizeProperty, value); } static void OnFieldSizeChanged(DependencyObject target, DependencyPropertyChangedEventArgs e) { Debug.WriteLine("FieldSize just changed: " + e.NewValue); } } [ValueConversion(/* sourceType */ typeof(int), /* targetType */ typeof(Rect))] public class FieldSizeToRectConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { Debug.Assert(targetType == typeof(int)); int fieldSize = int.Parse(value.ToString()); return new Rect(0, 0, 2 * fieldSize, 2 * fieldSize); } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { // should not be called in our example throw new NotImplementedException(); } } }

    Read the article

  • csutom converter in XStream

    - by Raja Chandra Rangineni
    Hi All, I am using XStream to serialize my Objects to XML format. The formatted xml that I get is as below: node1, node2, node 3 are attributes of pojo,DetailDollars 100 25 10 I have requirement where in I have to calucluate a percentage, for example 100/ 25 and add the new node to the existing ones. So, the final output should be : 100 25 10 4 I wrote a custom converter and registered to my xstream object. public void marshal(..){ writer.startNode("node4"); writer.setValue(getNode1()/ getnode2() ); writer.endNode(); } But, the xml stream I get has only the new node: 4 I am not sure which xstream api would get me the desired format. could you please help me with this . Thanks, Raja chandra Rangineni.

    Read the article

  • custom converter in XStream

    - by Raja Chandra Rangineni
    Hi All, I am using XStream to serialize my Objects to XML format. The formatted xml that I get is as below: node1, node2, node 3 are attributes of pojo,DetailDollars DetailDollars node1 100 /node1 node2 25 /node2 node3 10 /node3 /DetailDollars I have requirement where in I have to calucluate a percentage, for example 100/ 25 and add the new node to the existing ones. So, the final output should be : DetailDollars node1 100 /node1 node2 25 /node2 node3 10 /node3 node4 4 /node4 DetailDollars I wrote a custom converter and registered to my xstream object. public void marshal(..){ writer.startNode("node4"); writer.setValue(getNode1()/ getnode2() ); writer.endNode(); } But, the xml stream I get has only the new node: DetailDollars node4 4 /node4 /DetailDollars I am not sure which xstream api would get me the desired format. could you please help me with this . Thanks, Raja chandra Rangineni.

    Read the article

  • How to use Object Type Converter

    - by arun.x.sridharan(at)oracle.com
    UseCase Description A person form where in user will enter String which has to be converted to Number while persisting. From the User Interface we might be getting a String value which has to be persisted in the database as a number in that scenario we can use converters to map the java object which is of type String to its database value which is a Number. For example , there is a 'Person' table in database which is used to store the user details passed from the User Interface. It has a 'Status' column which is of the value  Number. But from the User Interface String values (Active/InActive) are passed . For persisting the user details we can use Object type converter and provide the mappings for status column corresponding to the String values. Object type converter can be used if you wanted to have a mapping for a field for example when departmentName on the entity was of String value and mapped to dept_name field on the database table which is of the value NUMBER.   Implementation steps Sample EJB API for setting the value of status on Person Entity as a String     public void createPerson(String status,String firstName,String lastName) {                Person person = new Person();                // status will be set as a String value received from the User Interface         person.setStatus(status);                person.setFirstname(firstName);        person.setLastname(lastName);                persistPerson(person);         } In the sample code shown above status is passed as a String, this has to be converted to Number. The String value obtained will be set on Person object and persistPerson API will be called for creating a new person from the values passed from the User Interface.  Steps to configure Object type converter: 1. Navigate to Person Entity from persistence.xml and navigate to status field2. Click on Conversion tab and select Converted check box3. Select Object Type Converter radio button and set the Data Type Class to      java.math.BigDecimal and Object Type Class to java.lang.String4. Specify the conversion values for all the values that can be passed from the user interface  as shown below5. Set the Default Object value

    Read the article

  • LINQ to SQL Converter

    - by user609511
    How can I convert My LINQ to SQL ? i have this LINQ statement: int LimCol = Convert.ToInt32(LimitColis); result = oListTUP .GroupBy(x => new { x.Item1, x.Item2, x.Item3, x.Item4, x.Item5 }) .Select(g => new { Key = g.Key, Sum = g.Sum(x => x.Item6), Poids = g.Sum(x => x.Item7), }) .Select(p => new { Key = p.Key, Items = Enumerable.Repeat(LimCol, p.Sum / LimCol).Concat(Enumerable.Repeat(p.Sum % LimCol, p.Sum % LimCol > 0 ? 1 : 0)), CalculPoids = p.Poids / Enumerable.Repeat(LimCol, p.Sum / LimCol).Concat(Enumerable.Repeat(p.Sum % LimCol, p.Sum % LimCol > 0 ? 1 : 0)).Count() }) .SelectMany(p => p.Items.Select(i => Tuple.Create(p.Key.Item1, p.Key.Item2, p.Key.Item3, p.Key.Item4, p.Key.Item5, i, p.CalculPoids))) .ToList(); } It works well, but somehow want to push it and it become too complicated, so I want to convert it into Pure SQL. I have tried SQL Profiler and LinqPad, but neither shows me the SQL. How can I see the SQL code from My LINQ ? Thank you in advance.

    Read the article

  • A Generic Boolean Value Converter

    - by codingbloke
    On fairly regular intervals a question on Stackoverflow like this one:  Silverlight Bind to inverse of boolean property value appears.  The same answers also regularly appear.  They all involve an implementation of IValueConverter and basically include the same boilerplate code. The required output type sometimes varies, other examples that have passed by are Boolean to Brush and Boolean to String conversions.  Yet the code remains pretty much the same.  There is therefore a good case to create a generic Boolean to value converter to contain this common code and then just specialise it for use in Xaml. Here is the basic converter:- BoolToValueConverter using System; using System.Windows.Data; namespace SilverlightApplication1 {     public class BoolToValueConverter<T> : IValueConverter     {         public T FalseValue { get; set; }         public T TrueValue { get; set; }         public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)         {             if (value == null)                 return FalseValue;             else                 return (bool)value ? TrueValue : FalseValue;         }         public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)         {             return value.Equals(TrueValue);         }     } } With this generic converter in place it easy to create a set of converters for various types.  For example here are all the converters mentioned so far:- Value Converters using System; using System.Windows; using System.Windows.Media; namespace SilverlightApplication1 {     public class BoolToStringConverter : BoolToValueConverter<String> { }     public class BoolToBrushConverter : BoolToValueConverter<Brush> { }     public class BoolToVisibilityConverter : BoolToValueConverter<Visibility> { }     public class BoolToObjectConverter : BoolToValueConverter<Object> { } } With the specialised converters created they can be specified in a Resources property on a user control like this:- <local:BoolToBrushConverter x:Key="Highlighter" FalseValue="Transparent" TrueValue="Yellow" /> <local:BoolToStringConverter x:Key="CYesNo" FalseValue="No" TrueValue="Yes" /> <local:BoolToVisibilityConverter x:Key="InverseVisibility" TrueValue="Collapsed" FalseValue="Visible" />

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >