Search Results

Search found 3677 results on 148 pages for 'cs 79'.

Page 102/148 | < Previous Page | 98 99 100 101 102 103 104 105 106 107 108 109  | Next Page >

  • PrivateFontCollection fails on appharbor

    - by grennis
    I am trying to load a custom font (ttf file) and draw into an image with the Graphics object. This code runs fine locally: PrivateFontCollection fonts = new PrivateFontCollection(); string path = context.Server.MapPath("~/App_Data/Futura LT Bold.ttf"); if (!System.IO.File.Exists(path)) { throw new InvalidOperationException("Font file is not deployed: " + path); } fonts.AddFontFile(path); However when run on appharbor, the call to AddFontFile fails with the exception: System.ArgumentException: Font 'Futura LT Book' does not support style 'Regular'. at System.Drawing.Font.CreateNativeFont() at System.Drawing.Font.Initialize(FontFamily family, Single emSize, FontStyle style, GraphicsUnit unit, Byte gdiCharSet, Boolean gdiVerticalFont) at System.Drawing.Font..ctor(FontFamily family, Single emSize) at LumenboxWeb.Controllers.GalleryController.FontTest() in d:\temp\h5oqslma.udd\input\src\LumenboxWeb\Controllers\GalleryController.cs:line 59 at lambda_method(Closure , ControllerBase , Object[] ) at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) I have tried different fonts, and they all work locally, but none work on appharbor. Is it possible to load fonts dynamically on appharbor?

    Read the article

  • How to write back to database from Silverlight?

    - by Manoj
    Hi, I use LINQ to SQL to get data from a database and use a service contract to access it in Silverlight at the client side. I display the data in a DataGrid. Now how do I make sure that any changes in the datagrid is written back to the database? EDIT: This is the example code I implemented: http://www.silverlight.net/learn/tutorials/sqldatagrid-cs/ Here I wanted any change in the datagrid reflected back in the database. The SubmitChanges function works in the DataContext object which is: public partial class DataClasses1DataContext : System.Data.Linq.DataContext But this is not exposed in the contract and so not visible in the client side code.

    Read the article

  • C++ Vector of pointers

    - by xbonez
    For my latest CS homework, I am required to create a class called Movie which holds title, director, year, rating, actors etc. Then, I am required to read a file which contains a list of this info and store it in a vector of pointers to Movies. I am not sure what the last line means. Does it mean, I read the file, create multiple Movie objects. Then make a vector of pointers where each element (pointer) points to one of those Movie objects? Do I just make two vectors - one of pointers and one of Movies and make a one-to-one mapping of the two vectors?

    Read the article

  • Cure for puzzle piece programming habbits?

    - by Recursion
    Even though I went to a decent CS school, I was still taught with the mentality of programming with puzzle pieces. By puzzle pieces I mean, looking up code segments at each step of the development process and adding them together as needed. Eventually gathering all of the pieces and having a properly working program. So as an example, if in my program the next step is to tokenize a string, I go to google and search "how do I tokenize a string in language". All instead of critically thinking about its implementation. I personally don't think its a very good way to program and I always seem to forget everything that I have searched for. So how can I get out of this puzzle piece mode of programmer that I was taught.

    Read the article

  • When using source control, what files should actually be commited?

    - by SimpleCoder
    I am working on a small project, hosted on Google Code, using SVN for source control. This is my first time using source control, and I'm a bit confused about what I should actually be committing to the repository. My project is very simple: A Class Library project, written in C#. The actual code that I have written is a single file. My question is this: Should I be committing the entire project (including directories like Debug, Release, Properties, etc.) or just my main .cs file? Thanks, After fighting with Subversion for a while (note to self: do not reset repository), it looks like I finally have it working with the directories laid out properly. Thanks again for all your advice.

    Read the article

  • AppDomain assemblies not being loaded correctly.

    - by SharePoint Newbie
    Hi, We are doing the following in the Application_Start (Global.ascx.cs) for a WCF Service hosted by IIS 7.0 (integrated pipeline). var mapperConfigurations = AppDomain.CurrentDomain.GetAssemblies() .SelectMany(a => a.GetExportedTypes().Where(t => typeof (IMapperConfiguration).IsAssignableFrom(t) && t.IsClass)) .ToList(); The web-service has 8-10 assemblies in its bin folder and each of them have multiple implementations of IMapperConfiguration. After an IIS Reset, no mapper configurations are found (found this using debug.write). However, this behaviour is inconsistent and at other times all implementations of IMapperConfiguration are found. When exactly does IIS load assemblies and what is wrong with this code? Thanks

    Read the article

  • Explain to me the following VS 2010 Extension Sample code..

    - by ealshabaan
    Coders, I am building a VS 2010 extension and I am experimenting around some of the samples that came with the VS 2010 SDK. One of the sample projects is called TextAdornment. In that project there is a weirdo class that looks like the following: [Export(typeof(IWpfTextViewCreationListener))] [ContentType("text")] [TextViewRole(PredefinedTextViewRoles.Document)] internal sealed class TextAdornment1Factory : IWpfTextViewCreationListener While I was experimenting with this project, I tried to debug the project to see the flow of the program and I noticed that this class gets hit when I first start the debugging. Now my question is the following: what makes this class being the first class to get called when VS starts? In other words, why this class gets active and it runs as of some code instantiate an object of this class type? Here is the only two files in the sample project: TextAdornment1Factory.cs using System.ComponentModel.Composition; using Microsoft.VisualStudio.Text.Editor; using Microsoft.VisualStudio.Utilities; namespace TextAdornment1 { #region Adornment Factory /// /// Establishes an to place the adornment on and exports the /// that instantiates the adornment on the event of a 's creation /// [Export(typeof(IWpfTextViewCreationListener))] [ContentType("text")] [TextViewRole(PredefinedTextViewRoles.Document)] internal sealed class TextAdornment1Factory : IWpfTextViewCreationListener { /// /// Defines the adornment layer for the adornment. This layer is ordered /// after the selection layer in the Z-order /// [Export(typeof(AdornmentLayerDefinition))] [Name("TextAdornment1")] [Order(After = PredefinedAdornmentLayers.Selection, Before = PredefinedAdornmentLayers.Text)] [TextViewRole(PredefinedTextViewRoles.Document)] public AdornmentLayerDefinition editorAdornmentLayer = null; /// <summary> /// Instantiates a TextAdornment1 manager when a textView is created. /// </summary> /// <param name="textView">The <see cref="IWpfTextView"/> upon which the adornment should be placed</param> public void TextViewCreated(IWpfTextView textView) { new TextAdornment1(textView); } } #endregion //Adornment Factory } TextAdornment1.cs using System.Windows; using System.Windows.Controls; using System.Windows.Media; using Microsoft.VisualStudio.Text; using Microsoft.VisualStudio.Text.Editor; using Microsoft.VisualStudio.Text.Formatting; namespace TextAdornment1 { /// ///TextAdornment1 places red boxes behind all the "A"s in the editor window /// public class TextAdornment1 { IAdornmentLayer _layer; IWpfTextView _view; Brush _brush; Pen _pen; ITextView textView; public TextAdornment1(IWpfTextView view) { _view = view; _layer = view.GetAdornmentLayer("TextAdornment1"); textView = view; //Listen to any event that changes the layout (text changes, scrolling, etc) _view.LayoutChanged += OnLayoutChanged; _view.Closed += new System.EventHandler(_view_Closed); //selectedText(); //Create the pen and brush to color the box behind the a's Brush brush = new SolidColorBrush(Color.FromArgb(0x20, 0x00, 0x00, 0xff)); brush.Freeze(); Brush penBrush = new SolidColorBrush(Colors.Red); penBrush.Freeze(); Pen pen = new Pen(penBrush, 0.5); pen.Freeze(); _brush = brush; _pen = pen; } void _view_Closed(object sender, System.EventArgs e) { MessageBox.Show(textView.Selection.IsEmpty.ToString()); } /// <summary> /// On layout change add the adornment to any reformatted lines /// </summary> private void OnLayoutChanged(object sender, TextViewLayoutChangedEventArgs e) { foreach (ITextViewLine line in e.NewOrReformattedLines) { this.CreateVisuals(line); } } private void selectedText() { } /// <summary> /// Within the given line add the scarlet box behind the a /// </summary> private void CreateVisuals(ITextViewLine line) { //grab a reference to the lines in the current TextView IWpfTextViewLineCollection textViewLines = _view.TextViewLines; int start = line.Start; int end = line.End; //Loop through each character, and place a box around any a for (int i = start; (i < end); ++i) { if (_view.TextSnapshot[i] == 'a') { SnapshotSpan span = new SnapshotSpan(_view.TextSnapshot, Span.FromBounds(i, i + 1)); Geometry g = textViewLines.GetMarkerGeometry(span); if (g != null) { GeometryDrawing drawing = new GeometryDrawing(_brush, _pen, g); drawing.Freeze(); DrawingImage drawingImage = new DrawingImage(drawing); drawingImage.Freeze(); Image image = new Image(); image.Source = drawingImage; //Align the image with the top of the bounds of the text geometry Canvas.SetLeft(image, g.Bounds.Left); Canvas.SetTop(image, g.Bounds.Top); _layer.AddAdornment(AdornmentPositioningBehavior.TextRelative, span, null, image, null); } } } } } }

    Read the article

  • Nesting a SharePoint Webpart inside of a User Control

    - by jlech
    I know it's usually the other way around, but I have some extenuating requirements that must be met (read as "No one bothered to do the research and now I have to bail them out") I have a standard user control (ascx) that is to be imported into a SharePoint 2007 website. Due to a design constraint, a sharepoint web part that is also needed has to be nested inside of this user control. So in other words, the user control would have to look something like this: <%@ Control Language="C#" AutoEventWireup="true" CodeFile="foo.ascx.cs" Inherits="foo" %> <div id="container"> ...snipped... <!-- SharePoint web part goes here --> ...snipped... </div> Any help would be appreciated. Thanks!

    Read the article

  • How to set ItemsSource?

    - by Mark
    This dialog makes no sense to me And I'm having trouble finding good tutorials on it. Most of the examples aren't detailed enough, or do stuff via code, but I'd like to take advantage of the IDE as much as possible. Whats the difference between ItemsSource and DataContext? I'd like to bind it to just a List for starters. I don't need SQL or databases or anything fancy. Where would I declare my list? In MainWindow.xaml.cs? How do I get it to appear in that dialog?

    Read the article

  • Mvc3 IEnumerable<QuestionModel> have a List<QuestionOptionModel> property. When I post, I get null list

    - by user1649439
    There is a example here. I am trying to use this technique in a large form with a list(List) but when I post back, the Viewmodel.Order that should’ve contained list of items and activities return with the lists empty. My QuestionModel.cs like this. public int Id { get; set; } public string QuestionText { get; set; } public System.Nullable<bool> OptionType1 { get; set; } public System.Nullable<bool> OptionType2 { get; set; } public List<QuestionOptionModel> OptionList = new List<QuestionOptionModel>(); When I post back "IEnumerable questions" List OptionList comes null. How can I do this?

    Read the article

  • algorithm to combine data for linear fit?

    - by BoldlyBold
    I'm not sure if this is the best place to ask this, but you guys have been helpful with plenty of my CS homework in the past so I figure I'll give it a shot. I'm looking for an algorithm to blindly combine several dependent variables into an index that produces the best linear fit with an external variable. Basically, it would combine the dependent variables using different mathematical operators, include or not include each one, etc. until an index is developed that best correlates with my external variable. Has anyone seen/heard of something like this before? Even if you could point me in the right direction or to the right place to ask, I would appreciate it. Thanks.

    Read the article

  • Paging with jQuery

    - by zurna
    I get data from another page using jQuery get method. But I have a small problem. Sometimes, data that I take from another page is too long so it's divided into pages. When the user clicks on 1, 2, 3, ... links he/she is redirected to the other page. However, I want data to be reloaded on the same page. Edit $('ul.thumbs li.pagination a').live('click', function() { var pageNumber = parseInt($(this).text().replace(/[^0-9]/g, '')); $.ajax({ type: "GET", url: "images.cs.asp?Process=ViewImages&PAGEID=<%=Request.QueryString("PAGEID")%>", success: function(data) { $("#ViewImages").html(data); }, error: function (XMLHttpRequest, textStatus, errorThrown) { $("#ViewImages").html('.'); } }); return false; });

    Read the article

  • Opening PDF String in new window with javascript

    - by DaveC
    Hello, I have a formatted PDF string that looks like %PDF-1.73 0 obj<<< /Type /Group /S /Transparency /CS /DeviceRGB >> /Resources 2 0 R/Contents 4 0 R>> endobj4 0 obj<> streamx??R=o?0??+??=|vL?R???l?-???,???Ge?JK????{???Y5?????Z?k?vf?a??`G????Asf?z????`%??aI#?!;?t???GD?!???<?????B?b?? ... 00000 n 0000000703 00000 n 0000000820 00000 n 0000000926 00000 n 0000001206 00000 n 0000001649 00000 n trailer << /Size 11 /Root 10 0 R /Info 9 0 R >>startxref2015%%EOF I am trying to open up this string in a new window as a PDF file. Whenever I use window.open() and write the string to the new tab it thinks that the text should be the contents of an HTML document. I want it to recognize that this is a PDF file. Any help is much appreciated

    Read the article

  • jQuery Loading Status for $.ajax

    - by Geetha
    Hi All, I am using the following code to get data from the database( from cs page itself i am creating the html code) and binding the html code to the div. Problem: If the database size is higher it takes some time to show the result. thet time i want to shoe a loading.gif image in that location. Once it get the data i have to hide the load image. Code: $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", data: "{ searchText: '" + searchText + "', product: '" + product + "', category: '" + category + "', artist:'" + artist + "'}", url: "Search.aspx/FetchSearchResult", dataType: "json", success: function(data) { $("#searchContainer").html(data.d[0]);}}); Geetha.

    Read the article

  • CruiseControl.NET, Visual Studio & SubVersion

    - by Ian
    Hi All, I am setting up a Continuous Integration server. I have one issue that doesn't seem to be mentioned in the tutorials. I have a ASP.net Web Application that I need to compile and them publish. My Problem is that I seem to be able to compile the app but when I attempt to use a buildPublisher this copies every thing including .svn files & folders and ms CS files. I am using an MSBuild task to compile my source. I tried setting my MSBuild Output Directory to directory but this didn't seem to have any effect. What am I not understanding? Thanks

    Read the article

  • How do I ensure my abstract class's function can only operate on extenders of the same type as the c

    - by incrediman
    For example, let's say this is my abstract class: abstract class A{ int x; int y; void foo(A fooMe); } ...and B and C are two classes which extend A. What I want is for B to only be able to call foo() on other Bs, and for C to only be able to call foo() on other Cs. But I want this to be out of the hands of the programmer who's extending my A class - that is, I want a way to ensure this functionality within As code alone. What can I do? (If possible) I'd like to avoid any hack or generics solution that's too messy - I still want foo to be able to be called like this, for example: B b=new B(); B bb=new B(); bb.foo(b);

    Read the article

  • How does the dataset determine the return type of a scalar query?

    - by Tobias Funke
    I am attempting to add a scalar query to a dataset. The query is pretty straight forward, it's just adding up some decimal values in a few columns and returning them. I am 100% confident that only one row and one column is returned, and that it is of decimal type (SQL money type). The problem is that for some reason, the generated method (in the .designer.cs code file) is returning a value of type object, when it should be decimal. What's strange is that there's another scalar query that has the exact same SQL but is returning decimal like it should. How does the dataset designer determine the data type, and how can I tell it to return decimal?

    Read the article

  • Should a service layer return view models for an MVC application?

    - by erg39
    Say you have an ASP.NET MVC project and are using a service layer, such as in this contact manager tutorial on the asp.net site: http://www.asp.net/mvc/tutorials/iteration-4-make-the-application-loosely-coupled-cs If you have viewmodels for your views, is the service layer the appropriate place to provide each viewmodel? For instance, in the service layer code sample there is a method public IEnumerable<Contact> ListContacts() { return _repository.ListContacts(); } If instead you wanted a IEnumerable, should it go in the service layer, or is there somewhere else that is the "correct" place? Perhaps more appropriately, if you have a separate viewmodel for each view associated with ContactController, should ContactManagerService have a separate method to return each viewmodel? If the service layer is not the proper place, where should viewmodel objects be initialized for use by the controller?

    Read the article

  • Do I have partial view/code behind in Flask?

    - by hbrlovehaku
    I'm migrating from C#.NET to Python/Flask. In .NET I have MasterPage, UserControl, PartialView each has its own code behind. e.g. I can save the check login functions in Login.ascx.cs and render the Login.ascx wherever I'd like to. If logged in, it shows the welcome message, else shows the login form. But in Flask I only found {% include 'login.html' %} which include the static html file. How can I implement this design in Flask?

    Read the article

  • OnClientClick event for keeping track of prints?

    - by Ram
    Hello, I am trying to keep track of prints that are made for a page. The page has Print this page link. And the code for it is like below: This is written in .cs file as there are many conditions for displaying this. And i am appending here using String Builder. sbOutput.AppendFormat("<td align=\"right\" valign=\"bottom\"><div style =\"float:right;text-align:right; valign:bottom;width:200px\"class=\"print_button notPrinted\"><a class=\"notPrinted\" href=\"#\" onclick=\"window.print();\">PRINT THIS COUPON </a><img src=\"images/print-icon-34x34.gif\" class=\"notPrinted\" align=\"absmiddle\" /></div> </td></tr></table>", couponid, Userid, locationid); Do i have to use onclientclick or something else?? Thanks so much in advance.

    Read the article

  • Reason for different segments in Linux on x86

    - by anjruu
    Hey all, So, I know that Linux uses four default segments for an x86 processor (kernel code, kernel data, user code, user data), but they all have the same base and limit (0x00000000 and 0xfffff), meaning each segment maps to the same set of linear addresses. Given this, why even have user/kernel segments? I understand why there should be separate segments for code and data (just due to how the x86 processor deals with the cs and ds registers), but why not have a single code segment and a single data segment? Memory protection is done through paging, and the user and kernel segments map to the same linear addresses anyway. Thanks! anjruu

    Read the article

  • Firing events in script task

    - by Anonymouslemming
    I've got an SSIS project where I am constructing an SQL command based on some variables. I'm constructing the command in a script task, and want to output the constructed SQL to the 'Execution Results' window. I am trying to do this using a FireInformation line from inside my script as follows: Dts.Events.FireInformation(99, "test", "Make this event appear!", "", 0, true); However, in the script editor when editing ScriptMain.cs, that line is underlined in red, and on mouseover, I get the following message: Error: The best overloaded method match for 'Microsoft.SqlServer.Dts.Tasks.ScriptTask.EventsObjectWrapper.FireInformation(int, string, string, string, int, ref bool') has some invalid arguments As a result, my script does not compile and I cannot execute it. Any idea what I'm doing wrong here, or what I need to change to be able to see the values of my variables at this point in the Execution output?

    Read the article

  • How to create a web framework in C# without ASP?

    - by Mark
    I've managed to get a C# asp page running under ubuntu/apache/mono, but I don't want to write my framework in these ASP pages, I want to use straight C# and then I'll use a templating language for my views. But I don't know where to begin? C# is a compiled language, so... how would I do this? Would I compile everything and then have apache hook into the (single) executable and pass in the the request URL? Could I request specific .cs pages and then have apache tell it to compile and then "display" it only if it's been updated? Can the "view" files be compiled individually to avoid having to recompile everything every time there's a change? Is there some "base" I can work from, or am I going to have to reinvent accessing GET and POST variables (by reading header info) and all sorts of other stuff we take for granted in languages like PHP?

    Read the article

  • from JS to iphone dev - what's the best language to start with?

    - by Enkai
    I am a total beginner and would like to eventually learn to develop for the iphone. I have just done a beginner's CS course where the language we learned was JavaScript. We studied basic concepts like: variables, arrays, loops (for,while,if,if..else..), properties and functions. I'm wondering if I am starting in the right/wrong place by following this book: Learn C on the Mac by Dave Mark? I have read a few chapters and am finding it a bit hard to get my head around the way that C works, for example the way that Strings are printed seems overly complicated as compared to JS. Do you think that JS was the wrong language to start off with and would I be better to go from JS straight to Objective-C rather than to C? I have tried to read up on previous threads on the merits/demerits of learning C first but haven't found any that relate JS to learning C/Obj C/ Cocoa. Any advice appreciated as I am very new to this. Thanks

    Read the article

  • Passing derived objects in a constructure

    - by Clarence Klopfstein
    This is a bit of a convoluted question, hopefully I can make it clear. I am finding that this may not be possible, but am trying to see if anybody has a solution. I have four classes, two are core classes and two are those core classes extended: extUser Extends coreUser extSecurity Extends coreSecurity In the constructor for coreUser you have this: public coreUser(string id, ref coreSecurity cs) When trying to extend coreUser you would have this: public extUser(string id ref extSecurity es) : base(id, ref es) This fails because es is of type, extSecurity and the base class expects a type of coreSecurity. I've not found anyway to cast this to allow for me to override this base class in C#. In VB it works just fine. Ideas?

    Read the article

< Previous Page | 98 99 100 101 102 103 104 105 106 107 108 109  | Next Page >