Daily Archives

Articles indexed Saturday May 1 2010

Page 10/76 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • dynamically load PHP code from external file

    - by jera
    code is in a static class in an external file eg. /home/test/public_html/fg2/templatecode/RecordMOD/photoslide.mod how do I load this into my script on demand, and be able to call its functions ? I am a novice at php , so please explain your code. help is appreciated. Jer

    Read the article

  • fast algorithm to sort very small set

    - by aaa
    hello. This is the problem I ran into long time ago. I thought I may ask your for your ideas. assume I have very small set of numbers (integers), 4 or 8 elements, that need to be sorted, fast. what would be the best approach/algorithm? my approach was to use the max/min functions only. At this point it becomes somewhat hardware dependent , so let us assume Intel 64-bit processor with SSE3 . Thanks

    Read the article

  • accessing a value of a nested hash

    - by st
    Hello! I am new to perl and I have a problem that's very simple but I cannot find the answer when consulting my perl book. When printing the result of Dumper($request); I get the following result: $VAR1 = bless( { '_protocol' => 'HTTP/1.1', '_content' => '', '_uri' => bless( do{\(my $o = 'http://myawesomeserver.org:8081/counter/')}, 'URI::http' ), '_headers' => bless( { 'user-agent' => 'Mozilla/5.0 (X11; U; Linux i686; en; rv:1.9.0.4) Gecko/20080528 Epiphany/2.22 Firefox/3.0', 'connection' => 'keep-alive', 'cache-control' => 'max-age=0', 'keep-alive' => '300', 'accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'accept-language' => 'en-us,en;q=0.5', 'accept-encoding' => 'gzip,deflate', 'host' => 'localhost:8081', 'accept-charset' => 'ISO-8859-1,utf-8;q=0.7,*;q=0.7' }, 'HTTP::Headers' ), '_method' => 'GET', '_handle' => bless( \*Symbol::GEN0, 'FileHandle' ) }, 'HTTP::Server::Simple::Dispatched::Request' ); How can I access the values of '_method' ('GET') or of 'host' ('localhost:8081'). I know that's an easy question, but perl is somewhat cryptic at the beginning. Thank you, St.

    Read the article

  • jQuery Stop non-css animation

    - by Mark
    I'm trying to stop a non-css animation: http://jsbin.com/aqute4/4/edit Button 1 starts the animation nicely, totally lost on how to stop it though, since .stop() seems to need a DOM element... rather than a random object. Thanks in advance. PS: Original code comes from: http://james.padolsey.com/javascript/fun-with-jquerys-animate/

    Read the article

  • not returning anything from postgresql function?

    - by netllama
    Is it possible for a PostgreSQL plpgsql function to not return anything? I've created a function, and I don't need it to return anything at all, as it performs a complex SQL query, and inserts the results of that query into another table (SELECT INTO ....). Thus, I have no need or interest in having the function return any output or value. Unfortunately, when I try to omit the RETURN clause of the function declaration, I can't create the function. Is it possible for a PostgreSQL plpgsql function to not return anything?

    Read the article

  • css3 rotate alternative

    - by JCHASE11
    I am using the CSS3 rule, "rotate" to rotate a div containing text. You can see the page here: http://vitaminjdesign.com/v2/socialmedia.html. I am looking for cross browser support for rotating the div; however, this CS3 rule won't work on IE. Is there a jquery option or another javascript solution that will yield the same result, with cross browser compatibility?

    Read the article

  • Dual NIC internet access

    - by JavaRocky
    Q1. If a computer had two NICs, lets say windows, on which interface would HTTP traffic (or any for that matter) go out on. Not sure how the routes table would look like. Q2. If one of the NICs link becomes unresponsive, would traffic be automatically routed to the other NIC? Thanks.

    Read the article

  • Installed Perl DBI Module Can't Be Found

    - by Russell C.
    I'm trying to setup a Perl development environment on my Mac laptop and have been having a really hard time getting it working. I thought I had everything configured correctly but when I try to run a sample script it is reporting errors with the DBI module and can't access the DB. Here is what is reported in the Apache error logs: [Fri Apr 30 23:11:33 2010] [error] [client 127.0.0.1] Can't locate DBI.pm in @INC (@INC contains: /Library/Perl/Updates/5.10.0/darwin-thread-multi-2level /Library/Perl/Updates/5.10.0 /System/Library/Perl/5.10.0/darwin-thread-multi-2level /System/Library/Perl/5.10.0 /Library/Perl/5.10.0/darwin-thread-multi-2level /Library/Perl/5.10.0 /Network/Library/Perl/5.10.0/darwin-thread-multi-2level /Network/Library/Perl/5.10.0 /Network/Library/Perl /System/Library/Perl/Extras/5.10.0/darwin-thread-multi-2level /System/Library/Perl/Extras/5.10.0 .) at main.pm line 5. I downloaded and installed both modules manually to work with MAMP using the following commands as specified in this forum post: For DBI 1. cd /Library/Perl/DBI-1.611 2. sudo Perl Makefile.PL 3. sudo make 4. sudo make install For DBD 1. cd /Library/Perl/DBD-mysql-4.014 2. sudo Perl Makefile.PL --mysql_config=/Applications/MAMP/Library/bin/mysql_config 3. sudo make 4. sudo make install What I noticed while running the above commands is that the files seems to be getting installed in the '/opt/local/lib/perl5/site_perl/5.8.9/darwin-2level/' directory which doesn't seem to be one of the search directories that Apache mentions in the error at the beginning of this post. Here is what I'm seeing during the install: $ sudo make install Files found in blib/arch: installing files in blib/lib into architecture dependent library tree Installing /opt/local/lib/perl5/site_perl/5.8.9/darwin-2level/auto/DBI/DBI.bundle Installing /opt/local/lib/perl5/site_perl/5.8.9/darwin-2level/auto/DBI/dbipport.h Installing /opt/local/lib/perl5/site_perl/5.8.9/darwin-2level/auto/DBI/DBIXS.h Installing /opt/local/lib/perl5/site_perl/5.8.9/darwin-2level/auto/DBI/dbixs_rev.h Installing /opt/local/lib/perl5/site_perl/5.8.9/darwin-2level/auto/DBI/Driver.xst Installing /opt/local/lib/perl5/site_perl/5.8.9/darwin-2level/auto/DBI/Driver_xst.h Installing /opt/local/lib/perl5/site_perl/5.8.9/darwin-2level/DBI.pm Installing /opt/local/lib/perl5/site_perl/5.8.9/darwin-2level/TASKS.pod Installing /opt/local/lib/perl5/site_perl/5.8.9/darwin-2level/DBD/DBM.pm Installing /opt/local/lib/perl5/site_perl/5.8.9/darwin-2level/DBD/File.pm Installing /opt/local/lib/perl5/site_perl/5.8.9/darwin-2level/DBD/Gofer.pm Installing /opt/local/lib/perl5/site_perl/5.8.9/darwin-2level/DBI/Changes.pm Installing /opt/local/lib/perl5/site_perl/5.8.9/darwin-2level/DBI/DBD.pm Installing /opt/local/lib/perl5/site_perl/5.8.9/darwin-2level/DBI/Profile.pm Installing /opt/local/lib/perl5/site_perl/5.8.9/darwin-2level/DBI/ProxyServer.pm Installing /opt/local/lib/perl5/site_perl/5.8.9/darwin-2level/DBI/PurePerl.pm Installing /opt/local/share/man/man3/DBD::DBM.3pm Installing /opt/local/share/man/man3/DBD::File.3pm Installing /opt/local/share/man/man3/DBD::Gofer.3pm Installing /opt/local/share/man/man3/DBI.3pm Installing /opt/local/share/man/man3/DBI::DBD.3pm Installing /opt/local/share/man/man3/DBI::Profile.3pm Installing /opt/local/share/man/man3/DBI::ProxyServer.3pm Installing /opt/local/share/man/man3/DBI::PurePerl.3pm Installing /opt/local/share/man/man3/TASKS.3pm Installing /opt/local/bin/dbiprof Installing /opt/local/bin/dbiproxy Writing /opt/local/lib/perl5/site_perl/5.8.9/darwin-2level/auto/DBI/.packlist Appending installation info to /opt/local/lib/perl5/5.8.9/darwin-2level/perllocal.pod My question is, what am I doing wrong and how can I either 1) Get Apache to look in the right directory where the DBD & DBI modules are installed or 2) Update the way I'm installing the module to install them into one of the search directories. I honestly don't know what option makes more sense and could use guidance on that as well. As you can probably tell I'm pretty lost at the moment. Please help!!!

    Read the article

  • Browser for cross-site-script testing (for testing Mozilla Add-On)

    - by Anthony
    I am working on a Firefox extension that will involve ajax calls to domains that would normally fail due to the same-origin policy set by Firefox (and most modern browsers). I was wondering if there is a way to either turn off the same-origin restriction (in about:config, perhaps) or if there was a standard lite-browser that developers turn to for this. I really would like to avoid using any blackhat tools, if possible. Not because I'm against them, I just don't want to add another learning curve to the process. I can use curl in PHP to confirm that the requests work, but I want to get started on writing the js that the addon will actually use, so I need a client that will execute js. I also tried spidermonkey, but since I'm doing the ajax with jquery, it threw a fit at all of the browser-based default variables. So, short version: is there a reliable browser/client for cross site scripting that isn't primarily a hacker app? Or can I just turn off same-domain policy in Firefox?

    Read the article

  • XMLHttpRequest() and Google Analytics Tracking

    - by sjw
    I have implemented an XMLHttpRequest() call to a standalone html page which simply has an html, title & body tag which Google Analytics Tracking code. I want to track when someone makes a request to display information (i.e. phone number) to try and understand what portion of people look at my directory versus obtaining a phone number to make a call. It is very simple code: var xhReq = new XMLHttpRequest(); xhReq.open("GET", "/registerPhoneClick.htm?id=" + id, false); xhReq.send(null); var serverResponse = xhReq.responseText Yet I cannot see the "hit" in Analytics... Has anyone had this issue? All the analytics tracking code does is call: <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> try { var pageTracker = _gat._getTracker("UA-XXXXXXX"); pageTracker._trackPageview(); } catch(err) {}</script> So realistically, my XmlHTTPRequest() calls an htm file within which a script is execute to make an outbound call to Google Analytics. Is there any reason why an XmlHTTPRequest() would not execute this? Does an XmlHTTPRequest() still bring the code to the client before execution? Help Please

    Read the article

  • VS2010, MSDeploy and declaration of parameters

    - by MartinHN
    Hi I'm trying to deploy an ASP.NET MVC 2 app using MSDeploy. I use VS2010 to generate the package as a ZIP. Inside that ZIP is a parameters.xml file that declares the parameters that I can set. I want to be able to set more parameters, using the auto-generated deploy.cmd file like this: MySite.deploy.cmd "-setParam:name='IIS Web Application Name',value=MySite" "-setParam:name=IisVirtualDirectoryPhysicalPath,value=C:\inetpub\MySite" "-setParam:name=httpBinding,value=*:80:www.mysite.dk" That works fine, except for the httpBinding param. That is because that parameter is not declared inside the parameters.xml file that is added to the ZIP container. I could go and add that parameter declaration manually, but isn't there a way to do it from the command line and have it declare parameters I have in another XML file?

    Read the article

  • fast algorithm implementation to sort very small set

    - by aaa
    hello. This is the problem I ran into long time ago. I thought I may ask your for your ideas. assume I have very small set of numbers (integers), 4 or 8 elements, that need to be sorted, fast. what would be the best approach/algorithm? my approach was to use the max/min functions. I guess my question pertains more to implementation, rather than type of algorithm. At this point it becomes somewhat hardware dependent , so let us assume Intel 64-bit processor with SSE3 . Thanks

    Read the article

  • There's some html content in a file which is downloaded using PHP scripts on firefox

    - by chqiu
    I use the following to download a file with PHP: ob_start(); $browser = id_browser(); header('Content-Type: '.(($browser=='IE' || $browser=='OPERA')? 'application/octetstream':'application/octet-stream')); header('Expires: '.gmdate('D, d M Y H:i:s').' GMT'); header('Content-Transfer-Encoding: binary'); header('Content-Length: '.filesize(realpath($fullpath))); //header("Content-Encoding: none"); if($browser == 'IE') { header('Content-Disposition: attachment; filename="'.$file.'"'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); } else { header('Content-Disposition: attachment; filename="'.$file.'"'); header('Cache-Control: no-cache, must-revalidate'); header('Pragma: no-cache'); } //@set_time_limit( 0 ); ReadFileChunked(utf8_decode($fullpath)); ob_end_flush(); The source code of ReadFileChunked is: function ReadFileChunked($filename,$retbytes=true) { $chunksize = 1*(1024*1024); $remainFileSize = filesize($filename); if($remainFileSize < $chunksize) $chunksize = $remainFileSize; $buffer = ''; $cnt =0; // $handle = fopen($filename, 'rb'); //echo $filename."<br>"; $handle = fopen($filename, 'rb'); if ($handle === false) { //echo 1; return false; } //echo 2; while (!feof($handle)) { //echo "current remain file size $remainFileSize<br>"; //echo "current chunksize $chunksize<br>"; $buffer = fread($handle, $chunksize); echo $buffer; sleep(1); ob_flush(); flush(); if ($retbytes) { $cnt += strlen($buffer); } $remainFileSize -= $chunksize; if($remainFileSize == 0) break; if($remainFileSize < $chunksize) { $chunksize = $remainFileSize; } } $status = fclose($handle); if ($retbytes && $status) { return $cnt; // return num. bytes delivered like readfile() does. } return $status; } The question is : The file downloaded will contiain some html tags which are the content of the html code generated by the php. The error will happened when downloading the txt file with the file size smaller than 4096 bytes. Please help me to slove this problem , thank you very much! Chu

    Read the article

  • Detect marker with opencv and python

    - by Mitch
    Hi im trying to detect a marker in a webcam video feed and overlay it with a 3d object - pretty much exactly like this: http://www.morethantechnical.com/2009/06/28/augmented-reality-with-nyartoolkit-opencv-opengl/ i know artoolkit is the best module for this, but i was hoping to just use opencv in python since i dont know nearly enough c/c++ to be able to use artoolkit. im hoping someone will be able to get me on the right track towards detecting the marker and determining its location and orientation etc since i have no idea how best to go about this or what functions i should be using thanks mitch

    Read the article

  • What do I do when I get a Linux kernel bug?

    - by raldi
    I just bought a tiny computer called a fit-pc2 which came with a somewhat customized Ubuntu 9.10 installation. uname -a reports: Linux 2.6.31-34-fitpc2 #7 SMP Thu Apr 22 17:43:26 IDT 2010 i686 GNU/Linux It seems that after several hours of running with heavy network load, all networking ceases and I get the following in kern.log: BUG: unable to handle kernel paging request at ff09dfc0 IP: [<c0150300>] kthread_should_stop+0x10/0x20 *pde = 00000000 Oops: 0000 [#1] SMP last sysfs file: /sys/devices/pci0000:00/0000:00:1d.7/usb1/idVendor Modules linked in: binfmt_misc ppdev sbc_fitpc2_wdt snd_usb_audio snd_usb_lib i2c_isch sch_gpio snd_seq_dummy snd_hda_intel snd_pcm_oss snd_seq_oss snd_seq_midi snd_rawmidi snd_mixer_oss snd_seq_midi_event snd_seq snd_pcm snd_timer snd_page_alloc snd_seq_device iptable_filter ip_tables x_tables snd_hwdep lpc_sch snd psmouse rt2860sta(C) uvcvideo video pl2303 soundcore mfd_core output videodev v4l1_compat lirc_igorplugusb lirc_dev serio_raw lp parport usbhid r8169 mii iegd_mod drm agpgart Pid: 16, comm: kblockd/1 Tainted: G C (2.6.31-34-fitpc2 #7) SBC-FITPC2 EIP: 0060:[<c0150300>] EFLAGS: 00010246 CPU: 1 EIP is at kthread_should_stop+0x10/0x20 EAX: ff09dfc4 EBX: c180cbac ECX: 0109d000 EDX: f709df98 ESI: f709df98 EDI: c180cba0 EBP: f709dfb8 ESP: f709df90 DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068 Process kblockd/1 (pid: 16, ti=f709c000 task=f7084b60 task.ti=f709c000) Stack: c014c14d c180cba4 00000000 f7084b60 c0150770 f709dfa4 f709dfa4 f7023ef4 <0> c180cba0 c014c0d0 f709dfe0 c015047c 00000000 00000000 00000000 f709dfcc <0> f709dfcc c0150400 00000000 00000000 00000000 c0103ce7 f7023ef4 00000000 Call Trace: [<c014c14d>] ? worker_thread+0x7d/0xe0 [<c0150770>] ? autoremove_wake_function+0x0/0x40 [<c014c0d0>] ? worker_thread+0x0/0xe0 [<c015047c>] ? kthread+0x7c/0x90 [<c0150400>] ? kthread+0x0/0x90 [<c0103ce7>] ? kernel_thread_helper+0x7/0x10 Code: a6 8b 55 0c 8d 4d e0 89 f8 89 34 24 e8 7a fd ff ff 89 c3 eb 92 90 90 90 90 90 90 55 64 a1 00 80 76 c0 8b 80 70 02 00 00 89 e5 5d <8b> 40 fc c3 8d b6 00 00 00 00 8d bf 00 00 00 00 55 ba d7 86 62 EIP: [<c0150300>] kthread_should_stop+0x10/0x20 SS:ESP 0068:f709df90 CR2: 00000000ff09dfc0 ---[ end trace 06004df70b9cf435 ]--- BUG: unable to handle kernel paging request at ff09dfc8 IP: [<c0521bc8>] _spin_lock_irqsave+0x18/0x30 *pde = 00000000 Oops: 0002 [#2] SMP last sysfs file: /sys/devices/pci0000:00/0000:00:1d.7/usb1/idVendor Modules linked in: binfmt_misc ppdev sbc_fitpc2_wdt snd_usb_audio snd_usb_lib i2c_isch sch_gpio snd_seq_dummy snd_hda_intel snd_pcm_oss snd_seq_oss snd_seq_midi snd_rawmidi snd_mixer_oss snd_seq_midi_event snd_seq snd_pcm snd_timer snd_page_alloc snd_seq_device iptable_filter ip_tables x_tables snd_hwdep lpc_sch snd psmouse rt2860sta(C) uvcvideo video pl2303 soundcore mfd_core output videodev v4l1_compat lirc_igorplugusb lirc_dev serio_raw lp parport usbhid r8169 mii iegd_mod drm agpgart Pid: 16, comm: kblockd/1 Tainted: G D C (2.6.31-34-fitpc2 #7) SBC-FITPC2 EIP: 0060:[<c0521bc8>] EFLAGS: 00010086 CPU: 1 EIP is at _spin_lock_irqsave+0x18/0x30 EAX: 00000100 EBX: ff09dfc8 ECX: 00000286 EDX: ff09dfc8 ESI: f7084b60 EDI: ff09dfc4 EBP: f709dd88 ESP: f709dd88 DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068 Process kblockd/1 (pid: 16, ti=f709c000 task=f7084b60 task.ti=f709c000) Stack: f709dda4 c0127c0b 00000082 00000001 ff09dfc4 f7084b60 00000000 f709ddd0 <0> c0137fd2 00000086 f70954c4 00000000 f7098480 f709ddf0 f7094fc0 f7084b60 <0> 00000000 00000009 f709ddf0 c013c3f8 00000001 c1807c60 f709ddf0 f7084b60 Call Trace: [<c0127c0b>] ? complete+0x1b/0x60 [<c0137fd2>] ? mm_release+0x52/0xf0 [<c013c3f8>] ? exit_mm+0x18/0x110 [<c013c6db>] ? do_exit+0xfb/0x2e0 [<c013998a>] ? print_oops_end_marker+0x2a/0x30 [<c0522aab>] ? oops_end+0x8b/0xd0 [<c011eac4>] ? no_context+0xb4/0xd0 [<c011eb1d>] ? __bad_area_nosemaphore+0x3d/0x1a0 [<c0133a56>] ? load_balance_newidle+0x96/0x320 [<c011ec92>] ? bad_area_nosemaphore+0x12/0x20 [<c0524106>] ? do_page_fault+0x2f6/0x380 [<c012cc30>] ? finish_task_switch+0x50/0xe0 [<c0523e10>] ? do_page_fault+0x0/0x380 [<c0522006>] ? error_code+0x66/0x70 [<c0523e10>] ? do_page_fault+0x0/0x380 [<c0150300>] ? kthread_should_stop+0x10/0x20 [<c014c14d>] ? worker_thread+0x7d/0xe0 [<c0150770>] ? autoremove_wake_function+0x0/0x40 [<c014c0d0>] ? worker_thread+0x0/0xe0 [<c015047c>] ? kthread+0x7c/0x90 [<c0150400>] ? kthread+0x0/0x90 [<c0103ce7>] ? kernel_thread_helper+0x7/0x10 Code: 00 00 00 55 89 e5 f0 83 28 01 79 05 e8 02 ff ff ff 5d c3 55 89 c2 89 e5 9c 58 8d 74 26 00 89 c1 fa 90 8d 74 26 00 b8 00 01 00 00 <f0> 66 0f c1 02 38 e0 74 06 f3 90 8a 02 eb f6 89 c8 5d c3 90 8d EIP: [<c0521bc8>] _spin_lock_irqsave+0x18/0x30 SS:ESP 0068:f709dd88 CR2: 00000000ff09dfc8 ---[ end trace 06004df70b9cf436 ]--- Fixing recursive fault but reboot is needed! This seems to happen at least once a day. How do I even begin to debug this?

    Read the article

  • registerForRemoteNotificationTypes causes app to exit immediately

    - by esilver
    I'm seeing behaviour on my iPhone where debug builds immediately exit after a call to [[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeAlert]; The debugger reports it exited with the message Terminating in response to SpringBoard's termination. This behaviour doesn't happen on my ad hoc distribution builds. Can anyone explain this behavior?

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >