Search Results

Search found 3479 results on 140 pages for 'chris cyvas'.

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

  • How do I return the ancestors of an object with LINQ?

    - by Chris
    I have a District class that looks like this: public class District { public int Id { get; set; } public string Name { get; set; } public District Parent { get; set; } public IEnumerable<District> Ancestors { get { /* what goes here? */ } } } I would like to be able to get a list of each District's ancestors. So if District "1.1.1" is a child of District "1.1", which is a child of District "1", getting Ancestors on District "1.1.1" would return a list that contains the District objects whose names are "1.1" and "1". Does this involve the yield return statement (I never totally understood that)? Can it be done in one line?

    Read the article

  • Disable buttons on post back using jquery in .net app

    - by Chris Lively
    I have a asp.net app that I want to disable the buttons as soon as they are clicked in order to prevent multiple submissions. I'd like to use jquery for this as the site already liberally uses it anyway. What I've tried is: $(document).ready(function () { $("#aspnetForm").submit(function () { $('input[type=submit]', $(this)).attr("disabled", "disabled"); }) }); The above will disable the button, and the page submits, but the asp.net button on click handler is never called. Simply removing the above and the buttons work as normal. Is there a better way?

    Read the article

  • Enterprise integration of disparate systems

    - by Chris Latta
    We're about to embark on a fairly large integration effort to kill off a bunch of Access and Sql Server databases and get everything into one coherent enterprise system. There are also a number of other systems (accounting, CRM, payroll, MS Exchange) that hold critical data that we need to integrate (use for data validation in other systems), report on and otherwise expose. It is likely that some of these systems will change in the next few years, so we need to isolate our systems to be ready for change. Ideally we would be able to expose our forms in a consistent manner across as many of our our systems as possible without having to re-develop them for each system. We are currently targeting SharePoint (2007 and soon 2010), Office (2007 and soon 2010 - Word, Excel, PowerPoint and Outlook), Reporting Services, .Net console applications, .Net Windows applications, shell extensions, and with the possibility of exposing some functionality on mobile devices (BlackBerries currently, maybe iPhones later) and via our website. We're moving development to Visual Studio 2010 (from 2005) ahead of migrating to SharePoint 2010 and Office 2010. Given that most of our development is presently targeted to the .Net framework (mostly in C#) it seems logical to stick with this unless there is some compelling reason to switch frameworks/platform for some aspects. We're thinking of your standard Database-Data Integration layer-Business Objects Layer-Web Services (or REST) layer-Client Application plus doing our own client application with WPF (or something else?) forms that can also be exposed in the MS systems (SharePoint, Office, Windows). So, we don't want much, just everything :) Basically we need to isolate ourselves from database and systems changes, create an API that can be used throughout our systems and then make this functionality available in our client applications. I'm very keen to get pointers from anyone who has tips on how to pull this off. Should we look at the Enterprise Library as a place to start? Is REST with ASP.Net MVC2 a better solution than Web Services for a system like this? Will WPF deliver forms re-use or is there something better?

    Read the article

  • compare function for dates

    - by Chris
    I have struct as: struct stored { char *dates; // 12/May/2010, 10/Jun/2010 etc.. int ctr; }; // const struct stored structs[] = {{"12/May/2010", 1}, {"12/May/2011", 1}, {"21/May/2009", 4}, {"12/May/2011", 3}, {"10/May/2011", 8}, {"12/May/2011", 4 }}; What I want to do is to sort struct 'stored' by stored.dates. qsort(structs, 9, sizeof(struct stored*), sortdates); // sortdates function I'm not quite sure what would be a good way to sort those days? Compare them as c-strings?

    Read the article

  • LinkedList Wrong Display(string builder)

    - by Chris
    Hello, The following program is a basic linked list divided in 3 classes. In the tester class (main) i add several numbers to the list (sorted). But insteed of getting the numbers as a result i get the result: LinkedList.LinkedList Is something wrong with the stringbuilder (the program was first in java where a string buffer was used, but that should be the same i think?) LinkedListTester.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace LinkedList { public class LinkedListTester { static void Main(string[] args) { LinkedList ll = new LinkedList(); ll.addDataSorted(5); ll.addDataSorted(7); ll.addDataSorted(13); ll.addDataSorted(1); ll.addDataSorted(17); ll.addDataSorted(8); Console.WriteLine(ll); } } }/LinkedList/ LinkedList.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace LinkedList { public class LinkedList { //toestand private LinkedListNode first; private LinkedListNode last; //gedrag public LinkedList() { first = null; last = null; } public void addDataInFront(int data) { first = new LinkedListNode(data, first); if (last == null){ last = first; } }/*addDataInFront*/ public void addDataToBack(int data) { if (first == null) { addDataInFront(data); } else { last.setNext(new LinkedListNode(data, null)); last = last.getNext(); } }/*addDataToBack*/ public void addDataSorted(int data) { if (first == null || first.getData() > data) { addDataInFront(data); } else { LinkedListNode currentNode = first; while (currentNode.getNext() != null && currentNode.getNext().getData() < data) { currentNode = currentNode.getNext(); } currentNode.setNext(new LinkedListNode(data, currentNode.getNext())); currentNode = currentNode.getNext(); if (currentNode.getNext() == null) { last = currentNode; } } }/*addDataSorted*/ public String toString() { StringBuilder Buf = new StringBuilder(); LinkedListNode currentNode = first; while (currentNode != null) { Buf.Append(currentNode.getData()); Buf.Append(' '); currentNode = currentNode.getNext(); } return Buf.ToString(); }/*toString*/ }/*LinkedList*/ }/LinkedList/ LinkedListNode: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace LinkedList { public class LinkedListNode { //toestand private int data; private LinkedListNode next; private LinkedListNode previous; //gedrag public LinkedListNode(int data, LinkedListNode next) { this.data = data; this.next = next; this.previous = null; } public LinkedListNode(int data, LinkedListNode next, LinkedListNode previous) { this.data = data; this.next = next; this.previous = previous; } public LinkedListNode getNext() { return next; } public LinkedListNode getPrevious() { return previous; } public void setNext(LinkedListNode next) { this.next = next; } public void setPrevious(LinkedListNode previous) { this.previous = previous; } public int getData() { return data; } }/*LinkedListNode*/ }/LinkedList/

    Read the article

  • Executing an exe with arguments using Powershell

    - by Chris Charge
    This is what I want to execute: c:\Program Files (x86)\SEQUEL ViewPoint\viewpoint.exe /Setvar((POSTSTR $POSTSTR)(POSTEND $POSTEND)) /G:C:\viewpointfile.vpt /D:C:($BEGDATE to $TODDATE).xls This is what I have tried: $a = "/Setvar((POSTSTR $POSTSTR)(POSTEND $POSTEND))" $b = "/G:C:\viewpointfile.vpt" $c = "/D:C:($BEGDATE to $TODDATE).xls" $Viewpoint = "c:\Program Files (x86)\SEQUEL ViewPoint\viewpoint.exe" &$Viewpoint $a $b $c When I execute this I receive an error stating: File C:\viewpointfile.vpt "/D:C:($BEGDATE to $TODDATE).xls" not found! I'm not sure where it gets the extra quotes from. If I run the command with just $a and $b it runs fine. Any help would be greatly appreciated. Thanks! :) Update manojlds suggested echoargs so here it the output from it: &./echoargs.exe $viewpoint $a $b $c Arg 0 is C:\Program Files (x86)\SEQUEL ViewPoint\viewpoint.exe Arg 1 is /Setvar((POSTSTR 20101123)(POSTEND 20111123)) Arg 2 is /G:C:\viewpointfile.vpt Arg 3 is /D:C:(2010-11-23 to 2011-11-23 PM).xls It appears that all the arguments are being passed properly. When I run this as a command in cmd.exe it executes perfectly. So something on Powershells end must be messing up the output. Is there any other way to go about executing this command using Powershell?

    Read the article

  • Set Page Output Cache VaryByCustom value programmatically

    - by Chris Marisic
    I want to use an Enum value for the types of VaryByCustom parameters I will support, is it possible to do this? I tried setting it in the page itself <%@ OutputCache Duration="600" VaryByParam="none" VaryByCustom='<%=VaryByCustomType.IsAuthenticated.ToString(); %>' %> But this returned the entire literal string "<%=VaryByCustomType.IsAuthenticated.ToString(); %>" inside my global.asax is there any way to do this either on the page itself or from the codebehind? Or is this just something I have to accept is purely magic strings and nothing I can do to add type safety to it?

    Read the article

  • Is C++ Unmanaged?

    - by Chris Becke
    Am I the only one bugged by the phrase "unmanaged c++"? I think the phrase is implicitly insulting, and is designed to be so. Stroustrup never wrote "The Design and Evolution of Unmanaged C++" and the not unmanaged C++ standards committee is not working on "UC++1x". Maybe I should disingeneously invent a suite of languages called "Faster" purely so I can refer to any language I want to implicitly denigrate with a "Slow" prefix. "Oh, youre using Slow CSharp? Shame!"

    Read the article

  • Is there a limit to the number of DataContracts that can be used by a WCF Service?

    - by Chris
    Using WCF3.5SP1, VS2008. Building a WCF service that exposes about 10 service methods. We have defined about 40 [DataContract] types that are used by the service. We now experience that adding an additional [DataContract] type to the project (in the same namespace as the other existing types) does not get properly exposed. The new type is not in the XSD schemas generated with the WSDL. We have gone so far as to copy and rename an existing (and working) type, but it too is not present in the generated WSDL/XSD. We've tried this on two different developer machines, same problem. Is there a limit to the number of types that can exposed as [DataContract] for a Service? per Namespace?

    Read the article

  • App store for the PC?

    - by Chris
    So I've spent a lot of time making an iPhone game and have recently realized that I don't have to limit myself to just Apple - I know there are app stores for Palm and Android, but does anybody know of a good "app store" for the plain old PC? I would like to have one where individual developers can publish an app and not have to worry about all the billing and piracy issues!

    Read the article

  • jQuery - Multiple setInterval Conflict

    - by Chris Bowyer
    I am a jQuery novice and each of the following work fine on their own, but get out of time when working together. What am I doing wrong? Any improvement on the code would be appreciated too... It is to be used to rotate advertising. <!--- Header Rotator ---> <script type="text/javascript"> $(document).ready(function() { $("#header").load("header.cfm"); var refreshHeader = setInterval(function() { $("#header").load("header.cfm"); }, 10000); }); </script> <!--- Main Rotator ---> <script type="text/javascript"> $(document).ready(function() { $("#main").load("main.cfm"); var refreshMain = setInterval(function() { $("#main").load("main.cfm"); }, 5000); }); </script> <!--- Footer Rotator ---> <script type="text/javascript"> $(document).ready(function() { $("#footer").load("footer.cfm"); var refreshFooter = setInterval(function() { $("#footer").load("footer.cfm"); }, 2000); }); </script>

    Read the article

  • larger file upload problem with php

    - by chris
    I need to upload a csv file to a server. works fine for smaller files but when the file is 3-6 meg its not working. $allowedExtensions = array("csv"); foreach ($_FILES as $file) { if ($file['tmp_name'] > '') { if (!in_array(end(explode(".", strtolower($file['name']))), $allowedExtensions)) { die($file['name'].' is an invalid file type!<br/>'. '<a href="javascript:history.go(-1);">'. '&lt;&lt Go Back</a>'); } if (move_uploaded_file($file['tmp_name'], $uploadfile)) { echo "File is valid, and was successfully uploaded.\n"; } else { echo "Possible file upload attack!\n"; } echo "File has been uploaded"; } //upload form <form name="upload" enctype="multipart/form-data" action="<? echo $_SERVER['php_self'];?>?action=upload_process" method="POST"> <!-- MAX_FILE_SIZE must precede the file input field --> <input type="hidden" name="MAX_FILE_SIZE" value="31457280" /> <!-- Name of input element determines name in $_FILES array --> Send this file: <input name="userfile" type="file" /> <input type="submit" value="Send File" /> </form> I have also added this to htaccess php_value upload_max_filesize 20M php_value post_max_size 20M php_value max_execution_time 200 php_value max_input_time 200 Where am i going wrong?

    Read the article

  • Why must I rewind IteratorIterator

    - by chris
    $arrayIter = new ArrayIterator( array(1, 2) ); $iterIter = new IteratorIterator($arrayIter); var_dump($iterIter->valid()); //false var_dump($arrayIter->valid()); //true If I first call $iterIter-rewind(), then $iterIter-valid() is true. I'm curious why it requires that rewind() be called. I imagine there's good reason for it, but I would have expected it to simply start iteration at whatever state it's inner iterator is in, and leave it as an option to rewind before beginning iteration. calling next() also seems to put it in a "valid" state(although it advances to the next position, suggesting it was previously at the first position). $arrayIter = new ArrayIterator(array(1,2)); $iterIter = new IteratorIterator($arrayIter); $iterIter->next(); var_dump($iterIter->valid()); Again, I'm curious why I need to call rewind(), despite the inner iterator being in a valid state.

    Read the article

  • Microsoft Excel; Two conditions have to be true then be counted

    - by Chris Jones
    I'm working on a spreadsheet that two conditions have to true in order to be counted. If the month is January, and the number next to it is less than or equal to 30, then it's counted. Same rule applies for all the other months. Thus far, I have: =COUNTIFS(Sheet1!D2:D7,(SUMPRODUCT(--(MONTH(D2:D7)=1))),Sheet1!E2:E7,(COUNTIFS(E2:E7,"<=30"))) For example: Column D Jan 1, 2014 Feb 3, 2014 Feb 16, 2014 Mar 5, 2014 Mar 13, 2014 Mar 29, 2014 Column E 37 25 30 31 1 16 Outcome Jan 0 Feb 2 Mar 2

    Read the article

  • Javascript Alert Return value / Event

    - by Chris
    Hey, The question is pretty simple, but i'm not the big AJAX/JS coder, so I have no clue if it's possible. Is there any way that I can check whether or not an alert() was executed on a remote site? Like if I inputted an alert("Welcome to this site"); through a get variable, is there any way to check if it that alert() was actually executed in the browser? And not necessarily through AJAX/JS.

    Read the article

  • Modify onclick function with jQuery

    - by Chris Barr
    I've got a button that has an onclick event in it, which was set on the back end from .NET. Beside it is a checkbox <button class="img_button" onclick="if(buttonLoader(this)){WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions('uxBtnRelease', '', true, '', 'somepage.aspx?oupid=5&fp=true', false, true))} return false;" type="button">Release</button> <input type="checkbox" checked="checked" id="myCheckbox"> When the checkbox is clicked, needs to change the value of the query string in the URL inside the onclick function of the button. So far I have this, and the idea is right, but I keep getting errors when it's run: "Uncaught SyntaxError: Unexpected token ILLEGAL" var defaultReleaseOnClick=null; $("#myCheckbox").click(function(){ var $releaseBtn = $(".img_button"); if(defaultReleaseOnClick==null) defaultReleaseOnClick=$releaseBtn.attr("onclick"); var newOnClickString = defaultReleaseOnClick.toString().replace(/&fp=[a-z]+'/i,"&fp="+this.checked); $releaseBtn.removeAttr("onclick").click(eval(newOnClickString)); }); I know it seems kinda hacky to convert the function to a string, do a replacement, and then try to convert it back to a function, but I don't know any other way to do it. Any ideas? I've set up a demo here: http://jsbin.com/asiwu4/edit

    Read the article

  • How do you override an existing html form to use jquery to post the form?

    - by Chris
    I have a simple form that I am currently posting back to the server to update a nickname. What jquery code do I add (without changing the form) so that the page will not refresh, but instead jquery will post the form in the background and then pop up an alert message containing the reply back from the server? <form method="post" action="http://www.myserver.com/update_nickname" name="input"> Quick form to test update_nickname:<br> New nickname:<input type="text" value="BigJoe" name="newNickname"><br> <input type="submit" value="Submit"> </form> <script src="jquery-1.4.2.min.js" type="text/javascript"> </script>

    Read the article

  • google collections ordering on map values

    - by chris-gr
    I would like to order a map based on the values. Function<Map.Entry<A, Double>, Double> getSimFunction = new Function<Map.Entry<A, Double>, Double>() { public Double apply(Map.Entry<A, Double> entry) { return entry.getValue(); } }; final Ordering<Map.Entry<A, Double>> entryOrdering = Ordering.natural().onResultOf(getSimFunction); ImmutableSortedMap.orderedBy(entryOrdering).putAll(....).build(); How can I create a new sortedMap based on the ordering results or a sortedset based on the map.keyset()?

    Read the article

  • Need help optimizing a NHibernate criteria query that uses Restrictions.In(..)

    - by Chris F
    I'm trying to figure out if there's a way I can do the following strictly using Criteria and DetachedCriteria via a subquery or some other way that is more optimal. NameGuidDto is nothing more than a lightweight object that has string and Guid properties. public IList<NameGuidDto> GetByManager(Employee manager) { // First, grab all of the Customers where the employee is a backup manager. // Access customers that are primarily managed via manager.ManagedCustomers. // I need this list to pass to Restrictions.In(..) below, but can I do it better? Guid[] customerIds = new Guid[manager.BackedCustomers.Count]; int count = 0; foreach (Customer customer in manager.BackedCustomers) { customerIds[count++] = customer.Id; } ICriteria criteria = Session.CreateCriteria(typeof(Customer)) .Add(Restrictions.Disjunction() .Add(Restrictions.Eq("Manager", manager)) .Add(Restrictions.In("Id", customerIds))) .SetProjection(Projections.ProjectionList() .Add(Projections.Property("Name"), "Name") .Add(Projections.Property("Id"), "Guid")) // Transform results to NameGuidDto criteria.SetResultTransformer(Transformers.AliasToBean(typeof(NameGuidDto))); return criteria.List<NameGuidDto>(); }

    Read the article

  • Learning HTML - What is the BEST ONLINE RESOURCE?

    - by Chris Jacob
    The Goal: Use votes to rank nominated sites. The first answer to reach 100+ votes will be accepted. Please answer following these 5 simple rules: ONE SITE per answer. Link to each page if nominating a "series" of resources on a SITE. No "offline" books. Only online resources (tutorials, API references, blogs, screencasts, etc). Don't add "subjective" details/notes in your answer. Add them as a comment to the answer. Don't post duplicates. If your favourite is already listed Up Vote It! Example Answer: Site Name http://www.example.com Example Answer (site with a series of resources): Site Name http://www.example.com Series Name A http://www.example.com/video/a/1 http://www.example.com/video/a/2 Series Name B http://www.example.com/video/b/1

    Read the article

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