Daily Archives

Articles indexed Friday May 7 2010

Page 28/110 | < Previous Page | 24 25 26 27 28 29 30 31 32 33 34 35  | Next Page >

  • Removing empty space with jQuery after deleting Selectable item

    - by Tx3
    I have two ordered lists and user can move items between them. I am using jQuery UI's Selectable for both of them. Problem is that when I move item from the middle of the list it leaves an empty space behind. How can I make list shrink according to the how many items is actually in the list? HTML <ol id="allUnits"> <li class="ui-state-default">Item 1</li> <li class="ui-state-default">Item 2</li> <li class="ui-state-default">Item 3</li> <li class="ui-state-default">Item 4</li> <li class="ui-state-default">Item 5</li> </ol> <input id="arrowRight" type="image" alt="Move item to right" src="<%= Url.Content("~/Content/Images/arrowRight.png")%>" /> <input id="arrowLeft" type="image" alt="Move item to left" src="<%= Url.Content("~/Content/Images/arrowLeft.png")%>" /> <ol id="productUnits"> <li class="ui-state-default">Item 1</li> <li class="ui-state-default">Item 2</li> <li class="ui-state-default">Item 3</li> <li class="ui-state-default">Item 4</li> <li class="ui-state-default">Item 5</li> </ol> jQuery $().ready(function () { $("#allUnits").selectable(); $("#productUnits").selectable(); $('#arrowRight').click(function () { return !$('#allUnits .ui-selected').remove().appendTo('#productUnits').removeClass(".ui-selected"); }); $('#arrowLeft').click(function () { return !$('#productUnits .ui-selected').remove().appendTo('#allUnits').removeClass(".ui-selected"); }); });

    Read the article

  • iPhone/Mac - C++ vector or NSMutableArray

    - by satyam
    I'm creating an application for iPhone which needs to handle large data. So, I would like to know which one will be better to use : C++ Vectors or ObjectiveC's NSMutableArray? Which one will be faster to access elements, delete elements, add elements etc. Can some one guide me please?

    Read the article

  • Does Visual Studio run Tests with a less privileged process?

    - by Filip Ekberg
    I have an application that is supposed to read from the Registry and when executing a console application my registry access works perfectly. However when I move it over to a test this returns null: var masterKey = Registry.LocalMachine.OpenSubKey("path_to_my_key"); So my question is: Does Visual Studio run Tests with a less privileged process? I tested to see what user this gave me: var x = WindowsIdentity.GetCurrent().Name; and it gives me the same as in the console application. So I am a bit confused here.

    Read the article

  • Fastest sort of fixed length 6 int array

    - by kriss
    Answering to another StackOverflow question (this one) I stumbled upon an interresting sub-problem. What is the fastest way to sort an array of 6 ints ? As the question is very low level (will be executed by a GPU): we can't assume libraries are available (and the call itself has it's cost), only plain C to avoid emptying instruction pipeline (that has a very high cost) we should probably minimize branches, jumps, and every other kind of control flow breaking (like those hidden behind sequence points in && or ||). room is constrained and minimizing registers and memory use is an issue, ideally in place sort is probably best. Really this question is a kind of Golf where the goal is not to minimize source length but execution speed. I call it 'Zening` code as used in the title of the book Zen of Code optimization by Michael Abrash and it's sequels.

    Read the article

  • zsh behaves weird in screen

    - by Nils Riedemann
    Hi there, I have zsh set up as my default shell. It works fine as long as i am not within a screen. When i start screen it looks as if some dotfiles are not loaded. For example my $PATH isn't set correctly and some directories are missing. I'm not quite sure where to start looking. Since all is fine, as long as i'm not in a screen. My dotfiles can be viewed on github. I also use oh-my-zsh — as you will notice.

    Read the article

  • trigger jQuery function after location.reload() completes

    - by raj
    I have a Rails app that allows users to login via jQuery modal form. Once logged in, I refresh the original page using location.reload(). At this point, I'm attempting to create a new jQuery dialog. How can I open the dialog only after location.reload() has finished executing? Right now the dialog is loading up before location.reload() is done. This is causing the dialog to disappear.

    Read the article

  • C++: why a self pointer of a struct automatically changes to void*

    - by Stone
    struct ptr{ int node; ptr *next; ptr(){} ptr(int _node, ptr *_next){ node=_node; next=_next; } }; struct list_t{ ptr *sht; int size; void push(int node){ size++; sht=new ptr(node,sht); } }shthead[100001], comp[200001], tree[200001]; The struct ptr is a smart pointer, be used as a linked list. But when I debug the code in gdb, I found that the ptr*'s were all converted to void*. GDB output: (gdb) pt ptr type = struct ptr { int node; void *next; public: ptr(void); ptr(int, void *); } However, I can still see the data of the struct if I covert them back to ptr* in gdb. What's the reason for this please?

    Read the article

  • subversion 1.6.x losing changes on check-in

    - by Bernard
    I'm trying to figure out if this is a known issue with SVN 1.6.x Developer A modifies a file and commits it. Developer B modifies the same file. Tries to commit it and gets told local copy out of date so does an update and then a commit. However the changes from Developer A are lost so the resulting file only contains the version that Developer B checked in. We can see this in the logs. It seems to happen when the same file is modified but in different places. Anyone else experienced this? We've had it happen 4 or 5 times in the past few weeks and we've lost a half day or so each time trying to figure out what's been lost, etc. We're starting to lose confidence in SVN. Should we be thinking of moving to GIT or Mecurial? Would that sort out this problem?

    Read the article

  • Edit problem on asp.net mvc

    - by ognjenb
    <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<MvcKVteam.Models.transporter>>" %> <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> Transporters </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <h2>Transporters</h2> <table class="data-table" id=""> <tr> <th> Id </th> <th> ContactId </th> <th> Name </th> <th> Notes </th> <th> PreferredCurrency </th> <th> PriceList </th> <th> SeviceTypeAvailible </th> <th> Contact </th> </tr> <% foreach (var item in Model) { %> <tr> <td> <%= Html.Encode(item.Id) %> </td> <td> <%= Html.Encode(item.ContactId) %> </td> <td> <%= Html.Encode(item.Name) %> </td> <td> <%= Html.Encode(item.Notes) %> </td> <td> <%= Html.Encode(item.PreferredCurrency) %> </td> <td> <%= Html.Encode(item.PriceList) %> </td> <td> <%= Html.Encode(item.SeviceTypeAvailible) %> </td> <td> <%= Html.ActionLink("View contact info", "Edit", new { id = item.ContactId }) %> </td> </tr> <% } %> </table> <p> <%= Html.ActionLink("Create New", "Create") %> </p> This action for Edit: public ActionResult Edit(int id) { var FilesQuery1 = from i in FilesEntities.contact where i.Id == id select i; return View(FilesQuery1); } When click on "View contact info" link I have this error: The model item passed into the dictionary is of type 'System.Data.Objects.ObjectQuery`1[MvcKVteam.Models.contact]', but this dictionary requires a model item of type 'MvcKVteam.Models.contact'.

    Read the article

  • Javascript "Match" Function Not Returning Proper Results in Safari or IE (but yes in FF)

    - by Jascha
    Forgive me as this is a time sensitive issue and I will have to switch the site back in a few hours so the link will be bad... but: I am simply comparing two strings looking for a match with this function... I have an array of objects called linkArray and I need to match the .src of each object to a .src I send it (the src of the clicked image). if the the src of the image I clicked matches the src of an object in my array, I set a variable to the link string of that object and return true, letting my page know that the link is available. Now, this works great in FF. But not in any other browser and I can't figure out for the life of me why. I have set up a dialogue box to literally compare, by eye, the two strings that should at the very least throw the message "match". Can anyone see what I am missing here??? here is the link... http://7thart.com/Jewish-History-and-Culture/Jews-and-Baseball-An-American-Love-Story If you click any of the thumbnails on the left, you will activate the function. Again, I apologize as after a few hours I have to switch back to the original site and this link will be invalid. Thanks in advance for your help. (function below)... function matchLink(a){ for(var i=0;i<linkArray.length;i++){ var fixLink = '../' + linkArray[i]['src']; alert(fixLink + '\n = \n' + a); if(fixLink == a){ alert('match'); newLink = linkArray[i]['link']; return true; } } return false; } Note: The "match" will return on two of the images.. the initial image, and the first thumbnail on the left. The second thumbnail SHOULD match, and the third one SHOULD NOT match.

    Read the article

  • Assembly.CodeBase: when is it no file-URI?

    - by Marc Wittke
    Assembly.Location gives a plain path to the assembly. Unfortunately this is empty when running in a shadowed environment, such as unit test or ASP.NET. Hovever, the Codebase property is available and provides a URI that can be used instead. In which cases it returns no URI starting with file:///? Or in other words: what are the cases in which this won't work or will return unusable results? Assembly assembly = GetType().Assembly; Uri codeBaseUri = new Uri(assembly.CodeBase); string path = codeBaseUri.LocalPath;

    Read the article

  • switching on and off in jquery

    - by Mac Taylor
    hey my friends i wrote a code to switch on or off the status of a story ( activate or deactivate ) this is my html part : $status_link = $active==1 ? "active.gif" : "inactive.gif"; <span id='status_link'> <a class='change_status' href='javascript:void(0)' id='$pid'> <img src='images/$status_link' class='active_status' id='$active'></a> </span> and this is my jquery code : <script type="text/javascript">$(function(){ $('.change_status').each(function(){ var pid=$(this).attr('id'); $('.active_status').each(function(){ var type=$(this).attr('id'); .click(function(){ $.post("change_status.php"+"&type="+type+"&pid="+pid, function(data){ $('#status_link').html(data).fadeIn("slow"); }); return false; }); }); </script> and a php function that is easy, i dont think its needed i myself think there is a problem with my jquery code how can i change the picture of that image by clicking on it

    Read the article

  • Protecing Code and Licencing

    - by Phil Jackson
    Hi, I have been creating a cross browser compatible ( = ie 6 + standards complaint browsers ) Online Instant Messenger What I would like to know is what licensing would I need to protect my code? how would i go about getting a license and where from? My code is in PHP, and jQuery. Regards, Phil

    Read the article

  • Can splitting .MDB files into segments help with stability?

    - by Craig Johnston
    Is this a realistic solution to the problems associated with larger .mdb files: split the large .mdb file into smaller .mdb files have one 'central' .mdb containing links to the tables in the smaller .mdb files How easy would it be to make this change to an .mdb backed VB application? Could the changes to the database be done so that there are no changes required to the front-end application?

    Read the article

  • jQuery Templates and Data Linking (and Microsoft contributing to jQuery)

    - by ScottGu
    The jQuery library has a passionate community of developers, and it is now the most widely used JavaScript library on the web today. Two years ago I announced that Microsoft would begin offering product support for jQuery, and that we’d be including it in new versions of Visual Studio going forward. By default, when you create new ASP.NET Web Forms and ASP.NET MVC projects with VS 2010 you’ll find jQuery automatically added to your project. A few weeks ago during my second keynote at the MIX 2010 conference I announced that Microsoft would also begin contributing to the jQuery project.  During the talk, John Resig -- the creator of the jQuery library and leader of the jQuery developer team – talked a little about our participation and discussed an early prototype of a new client templating API for jQuery. In this blog post, I’m going to talk a little about how my team is starting to contribute to the jQuery project, and discuss some of the specific features that we are working on such as client-side templating and data linking (data-binding). Contributing to jQuery jQuery has a fantastic developer community, and a very open way to propose suggestions and make contributions.  Microsoft is following the same process to contribute to jQuery as any other member of the community. As an example, when working with the jQuery community to improve support for templating to jQuery my team followed the following steps: We created a proposal for templating and posted the proposal to the jQuery developer forum (http://forum.jquery.com/topic/jquery-templates-proposal and http://forum.jquery.com/topic/templating-syntax ). After receiving feedback on the forums, the jQuery team created a prototype for templating and posted the prototype at the Github code repository (http://github.com/jquery/jquery-tmpl ). We iterated on the prototype, creating a new fork on Github of the templating prototype, to suggest design improvements. Several other members of the community also provided design feedback by forking the templating code. There has been an amazing amount of participation by the jQuery community in response to the original templating proposal (over 100 posts in the jQuery forum), and the design of the templating proposal has evolved significantly based on community feedback. The jQuery team is the ultimate determiner on what happens with the templating proposal – they might include it in jQuery core, or make it an official plugin, or reject it entirely.  My team is excited to be able to participate in the open source process, and make suggestions and contributions the same way as any other member of the community. jQuery Template Support Client-side templates enable jQuery developers to easily generate and render HTML UI on the client.  Templates support a simple syntax that enables either developers or designers to declaratively specify the HTML they want to generate.  Developers can then programmatically invoke the templates on the client, and pass JavaScript objects to them to make the content rendered completely data driven.  These JavaScript objects can optionally be based on data retrieved from a server. Because the jQuery templating proposal is still evolving in response to community feedback, the final version might look very different than the version below. This blog post gives you a sense of how you can try out and use templating as it exists today (you can download the prototype by the jQuery core team at http://github.com/jquery/jquery-tmpl or the latest submission from my team at http://github.com/nje/jquery-tmpl).  jQuery Client Templates You create client-side jQuery templates by embedding content within a <script type="text/html"> tag.  For example, the HTML below contains a <div> template container, as well as a client-side jQuery “contactTemplate” template (within the <script type="text/html"> element) that can be used to dynamically display a list of contacts: The {{= name }} and {{= phone }} expressions are used within the contact template above to display the names and phone numbers of “contact” objects passed to the template. We can use the template to display either an array of JavaScript objects or a single object. The JavaScript code below demonstrates how you can render a JavaScript array of “contact” object using the above template. The render() method renders the data into a string and appends the string to the “contactContainer” DIV element: When the page is loaded, the list of contacts is rendered by the template.  All of this template rendering is happening on the client-side within the browser:   Templating Commands and Conditional Display Logic The current templating proposal supports a small set of template commands - including if, else, and each statements. The number of template commands was deliberately kept small to encourage people to place more complicated logic outside of their templates. Even this small set of template commands is very useful though. Imagine, for example, that each contact can have zero or more phone numbers. The contacts could be represented by the JavaScript array below: The template below demonstrates how you can use the if and each template commands to conditionally display and loop the phone numbers for each contact: If a contact has one or more phone numbers then each of the phone numbers is displayed by iterating through the phone numbers with the each template command: The jQuery team designed the template commands so that they are extensible. If you have a need for a new template command then you can easily add new template commands to the default set of commands. Support for Client Data-Linking The ASP.NET team recently submitted another proposal and prototype to the jQuery forums (http://forum.jquery.com/topic/proposal-for-adding-data-linking-to-jquery). This proposal describes a new feature named data linking. Data Linking enables you to link a property of one object to a property of another object - so that when one property changes the other property changes.  Data linking enables you to easily keep your UI and data objects synchronized within a page. If you are familiar with the concept of data-binding then you will be familiar with data linking (in the proposal, we call the feature data linking because jQuery already includes a bind() method that has nothing to do with data-binding). Imagine, for example, that you have a page with the following HTML <input> elements: The following JavaScript code links the two INPUT elements above to the properties of a JavaScript “contact” object that has a “name” and “phone” property: When you execute this code, the value of the first INPUT element (#name) is set to the value of the contact name property, and the value of the second INPUT element (#phone) is set to the value of the contact phone property. The properties of the contact object and the properties of the INPUT elements are also linked – so that changes to one are also reflected in the other. Because the contact object is linked to the INPUT element, when you request the page, the values of the contact properties are displayed: More interesting, the values of the linked INPUT elements will change automatically whenever you update the properties of the contact object they are linked to. For example, we could programmatically modify the properties of the “contact” object using the jQuery attr() method like below: Because our two INPUT elements are linked to the “contact” object, the INPUT element values will be updated automatically (without us having to write any code to modify the UI elements): Note that we updated the contact object above using the jQuery attr() method. In order for data linking to work, you must use jQuery methods to modify the property values. Two Way Linking The linkBoth() method enables two-way data linking. The contact object and INPUT elements are linked in both directions. When you modify the value of the INPUT element, the contact object is also updated automatically. For example, the following code adds a client-side JavaScript click handler to an HTML button element. When you click the button, the property values of the contact object are displayed using an alert() dialog: The following demonstrates what happens when you change the value of the Name INPUT element and click the Save button. Notice that the name property of the “contact” object that the INPUT element was linked to was updated automatically: The above example is obviously trivially simple.  Instead of displaying the new values of the contact object with a JavaScript alert, you can imagine instead calling a web-service to save the object to a database. The benefit of data linking is that it enables you to focus on your data and frees you from the mechanics of keeping your UI and data in sync. Converters The current data linking proposal also supports a feature called converters. A converter enables you to easily convert the value of a property during data linking. For example, imagine that you want to represent phone numbers in a standard way with the “contact” object phone property. In particular, you don’t want to include special characters such as ()- in the phone number - instead you only want digits and nothing else. In that case, you can wire-up a converter to convert the value of an INPUT element into this format using the code below: Notice above how a converter function is being passed to the linkFrom() method used to link the phone property of the “contact” object with the value of the phone INPUT element. This convertor function strips any non-numeric characters from the INPUT element before updating the phone property.  Now, if you enter the phone number (206) 555-9999 into the phone input field then the value 2065559999 is assigned to the phone property of the contact object: You can also use a converter in the opposite direction also. For example, you can apply a standard phone format string when displaying a phone number from a phone property. Combining Templating and Data Linking Our goal in submitting these two proposals for templating and data linking is to make it easier to work with data when building websites and applications with jQuery. Templating makes it easier to display a list of database records retrieved from a database through an Ajax call. Data linking makes it easier to keep the data and user interface in sync for update scenarios. Currently, we are working on an extension of the data linking proposal to support declarative data linking. We want to make it easy to take advantage of data linking when using a template to display data. For example, imagine that you are using the following template to display an array of product objects: Notice the {{link name}} and {{link price}} expressions. These expressions enable declarative data linking between the SPAN elements and properties of the product objects. The current jQuery templating prototype supports extending its syntax with custom template commands. In this case, we are extending the default templating syntax with a custom template command named “link”. The benefit of using data linking with the above template is that the SPAN elements will be automatically updated whenever the underlying “product” data is updated.  Declarative data linking also makes it easier to create edit and insert forms. For example, you could create a form for editing a product by using declarative data linking like this: Whenever you change the value of the INPUT elements in a template that uses declarative data linking, the underlying JavaScript data object is automatically updated. Instead of needing to write code to scrape the HTML form to get updated values, you can instead work with the underlying data directly – making your client-side code much cleaner and simpler. Downloading Working Code Examples of the Above Scenarios You can download this .zip file to get with working code examples of the above scenarios.  The .zip file includes 4 static HTML page: Listing1_Templating.htm – Illustrates basic templating. Listing2_TemplatingConditionals.htm – Illustrates templating with the use of the if and each template commands. Listing3_DataLinking.htm – Illustrates data linking. Listing4_Converters.htm – Illustrates using a converter with data linking. You can un-zip the file to the file-system and then run each page to see the concepts in action. Summary We are excited to be able to begin participating within the open-source jQuery project.  We’ve received lots of encouraging feedback in response to our first two proposals, and we will continue to actively contribute going forward.  These features will hopefully make it easier for all developers (including ASP.NET developers) to build great Ajax applications. Hope this helps, Scott P.S. [In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu]

    Read the article

  • Le Viewer de Microsoft Powerpoint 2010 est disponible gratuitement

    Bonjour, Comme vous le savez, à chaque nouvelle version d'Office, Powerpoint intègre de nouvelles fonctionnalités. Afin que vos contacts puisse consulter vos présentations dans les meilleures conditions, deux solutions : Ils doivent faire l'aquisition d'Office 2010 dont la commercialisation pour les particuliers est prévue dans quelques jours Ils doivent téléecharger et utiliser le Viewer Powerpoint 2010 disponible gratuitement sur le site de Microsoft. Ce logiciel permet de lire n'importe quel document Powerpoint pouvant contenir les dernières nouveautés telles queles effets de transi...

    Read the article

  • C# and com for vb6

    - by Jim
    Hi all I have an issue with C# and COM. :( [Guid("f7d936ba-d816-48d2-9bfc-c18be6873b4d")] [ComVisible(true)] [ClassInterface(ClassInterfaceType.None)] public class Process : IProcess { public Process() { } public int UpdateBalance(string accountNumber, string adminEventDescription, decimal curAmount) { return 10; } } [ComVisible(true)] [Guid("5c640a0f-0dce-47d4-87df-07cee3b9a1f9")] [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface IProcess { int UpdateBalance(string accountNumber, string adminEventDescription, decimal curAmount); } And the VB code Private Sub Command1_Click() Dim test As Object Set test = New Forwardslash_PlayerTrackingSystem_Api.Process End Sub I get the following ActiveX component can't create object?

    Read the article

  • Cakephp database migration error

    - by Vijay Kumbhar
    Hello All, I am using Ubuntu + cakephp 1.3. I am trying the database migration with the help of cakeDC migration plugin. I configured the plugin as per the instructions. But when i goes to the terminal, goes to the path of the application application_path/app/ dir then fire a command 'cake migration help' it gives me following error, Hello user, Welcome to CakePHP v1.2 Console Current Paths: -working: /path/to/cake/ -root: /path/to/cake/ -app: /path/to/cake/app/ -core: /path/to/cake/ Changing Paths: your working path should be the same as your application path to change your path use the '-app' param. Example: -app relative/path/to/myapp or -app /absolute/path/to/myapp Available Shells: app/vendors/shells/: - none vendors/shells/: - none cake/console/libs/: acl api bake console extract To run a command, type 'cake shell_name [args]' To get help on a specific command, type 'cake shell_name help' Then i followed the steps given in the : http://book.cakephp.org/view/108/The-CakePHP-Console $ cake -app /path/to/app But i am not getting the success. Can anybody help me out from this issue... Thanks in adavnce.

    Read the article

  • The remote server returned an error: (401) Unauthorized.

    - by Zaidman
    Hi I'm trying to get the html code of certain webpage, I have a username and a password that are correct but i still can't get it to work, this is my code: private void buttondownloadfile_Click(object sender, EventArgs e) { NetworkCredentials nc = new NetworkCredentials("?", "?", "http://cdrs.globalpopsvoip.com/0000069/20091229/20091228_20091228.CDR"); WebClient client = new WebClient(); client.Credentials = nc; String htmlCode = client.DownloadString("http://cdrs.globalpopsvoip.com/0000069/20091229/20091228_20091228.CDR"); MessageBox.Show(htmlCode); } The MessageBox is just to test it, the problem is that every time I get to this line: String htmlCode = client.DownloadString("http://cdrs.globalpopsvoip.com/0000069/20091229/20091228_20091228.CDR"); I get an exception: The remote server returned an error: (401) Unauthorized. How do I fix this?

    Read the article

  • do you call them functions, procedures or methods?

    - by lowlyintern
    consider a standard c# 'function' public void foo() { //some code } In c or c++ this is called a 'function' - even if taking no parameters and returning no value. In another language maybe it would be a 'procedure'. In object orientation speak it would be called a 'method' if a class member. What would be the correct term to use in c#?

    Read the article

< Previous Page | 24 25 26 27 28 29 30 31 32 33 34 35  | Next Page >