Daily Archives

Articles indexed Wednesday June 16 2010

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

  • Best practices for class-mapping with SoapClient

    - by Foofy
    Using SoapClient's class mapping feature and it's pretty sweet. Unfortunately the SOAP service we're using has a bunch of read-only properties on some of the objects and will throw faults if the properties are passed back as anything but null. Need to filter out the properties before they're used in the SOAP call and am looking for advice on the best way to do it. So far the options are: Stick to a convention where I use getter and setter functions to manipulate the properties, and use property overloading to filter method access since only SoapClient would be doing that. E.g. developers would access properties like this: $obj->getAccountNumber() SoapClient would access properties like this: $obj->accountNumber I don't like this because the properties are still exposed and things could go wrong if developers don't stick to convention. Have a wrapper for SoapClient that sets a public property the mapped objects can check to see if the property is being accessed by SoapClient. I already have a wrapper that assigns a reference to itself to all the mapped objects. class SoapClientWrapper { public function __soapCall($method, $args) { $this->setSoapMode(true); $this->_soapClient->__soapCall($method, $args); $this->setSoapMode(false); } } class Invoice { function __get($val) { if($this->_soapClient->getSoapMode()) { return null; } else { return $this->$val; } } } This works but it doesn't feel right and seems a bit clunky. Do the mapping manually, and don't use SoapClient's mapping features. I'd just have a function on all the mapped objects that returns the safe-to-send properties. Also, nobody would have access to properties they shouldn't since I could enforce getters and setters. A lot more work, though.

    Read the article

  • File streaming in PHP - How to replicate this C#.net code in PHP?

    - by openid_kenja
    I'm writing an interface to a web service where we need to upload configuration files. The documentation only provides a sample in C#.net which I am not familiar with. I'm trying to implement this in PHP. Can someone familiar with both languages point me in the right direction? I can figure out all the basics, but I'm trying to figure out suitable PHP replacements for the FileStream, ReadBytes, and UploadDataFile functions. I believe that the RecService object contains the URL for the web service. Thanks for your help! private void UploadFiles() { clientAlias = “<yourClientAlias>”; string filePath = “<pathToYourDataFiles>”; string[] fileList = {"Config.txt", "ProductDetails.txt", "BrandNames.txt", "CategoryNames.txt", "ProductsSoldOut.txt", "Sales.txt"}; RecommendClient RecService = new RecommendClient(); for (int i = 0; i < fileList.Length; i++) { bool lastFile = (i == fileList.Length - 1); //start generator after last file try { string fileName = filePath + fileList[i]; if (!File.Exists(fileName)) continue; // file not found } // set up a file stream and binary reader for the selected file and convert to byte array FileStream fStream = new FileStream(fileName, FileMode.Open, FileAccess.Read); BinaryReader br = new BinaryReader(fStream); byte[] data = br.ReadBytes((int)numBytes); br.Close(); // pass byte array to the web service string result = RecService.UploadDataFile(clientAlias, fileList[i], data, lastFile); fStream.Close(); fStream.Dispose(); } catch (Exception ex) { // log an error message } } }

    Read the article

  • Did we really always need to use Ruby/ rails plugin?

    - by Devlim
    I been intersted in ruby and rails lately but what I always encounter in blog/ podcast / book is they will always teach how to use ruby or rails plugin/ ruby instead of writing one. Did we really always need to use plugin, even thing like authorization? Authenticate? Is it really waste time Or hard to write from start? Then if it hard and waste time why rails say make web development less painful? Or I was wrong in term of concept? Goal ? Or anything else? Of rails? Anyone can guide me ?

    Read the article

  • target="_blank" link using jQuery UI Tabs

    - by Tim
    Hello, I would like to use my existing Jquery UI tabs to shoot my users off to a new browser window Unfortunately adding a target="_blank" to the jquery tab code doesn't work. Does anyone have any ideas? Here is the default Tab Code found here <div id="tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin dolor</a></li> <li><a href="#tabs-3">Aenean lacinia</a></li> </ul> <div id="tabs-1"> <p>Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.</p> </div> <div id="tabs-2"> <p>Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat. Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.</p> </div> <div id="tabs-3"> <p>Mauris eleifend est et turpis. Duis id erat. Suspendisse potenti. Aliquam vulputate, pede vel vehicula accumsan, mi neque rutrum erat, eu congue orci lorem eget lorem. Vestibulum non ante. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce sodales. Quisque eu urna vel enim commodo pellentesque. Praesent eu risus hendrerit ligula tempus pretium. Curabitur lorem enim, pretium nec, feugiat nec, luctus a, lacus.</p> <p>Duis cursus. Maecenas ligula eros, blandit nec, pharetra at, semper at, magna. Nullam ac lacus. Nulla facilisi. Praesent viverra justo vitae neque. Praesent blandit adipiscing velit. Suspendisse potenti. Donec mattis, pede vel pharetra blandit, magna ligula faucibus eros, id euismod lacus dolor eget odio. Nam scelerisque. Donec non libero sed nulla mattis commodo. Ut sagittis. Donec nisi lectus, feugiat porttitor, tempor ac, tempor vitae, pede. Aenean vehicula velit eu tellus interdum rutrum. Maecenas commodo. Pellentesque nec elit. Fusce in lacus. Vivamus a libero vitae lectus hendrerit hendrerit.</p> </div> Thanks, Tim

    Read the article

  • Tuning performance of Ubuntu 10.04 on Compaq Evo W4000.

    - by Fantomas
    Hi, I got this computer free and installed Ubuntu 10.04 on it + updates, plus followed the following tutorial all the way: http://www.unixmen.com/linux-tutorials/937-things-to-do-after-installing-ubuntu-1004-lts-lucid-lynx I love the Docky which comes with it, but the computer has been running rather slowly. The System: kernel 2.6.32-22-generic Gnome 2.30.0 (I like Gnome!) Memory: 1GB Processor: Intel (R) Pentium (R) 4 CPU 1700 MHz (needless to say, it is 32 bit). I think I dedicated 128 Mb to video memory while installing, but cannot find this setting now. I did also install an NVidia driver for the 3D card, so I probably want to reclaim that memory back. I want to trim the fat but I also want to keep some of the sex appeal of Ubuntu 10.04. I will gift this computer to a friend, who will use it for Internet, music, videos, word processing, Skype and instant messaging - he is non-technical, so this hardware and Linux should work for him; I just need to speed it up while keeping the good software and having a nice UI. I sort of know my way around Linux, but not that well. Feel free to ask me to run particular commands if you want more info. For starters, here are the services below. Which ones can I kill and how? What else can go? There is no need to run ssh or ftp or http or ntp servers. As I said before, this computer is for non-technical person. There is also absolutely no bluetooth or wireless networking needed - it will feed off a regular ethernet cable. What I do not want to do is reinstall some other distro or recompile a kernel. I want to make it 80% perfect spending 20% of the energy :) Thanks! $ service --status-all [ ? ] acpi-support [ ? ] acpid [ ? ] alsa-mixer-save [ ? ] anacron [ - ] apparmor [ ? ] apport [ ? ] atd [ ? ] avahi-daemon [ ? ] binfmt-support [ - ] bluetooth [ - ] bootlogd [ - ] brltty [ ? ] console-setup [ ? ] cron [ + ] cups [ ? ] dbus [ ? ] dmesg [ ? ] dns-clean [ ? ] failsafe-x [ - ] fancontrol [ ? ] gdm [ - ] grub-common [ ? ] hostname [ ? ] hwclock [ ? ] hwclock-save [ ? ] irqbalance [ - ] kerneloops [ ? ] killprocs [ - ] lm-sensors [ ? ] module-init-tools [ ? ] network-interface [ ? ] network-interface-security [ ? ] network-manager [ ? ] networking [ ? ] ondemand [ ? ] pcmciautils [ ? ] plymouth [ ? ] plymouth-log [ ? ] plymouth-splash [ ? ] plymouth-stop [ ? ] pppd-dns [ ? ] procps [ + ] pulseaudio [ ? ] rc.local [ - ] rsync [ ? ] rsyslog [ - ] saned [ ? ] screen-cleanup [ ? ] sendsigs [ ? ] speech-dispatcher [ ? ] stop-bootlogd [ ? ] stop-bootlogd-single [ ? ] udev [ ? ] udev-finish [ ? ] udevmonitor [ ? ] udevtrigger [ ? ] ufw [ ? ] umountfs [ ? ] umountnfs.sh [ ? ] umountroot [ ? ] unattended-upgrades [ - ] urandom [ + ] winbind [ ? ] wpa-ifupdown [ - ] x11-common

    Read the article

  • How do I make the icons smaller in Stacks grid view for Snow Leopard?

    - by Sietse
    Since I installed Snow Leopard, I'm stuck with huge icons in my stacks/folder views in my dock. It use to adjust the layout and size of the window so that as many icons as possible fit on the screen, but now it shows huge icons and a scrollbar instead. I'd like the old behavior back so I don't have to scroll anymore. Does anyone know where the setting for this is? Maybe hidden in some .plist?

    Read the article

  • questions on transfer rate

    - by Nrew
    I tested my internet speed at speedtest.net. And go the result. .42Mbps Download and .21 Upload rate. My classmate got the same download speed of .42Mbps but has .87Mbps upload rate. Does upload rate affect the transfer rate?Because even though we got the same download speed. His transfer rate is about 100kbps downloading a movie from a torrent. And mine is only about 47kbps. Also the same torrent. And even direct download its always 47kbps. Is it possible to tweak something in order to have higher transfer rates.

    Read the article

  • Fix or replacement for thunderbird Buttons! plugin.

    - by Vlad
    I have been using Thunderbird Buttons! plug-in for years with Thunderbird 2.0, especially it's nifty Archive feature that lets you archive the message to one of the pre-set folder with a single mouse click. Unfortunately this plug-in doesn't work with Thunderbird version 3.0.4 and later. The plugin has not been updated since 2007. So could anybody recommend any fix or replacement for this?

    Read the article

  • What movie website allows people to scrape it?

    - by Sergio Tapia
    I've wanted to make a C# library to scrape movie information and return it to the application, but someone told me that it's against the TOS. RottenTomatoes seems to have no problems with it from what I've read on their licensing page, but I'm not quite sure. Where could I aquire movie information legally and without cost? It's for an open source application hosted here: LINK

    Read the article

  • Ruby on Rails wildcard routing such as /foo.htm /foo.php /foo.something

    - by fregas
    I'm trying to create a routing situation where by default, any URL's such as this: /foo /something /foo.php /somethingelse.xml /something.something.else etc. will all route to one controller, assuming they don't route anywhere else. i can get this to work with the following code in my routes: map.myroute '/:file_or_folder', :controller = 'mycontroller' this works fine as long as there are no dots in the URL: /something but this wont work: /something.foo any ideas?

    Read the article

  • Will the compiler optimize escaping an inner loop?

    - by BCS
    The code I have looks like this (all uses of done shown): bool done = false; for(int i = 0; i < big; i++) { ... for(int j = 0; j < wow; j++) { ... if(foo(i,j)) { done = true; break; } ... } if(done) break; ... } will any compilers convert it to this: for(int i = 0; i < big; i++) { ... for(int j = 0; j < wow; j++) { ... if(foo(i,j)) goto __done; // same as a labeled break if we had it ... } ... } __done:;

    Read the article

  • SAML Identity Provider based on Active Directory

    - by Jarret
    I have a 3rd party program that supports web SSO using SAML 1.1 (it is ready to serve as the Service Provider, in other words). We would like to implement this SSO for our intranet users based on their Active Directory credentials. In other words, they've already logged on to their system, so let's simply use those credentials to facilitate an SSO. I am a little overwhelmed at where to begin, though. My initial thought is that IIS / Active Directory could easily serve as the Identity Provider since IIS gives us "Integrated Windows Authentication" abilities. I would think we could just create a .NET web app that requires Integrated Authentication which simply extracts the current user ID, builds the SAML response, and re-directs the user back to the Service Provider with this SAML response to complete the SSO. But then, my problem is that I simply have no real idea of how to go about creating this SAML response, the X.509 certs involved, etc... I am wondering if I am in over my head on this, or if creating this SAML response should be relatively easy. Note this SSO is to be used by intranet users only, so no need to worry about federating with other companies / domains.

    Read the article

  • running pdb from within pdb

    - by Andrew Farrell
    I'm debugging an script that I'm writing and the result of executing a statement from pdb does not make sense so my natural reaction is to try to trace it with pdb. To paraphrase: Yo dawg, I like python, so can you put my pdb in my pdb so I can debug while I debug?

    Read the article

  • Easy Python input question

    - by Josh K
    I'd like to have something similar to the following pseudo code: while input is not None and timer < 5: input = getChar() timer = time.time() - start if timer >= 5: print "took too long" else: print input Anyway to do this without threading? I would like an input method that returns whatever has been entered since the last time it was called, or None (null) if nothing was entered.

    Read the article

  • Updating a module level shared dictionary

    - by Vishal
    Hi, A module level dictionary 'd' and is accessed by different threads/requests in a django web application. I need to update 'd' every minute with a new data and the process takes about 5 seconds. What could be best solution where I want the users to get either the old value or the new value of d and nothing in between. I can think of a solution where a temp dictionary is constructed with a new data and assigned to 'd' but not sure how this works! Appreciate your ideas. Thanks

    Read the article

  • How to simulate a dial-up connection for testing purposes?

    - by mawg
    I have to code a server app where clients open a TCP/IP socket, send some data and close the connection. The data packets are small < 100 bytes, however there is talk of having them batch their transactions and send multiple packets. How can I best simulate a dial-up ut connection (using Delphy & Indy components, just FYI)? Is it as simple as open connection wait a while (what is the definition of "a while"?) close connection

    Read the article

  • jQuery Grouping Similar Items w/ Multidimensional Array

    - by NessDan
    So I have this structure setup: <ul> <li>http://www.youtube.com/watch?v=dw1Vh9Yzryo</li> (Vid1) <li>http://www.youtube.com/watch?v=bOF3o8B292U</li> (Vid2) <li>http://www.youtube.com/watch?v=yAY4vNJd7A8</li> (Vid3) <li>http://www.youtube.com/watch?v=yAY4vNJd7A8</li> <li>http://www.youtube.com/watch?v=dw1Vh9Yzryo</li> <li>http://www.youtube.com/watch?v=bOF3o8B292U</li> <li>http://www.youtube.com/watch?v=yAY4vNJd7A8</li> <li>http://www.youtube.com/watch?v=dw1Vh9Yzryo</li> </ul> Vid1 is repeated 3 times, Vid2 is repeated 3 times, and Vid3 is repeated 2 times. I want to put them into a structure where I can reference them like this: youtube[0][repeated] = 3; youtube[0][download] = "http://www.youtube.com/get_video?video_id=dw1Vh9Yzryo&fmt=36" youtube[1][repeated] = 3; youtube[1][download] = "http://www.youtube.com/get_video?video_id=bOF3o8B292U&fmt=36" youtube[2][repeated] = 3; youtube[2][download] = "http://www.youtube.com/get_video?video_id=yAY4vNJd7A8&fmt=36" "This video was repeated " + youtube[0][repeated] + " times and you can download it here: " + youtube[0][download]; How can I set this multidimensional array up? Been Googling for hours and I don't know how to set it up. Can anyone help me out?

    Read the article

  • Consuming Web Services requiring Authentication from behind Proxy server

    - by Jan Petersen
    Hi All, I've seen a number of post about Proxy Authentication, but none that seams to address this problem. I'm building a SharePoint Web Service consuming desktop application, using Java, JAX-WS in NetBeans. I have a working prototype, that can query the server for authentication mode, successfully authenticate and retrieve a list of web site. However, if I run the same app from a network that is behind a proxy server (the proxy does not require authentication), then I'm running into trouble. The normal -dhttp.proxyHost ... settings does not seam to help any. But I have found that by creating a ProxySelector class and setting it as default, I can regain access to the authentication web service, but I still can't retrieve the list of web sites from the SharePoint server. It's almost as if the authentication I provide is going to the proxy rather than the SharePoint server. Anyone have any experience on how to make this work? I have put the source text java class files of a demo app up, showing the issue at the following urls (it's a bit to long even in the short demo form to post here). link text When running the code from a network behind a proxy server, I successfully retrieve the Authentication mode from the server, but the request for the Web Site list generates an exception originating at: com.sun.xml.internal.ws.transport.http.client .HttpClientTransport.readResponseCodeAndMessage(HttpClientTransport.java:201) The output from the source when no proxy is on the network is listed below: Successfully retrieved the SharePoint WebService response for Authentication SharePoint authentication method is: WINDOWS Calling Web Service to retrieve list of web site. Web Service call response: -------------- XML START -------------- <Webs xmlns="http://schemas.microsoft.com/sharepoint/soap/"> <Web Title="Collaboration Lab" Url="http://host.domain.com/collaboration"/> <Web Title="Global Data Lists" Url="http://host.domain.com/global_data_lists"/> <Web Title="Landing" Url="http://host.domain.com/Landing"/> <Web Title="SharePoint HelpDesk" Url="http://host.domain.com/helpdesk"/> <Web Title="Program Management" Url="http://host.domain.com/programmanagement"/> <Web Title="Project Site" Url="http://host.domain.com/Project Site"/> <Web Title="SharePoint Administration Tools" Url="http://host.domain.com/admin"/> <Web Title="Space Management Project" Url="http://host.domain.com/spacemgmt"/> </Webs> -------------- XML END -------------- Br Jan

    Read the article

  • WS Libs: com.sun.xml vs javax.xml

    - by Zilvinas
    There are identical classes of java WebServices API & IMPL in those packages groups, only package names are different. http://mvnrepository.com/artifact/javax.xml http://mvnrepository.com/artifact/com.sun.xml Which ones should I use in my code? I would prefer NON-com.sun.* as per java conventions, but still my dependencies ( e.g. Spring ) are using implementations from com.sun.* OR I can't find an implementation package in javax.xml Does anyone have any experience on this?

    Read the article

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