Search Results

Search found 6357 results on 255 pages for 'generic relations'.

Page 156/255 | < Previous Page | 152 153 154 155 156 157 158 159 160 161 162 163  | Next Page >

  • jQuery lava-lamp-like effect bouncing all over the place!

    - by Nathan Loding
    I followed the tutorial found here and added my own flare to it: tutorial What I was looking to accomplish was to put a specific image on the left and right side of the list item. So instead of just the generic <li id="blob"></li> created in the tutorial, I did <li id="blob"><div class="blob-wrap"><div class="leftimage"></div><div class="rightimage"></div></li> to accomplish the particular effect I wanted. It works beautifully ... except that the image attempts to bounce back the "currentPageItem" if I leave the mouse hovering over one of the list items. Here's a JS Bin example: http://jsbin.com/odome What do I need to do to fix it? jQuery is firing the "hoverOut" function (or whatever you want to call it). But why?

    Read the article

  • Convert IEnumerable<dynamic> to JsonArray

    - by Burt
    I am selecting an IEnumerable<dynamic> from the database using Rob Conery's Massive framework. The structure comes back in a flat format Poco C#. I need to transform the data and output it to a Json array (format show at bottom). I thought I could do the transform using linq (my unsuccessful effort is shown below): using System.Collections.Generic; using System.Json; using System.Linq; using System.ServiceModel.Web; .... IEnumerable<dynamic> list = _repository.All("", "", 0).ToList(); JsonArray returnValue = from item in list select new JsonObject() { Name = item.Test, Data = new dyamic(){...}... }; Here is the Json I am trying to generate: [ { "id": "1", "title": "Data Title", "data": [ { "column1 name": "the value", "column2 name": "the value", "column3 name": "", "column4 name": "the value" } ] }, { "id": "2", "title": "Data Title", "data": [ { "column1 name": "the value", "column2 name": "the value", "column3 name": "the value", "column4 name": "the value" } ] } ]

    Read the article

  • TortoiseSVN 1.6.8 missing repository browser in Branch/Tag "To URL" dialog?

    - by Ash
    It seems that in TortoiseSVN 1.6.8 (on Windows), when you click the "To URL..." button in the Branch/Tag dialog, it now pops up a generic "browse for folders" dialog. It used to pop up a Repository Browser. Displaying a regular folder browser isn't much use, since you can't navigate to any of the tags/branches via the file system. Does anyone know if this is a regression or a deliberate change? Any possible workarounds (other than reverting to 1.6.7, which works fine)? Notes: I am running a repository on the local file system, which may yield different results to one going across a network. I'm definitely using an FSFS repository, so changes to BDB access via file:/// shouldn't apply. The only reference I could find to this problem is here: http://groups.google.com/group/tortoisesvn/browse_thread/thread/f3406d1bad89f1d9.

    Read the article

  • IEnumerable<> to IList<>

    - by nachid
    I am using Linq to query my database and returning a generic IList. Whatever I tried I couldn't convert an IQueryable to an IList. Here is my code. I cannot write simpler than this and I don't understand why it is not working. public IList<IRegion> GetRegionList(string countryCode) { var query = from c in Database.RegionDataSource where (c.CountryCode == countryCode) orderby c.Name select new {c.RegionCode, c.RegionName}; return query.Cast<IRegion>().ToList(); } This returns an list with the right number of items but they are all empty Please help, I am bloqued with this for a couple of days now

    Read the article

  • How to determine whether a dependency object implements a given dependency property (C# / WPF)

    - by Tim Coulter
    I am working with the classes in the System.Windows.Documents namespace, trying to write some generic code that will conditionally set the value of certain dependency properties, depending on whether these properties exist on a given class. For example, the following method assigns an arbitrary value to the Padding property of the passed FrameworkContentElement: void SetElementPadding(FrameworkContentElement element) { element.SetValue(Block.PaddingProperty, new Thickness(155d)); } However, not all concrete implementations of FrameworkContentElement have a Padding property (Paragraph does but Span does not) so I would expect the property assignment to succeed for types that implement this property and to be silently ignored for types that do not. But it seems that the above property assignment succeeds for instances of all derivatives of FrameworkContentElement, regardless of whether they implement the Padding property. I make this assumption because I have always been able to read back the assigned value. I assume there is some flaw in the way I am assigning property values. What should I do to ensure that a given dependency property assignment is ignored by classes that do not implement that property? Many thanks for your advice. Tim

    Read the article

  • Converting C# void* to byte[]

    - by Yurik
    In C#, I need to write T[] to a stream, ideally without any additional buffers. I have a dynamic code that converts T[] (where T is a no-objects struct) to a void* and fixes it in memory, and that works great. When the stream was a file, I could use native Windows API to pass the void * directly, but now I need to write to a generic Stream object that takes byte[]. Can anyone suggest a hack way to create a dummy array object which does not actually have any heap allocations, but rather points to an already existing (and fixed) heap location. This is the pseudo-code that I need: void Write(Stream stream, T[] buffer) { fixed( void* ptr = &buffer ) // done with dynamic code generation { int typeSize = sizeof(T); // done as well byte[] dummy = (byte[]) ptr; // <-- how do I create this fake array? stream.Write( dummy, 0, buffer.Length*typeSize ); } }

    Read the article

  • Can't transfer list<T> to web service?

    - by iTayb
    I have the same classes on my server and on my web service. I have the following WebMethod: [WebMethod] public int CreateOrder(List<Purchase> p, string username) { o.Add(new Order(p,username)); return o.Count; } However the following code, run at server: protected void CartRepeater_ItemCommand(object source, RepeaterCommandEventArgs e) { List<Purchase> l = ((List<Purchase>)Session["Cart"]); if (e.CommandName == "Order") { localhost.ValidateService WS = new localhost.ValidateService(); WS.CreateOrder(l, Session["username"].ToString()); } } gives the following error: Argument '1': cannot convert from 'System.Collections.Generic.List<Purchase>' to 'localhost.Purchase[]'. How can I transfer the list<Purchase> object to the web service? Thank you very much.

    Read the article

  • LinkedList cannot be serialised?

    - by iTayb
    Here are my classes: http://pastebin.com/3dc5Vb1t When I try to run BookStore b = new BookStore(); b.LoadFromXML(Server.MapPath("list.xml")); Label1.Text = b.ToString(); I get the following error: You must implement a default accessor on System.Collections.Generic.LinkedList`1[[Book, App_Code.cxsacizw, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]] because it inherits from ICollection. The error source is XmlSerializer s = new XmlSerializer(typeof(BookStore)); When I tried to look for a solution on google, I found it that LinkedList has some problems with serialization. How can I deal with it? Thank you very much.

    Read the article

  • .NET: Type.Parse not working?

    - by Rosarch
    What am I doing wrong? using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.Xna.Framework.Graphics; using Box2D.XNA; //... Type.Parse("GameObjectModel"); Compilation error: 'System.Type' does not contain a definition for 'Parse' I am trying to get the type of a class name from a string, so I can instantiate an instance of that class.

    Read the article

  • htaccess redirect from root to subfolder and then mask the url?

    - by KiwiCoder
    Hello all, Two things: Firstly - I have version 2 of a website located in a folder named v2, and I want to redirect any traffic that is NOT a child of the v2 folder, to www.example.com/v2 The old site located in the root was created in iWeb and has a LOT of subfolders and sub-subfolders. So: www.example.com/v2 = New site www.example.com/Page.html www.example.com/category/Page.html ww.example.com/category/subcategory/Page.html = All generic examples of what I need to redirect. Secondly, and I don't know if this is possible, I want to hide /v2/ in the URL, so that visitors will just see www.example.com/page even though they are actually on www.example.com/v2/page Links are hardcoded to the v2 folder, like so <a href="v2/contact.html" Any help is MOST appreciated. I've spent hours trying to figure this out, but I'm only just learning about htaccess and regular expressions, and am totally confused. Thanks so much!

    Read the article

  • Does Visual Studio Localhost ASP.NET debugging allow caching?

    - by Joel
    The title pretty much says it all, but here's the issue. I have an generic handler that returns Javascript; the only line of code that deals with caching that I put in is the following: context.Response.Cache.SetCacheability(HttpCacheability.Public); context.Response.Cache.SetExpires(DateTime.Now.AddYears(1)); context.Response.ContentType = "text/javascript"; context.Response.Write("result"); I'm debugging on localhost. out of Visual Studio 2008, (that's "localhost." so fiddler picks it up) and Fiddler2 sees the expire date, but says that the cache header is set to private, and the page isn't being cached. Can anybody see what's going wrong here?

    Read the article

  • WPF: How to dynamically find a usercontrol or datatemplate

    - by Elger
    I have a bunch of datatemplates I use to display various sql-views in an ItemsControl. I don't know which datatemplate i'm going to use until run-time. (every view has different columns) Next to that, I made a generic dynamic datatemplate for all those views that don't need anything special. When I display the view I want to first look in all the available datatemplates if there is one that matches, else use the default dynamic datatemplate. My question is how can I 'search' a datatemplate by name in code? Usercontrol is also possible. Thanks, Elger

    Read the article

  • Do you still support Internet Explorer 6?

    - by Marcos Buarque
    Hi, I hope this question isn't tagged as too generic. But this is an honest concern/curiosity I have. Are you people still supporting Internet Explorer 6? Web developers sometimes use the concept of softly degrading their projects in older browsers. When I say "older", I mean mainly Internet Explorer 6. When you softly degrade you still have to waste tons of time tryng to fit things in IE6. This is time consuming and the client usually won`t even mind asking or checking how things look in IE6. So what are you doing when your website is completely broken in IE6? Do you bother to completely fix it and eat up your time or do you simply ignore it (leave broken boxes, opaque PNG files etc.)?

    Read the article

  • How to get users to read error messages?

    - by FX
    If you program for a nontechnical audience, you find yourself at a high risk that users will not read your carefully worded and enlightening error messages, but just click on the first button available with a shrug of frustration. So, I'm wondering what good practices you can recommend to help users actually read your error message, instead of simply waiving it aside. Ideas I can think of would fall along the lines of: Formatting of course help; maybe a simple, short message, with a "learn more" button that leads to the longer, more detailed error message Have all error messages link to some section of the user guide (somewhat difficult to achieve) Just don't issue error messages, simply refuse to perform the task (a somewhat "Apple" way of handling user input) Edit: the audience I have in mind is a rather broad user base that doesn't use the software too often and is not captive (i.e., not an in-house software or narrow community). A more generic form of this question was asked on slashdot, so you may want to check there for some of the answers.

    Read the article

  • Throwing exceptions as well as catching exceptions?

    - by Eric S
    I was wondering how Java takes the following scenario public static void main(String[] args) throws IndexOutOfBoundsException, CoordinateException, MissionException, SQLException, ParserConfigurationException { try { doSomething(); } catch (Exception e) { e.printStackTrace(); } } In the above code, I am declaring the main function to throw many different exceptions, but inside the function, I am catching the generic Exception. I am wondering how java takes this internally? I.e., say doSomething() throws an IndexOutOfBounds exception, will the e.printStackTrace() get called in the last catch (Exception e) {...} block? I know if an exception not declared in the throws area of the function gets thrown, the try/catch will handle it, but what about exceptions mentioned in the declaration?

    Read the article

  • Problem in populating a dictionary using Enumerable.Range()

    - by Newbie
    If I do for (int i = 0; i < appSettings.Count; i++) { string key = appSettings.Keys[i]; euFileDictionary.Add(key, appSettings[i]); } It is working fine. When I am trying the same thing using Enumerable.Range(0, appSettings.Count).Select(i => { string Key = appSettings.Keys[i]; string Value = appSettings[i]; euFileDictionary.Add(Key, Value); }).ToDictionary<string,string>(); I am getting a compile time error The type arguments for method 'System.Linq.Enumerable.Select(System.Collections.Generic.IEnumerable, System.Func)' cannot be inferred from the usage. Try specifying the type arguments explicitly. Any idea? Using C#3.0 Thanks

    Read the article

  • Is there a standard site structure format?

    - by artlung
    Is there a standard site structure format? The use of this would be for export and import into a CMS or framework to define the urls, content, metadata for a website. Something tool agnostic would be the goal. JSON, YAML, XML, whatever. Maybe something like: { 'baseurl': 'http://example.com', 'site': [ {'slug': '/', 'title': 'ExampleCo. Inc.'}, {'slug': '/about', 'title': 'About Our Company'}, {'slug': '/services', 'title': 'Our Services'}, {'slug': '/products', 'title': 'Products'}, {'slug': '/products/purchase', 'title': 'Purchase Products Now'}, {'slug': '/products/downloads', 'title': 'Downloads'}, {'slug': '/contact', 'title': 'Contact Us'} ] } My thinking is that it would allow you to quickly populate a content management system or framework with a generic site navigational structure. Does something like this exist?

    Read the article

  • Most used .NET namespace

    - by Michael Prewecki
    What is your most commonly used namespace in .NET. I know it will vary greatly based upon the types of projects you develop but the stack overflow audience should provide a fairly decent sample set for the types of .NET projects being developed. I'm simply interest in the name of the namespace (one namespace per answer and no one person should have more than one answer, if someone else has the same answer as you then just upvote their answer). Try to be as specific as possible (so answering System, isn't helpful). I'm after this information to help new developers focus their attention on the most common .NET namespaces...there are after all thousands of them! To start off mine is almost certainly System.Collections.Generic, I use lists of things everywhere.

    Read the article

  • How to include multiple XML files in a single XML file for deserialization by XmlSerializer in .NET

    - by harrydev
    Hi, is it possible to use the XmlSerializer in .NET to load an XML file which includes other XML files? And how? This, in order to share XML state easily in two "parent" XML files, e.g. AB and BC in below. Example: using System; using System.IO; using System.Xml.Serialization; namespace XmlSerializerMultipleFilesTest { [Serializable] public class A { public int Value { get; set; } } [Serializable] public class B { public double Value { get; set; } } [Serializable] public class C { public string Value { get; set; } } [Serializable] public class AB { public A A { get; set; } public B B { get; set; } } [Serializable] public class BC { public B B { get; set; } public C C { get; set; } } class Program { public static void Serialize<T>(T data, string filePath) { using (var writer = new StreamWriter(filePath)) { var xmlSerializer = new XmlSerializer(typeof(T)); xmlSerializer.Serialize(writer, data); } } public static T Deserialize<T>(string filePath) { using (var reader = new StreamReader(filePath)) { var xmlSerializer = new XmlSerializer(typeof(T)); return (T)xmlSerializer.Deserialize(reader); } } static void Main(string[] args) { const string fileNameA = @"A.xml"; const string fileNameB = @"B.xml"; const string fileNameC = @"C.xml"; const string fileNameAB = @"AB.xml"; const string fileNameBC = @"BC.xml"; var a = new A(){ Value = 42 }; var b = new B(){ Value = Math.PI }; var c = new C(){ Value = "Something rotten" }; Serialize(a, fileNameA); Serialize(b, fileNameB); Serialize(c, fileNameC); // How can AB and BC be deserialized from single // files which include two of the A, B or C files. // Using ideally something like: var ab = Deserialize<AB>(fileNameAB); var bc = Deserialize<BC>(fileNameBC); // That is, so that A, B, C xml file // contents are shared across these two } } } Thus, the A, B, C files contain the following: A.xml: <?xml version="1.0" encoding="utf-8"?> <A xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Value>42</Value> </A> B.xml: <?xml version="1.0" encoding="utf-8"?> <B xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Value>3.1415926535897931</Value> </B> C.xml: <?xml version="1.0" encoding="utf-8"?> <C xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Value>Something rotten</Value> </C> And then the "parent" XML files would contain a XML include file of some sort (I have not been able to find anything like this), such as: AB.xml: <?xml version="1.0" encoding="utf-8"?> <AB xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <A include="A.xml"/> <B include="B.xml"/> </AB> BC.xml: <?xml version="1.0" encoding="utf-8"?> <BC xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <B include="B.xml"/> <C include="C.xml"/> </BC> Of course, I guess this can be solved by implementing IXmlSerializer for AB and BC, but I was hoping there was an easier solution or a generic solution with which classes themselves only need the [Serializable] attribute and nothing else. That is, the split into multiple files is XML only and handled by XmlSerializer itself or a custom generic serializer on top of this. I know this should be somewhat possible with app.config (as in http://stackoverflow.com/questions/480538/use-xml-includes-or-config-references-in-app-config-to-include-other-config-files), but I would prefer a solution based on XmlSerializer. Thanks.

    Read the article

  • ExtJs: Tree: how download then select using AJAX calls ?

    - by Olivier Pons
    Hi, Here's my goal : - open a tree - download the root nodes - expand automatically one specific node using AJAX (and loop n times here) until i find a leaf then select the leaf Here's the function that works when I declare the Tree : listeners: { load: function(n) { console.log('load(n)'); n.eachChild( function(n) { if ((n.id=='lys/2007') || (n.id=='lys/2007/08') || (n.id=='lys/2007/08/29')) { n.expand(false,false); } }); } } But if I don't know how to make it more "generic" (almost exactly like the ExtJs documentation). But they don't jump automatically to a specific node (i.e. I want no user interaction). Any idea / advice how to do this? Don't hesitate to edit my post to make it proper English :)

    Read the article

  • C# .NET 4.0 and Generics

    - by Mr Snuffle
    I was wondering if anyone could tell me if this kind of behaviour is possible in C# 4.0 I have an object hierarchy I'd like to keep strongly typed. Something like this class ItemBase {} class ItemType<T> where T : ItemBase { T Base { get; set; } } class EquipmentBase : ItemBase {} class EquipmentType : ItemType<EquipmentBase> {} What I want to be able to do to have something like this ItemType item = new EquipmentType(); And I want item.Base to return type ItemBase. Basically I want to know if it's smart enough to strongly typed generic to a base class without the strong typing. Benefit of this being I can simply cast an ItemType back to an EquipmentType and get all the strongly typedness again. I may be thinking about this all wrong...

    Read the article

  • Django/MySQL - __istartswith not producing case-insensitive query.

    - by TheLizardKing
    I make use of generic views and I am attempting to query my MySQL db (utf8_bin collation) in a case insensitive manor to try to find all my song titles that start with a particular letter. view.py def tracks_by_title(request, starts_with): return object_list( request, queryset = Track.objects.filter(title__istartswith=starts_with), template_name = 'tlkmusic_base/titles_list.html', template_object_name = 'tracks', paginate_by = 25, ) and my urls.py urlpatterns = patterns('tlkmusic.apps.tlkmusic_base.views', (r'^titles/(?P<starts_with>\w)/$', tracks_by_title), ) the query it produces according to the django debug toolbar is: SELECT `tracks`.`id`, `tracks`.`url`, `tracks`.`artist`, `tracks`.`album`, `tracks`.`genre`, `tracks`.`year`, `tracks`.`title`, `tracks`.`comment`, `tracks`.`tracknumber`, `tracks`.`discnumber`, `tracks`.`bitrate`, `tracks`.`length`, `tracks`.`samplerate`, `tracks`.`filesize`, `tracks`.`createdate`, `tracks`.`modifydate` FROM `tracks` WHERE `tracks`.`title` LIKE a% LIMIT 1 specifically this line: WHERE `tracks`.`title` LIKE a% LIMIT 1 Why is it not ILIKE which is what I was expecting by using __istartswith? I am using Django 1.1.1 on Ubuntu.

    Read the article

  • Asp.Net MVC - Plugins Directory, Community etc?

    - by Jörg Battermann
    Good evening everyone, I am currently starting to dive into asp.net mvc and I really like what I see so far.. BUT I am somewhat confused about 'drop-in' functionality (similiar to what rails and it's plugins and nowadays gems are), an active community to contact etc. For rails there's github with one massiv index of plugins/gems/code-examples regarding mostly rails (despite their goal being generic source-code hosting..), for blogs, mailing lists etc it's also pretty easy to find the places the other developers flock around, but... for asp.net mvc I am somewhat lost where to go/look. It all seems scattered across codeplex and private sites, google code hosting etc etc.. but is there one (or few places) where to turn to regarding asp.net mvc development, sample code etc? Cheers and thanks, -Jörg

    Read the article

  • Starting work on a Pre-existing Project

    - by Toymakerii
    So this is more of a generic question. I seem to keep finding myself being put on larger and larger projects. Recently I have been assigned to a very large project written in C and VHDL. The goal is for me to become familiar with the code and eventually take the lead on the project. This is by far the largest project I have been assigned to work on that I didn't start. So here is my question: What methods/tools do you use to learn how everything works? Do you just increase and expand on comments? Do you make a UML representation of the project? Any tips would be great! Thanks

    Read the article

  • good documentation about "avoid catching throwable", in context of weblogic server

    - by Marcel
    hi all, i am currently refactoring an existing codebase (EJBs...) to rip out all blocks where a Throwable is catched inside of the EJB. try { ... do some business logic } catch(Throwable t){ ... log and swallow ... :-( } i want/need to convince the people around me with proper documentation that "catching throwable" is a no-go for an EJB (we have lots of discussions around this :-(( ). weblogic will handle all the "Error" conditions and maybe invalidate EJBs and put fresh(working) EJBs into the pool. catching Throwable would undermine all these security nets provided by weblogic. and catching throwable is bad practice anyway (but people here are reluctant and use the "throwable" hammer everywhere). is anyone able to point me to some online docs where this behaviour is explained (for weblogic or jboss or...). i searched via google and had a look at the weblogic docs but wasn't able to find anything, just generic java doc. any help highly appreciated cheers marcel

    Read the article

< Previous Page | 152 153 154 155 156 157 158 159 160 161 162 163  | Next Page >