Search Results

Search found 922 results on 37 pages for 'patrick pellegrino'.

Page 24/37 | < Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >

  • php file_get_contents and &amp;

    - by Patrick
    Hello all, I'm trying to use php's file_get_content('a url'); The thing is if the url has '&' in it, for example file_get_contents('http://www.google.com/?var1=1&var2=2') it automatically make a requests to www.google.com/?var1=1&amp<no space here>;var2=2 How do I prevent that from happening?

    Read the article

  • In Node.JS, how do I return an entire object from a separate .js file?

    - by Matthew Patrick Cashatt
    Thanks for looking. I am new to Node.js and trying to figure out how to request an object from a separate file (rather than just requesting a function) but everything I try--exports,module-exports,etc--is failing. So, for example, if I have foo.js: var methods = { Foobar:{ getFoo: function(){return "foo!!";}, getBar: function(){return "bar!!";} } }; And now I want to call a function within an object of foo.js from index.js: var m = require('./Methods'); function fooMain(){ return m.Foobar.getFoo(); }; How do I do this? I have tried all sorts of combinations of exports and module-exports but they seem to only work if I call a discrete function that is not part of an object. Thanks!

    Read the article

  • How to save an image in it's original format?

    - by Patrick Klug
    I am trying to figure out how I can get the original format of an image so that I can store it with the same encoding. It seems that the only way to save an Image is by using a BitmapEncoder but I don't know how I can get the correct format from the image. Example: Clipboard.GetImage() returns a InteropBitmap which doesn't seem to contain any information about the original format. I also tried using an Extension method: public static void Save(this BitmapImage image, System.IO.Stream stream) { var decoder = BitmapDecoder.Create(image.StreamSource, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default); var encoder = BitmapEncoder.Create(decoder.CodecInfo.ContainerFormat); foreach (var frame in decoder.Frames) { encoder.Frames.Add(BitmapFrame.Create(decoder.Frames[0])); } encoder.Save(stream); } but the problem is that a) the ImageSource is not always a BitmapImage (Clipboard.GetImage()) for example and b) the image.StreamSource can be null in some cases (seems to be when the image is loaded via a relative Uri)

    Read the article

  • Chrome error: Flash video player flickering instead of showing up

    - by Patrick
    hi, I cannot understand why the flash video player is not working in Google Chrome (it works perfectly in all other browsers...) could you give me a hand ? In Chrome it keeps flickering instead of showing up. http://www.sanstitre.ch/drupal/portfolio?tid[]=66&view_name=Portfolio&view_display_id=page_1&view_args=&view_path=portfolio&view_base_path=portfolio&view_dom_id=1&pager_element=0

    Read the article

  • Drupal: customizing modules question

    - by Patrick
    hi, I've a question about how to customize drupal modules avoiding hacks. Let's say I've downloaded Lightbox2 module and I want to change the javascript file to display differently my lightbox. At the moment I'm modifying the Lightbox2 module, so I cannot update it anymore, so I know it is not the best practice. I was wondering if I can customize the javascript file of this module with a hook, and how. Thanks

    Read the article

  • Python - network buffer handling question...

    - by Patrick Moriarty
    Hi, I want to design a game server in python. The game will mostly just be passing small packets filled with ints, strings, and bytes stuffed into one message. As I'm using a different language to write the game, a normal packet would be sent like so: Writebyte(buffer, 5); // Delimit type of message Writestring(buffer, "Hello"); Sendmessage(buffer, socket); As you can see, it writes the bytes to the buffer, and sends the buffer. Is there any way to read something like this in python? I am aware of the struct module, and I've used it to pack things, but I've never used it to actually read something with mixed types stuck into one message. Thanks for the help.

    Read the article

  • Dealing with &rest-parameters in common lisp

    - by Patrick
    I want define a functions that accepts &rest - parameters and delegates them to another function. (html "blah" "foo" baz) = "blahfoobaz" I did not find a better way than this one: (defun html (&rest values) (concatenate 'string "" (reduce #'(lambda(a b) (concatenate 'string a b)) values :initial-value "") "")) But this looks somewhat glumbsy to me, since line 4 does no more than concatenating the &rest parameter "values". I tried (concatenate 'string "" (values-list values) "") but this does not seem to work (SBCL). Could someone give me an advice? Kind regards

    Read the article

  • "Detecting" and loading of "plugins" in GAE

    - by Patrick Cornelissen
    Hi! I have a "plugin like" architecture and I want to create one instance of each class that implements a dedicated interface and put these in a cache. (To have a singleton-ish effect). The plugins will be provided as jars and put into the app engine war file before the app is uploaded. I have tried to use the ClassPathScanningCandidateComponentProvider as I'm using spring anyway, but this didn't work. The provider complained that it was not able to find the HttpServletResponse class file while scanning the classpath. I can't get around this, when I add the servlet jar, then I'll get of course problems, because the same jar is also provided by the GAE. If I don't, I'm getting the error above... So I tried to add a static initialization code, but of course this doesn't work, because the class is initialized when it's instantiated for the first time. (Well I knew that but it was worth a try) The last chance I currently see is that I create a properties file with all plugin classes when the package is created, but this requires writing of a maven plugin etc. and I'd like to avoid that. Is there something that I am missing?

    Read the article

  • django threadedcomments

    - by Patrick
    Hi folks, I would like to setup a comment systems on my site, using django threadedcomments, and I follow all the steps in the Tutorial, however, I get the following error: No module named newforms.util I am not sure what causing this issue, here is my configuration: #settings.py INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'myproject.myapp', 'threadedcomments', ) #urls.py from django.conf import settings from django.conf.urls.defaults import * from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', (r'^admin/', include(admin.site.urls)), (r'^threadedcomments/', include('threadedcomments.urls')), ) Please let me know if there is another better choice for commenting, as long as the comment system is flexible and able to do lot of customization, as well as threadedcomment, of coz, integrating with Rating, I am happy to use the other one. Thanks guys.

    Read the article

  • Verizon Fivespot firewall exceptions

    - by Patrick
    I have a Verizon Fivespot Wi-Fi router and am having issues connecting to the computer that uses it to get on the internet. I am able to connect to the Fivespot admin pages remotely and I am able to connect to the internet from the computer behind the Fivespot. I've tried asking this on superuser but have gotten nothing, I figure this is pertinent to programmers working on remote computers as well. There are two sections pertinent to this issue, Port Filtering And, Port Forwarding I've tried each individually and both together but cannot access anything through the router except for the admin page. I am trying to connect through SSH on Port 22 to an Ubuntu 10.04 box over wifi. I have called Verizon Tech Support but they were unhelpful, the person essentially read what it says on each screen without any elaboration. Any help is greatly appreciated!

    Read the article

  • MVC best practice when adding functions to controller?

    - by Patrick
    Hi I'm writing a function in my controller; this is supposed to take in a form, process it, register the user in DB, send a confirmation email etc etc. to avoid this function to be too cluttered, I was thinking of calling some sub-functions (eg: function registration() { //process form.. _insertInDb($formdata) _send_mail($address); //load confirmation view.. } function _send_mail($to) { //code here } function _insertInDb($formdata) { //other code here... } I'm not sure whether writing all the functions in the controller would be best practice -maybe I should insert all 'supporting' function (eg send_mail and insertInDb in this example) in another file and then import them? This would probably make the controller much more readable.. what's your view?

    Read the article

  • How to search array for duplicates using a single array?

    - by patrick
    I am checking a list of 10 spots, each spot w/ 3 top users to see if a user is in an array before echoing and storing. foreach($top_10['top_10'] as $top10) //loop each spot { $getuser = ltrim($top10['url'], " users/" ); //strip url if ($usercount < 3) { if ((array_search($getuser, $array) !== true)) { echo $getuser; $array[$c++] = $getuser; } else { echo "duplicate <br /><br />"; } } } The problem I am having is that for every loop, it creates a multi-dimensional array for some reason which only allows array_search to search the current array and not all combined. I am wanting to store everything in the same $array. This is what I see after a print_r($array) Array ( [0] => 120728 [1] => 205247 ) Array ( [0] => 232123 [1] => 091928 )

    Read the article

  • how to convert numbers to alpha numeric system with php

    - by Patrick
    Im not sure what this is called, which is why im having trouble searching for it. What im looking to do, is take numbers, and convert them to some alpha numeric base so that the number say 5000, wouldnt read 5000, but like G4u or something like that. The idea being to save space and also not make it obvious how many records there are in a given system. Im using php, so if there is something like this built into php even better, but even a name for this method would be helpful at this point Again, sorry for not being able to be more clear, im just not sure what this is called.

    Read the article

< Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >