Daily Archives

Articles indexed Sunday May 30 2010

Page 14/72 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • Unobtrusive Toggling failing in Rails

    - by sscirrus
    I've been at this for hours but it just isn't working. I'm trying to get ToggleJS working using Scriptaculous' Effects library. Specifically, the example: http://wiseheartdesign.com/page_attachments/0000/0075/demo.html. I got it working beautifully using a pure html file called new.html. I then converted it to new.html.erb so I can incorporate some of the animations into my Rails project and it stopped working! I tried both html and ruby javascript tags but neither are working, for example: <%= javascript_include_tag "application", "prototype", "effects", "lowpro", "toggle" %> The page's body is displaying on the browser, but without animations. I have made sure my javascript files are the same as the demo (plus, the html file is working with them anyway). Do you know where the problem might lie here with my .erb file?

    Read the article

  • Definitive list of protocols supported by the WebClient and WebRequest classes.

    - by the-locster
    The docs state: From WebRequest.Create Method The .NET Framework includes support for the http://, https://, and file:// URI schemes. Custom WebRequest descendants to handle other requests are registered with the RegisterPrefix method. However I've also been using this class to get files via ftp (not listed in the docs). Is there a definitive list of supported protocols documented anywhere? UPDATE: To clarify. Yes additional protocols can be plugged-in, but what is the standard/baseline set of protocols supported in the class framework assuming I haven't registered any others. e.g. sftp, tftp?

    Read the article

  • Hacking "Contact Form 7" code to Add A "Referred By" field

    - by Scott B
    I've got about 6 subdomains that have a "contact us" link and I'm sending all these links to a single form that uses "Contact Form 7". I add ?from=site-name to each of the links so that I can set a $referredFrom variable in the contact form. The only two things I'm missing are (1) the ability to insert this referredFrom variable into the email that I get whenever someone submits the form and (2) The ability to redirect the user back to the site they came from (stored in $referredFrom) Any ideas? Here's a bit of code from includes/classes.php that I thought might be part of the email insert but its not doing much... function mail() { global $referrer; $refferedfrom = $referrer; //HERE IS MY CUSTOM CODE $fes = $this->form_scan_shortcode(); foreach ( $fes as $fe ) { $name = $fe['name']; $pipes = $fe['pipes']; if ( empty( $name ) ) continue; $value = $_POST[$name]; if ( WPCF7_USE_PIPE && is_a( $pipes, 'WPCF7_Pipes' ) && ! $pipes->zero() ) { if ( is_array( $value) ) { $new_value = array(); foreach ( $value as $v ) { $new_value[] = $pipes->do_pipe( $v ); } $value = $new_value; } else { $value = $pipes->do_pipe( $value ); } } $this->posted_data[$name] = $value; $this->posted_data[$refferedfrom] = $referrer; //HERE IS MY CUSTOM CODE } I'm also thinking that I could insert the referredFrom code somewhere in this function as well... function compose_and_send_mail( $mail_template ) { $regex = '/\[\s*([a-zA-Z][0-9a-zA-Z:._-]*)\s*\]/'; $callback = array( &$this, 'mail_callback' ); $mail_subject = preg_replace_callback( $regex, $callback, $mail_template['subject'] ); $mail_sender = preg_replace_callback( $regex, $callback, $mail_template['sender'] ); $mail_body = preg_replace_callback( $regex, $callback, $mail_template['body'] ); $mail_recipient = preg_replace_callback( $regex, $callback, $mail_template['recipient'] ); $mail_headers = "From: $mail_sender\n"; if ( $mail_template['use_html'] ) $mail_headers .= "Content-Type: text/html\n"; $mail_additional_headers = preg_replace_callback( $regex, $callback, $mail_template['additional_headers'] ); $mail_headers .= trim( $mail_additional_headers ) . "\n"; if ( $this->uploaded_files ) { $for_this_mail = array(); foreach ( $this->uploaded_files as $name => $path ) { if ( false === strpos( $mail_template['attachments'], "[${name}]" ) ) continue; $for_this_mail[] = $path; } return @wp_mail( $mail_recipient, $mail_subject, $mail_body, $mail_headers, $for_this_mail ); } else { return @wp_mail( $mail_recipient, $mail_subject, $mail_body, $mail_headers ); } }

    Read the article

  • Bluehost internal server error

    - by Aditya
    Hello everyone, When i am creating the setup of my rails application on bluehost,it throw following error:- Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request. Apache/2.2.14 (Unix) mod_ssl/2.2.14 OpenSSL/0.9.8l DAV/2 mod_auth_passthrough/2.1 FrontPage/5.0.2.2635 Server at team.cipher-tech.com Port 80 Please help me.It's urgent. Thanks in advance..

    Read the article

  • i want to find determinant of 4x4 matrix in c#

    - by vj4u
    i want to find determinant of 4x4 matrix in c# please help urgent int ss = 4; int count = 0; int[,] matrix=new int[ss,ss]; ArrayList al = new ArrayList() {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 }; for (int i = 0; i < ss; i++) { for (int j = 0; j < ss; j++) { matrix[i, j] =Convert.ToInt32( al[count]); ++count; Response.Write(matrix[i, j] + " "); } Response.Write("<br/>"); }

    Read the article

  • Load thumbnail image into PictureBox from directory

    - by zaidwaqi
    Hi, I use the following code to get thumbnail of image in Resources, and display on Picturebox. Image tmp = (System.Drawing.Image)myManager.GetObject(tempImage); cfgPassPicture[m].Image = tmp.GetThumbnailImage(40, 40, new System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallback), System.IntPtr.Zero); How do I do this for images in directory (instead of resources), given only the URL? I can load image into PictureBox via ImageLocation property, but not sure how to use Image property of PictureBox for this. Thanks

    Read the article

  • disable keep-alive in NSURLConnection

    - by Nava Carmon
    How can disable keep-alive when using NSURLConnection? Seems, that after cancelling and close it it still saves somewhere a socket that I was connected to server with and while the server fetches for information i cannot access another urls from the same server. I wonder if there is a way to completely reset a socket and start another one. Thanks, Nav

    Read the article

  • High-quality ERD generator for PostgresQL under Linux?

    - by Dave Jarvis
    Background MySQL Workbench can produce appealing and high-quality ERDs such as: Research I have not found a tool that even comes close for PostgreSQL. Tools I have found: dbVisualizer - Yellow squares. AquaFold - Yellow squares. SQL Developer - Coloured squares. Dia - Coloured squares. SchemaBank - Can't export to PNG; looks okay, nothing stellar. SchemaSpy - XML export makes it possible to write an XSL skin... Gliffy - Incompatible Flash version. Druid - No. pgAdmin3 - Not applicable? phpPgAdmin - Couldn't login without a 30-minute configuration battle. Requirements Looking for an ERD tool: Visually stunning by default Can reverse-engineer a PostgreSQL (or JDBC-compliant) database Runs on Linux (or under WINE) Export high-resolution PNG (or SVG) FOSS

    Read the article

  • How can I add SOAP Headers to a WSDL generated Borland C++ Builder 6 application.

    - by MJG
    Using a WSDL that requires a SOAP HEADER for Authentication (fragment below) code that gets generated when creating a web service client via the "WSDL Importer" has no concept of the Authentication Headers and there are no examples in BCB6 C++ Examples/WebServices directories that show how, and nothing on Web that I can find. Anyone with BCB6 C++ (not Delphi) have an example of adding SOAP Headers to a TRemotable subclass? <s:element name="AuthenticationHeader" type="tns:AuthenticationHeader"/> <s:complexType name="AuthenticationHeader"> <s:complexContent mixed="false"> <s:extension base="tns:UserAuthHeader"> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="Function" type="s:string"/> <s:element minOccurs="1" maxOccurs="1" name="TimeOutMilliSec" type="s:int"/> </s:sequence> </s:extension> </s:complexContent> </s:complexType> <s:complexType name="UserAuthHeader"> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="Username" type="s:string"/> <s:element minOccurs="0" maxOccurs="1" name="Password" type="s:string"/> </s:sequence> <s:anyAttribute/> </s:complexType>

    Read the article

  • MySQL best usage in Tomcat?

    - by mabuzer
    Which one is better way of using MySQL in Tomcat : A) assign a DB connection for user as long as it's session is valid. [OR] B) open connection to DB, on every request come to server and when it's done close that. ?

    Read the article

  • using QTkit for recording audio

    - by RW
    It looks like using core audio to record audio is overly complicated. While QTkit is basic and down to earth However. All of the examples I have see integrate video and audio together. Does some one have or know an example of using QTkit for recording audio? rw

    Read the article

  • C#: Regex to extract portions of file name

    - by jakesankey
    I have text files formatted as such: R156484COMP_004A7001_20100104_065119.txt I need to consistently extract the R****COMP, the 004A7001 number, 20100104 (date), and don't care about the 065119 number. the problem is that not ALL of the files being parsed have the exact naming convention. some may be like this: R168166CRIT_156B2075_SU2_20091223_123456.txt or R285476COMP_SU1_125A6025_20100407_123456.txt So how could I use regex instead of split to ensure I am always getting that serial (ex. 004A7001), the date (ex. 20100104), and the R****COMP (or CRIT)??? Here is what I do now but it only gets the files formatted like my first example. if (file.Count(c => c == '_') != 3) continue; and further down in the code I have: string RNumber = Path.GetFileNameWithoutExtension(file); string RNumberE = RNumber.Split('_')[0]; string RNumberD = RNumber.Split('_')[1]; string RNumberDate = RNumber.Split('_')[2]; DateTime dateTime = DateTime.ParseExact(RNumberDate, "yyyyMMdd", Thread.CurrentThread.CurrentCulture); string cmmDate = dateTime.ToString("dd-MMM-yyyy");

    Read the article

  • Which header files are necessary to run this code snippet?

    - by httpinterpret
    It's from here,but fails when compiling: int main(int argc, char **argv) { struct hostent { char *h_name; // main name char **h_aliases; // alternative names (aliases) int h_addrtype; // address type (usually AF_INET) int h_length; // length of address (in octets) char **h_addr_list; // alternate addresses (in Network Byte Order) }; #define h_addr h_addr_list[0] // First address of h_addr_list. struct hostent *info_stackoverflow; int i = 0; info_stackoverflow = gethostbyname( "www.stackoverflow.com" ); printf("The IP address of %s is %s", info_stackoverflow->h_name, inet_ntoa( * ((struct in_addr *)info_stackoverflow->h_addr ))); /* aliases */ while( *(pc_ip->h_aliases + i) != NULL ) { printf("\n\tAlias: %s", *(pc_ip->h_aliases + i) ); i++; } }

    Read the article

  • Problem removing registry key with .reg file

    - by TMRW
    Didnt notice this being asked so here i am. I have a problem with specific registry key: NvCplDaemon"="RUNDLL32.EXE C:\\Windows\\system32\\NvCpl.dll,NvStartup" Problem is that i have tried many variations of the reg file like: Windows Registry Editor Version 5.00 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run "NvCplDaemon"=-"RUNDLL32.EXE C:\\Windows\\system32\\NvCpl.dll,NvStartup" and Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run] "NvCplDaemon"=-"RUNDLL32.EXE C:\\Windows\\system32\\NvCpl.dll,NvStartup" And they all seemingly complete but the key remains.It is not locked or something.I can delete and recreate it manually any time.Im guessing there is some small spelling error on my file because i think i have followed MS instructions: http://support.microsoft.com/kb/310516 This is how it looks in Registry: Someone?

    Read the article

  • Fastest router for OpenWRT/etc?

    - by marienbad
    I realize OpenWRT Wiki hardware info tells CPU model and MHz for many routers, but MHz doesn't directly map to speed. So... as far as you know, what are some of the fastest OpenWRT-compatible wifi routers out there?

    Read the article

  • jQuery ajax multiline "script" response

    - by Rendrik
    I'm designing a template creation tool, which uses a jQuery Ajax request that posts parameters to a PHP file. The PHP does the actual generation of the template's HTML. // Send for processing. Expect JS back to execute. function generate() { $.ajax({ type: "POST", url: "generate.php", data: $('#genform :input').serialize(), dataType: "script", beforeSend: function() { $("#loading").html("<img src='images/loadbar.gif' />"); $("#loading") .dialog({ height: 80, width: 256, autoOpen: true, modal: true }); }, success: function(data) { $("#loading").dialog('close'); } }); } My trouble is that I have the ajax dataType: set to "script". Using this, the PHP file generates some jQuery dialogs for any errors which works nicely. However, after I generate the HTML, i'm having trouble passing it back. So I have probably 100 lines of generated HTML and javascript which i'd like to work with. In the PHP file, i've tried: echo('$("#result").html("'.$html.'");'); This does actually work if there are NO line breaks in $html. As soon as there are any line breaks, the Chrome debugger reports "gen.html:1 Uncaught SyntaxError: Unexpected token ILLEGAL". It's obvious that it's trying to eval the returned response headers, but is stopping at any line break. So, to be clear, when I pass $html back, if the contents are this: $html = "<div>hi there</div>"; It works fine (all of my error message dialogs are one line). But if it's: $html = "<div> hi there </div>"; It blows up. I'm really not sure how to get around this, or if there's a better way to go about it. It's important to me to keep the formatting so people can copy the HTML template. I may just break down and display the template file on the PHP page if I can't solve this, but I was really hoping to keep everything within the confines of the HTML page.

    Read the article

  • rails dates with json

    - by fenec
    hello am implementing a facebook application and am using AJAX/Json,however the json structures that are returned have this format "2010-05-30T06:14:00Z" , I am using Game.all.to_json how can i convert them to a normal date format ? Is it easier to do it from the server side or the client side using fbjs? (there are a lot of bugs with fbjs so i would prefer using a solution from the server side , like converting the data before sending the json structures) thnak you

    Read the article

  • Is there any program that obfuscates C# source code?

    - by markattwood
    Our requirement is being able to integrate our DLLs with ClickOnce. Dotfuscator does the obfuscation job nicely but the obfuscated DLLs cannot be deployed with ClickOnce on customer side. On our side, we can handle it perfectly. Moreover, the obfuscated assemblies sometime crashes our .NET CF app. It turns out to a solution that creates a temporary source and obfuscates it before compiling with VS. This ensures that the compiled assembly can be integrated with ClickOnce and fully compatible with .NET CF. What is the best tool to obfuscate C# SOURCE CODE (not assemblies)?

    Read the article

  • Should I still care about IE6?

    - by Nimbuz
    I've finished the design and about to code HTML for a website that will use fancy form elements and effects. I'm wondering if I should support IE6? What are the latest stats? Do you support IE6 still?

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >