Search Results

Search found 2462 results on 99 pages for 'workaround'.

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

  • PHP pathinfo gets fooled by url in quert string. Any workaround?

    - by Majid
    I am working on a small function to take in a url and return a relative path based on where it resides itself. If the url contains a path in the query string, pathinfo returns incorrect results. This is demonstrated by the code below: $p = 'http://localhost/demos/image_editor/dir_adjuster.php?u=http://localhost/demos/some/dir/afile.txt'; $my_path_info = pathinfo($p); echo $p . '<br/><pre>'; print_r($my_path_info); echo '</pre>'; That code outputs: http://localhost/demos/image_editor/dir_adjuster.php?u=http://localhost/demos/some/dir/afile.txt Array ( [dirname] => http://localhost/demos/image_editor/dir_adjuster.php?u=http://localhost/demos/some/dir [basename] => afile.txt [extension] => txt [filename] => afile ) Which obviously is wrong. Any workaround?

    Read the article

  • Workaround for Outlook 2007 for wrapping text around image with margin?

    - by DavidW
    As we all know, Outlook 2007 uses the Word 2007 rendering engine, causing endless grief when designing HTML email message. [Insert rant here] In particular, float, margin, and padding are - shall we say? - poorly supported. To simulate float so that text wraps around an image, apparently we can simply use: <img src="foo.png" align="right"> The issue is padding/margin. Without padding/margin, the wrapped text butts up against the image which looks goofy. One workaround is to edit the image and add transparent framing that simulates margin. Does anyone know any other workarounds?

    Read the article

  • MySQL triggers cannot update rows in same table the trigger is assigned to. Suggested workaround?

    - by Cory House
    MySQL doesn't currently support updating rows in the same table the trigger is assigned to since the call could become recursive. Does anyone have suggestions on a good workaround/alternative? Right now my plan is to call a stored procedure that performs the logic I really wanted in a trigger, but I'd love to hear how others have gotten around this limitation. Edit: A little more background as requested. I have a table that stores product attribute assignments. When a new parent product record is inserted, I'd like the trigger to perform a corresponding insert in the same table for each child record. This denormalization is necessary for performance. MySQL doesn't support this and throws: Can't update table 'mytable' in stored function/trigger because it is already used by statement which invoked this stored function/trigger. A long discussion on the issue on the MySQL forums basically lead to: Use a stored proc, which is what I went with for now. Thanks in advance!

    Read the article

  • How to push oath token to LocalStorage or LocalSession and listen to the Storage Event? (SoundCloud Php/JS bug workaround)

    - by afxjzs
    This references this issue: Javascript SDK connect() function not working in chrome I asked for more information on how to resolve with localstorage and was asked to create a new topic. The answer was "A workaround is instead of using window.opener, push the oauth token into LocalStorage or SessionStorage and have the opener window listen to the Storage event." but i have no idea how to do that. It seems really simple, but i don't know where to start. I couldn't find an relevant examples. thanks for your help!

    Read the article

  • "Use windows xp style dpi scaling" disables automatic auto-hide of taskbar on W7. Workaround?

    - by Pelle
    We noticed that on W7 with DPI set to 125% or to 100% with ("Use windows xp style dpi scaling") turned off, our fullscreen mode (which sets the client rect of our window = desktop rect of the main monitor) no longer hides the task bar like it does for other settings. (The setting can be found in the Control Panel\Appearance and Personalization\Display section after clicking on the "Set custom text size (DPI)" link) I found the following interesting article: http://www.mathies.com/weblog/?p=908 So I set out to try to work around the bug in other means than manually hiding/restoring the taskbar visibility but so far I've failed and currently believe it's a bug in W7 (and possibly vista). The following applications also fail to work properly in fullscreen mode (the taskbar is still visible): * Microsoft Visual Studio 2008 * Microsoft Word 2007 * Adobe Reader 9.1.3 These apps work (probably by hiding the task bar through the WIN32 API): * Powerpoint Slide Show I also tried creating a brand new MFC-based app and use its "SetFullScreenMode()" functionality but it fails in the same way as all other apps on the list. Does anyone know of a workaround? Thanks, Per

    Read the article

  • Have a workaround for the 1,000 file limit in a directory on windows mobile 5?

    - by nateday76
    I need to download more than 1,000 files into a windows mobile 5 directory located on the storage card. If i copy the files onto the storage card via my desktop there is no problem. But when i try to download the files from the handheld device I get a disk full error, even though there is plenty of room due to the 1,000 file limit. Has anyone run into this and found a workaround? I'm going to try zipping all of the files then decompressing on the device but not sure that this will work.

    Read the article

  • Accidentally Removed Permissions for the XP SP3 Registry key HKEY_CLASSES_ROOT! Workaround Please!

    - by Praveen Kumar
    This is Praveen and I am using Microsoft Windows XP SP3 Build 2600. I had problems with using Microsoft Office 2010. It was keeping on saying, "Please wait while windows configures Microsoft Office Professional Plus 2010". After seeing this link: http://social.answers.microsoft.com/Forums/en-US/outlookcontact/thread/6e9c3f2e-010a-4b74-b433-0c41548ee468?prof=required I thought of giving the Registry Key: HKEY_CLASSES_ROOT, full access permissions for Everyone. I went to the registry, right-clicked on HKEY_CLASSES_ROOT and clicked on Permissions. I added Everyone and gave Full Control to the ACL and clicked on Apply. Also I checked "Replace permission entries on all child objects with entries shown here that apply to child objects." After a long time, it said with an error, cannot replace for few entries. Now, the key, HKEY_CLASSES_ROOT has no access to any user. My system is not starting up. Some of my friends asked me to try the Last Known Good Configuration. Even that did not work out. When I tried to open in the Safe Mode, I got only one driver to load and even that didn't load well. Another friend suggested me to put the Setup disk and reinstall the OS. I tried that and after completing the "Installing Device Drivers" part, when it started "Installing Network", the system is getting restarted. Now, the setup is also half way through and even if I open in Safe Mode to try System Restore, it popped up a message saying, "Setup cannot run under Safe Mode. Setup will restart now." and the system is restarting. All my official files and my software, which I developed for Registry Security, resides in my system now. I am unable to access the system and I want it to be working to submit the project, as the deadline is this week. I had no better solutions from elsewhere. Can anyone please help me out with this issue. If it is possible to open the registry editor's stored file from another system and restore the access permissions, I hope it would solve the problem. Please do help me. Thanking You, Praveen.

    Read the article

  • how to workaround glassfish 3.0.1 admin page slow startup?

    - by black sensei
    I've installed netbeans which comes with glassfish. i just got a book about glassfish and i wanted to try.the first surprise is the time it took to the admin page to load. i've found on serverfault and by googling that the server is making call to external resource on the network on online (not sure about that). but the adding of the java options didn't speed up the loading of the admin page. how to work around it? i've heard so good about glassfish that this leaves me perplexed. thanks for reading and for helping.

    Read the article

  • Having trouble with a workaround, for booting from a usb stick, using grub and a minimal linux kernel to load usb drivers

    - by s hanley
    I'm trying to boot from a usb stick. I formatted it to fat32, and later to ext2, and installed dsl on it using unetbootin, and later the usb install guide on dsl wiki (http://www.damnsmalllinux.org/wiki/index.php/Install_to_USB_From_within_Linux). The bios doesn't have a setting for booting from usb. Grub doesn't "see" the usb drive when I use the root and find commands, explained in (http://www.damnsmalllinux.org/wiki/index.php/USB_Booting). This happens even when I set boot from floppy at the top of the boot order. However, my usb keyboard is recognised by the bios and by grub. How can it recognise the keyboard but not the usb drive? Also, the usb led does flash even before grub starts up, so surely something must be happening usb-wise? I am now following an ubuntu guide to booting from a USB stick, using a hdd-based, minimal linux kernel to supply the usb drivers. But I'm having difficulty adapting it to other OSes (slax/dsl/aptosid). I believe I have to alter the initrd.gz file to include usb drivers and then copy that file along with vmlinuz to a partition on my hdd. But, what's the grub command for the kernel line supposed to look like? From the ubuntu example it's: title USB FLASH DRIVE root (hd0,6) kernel /boot/usb-boot/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper noprompt cdrom-detect/try-usb=true persistent initrd /boot/usb-boot/initrd.lz boot Should mine just be: title USB FLASH DRIVE root (hd0,6) kernel /boot/usb-boot/vmlinuz cdrom-detect/try-usb=true initrd /boot/usb-boot/initrd.lz boot

    Read the article

  • Cannot "add to address book" in thunderbird on mac. Know a workaround?

    - by Arthur
    Runing TB 24.5.0 on Mac 10.8.5. I configure TB so that File-"Use Mac OS X Address Book" is not selected. Can open Address Book and see addresses in "COllected Addresses" & create New contact there. But in TB cannot "add to address book". I click on star to right of email address or ctrl-click correspondent and "add to address book". Nothing happens. But correspondent should be added to (some) address book. This is a major inconvenience because I use the address book to distinguish between junk mail from people who I do not know and good mail from people who I do know. Currently the only way for me to add anybody to the address book is to do so by hand, one at a time in "collected addresses". I welcome any work around that would let me add somebody to an address book with a single click. Thanks

    Read the article

  • Is there a postfix mysql virtual_maps append_at_origin workaround so I can pipe to external scripts?

    - by FilmJ
    I am using virtual domains, and I'd like to setup the server to alias to custom scripts. I manage all accounts using postfix mappings to mysql. It seems that postfix automatically appends a virtual domain regardless of how the forwarded/aliased result comes back. So even though i have: "|/bin/command" postfix is reading it as: "|/bin/command"@mydomain.com Is there any work-around, or setting I can fix? It would seem than append_at_myorigin=no would be ideal, but that's unsupported according to the documentation. Another option, maybe I can skip virtual aliases altogether and use the "/etc/postfix/aliases" table - assuming all emails go to the main domain. I'll try this, but if anyone has any other ideas how to make it work with virtual domains, please let me know as this would be very useful! Thanks.

    Read the article

  • How to workaround Python "WindowsError messages are not properly encoded" problem?

    - by Victor Lin
    It's a trouble when Python raised a WindowsError, the encoding of message of the exception is always os-native-encoded. For example: import os os.remove('does_not_exist.file') Well, here we get an exception: Traceback (most recent call last): File "<stdin>", line 1, in <module> WindowsError: [Error 2] ???????????: 'does_not_exist.file' As the language of my Windows7 is Traditional Chinese, the default error message I get is in big5 encoding (as know as CP950). >>> try: ... os.remove('abc.file') ... except WindowsError, value: ... print value.args ... (2, '\xa8t\xb2\xce\xa7\xe4\xa4\xa3\xa8\xec\xab\xfc\xa9w\xaa\xba\xc0\xc9\xae\xd7\xa1C') >>> As you see here, error message is not Unicode, then I will get another encoding exception when I try to print it out. Here is the issue, it can be found in Python issue list: http://bugs.python.org/issue1754 The question is, how to workaround this? How to get the native encoding of WindowsError? The version of Python I use is 2.6. Thanks.

    Read the article

  • WPF PasswordBox Input Panel Icon Not Appearing: Better Workaround?

    - by Anna Savarin
    Hello, There is a known issue in WPF where the Input Panel icon does not appear when you set focus on a PasswordBox control. I'm in need of a workaround for this, but the one suggested -- using the ITextInputPanel API -- does not quite cut it for me. Fist of all, the API works with Windows Forms controls and alternatively accepts control handles. Since WPF controls are not handle based, and they are not Forms controls, this is not quite suitable. I tried hosting a Forms control on my WPF page and that worked on the Windows XP Tabled PC (albeit with some COM exceptions) but, since there is no PasswordBox in Forms, I had to stick with a regular textbox, which is not what I need. Alternatively, using the VisualTreeHelper to get a handle on the control did not work, either. The API, according to http://msdn.microsoft.com/en-us/library/ms699559%28VS.85%29.aspx, is only compatible with Vista. I'm dealing with Windows XP tablets. I understand that the IPenInput API can be used as an alternative, but it is now deprecated. Can someone please suggest something? I really need to fix this issue. Thanks in advance!

    Read the article

  • Ruby hpricot does not like dash in symbol, is there a workaround?

    - by eakkas
    I am trying to parse an xml file with hpricot. The xml element that I am trying to get has a dash though and hence the issue that I am facing xml <xliff xmlns="urn:oasis:names:tc:xliff:document:1.1" version="1.1"> <trans-unit> <source>"%0" can not be found. Please try again.</source> <target>"%0" can not be found. Please try again.</target> </trans-unit> </xliff> rb def read_in_xliff(xlf_file_name) stream = open(xlf_file_name) {|f| Hpricot(f)} (stream/:xliff/:'trans-unit').each do |transunit| .......... This does not work because of the dash. If I rename the tag to transunit and edit the symbol reference accordingly everything seems to be fine. I thought using the symbol between quotes should work but hpricot does not seem to like this. Can anyone think of a workaround? Thanks in advance

    Read the article

  • Is there a workaround for Linux mono's refusal to acknowledge that I have resized the columns of my

    - by fantius
    When I resize a column, it does not redraw the data with the updated alignment. I've tried Invalidating, Refreshing, and a few other things. Nothing has worked. Does anyone know a workaround? I have not tried this in mono for Windows. To see what I mean, drop this control on a form, and run it in mono for Linux: using System; using System.Collections.Generic; using System.Text; using System.Windows.Forms; using System.Drawing; class MyListView : ListView { private readonly List<ListViewItem> items_ = new List<ListViewItem>(); public MyListView() { VirtualMode = true; Columns.Add("Col 1"); Columns.Add("Col 2"); Columns.Add("Col 3"); Add(new ListViewItem(new[] { "a", "b", "c" })); Add(new ListViewItem(new[] { "a", "b", "c" })); Add(new ListViewItem(new[] { "a", "b", "c" })); Add(new ListViewItem(new[] { "a", "b", "c" })); Add(new ListViewItem(new[] { "a", "b", "c" })); } protected override void OnRetrieveVirtualItem(RetrieveVirtualItemEventArgs e) { e.Item = items_[e.ItemIndex]; base.OnRetrieveVirtualItem(e); } public void Add(ListViewItem item) { items_.Add(item); VirtualListSize = items_.Count; } protected override void OnDrawColumnHeader(DrawListViewColumnHeaderEventArgs e) { e.DrawText(); base.OnDrawColumnHeader(e); } protected override void OnDrawSubItem(DrawListViewSubItemEventArgs e) { var text = ((ListViewItem.ListViewSubItem)e.SubItem).Text; using (var brush = new SolidBrush(e.SubItem.ForeColor)) { e.Graphics.DrawString(text, Font, brush, e.Bounds); } base.OnDrawSubItem(e); } protected override void OnColumnWidthChanged(ColumnWidthChangedEventArgs e) { base.OnColumnWidthChanged(e); Invalidate(true); // Nope, that didn't work Refresh(); // Nope, that didn't work } }

    Read the article

  • What features are heavily used in C# 2.0, but is not available in VBNET 2.0, and how to workaround?

    - by Will Marcouiller
    I don't want a war between VBNET and C# developpers, neither is my goal to open a C# VS VBNET confrontation. I would like you all to list a feature that is heavily used in C#, but is not available in VBNET 2.0, and how would you work around to achieve a similar behaviour or purpose? For example: C# Accepts void (return) lambda expressions. Here's an example with FNH mapping: Component(x => x.Address, m => { m.Map(x => x.Number); m.Map(x => x.Street); m.Map(x => x.PostCode); }); This is impossible to do before VBNET 4.0 (supposed to be doable in VBNET 4.0) VBNET Must write a helping method (Sub), and provide the AddressOf this method in order to workaround. Private Sub Helper(ByVal m As MType) m.Map(Function(x) x.Number) m.Map(Function(x) x.Street) m.Map(Function(x) x.PostCode) End Sub ... Component(Function(x) x.Address, AddressOf Helper) Now I know, it is not VBNET 2.0, but this is an example. VBNET 3.0 and 3.5 can used too. Please just mention what version of VBNET this refers to.

    Read the article

  • SVG rotation animation having problems on chrome for jelly bean, is there a workaround?

    - by Metalskin
    I've got a strange problem with chrome on jellybean running svg animations triggered from javascript. This JSFiddle example works fine on chrome and firefox on linux, but when I run it on android with chrome I get the final step of the animation painted at the beginning of the animation. I've tried this on both an Nexus 7 and Transformer Prime, they both have the problem. I've tested using firefox on the android devices and the problem doesn't exist. So I'm presuming that it's a defect with chrome. However I've seen other animations using svg that do not have this problem in chrome on jellybean. Is anyone aware of a way to get around this problem, or is there something that I'm doing in my animation/js that is a possible cause of the problem? I've now created a bug report at code.google.com, however I still need a workaround, if anyone can help me (or in case I'm doing something stupid). I've now discovered that this is reproducible on chrome for linux (and I suspect windows). If you click on the button to start the animation before the previous animation has completed then the problem occurs. In this case the hand is drawn at the end of the 45 degree sweep before it starts the sweep. I now suspect that I should be calling something to stop the animation before I change the animation. Anyway, hopefully someone can resolve this problem.

    Read the article

  • Element.appendChild() hosed in IE .. workaround? (related to innerText vs textContent)

    - by Rowe Morehouse
    I've heard that using el.innerText||el.textContent can yield unreliable cross-browswer results, so I'm walking the DOM tree to collect text nodes recursively, and write them into tags in the HTML body. What this script does is read hash substring valus from the window.location and write them into the HTML. This script is working for me in Chrome & Firefox, but choking in IE. I call the page with an URL syntax like this: http://example.com/pagename.html#dyntext=FOO&dynterm=BAR&dynimage=FRED UPDATE UPDATE UPDATE Solution: I moved the scripts to before </body> (where they should have been) then removed console.log(sPageURL); and now it's working in Chrome, Firefox, IE8 and IE9. This my workaround for the innerText vs textContent crossbrowser issue when you are just placing text rather than getting text. In this case, getting hash substring values from the window.location and writing them into the page. <html> <body> <span id="dyntext-span" style="font-weight: bold;"></span><br /> <span id="dynterm-span" style="font-style: italic;"></span><br /> <span id="dynimage-span" style="text-decoration: underline;"></span><br /> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script> <script> $(document).ready(function() { var tags = ["dyntext", "dynterm", "dynimage"]; for (var i = 0; i < tags.length; ++i) { var param = GetURLParameter(tags[i]); if (param) { var dyntext = GetURLParameter('dyntext'); var dynterm = GetURLParameter('dynterm'); var dynimage = GetURLParameter('dynimage'); } } var elem = document.getElementById("dyntext-span"); var text = document.createTextNode(dyntext); elem.appendChild(text); var elem = document.getElementById("dynterm-span"); var text = document.createTextNode(dynterm); elem.appendChild(text); var elem = document.getElementById("dynimage-span"); var text = document.createTextNode(dynimage); elem.appendChild(text); }); function GetURLParameter(sParam) { var sPageURL = window.location.hash.substring(1); var sURLVariables = sPageURL.split('&'); for (var i = 0; i < sURLVariables.length; i++) { var sParameterName = sURLVariables[i].split('='); if (sParameterName[0] == sParam) { return sParameterName[1]; } } } </script> </body> </html> FINAL UPDATE If your hash substring values require spaces (like a linguistic phrase with three words, for example) then separate the words with the + character in your URI, and replace the unicode \u002B character with a space when you create each text node, like this: var elem = document.getElementById("dyntext-span"); var text = document.createTextNode(dyntext.replace(/\u002B/g, " ")); elem.appendChild(text); var elem = document.getElementById("dynterm-span"); var text = document.createTextNode(dynterm.replace(/\u002B/g, " ")); elem.appendChild(text); var elem = document.getElementById("dynimage-span"); var text = document.createTextNode(dynimage.replace(/\u002B/g, " ")); elem.appendChild(text); Now form your URI like this: http://example.com/pagename.html#dyntext=FOO+MAN+CHU&dynterm=BAR+HOPPING&dynimage=FRED+IS+DEAD

    Read the article

  • Looking for a workaround for IE 6/7 "Unspecified Error" bug when accessing offsetParent; using ASP.N

    - by CodeChef
    I'm using jQuery UI's draggable and droppable libraries in a simple ASP.NET proof of concept application. This page uses the ASP.NET AJAX UpdatePanel to do partial page updates. The page allows a user to drop an item into a trashcan div, which will invoke a postback that deletes a record from the database, then rebinds the list (and other controls) that the item was drug from. All of these elements (the draggable items and the trashcan div) are inside an ASP.NET UpdatePanel. Here is the dragging and dropping initialization script: function initDragging() { $(".person").draggable({helper:'clone'}); $("#trashcan").droppable({ accept: '.person', tolerance: 'pointer', hoverClass: 'trashcan-hover', activeClass: 'trashcan-active', drop: onTrashCanned }); } $(document).ready(function(){ initDragging(); var prm = Sys.WebForms.PageRequestManager.getInstance(); prm.add_endRequest(function() { initDragging(); }); }); function onTrashCanned(e,ui) { var id = $('input[id$=hidID]', ui.draggable).val(); if (id != undefined) { $('#hidTrashcanID').val(id); __doPostBack('btnTrashcan',''); } } When the page posts back, partially updating the UpdatePanel's content, I rebind the draggables and droppables. When I then grab a draggable with my cursor, I get an "htmlfile: Unspecified error." exception. I can resolve this problem in the jQuery library by replacing elem.offsetParent with calls to this function that I wrote: function IESafeOffsetParent(elem) { try { return elem.offsetParent; } catch(e) { return document.body; } } I also have to avoid calls to elem.getBoundingClientRect() as it throws the same error. For those interested, I only had to make these changes in the jQuery.fn.offset function in the Dimensions Plugin. My questions are: Although this works, are there better ways (cleaner; better performance; without having to modify the jQuery library) to solve this problem? If not, what's the best way to manage keeping my changes in sync when I update the jQuery libraries in the future? For, example can I extend the library somewhere other than just inline in the files that I download from the jQuery website. Update: @some It's not publicly accessible, but I will see if SO will let me post the relevant code into this answer. Just create an ASP.NET Web Application (name it DragAndDrop) and create these files. Don't forget to set Complex.aspx as your start page. You'll also need to download the jQuery UI drag and drop plug in as well as jQuery core Complex.aspx <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Complex.aspx.cs" Inherits="DragAndDrop.Complex" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> <script src="jquery-1.2.6.min.js" type="text/javascript"></script> <script src="jquery-ui-personalized-1.5.3.min.js" type="text/javascript"></script> <script type="text/javascript"> function initDragging() { $(".person").draggable({helper:'clone'}); $("#trashcan").droppable({ accept: '.person', tolerance: 'pointer', hoverClass: 'trashcan-hover', activeClass: 'trashcan-active', drop: onTrashCanned }); } $(document).ready(function(){ initDragging(); var prm = Sys.WebForms.PageRequestManager.getInstance(); prm.add_endRequest(function() { initDragging(); }); }); function onTrashCanned(e,ui) { var id = $('input[id$=hidID]', ui.draggable).val(); if (id != undefined) { $('#hidTrashcanID').val(id); __doPostBack('btnTrashcan',''); } } </script> </head> <body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <div> <asp:UpdatePanel ID="updContent" runat="server" UpdateMode="Always"> <ContentTemplate> <asp:LinkButton ID="btnTrashcan" Text="trashcan" runat="server" CommandName="trashcan" onclick="btnTrashcan_Click" style="display:none;"></asp:LinkButton> <input type="hidden" id="hidTrashcanID" runat="server" /> <asp:Button ID="Button1" runat="server" Text="Save" onclick="Button1_Click" /> <table> <tr> <td style="width: 300px;"> <asp:DataList ID="lstAllPeople" runat="server" DataSourceID="odsAllPeople" DataKeyField="ID"> <ItemTemplate> <div class="person"> <asp:HiddenField ID="hidID" runat="server" Value='<%# Eval("ID") %>' /> Name: <asp:Label ID="lblName" runat="server" Text='<%# Eval("Name") %>' /> <br /> <br /> </div> </ItemTemplate> </asp:DataList> <asp:ObjectDataSource ID="odsAllPeople" runat="server" SelectMethod="SelectAllPeople" TypeName="DragAndDrop.Complex+DataAccess" onselecting="odsAllPeople_Selecting"> <SelectParameters> <asp:Parameter Name="filter" Type="Object" /> </SelectParameters> </asp:ObjectDataSource> </td> <td style="width: 300px;vertical-align:top;"> <div id="trashcan"> drop here to delete </div> <asp:DataList ID="lstPeopleToDelete" runat="server" DataSourceID="odsPeopleToDelete"> <ItemTemplate> ID: <asp:Label ID="IDLabel" runat="server" Text='<%# Eval("ID") %>' /> <br /> Name: <asp:Label ID="NameLabel" runat="server" Text='<%# Eval("Name") %>' /> <br /> <br /> </ItemTemplate> </asp:DataList> <asp:ObjectDataSource ID="odsPeopleToDelete" runat="server" onselecting="odsPeopleToDelete_Selecting" SelectMethod="GetDeleteList" TypeName="DragAndDrop.Complex+DataAccess"> <SelectParameters> <asp:Parameter Name="list" Type="Object" /> </SelectParameters> </asp:ObjectDataSource> </td> </tr> </table> </ContentTemplate> </asp:UpdatePanel> </div> </form> </body> </html> Complex.aspx.cs namespace DragAndDrop { public partial class Complex : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected List<int> DeleteList { get { if (ViewState["dl"] == null) { List<int> dl = new List<int>(); ViewState["dl"] = dl; return dl; } else { return (List<int>)ViewState["dl"]; } } } public class DataAccess { public IEnumerable<Person> SelectAllPeople(IEnumerable<int> filter) { return Database.SelectAll().Where(p => !filter.Contains(p.ID)); } public IEnumerable<Person> GetDeleteList(IEnumerable<int> list) { return Database.SelectAll().Where(p => list.Contains(p.ID)); } } protected void odsAllPeople_Selecting(object sender, ObjectDataSourceSelectingEventArgs e) { e.InputParameters["filter"] = this.DeleteList; } protected void odsPeopleToDelete_Selecting(object sender, ObjectDataSourceSelectingEventArgs e) { e.InputParameters["list"] = this.DeleteList; } protected void Button1_Click(object sender, EventArgs e) { foreach (int id in DeleteList) { Database.DeletePerson(id); } DeleteList.Clear(); lstAllPeople.DataBind(); lstPeopleToDelete.DataBind(); } protected void btnTrashcan_Click(object sender, EventArgs e) { int id = int.Parse(hidTrashcanID.Value); DeleteList.Add(id); lstAllPeople.DataBind(); lstPeopleToDelete.DataBind(); } } } Database.cs namespace DragAndDrop { public static class Database { private static Dictionary<int, Person> _people = new Dictionary<int,Person>(); static Database() { Person[] people = new Person[] { new Person("Chad") , new Person("Carrie") , new Person("Richard") , new Person("Ron") }; foreach (Person p in people) { _people.Add(p.ID, p); } } public static IEnumerable<Person> SelectAll() { return _people.Values; } public static void DeletePerson(int id) { if (_people.ContainsKey(id)) { _people.Remove(id); } } public static Person CreatePerson(string name) { Person p = new Person(name); _people.Add(p.ID, p); return p; } } public class Person { private static int _curID = 1; public int ID { get; set; } public string Name { get; set; } public Person() { ID = _curID++; } public Person(string name) : this() { Name = name; } } }

    Read the article

  • groovyx.net.ws.WSClient is having problems with ''soapenc:Array' Any workaround?

    - by ?????
    I'm trying to call a webservice (implemented with a .NET/ASP system) from groovy/grails using WSClient. I have no trouble accessing this service using the SOAPClient debugger (Todd Ditchendorf's program for OSX), but when i try it via groovy/grails, I get the error undefined simple or complex type 'soapenc:Array' Is there any solution? Looking at it with wireshark: It seems to have thrown this error even before it gets a chance to perform the transaction. The error is thrown right after WSClient has downloaded the second of two schemas referenced in he WSDL.

    Read the article

  • What are the security implications of making a clientaccesspolicy proxy workaround?

    - by Edward Tanguay
    I wanted to use a published GoogleDocs document as the datasource of a Silverlight application but ran into clientaccesspolicy issues. I read many articles like this and this about how difficult it is to get around the clientaccesspolicy issue. So I wrote this 15-line CURL script and put it on my PHP site and now I can get the text of any GoogleDocs document and any text from any URL into my Silverlight application: <?php $url = filter_input(INPUT_GET, 'url',FILTER_SANITIZE_STRING); $user_agent = 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)'; $ch = curl_init(); curl_setopt($ch, CURLOPT_COOKIEJAR, "/tmp/cookie"); curl_setopt($ch, CURLOPT_COOKIEFILE, "/tmp/cookie"); curl_setopt($ch, CURLOPT_URL, $url ); // set url to post to curl_setopt($ch, CURLOPT_FAILONERROR, 1); // Fail on errors curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0); // allow redirects curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable curl_setopt($ch, CURLOPT_TIMEOUT, 15); curl_setopt($ch, CURLOPT_USERAGENT, $user_agent); curl_setopt($ch, CURLOPT_VERBOSE, 0); echo curl_exec($ch); ?> So it makes me wonder: Why is there so much discussion about whether or not URLs support clientaccesspolicy or not, since you just have to write a simple proxy script and get the information through it? Why aren't there services, e.g. like the URL shortening services, which supply this functionality? What are the security implications of having a script like this?

    Read the article

  • jquery ajax request is Forbidden in FF 3.6.2 and IE. How to fix (any workaround)?

    - by 1gn1ter
    <script type="text/javascript"> $(function () { $("select#oblast").change(function () { var oblast_id = $("#oblast > option:selected").attr("value"); $("#Rayondiv").hide(); $.ajax({ type: "GET", contentType: "application/json", url: "http://site.com/Regions.aspx/FindGorodByOblastID/", data: 'oblast_id=' + oblast_id, dataType: "json", success: function (data) { if (data.length > 0) { var options = ''; for (p in data) { var gorod = data[p]; options += "<option value='" + gorod.Id + "'>" + gorod.Name + "</option>"; } $("#gorod").removeAttr('disabled').html(options); } else { $("#gorod").attr('disabled', false).html(''); } } }); }); }); </script>

    Read the article

  • Java: How to workaround the lack of Equatable interface?

    - by java.is.for.desktop
    Hello, everyone! As far as I know, things such as SortedMap or SortedSet, use compareTo (rather than equals) on Comparable<?> types for checking equality (contains, containsKey). But what if certain types are equatable by concept, but not comparable? I have to declare a Comparator<?> and override the method int compareTo(T o1, To2). OK, I can return 0 for instances which are considered equal. But, for unqeual instances, what do I return when an order is not evident? Is the approach of using SortedMap or SortedSet on equatable but (by concept) not comparable types good anyway? Thank you! EDIT: I don't want to store things sorted, but would I use "usual" Map and Set, I couldn't "override" the equality-behavior. EDIT 2: Why I can't just override equals(...): I need to alter the equality-behavior of a foreign class. Can't edit it. EDIT 3: Just think of .NET: They have IEquatable interface which cat alter the equality-behavior without touching the comparable behavior.

    Read the article

  • Error in my OO Generics design. How do I workaround it?

    - by John
    I get "E2511 Type parameter 'T' must be a class type" on the third class. type TSomeClass=class end; ParentParentClass<T>=class end; ParentClass<T: class> = class(ParentParentClass<T>) end; ChildClass<T: TSomeClass> = class(ParentClass<T>) end; I'm trying to write a lite Generic Array wrapper for any data type(ParentParentClass) ,but because I'm unable to free type idenitifiers( if T is TObject then Tobject(T).Free) , I created the second class, which is useful for class types, so I can free the objects. The third class is where I use my wrapper, but the compiler throws that error. How do I make it compile?

    Read the article

  • Got blue screen with a warning that I boot loader may not be properly configured, workaround?

    - by JohnHF
    After running sudo apt-get update got this message: Configuring grub-pc You chose not to install GRUB to any devices. If you continue, the boot loader may not be properly configured, and when your computer next starts up it will use whatever was previously in the boot sector. If there is an earlier version of GRUB 2 in the boot sector, it may be unable to load modules or handle the current configuration file. If you are already running a different boot loader and want to carry on doing so, or if this is a special environment where you do not need a boot loader, then you should continue anyway. Otherwise, you should install GRUB somewhere. Continue without installing GRUB? <Yes> <No> Apparently there is a bug in ubuntu 10.04. But this hang the system. Any ideas on how to fix this? All I wanted was to install gcc that is missing.

    Read the article

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