Search Results

Search found 20383 results on 816 pages for 'hello'.

Page 75/816 | < Previous Page | 71 72 73 74 75 76 77 78 79 80 81 82  | Next Page >

  • Why Response.Write behavior varies in the given scenario?

    - by Sri Kumar
    Hello All, When i POST the page using the following code, the Response.write("Hey") doesn't write the content ("Hello") to the parent page <form method="post" name="upload" enctype="multipart/form-data" action="http://localhost:2518/Web/CrossPage.aspx?cmd=getvalue" > <input type="file" name="filename" /> <input type="submit" value="Upload Data File" name="cmdSubmit" /> </form> But When i use following code , and POST the data, the Response.write("Hey") can be obtained in the parent page HttpWebRequest requestToSender = (HttpWebRequest)WebRequest.Create("http://localhost:2518/Web/CrossPage.aspx?cmd=getvalue"); requestToSender.Method = "POST"; requestToSender.ContentType = "multipart/form-data"; HttpWebResponse responseFromSender = (HttpWebResponse)requestToSender.GetResponse(); string fromSender = string.Empty; using (StreamReader responseReader = new StreamReader(responseFromSender.GetResponseStream())) { fromSender = responseReader.ReadToEnd(); } In the CrossPage.aspx i have the following code if (!Page.IsPostBack) { NameValueCollection postPageCollection = Request.Form; foreach (string name in postPageCollection.AllKeys) { Response.Write(name + " " + postPageCollection[name]); } HttpFileCollection postCollection = Request.Files; foreach (string name in postCollection.AllKeys) { HttpPostedFile aFile = postCollection[name]; aFile.SaveAs(Server.MapPath(".") + "/" + Path.GetFileName(aFile.FileName)); } Response.Write("Hey"); } I don't have any code in the Page_Load event of parent page.? What could be the cause? I need to write the "hey" to the Parent page using the first scenario. Both the application are of different domain. Edit: "Hey" would be from the CrossPage.aspx. I need to write this back to the Parent Page

    Read the article

  • jQuery: bind generated elements

    - by superUntitled
    Hello, thank you for taking time to look at this. I am trying to code my very first jQuery plugin and have run into my first problem. The plugin is called like this <div id="kneel"></div> <script type="text/javascript"> $("#kneel").zod(1, { }); </script> It takes the first option (integer), and returns html content that is dynamically generated by php. The content that is generated needs to be bound by a variety of functions (such as disabling form buttons and click events that return ajax data. The plugin looks like this (I have included the whole plugin in case that matters)... (function( $ ){ $.fn.zod = function(id, options ) { var settings = { 'next_button_text': 'Next', 'submit_button_text': 'Submit' }; return this.each(function() { if ( options ) { $.extend( settings, options ); } // variables var obj = $(this); /* these functions contain html elements that are generated by the get() function below */ // disable some buttons $('div.bario').children('.button').attr('disabled', true); // once an option is selected, enable the button $('input[type="radio"]').live('click', function(e) { $('div.bario').children('.button').attr('disabled', false); }) // when a button is clicked, return some data $('.button').bind('click', function(e) { e.preventDefault(); $.getJSON('/returnSomeData.php, function(data) { $('.text').html('<p>Hello: ' + data + '</p>'); }); // generate content, this is the content that needs binding... $.get('http://example.com/script.php?id='+id, function(data) { $(obj).html(data); }); }); }; })( jQuery ); The problem I am having is that the functions created to run on generated content are not binding to the generated content. How do I bind the content created by the get() function?

    Read the article

  • How to configure and run a fastcgi application using Lighthttpd...

    - by Airy
    Hi, i've installed Lighthttpd for windows and i'd created a simple program in c++ which uses fastcgi libraries. i'll post the code here... #include "fcgi_stdio.h" #include <stdlib.h> int count; void initialize(void) { count=0; } void main(void) { initialize(); while (FCGI_Accept() >= 0) { printf("Content-type: text/html\r\n" "\r\n" "<title>FastCGI Hello! (C, fcgi_stdio library)</title>" "<h1>FastCGI Hello! (C, fcgi_stdio library)</h1>" "Request number %d running on host <i>%s</i>\n", ++count, getenv("SERVER_HOSTNAME")); } } I've spawned the fastcgi application in lighthttpd using the below configuration in lightttpd-inc.conf fastcgi.server = ( ".exe" => ( "" => ( "bin-path" => "D:\tinycgi.exe", "port" => 8080, "min-procs" => 1, "max-procs" => 1 ) ) ) while sending a request using the browser the server is responding with this message in the console 2009-02-18 16:08:34: (mod_fastcgi.c.2494) unexpected end-of-file (perhaps the fa stcgi process died): pid: 0 socket: tcp:localhost:8080 2009-02-18 16:08:34: (mod_fastcgi.c.3325) response not received, request sent: 1 024 on socket: tcp:localhost:8080 for /new/tinycgi.exe , closing connection I think the fastcgi application is not spawned correctly. Thank you, Varun

    Read the article

  • Perl 500 internal server error. Something wrong with my code.

    - by Nitish
    I get a 500 internal server error when I try to run the code below in a web server which supports perl: #! /usr/bin/perl use LWP; my $ua = LWP::UserAgent->new; $ua->agent("TestApp/0.1 "); $ua->env_proxy(); my $req = HTTP::Request->new(POST => 'http://www.google.com/loc/json'); $req->content_type('application/jsonrequest'); $req->content('{ "cell_towers": [{"location_area_code": "55000", "mobile_network_code": "95", "cell_id": "20491", "mobile_country_code": "404"}], "version": "1.1.0", "request_address": "true"}'); my $res = $ua->request($req); if ($res->is_success) { print $res->content,"\n"; } else { print $res->status_line, "\n"; return undef; } But there is no error when I run the code below: #! /usr/bin/perl use CGI::Carp qw(fatalsToBrowser); print "Content-type: text/html\n\n"; print "<HTML>\n"; print "<HEAD><TITLE>Hello World!</TITLE></HEAD>\n"; print "<BODY>\n"; print "<H2>Hello World!</H2> <br /> \n"; foreach $key (sort keys(%ENV)) { print "$key = $ENV{$key}<p>" ; } print "</BODY>\n"; print "</HTML>\n"; So I think there is some problem with my code. When I run the first perl script in my local machine with the -wc command, it says that the syntax is OK. Help me please.

    Read the article

  • Google Maps API v3 - infoWindows all have same content

    - by paulriedel
    Hello, I've been having problems with the infoWindows and Google Maps API v3. Initially, I've ran into the problem that everyone else has of closing infoWindows when opening a new one. I thought to have solved the problem by defining "infowindow" beforehand. Now they close when I click on a new marker, but the content is the same. How should I re-structure my code to make sure the content is the right one each time - and only one infoWindow is open at a given time? Thank you! Paul var allLatLngs = new Array(); var last = 0; var infowindow; function displayResults(start, count){ if(start === undefined){ start = last; } if(count === undefined){ count = 20; } jQuery.each(jsresults, function(index, value) { if(index >= start && index < start+count){ var obj = jQuery.parseJSON(value); $("#textresults").append(index + ": <strong>" + obj.name + "</strong> " + Math.round(obj.distanz*100)/100 + " km entfernt" + "<br/>"); var myLatlng = new google.maps.LatLng(obj.geo_lat, obj.geo_lon); allLatLngs.push(myLatlng); var contentString = '<strong>'+obj.name+'</strong>'; infowindow = new google.maps.InfoWindow({ content: contentString }); var marker = new google.maps.Marker({ position: myLatlng, //title:"Hello World!" }); marker.setMap(map); google.maps.event.addListener(marker, 'click', function() { if (infowindow) { infowindow.close(map,marker); } infowindow.open(map,marker); }); } }); last = start+count;

    Read the article

  • problem finding a header with a c++ makefile

    - by Max
    Hi. I've started working with my first makefile. I'm writing a roguelike in C++ using the libtcod library, and have the following hello world program to test if my environment's up and running: #include "libtcod.hpp" int main() { TCODConsole::initRoot(80, 50, "PartyHack"); TCODConsole::root->printCenter(40, 25, TCOD_BKGND_NONE, "Hello World"); TCODConsole::flush(); TCODConsole::waitForKeypress(true); } My project directory structure looks like this: /CppPartyHack ----/libtcod-1.5.1 # this is the libtcod root folder --------/include ------------libtcod.hpp ----/PartyHack --------makefile --------partyhack.cpp # the above code (while we're here, how do I do proper indentation? Using those dashes is silly.) and here's my makefile: SRCDIR = . INCDIR = ../libtcod-1.5.1/include CFLAGS = $(FLAGS) -I$(INCDIR) -I$(SRCDIR) -Wall CC = gcc CPP = g++ .SUFFIXES: .o .h .c .hpp .cpp $(TEMP)/%.o : $(SRCDIR)/%.cpp $(CPP) $(CFLAGS) -o $@ -c $< $(TEMP)/%.o : $(SRCDIR)/%.c $(CC) $(CFLAGS) -o $@ -c $< CPP_OBJS = $(TEMP)partyhack.o all : partyhack partyhack : $(CPP_OBJS) $(CPP) $(CPP_OBJS) -o $@ -L../libtcod-1.5.1 -ltcod -ltcod++ -Wl,-rpath,. clean : \rm -f $(CPP_OBJS) partyhack I'm using Ubuntu, and my terminal gives me the following errors: max@max-desktop:~/Desktop/Development/CppPartyhack/PartyHack$ make g++ -c -o partyhack.o partyhack.cpp partyhack.cpp:1:23: error: libtcod.hpp: No such file or directory partyhack.cpp: In function ‘int main()’: partyhack.cpp:5: error: ‘TCODConsole’ has not been declared partyhack.cpp:6: error: ‘TCODConsole’ has not been declared partyhack.cpp:6: error: ‘TCOD_BKGND_NONE’ was not declared in this scope partyhack.cpp:7: error: ‘TCODConsole’ has not been declared partyhack.cpp:8: error: ‘TCODConsole’ has not been declared make: * [partyhack.o] Error 1 So obviously, the makefile can't find libtcod.hpp. I've double checked and I'm sure the relative path to libtcod.hpp in INCDIR is correct, but as I'm just starting out with makefiles, I'm uncertain what else could be wrong. My makefile is based off a template that the libtcod designers provided along with the library itself, and while I've looked at a few online makefile tutorials, the code in this makefile is a good bit more complicated than any of the examples the tutorials showed, so I'm assuming I screwed up something basic in the conversion. Thanks for any help.

    Read the article

  • Error 100 When Attempting to post from app to Facebook wall?

    - by IMAPC
    I'm playing around with the Facebook API, and have gotten far enough to get the access token into my app, but when I go to actually send a post to my Facebook wall I get the error message, {"error":{"message":"(#100) You can't post this because it has a blocked link.","type":"OAuthException","code":100}}1 I'm not attempting to send any kind of link, just "Hello, World!" so this seems pretty weird to me :\ Here's my code so far: $content = urlencode("Hello, World!"); $accesstoken = urlencode($row['fbid']); $result = getPageWithPOST("https://graph.facebook.com/me/feed", "access_token=" . $accesstoken . "&message=" . $content); echo $result; where getPageWithPOST is, function getPageWithPOST($url, $posts) { $c = curl_init(); curl_setopt($c, CURLOPT_URL, $url); curl_setopt($c, CURLOPT_POST, true); curl_setopt($c, CURLOPT_POSTFIELDS, $posts); $content = curl_exec ($c); curl_close ($c); return $content; } thanks!

    Read the article

  • JavaScript: How is "function x() {}" different from "x = function() {}" ?

    - by jleedev
    In the answers to this question, we read that function f() {} defines the name locally, while [var] f = function() {} defines it globally. That makes perfect sense to me, but there's some strange behavior that's different between the two declarations. I made an HTML page with the script onload = function() { alert("hello"); } and it worked as expected. When I changed it to function onload() { alert("hello"); } nothing happened. (Firefox still fired the event, but WebKit, Opera, and Internet Explorer didn't, although frankly I've no idea which is correct.) In both cases (in all browsers), I could verify that both window.onload and onload were set to the function. In both cases, the global object this is set to the window, and I no matter how I write the declaration, the window object is receiving the property just fine. What's going on here? Why does one declaration work differently from the other? Is this a quirk of the JavaScript language, the DOM, or the interaction between the two?

    Read the article

  • How to use ID selector after jQuery html()

    - by user555617
    It's amazing to try to understand why the function alert("hello") is not generated after clicking more than once... There is some method to do this function is executed? Note that doesn't work after update using html() involving id "press" in button. Any idea? See: http://jsbin.com/atuqu3 JavaScript: $(document).ready(function (){ $("#press").click(function() { $("#relation-states").html('<select id="state" name="state"> <option value="Texas">Texas</option> </select><button id="press" type="button" title="" aria-haspopup="true" style="width: 175px;"><span>Select an item</span></button>');; alert("hello"); }); }); HTML: <div id="relation-states"> <select id="state" name="state"> <option value="New York">New York</option> </select> <button id="press" type="button" title="" aria-haspopup="true" style="width: 175px;"><span>Select an item</span></button> </div>

    Read the article

  • Some questions about special operators i've never seen in C++ code.

    - by toto
    I have downloaded the Phoenix SDK June 2008 (Tools for compilers) and when I'm reading the code of the Hello sample, I really feel lost. public ref class Hello { //-------------------------------------------------------------------------- // // Description: // // Class Variables. // // Remarks: // // A normal compiler would have more flexible means for holding // on to all this information, but in our case it's simplest (if // somewhat inelegant) if we just keep references to all the // structures we'll need to access as classstatic variables. // //-------------------------------------------------------------------------- static Phx::ModuleUnit ^ module; static Phx::Targets::Runtimes::Runtime ^ runtime; static Phx::Targets::Architectures::Architecture ^ architecture; static Phx::Lifetime ^ lifetime; static Phx::Types::Table ^ typeTable; static Phx::Symbols::Table ^ symbolTable; static Phx::Phases::PhaseConfiguration ^ phaseConfiguration; 2 Questions : What's that ref keyword? What is that sign ^ ? What is it doing protected: virtual void Execute ( Phx::Unit ^ unit ) override; }; override is a C++ keyword too? It's colored as such in my Visual Studio. I really want to play with this framework, but this advanced C++ is really an obstacle right now. Thank you.

    Read the article

  • String literal recognition problem

    - by helicera
    Hello! I'm trying to recognize string literal by reading string per symbol. Here is a sample code: #region [String Literal (")] case '"': // {string literal ""} { // skipping '"' ChCurrent = Line.ElementAtOrDefault<Char>(++ChPosition); while(ChCurrent != '"') { Value.Append(ChCurrent); ChCurrent = Line.ElementAtOrDefault<Char>(++ChPosition); if(ChCurrent == '"') { // "" sequence only acceptable if(Line.ElementAtOrDefault<Char>(ChPosition + 1) == '"') { Value.Append(ChCurrent); // skip 2nd double quote ChPosition++; // move position next ChCurrent = Line.ElementAtOrDefault<Char>(++ChPosition); } } else if(default(Char) == ChCurrent) { // message: unterminated string throw new ScanningException(); } } ChPosition++; break; } #endregion When I run test: [Test] [ExpectedException(typeof(ScanningException))] public void ScanDoubleQuotedStrings() { this.Scanner.Run(@"""Hello Language Design""", default(System.Int32)); this.Scanner.Run(@"""Is there any problems with the """"strings""""?""", default(System.Int32)); this.Scanner.Run(@"""v#:';?325;.<>,|+_)""(*&^%$#@![]{}\|-_=""", default(System.Int32)); while(0 != this.Scanner.TokensCount - 1) { Assert.AreEqual(Token.TokenClass.StringLiteral, this.Scanner.NextToken.Class); } } It passes with success.. while I'm expecting to have an exception according to unmatched " mark in this.Scanner.Run(@"""v#:';?325;.<>,|+_)""(*&^%$#@![]{}\|-_=""", default(System.Int32)); Can anyone explain where is my mistake or give an advice on algorithm.

    Read the article

  • Can Haskell's monads be thought of as using and returning a hidden state parameter?

    - by AJM
    I don't understand the exact algebra and theory behind Haskell's monads. However, when I think about functional programming in general I get the impression that state would be modelled by taking an initial state and generating a copy of it to represent the next state. This is like when one list is appended to another; neither list gets modified, but a third list is created and returned. Is it therefore valid to think of monadic operations as implicitly taking an initial state object as a parameter and implicitly returning a final state object? These state objects would be hidden so that the programmer doesn't have to worry about them and to control how they gets accessed. So, the programmer would not try to copy the object representing the IO stream as it was ten minutes ago. In other words, if we have this code: main = do putStrLn "Enter your name:" name <- getLine putStrLn ( "Hello " ++ name ) ...is it OK to think of the IO monad and the "do" syntax as representing this style of code? putStrLn :: IOState -> String -> IOState getLine :: IOState -> (IOState, String) main :: IOState -> IOState -- main returns an IOState we can call "state3" main state0 = putStrLn state2 ("Hello " ++ name) where (state2, name) = getLine state1 state1 = putStrLn state0 "Enter your name:"

    Read the article

  • C: Fifo between threads, writing and reading strings

    - by Yonatan
    Hello once more dear internet, I writing a small program that among other things, writes a log file of commands received. to do that, I want to use a thread that all it should do is just attempt to read from a pipe, while the main thread will write into that pipe whenever it should. Since i don't know the length of each string command, i thought about writing and reading the pointer to the char buf[MAX_MESSAGE_LEN]. Since what i've tried so far doesn't work, i'll post my best effort :P char str[] = "hello log thread 123456789 10 11 12 13 14 15 16 17 18 19\n"; if (pipe(pipe_fd) != 0) return -1; pthread_t log_thread; pthread_create(&log_thread,NULL, log_thread_start, argv[2]); success_write = 0; do { write(pipe_fd[1],(void*)&str,sizeof(char*)); } while (success_write < sizeof(char*)); and the thread does this: char buffer[MAX_MSGLEN]; int success_read; success_read = 0; //while(1) { do { success_read += read(pipe_fd[0],(void*)&buffer, sizeof(char*)); } while (success_read < sizeof(char*)); //} printf("%s",buffer); (Sorry if this doesn't indent, i can't seem to figure out this editor...) oh, and pipe_fd[2] is a global parameter. So, any help with this, either by the way i thought of, or another way i could read strings without knowing the length, would be much appreciated. On a side note, i'm working on Eclipse IDE C/C++, version 1.2.1 and i can't seem to set up the compiler so it will link the pthread library to my project. I've resorted to writing my own Makefile to make it (pun intended :P) work. Anyone knows what to do ? i've looked online, but all i find are solutions that are probably good on an older version because the tabs and option keys are different. Anyways, Thanks a bunch internet ! Yonatan

    Read the article

  • PDF (VisPDF component) Problem with DecimalSeparator in Delphi/C++Builder2009

    - by Katsumi
    Hello. I use VisPDF component Delphi/C++Builder 2009 and show text with ShowMessage(FloatToStrF(1.23, ffFixed, 6, 2)); // Output: 1,23 (right!) UnicodeString Text = "Hello world!"; VPDF->CurrentPage->UnicodeTextOutStr( x, y, 0, Text); ShowMessage(FloatToStrF(1.23, ffFixed, 6, 2)); // Output: 1.23 (false!) afer UnicodeTextOutStr() the DecimalSeparator is changed. I have look in VisPDF source and found, that: Abscissa := Angle * Pi / 180; X := XProjection(X) + StrHeight * sin(Abscissa); Y := (YProjection(Y)) - StrHeight * cos(Abscissa); MtxA := cos(Abscissa); MtxB := sin(Abscissa); SetTextMatrix(MtxA, MtxB, -MtxB, MtxA, X, Y); with SetTextMatrix() show up the bug. comment out this line, DecimalSeparator is right, but no text in my pdf. procedure TVPDFPage.SetTextMatrix(a, b, c, d, x, y: Single); var S: AnsiString; begin S := _CutFloat(a) + ' ' + _CutFloat(b) + ' ' + _CutFloat(c) + ' ' + _CutFloat(d) + ' ' + _CutFloat(x) + ' ' + _CutFloat(y) + ' Tm'; SaveToPageStream(S); end; procedure TVPDFPage.SaveToPageStream(ValStr: AnsiString); begin PageContent.Add(string(ValStr)); // PageContent: TStringList; end; I don't understand this function. Can somebody help? VisPDF does not use any DLL or other software to create PDF files. Using VisPDF is very easy and have good examples.

    Read the article

  • Dynamic Variable Names in Included Module in Ruby?

    - by viatropos
    I'm hoping to implement something like all of the great plugins out there for ruby, so that you can do this: acts_as_commentable has_attached_file :avatar But I have one constraint: That helper method can only include a module; it can't define any variables or methods. Here's what the structure looks like, and I'm wondering if you know the missing piece in the puzzle: # 1 - The workhorse, encapsuling all dynamic variables module My::Module def self.included(base) base.extend ClassMethods base.class_eval do include InstanceMethods end end module InstanceMethods self.instance_eval %Q? def #{options[:my_method]} "world!" end ? end module ClassMethods end end # 2 - all this does is define that helper method module HelperModule def self.included(base) base.extend(ClassMethods) end module ClassMethods def dynamic_method(options = {}) include My::Module(options) end end end # 3 - send it to active_record ActiveRecord::Base.send(:include, HelperModule) # 4 - what it looks like class TestClass < ActiveRecord::Base dynamic_method :my_method => "hello" end puts TestClass.new.hello #=> "world!" That %Q? I'm not totally sure how to use, but I'm basically just wanting to somehow be able to pass the options hash from that helper method into the workhorse module. Is that possible? That way, the workhorse module could define all sorts of functionality, but I could name the variables whatever I wanted at runtime.

    Read the article

  • My app crash with MFMailComposeViewController and MFMessageComposeViewController when I re-launch it.

    - by Dolwen
    Hello all, I encounter a crash with MFMailComposeViewController, MFMessageComposeViewController and multitasking on IOS 4.2 (both simulator and IPHone 4). Code i use : Class emailClass = (NSClassFromString(@"MFMailComposeViewController")); if( emailClass != nil ) { MFMailComposeViewController * controller = [[emailClass alloc] init]; if([emailClass canSendMail]) { // delegate controller.mailComposeDelegate = self; // subject [controller setSubject:@"Hello All."]; // main message [controller setMessageBody:@"I love Stackoverflow.com !" isHTML:NO]; // adding image attachment // getting path for the image we have in the tutorial project NSString *path = [[NSBundle mainBundle] pathForResource:@"image" ofType:@"png"]; // loading content of the image into NSData NSData *imageData = [NSData dataWithContentsOfFile:path]; // adding the attachment to he message [controller addAttachmentData:imageData mimeType:@"image/png" fileName:@"My Byook image"]; // setting different than the default transition for the modal view controller [controller setModalTransitionStyle:UIModalTransitionStyleCoverVertical]; // show [[CGameStateManager getCurrentGameState] presentModalViewController:controller animated:YES]; } [controller release]; } To close MFMailComposeViewController i use : [[CGameStateManager getCurrentGameState] dismissModalViewControllerAnimated:NO]; Then the app crash on the "dismissModalViewControllerAnimated:" and we can read in the debugger with NSZombieEnabled : * -[UIImage isKindOfClass:]: message sent to deallocated instance 0xb0b9f80 Anyone have an answer to solve my problem ? :) Thx

    Read the article

  • jtable update data not visible

    - by Thomas n
    I am running into a problem similar to what I have read here about inserted data and added data not showing up on jtable. I have tried repaint() and revalidate(), but to no avail. Basically, I have two classes say A and B. A calls a function in class B to add a row of data to the table. Here is the code.(By the way I am using Netbeans 7.1.2 to add a table and then add some code to handle the update.) public void callUpdateTable(){ DefaultTableModel myModel = (DefaultTableModel)jTable1.getModel(); DateFormat dateFormate = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss"); Object[] str = new Object[3]; Date date = new Date(); str[0] = dateFormate.format(date); str[1] = "Robot"; str[2] = "hello"; // myModel.addRow(str); myModel.insertRow(1, str); myModel.setValueAt("Hello", 1, 2); System.out.println("count = " + myModel.getValueAt(1, 2)); jTable1.repaint(); } The funny thing is on system print it prints out the value at the cell(1,2) I set the value, but doesn't show up on the table. Thank you for your help.

    Read the article

  • Implicit linking vs. explicit linking of DLL in Delphi

    - by Tom
    I'm having trouble getting my dll to work when using explicit linking. Using implicit linking it works fine. Would someone google me a solution? :) No, just kidding, here's my code: This code works fine: function CountChars(_s: Pchar): integer; StdCall; external 'sample_dll.dll'; procedure TForm1.Button1Click(Sender: TObject); begin ShowMessage(IntToStr(CountChars('Hello world'))); end; This code doesn't work (I get an access violation): procedure TForm1.Button1Click(Sender: TObject); var LibHandle: HMODULE; CountChars: function(_s: PChar): integer; begin LibHandle := LoadLibrary('sample_dll.dll'); ShowMessage(IntToStr(CountChars('Hello world'))); // Access violation FreeLibrary(LibHandle); end; This is the DLL code: library sample_dll; uses FastMM4, FastMM4Messages, SysUtils, Classes; {$R *.res} function CountChars(_s: PChar): integer; stdcall; begin Result := Length(_s); end; exports CountChars; begin end.

    Read the article

  • Why doesn't line-height work on FF/3.5.8(Mac)?

    - by Znarkus
    I can't get line-height on a text input to work on Firefox 3.5.8/(Mac). Works flawlessly on: IE6 IE7 IE8 FF3.6/PC FF3.6/Mac Safari Test code: <!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> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>asd</title> <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.8.0r4/build/reset/reset-min.css" /> </head> <body> <input type="text" value="Hello" style="line-height:50px;height:50px;font-size:16px;" /> <input type="text" value="Hello" style="padding:17px 0;font-size:16px;" /> </body> </html> Is there an alternate solution or any idea how to fix this? Edit: Updated the test code, to compare line-height vs. padding technique. Padding works on all above browsers except IE8. Whaat? I can't test on FF/3.5.8 anymore, could someone please report the result from this browser on any plattform? I'm now thinking this is a Firefox 3.5.8 issue, plattform independent.

    Read the article

  • Converting WAR to EAR and other Glassfish stories

    - by Random
    Hello! I am really new in this so I hopefully don't make any terrible mistake. I apologize before hand if I have. In my project I was using tomcat and deploying WAR files. But now some bosses wants to deploy EAR files. So there we go. I first downloaded Glassfish (don't know if it's the apropiate application server for a newbie like me), instaled it and all (I even deployed the hello.war in the autodeploy _< ). Then prepared an EAR file. From what I know, I just need to create an Enterprise Application Project in Eclipse and add to the module my war file. This changes the application.xml file automatically (thanks eclipse project!). So I exported it to an EAR file and uploaded it to the glassfish server. Wonders of wonders, it doesn't work. I also tried deploying the old WAR file in this new shiny glassfish but it goes on http-404 not found error. The glassfish seems to say that my project is not in ~/domains/domain1/docroot. By the way I am using windows and I am aware of some problems between glassfish and windows due to some updating open files or such. So I have to questions: First, Am I doing the EAR package correctly? Second, Do I need to do some especial configuration to the glassfish server to deploy EAR and WAR files? Thanks!

    Read the article

  • php code works with mamp but not on ubuntu server

    - by user355510
    Hello, I have start looking at a twitter php library http://github.com/abraham/twitteroauth, but i can't get it to work on my ubuntu server, but on my mac, with mamp it works without any problems. This is the code that don't won't to work on my server, but in mamp. Yes i have edit config file <?php /* Start session and load library. */ session_start(); require_once('twitteroauth/twitteroauth.php'); require_once('config.php'); /* Build TwitterOAuth object with client credentials. */ $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET); /* Get temporary credentials. */ $request_token = $connection->getRequestToken(OAUTH_CALLBACK); /* Save temporary credentials to session. */ $_SESSION['oauth_token'] = $token = $request_token['oauth_token']; $_SESSION['oauth_token_secret'] = $request_token['oauth_token_secret']; /* If last connection failed don't display authorization link. */ switch ($connection->http_code) { case 200: /* Build authorize URL and redirect user to Twitter. */ $url = $connection->getAuthorizeURL($token); header('Location: ' . $url); break; default: /* Show notification if something went wrong. */ echo 'Could not connect to Twitter. Refresh the page or try again later.'; } I have enable php session on my ubuntu server, because this code works <?php session_start(); $_SESSION["secretword"] = "hello there"; $secretword = $_SESSION["secretword"] ; ?> <html> <head> <title>A PHP Session Example</title> </head> <body> <?php echo $secretword; ?> </body> </html>

    Read the article

  • Error running web project in eclipse

    - by DarkKnight
    I am a newbie to servlets. I created a dynamic web project in eclipse. I have following files in my project home.html validateServlet.java I have defined validated servlet as an action in home.html form. However when I run it, I get http status 404. Below is the hierarchy of my project Project Java Resources src com.servlets ValidateServlet.java build WebContent META-INF WEB-INF web.xml hello.html Contents of my web.xml are as follows: <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web- app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"> <display-name>Website</display-name> <servlet> <description></description> <display-name>ValidateServlet</display-name> <servlet-name>validate</servlet-name> <servlet-class>com.oracle.coen235.servlets.ValidateServlet</servlet-class> </servlet> </web-app> In my hello.html, action is specified as , What might be the issue? I guess I am not able to generate the class file for my servlet. Can anyone guide me through this problem?

    Read the article

  • how to install a file handle in perl class

    - by Haiyuan Zhang
    please looku up the following code first. #! /usr/bin/perl package foo; sub new { my $pkg = shift; my $self = {}; my $self->{_fd} = undef; bless $self, $pkg; return $self; } sub Setfd { my $self = shift; my $fd = shift; $self_->{_fd} = $fd; } sub write { my $self = shift; print $self->{_fd} "hello word"; } my $foo = new foo; My intention is to store a file handle within a class using hash. the file handle is undefined at first, but can be initilized afterwards by calling Setfd function. then write can be called to actually write string "hello word" to a file indicated by the file handle, supposed that the file handle is the result of a success "write" open. but, perl compiler just complains that there are syntax error in the "print" line. can anyone of you tells me what's wrong here? thanks in advance.

    Read the article

  • Colorbox iFrame content not appearing in IE 8/9

    - by Rocketpig
    I'm using ColorBox to call a few informational modals on-screen and given the client's requirements, the best way to do this is via iFrames (not my first choice but whatever). Everything is working peachy in Chrome, FF, etc. but the iFrame content is not working in any version of IE. The modal wrapper appears but nothing is inside. This is what I've done so far: Changed the doctype to transitional and strict for IE. No dice. Removed the "iframe: true" and replaced it with HTML "Hello". That worked fine and "Hello" appeared in the Colorbox modal. I've removed all stylesheets from the header. No luck so it's not a CSS issue. Just to be sure, I rolled back my JQuery library to 1.6.2 from 1.8.2. Nothing there, either. Any help would be appreciated. This is aggravating. Some code: $(function () { $(".modal-large").colorbox({iframe:true, innerWidth:580, innerHeight:500}); }) HTML: <div class="top-droptext"><a class="modal-large" href="modal/serviceproviderinfo.html">Update Password</a></div>

    Read the article

  • pointer, malloc and char in C

    - by user2534078
    im trying to copy a const char array to some place in the memory and point to it . lets say im defining this var under the main prog : char *p = NULL; and sending it to a function with a string : myFunc(&p, "Hello"); now i want that at the end of this function the pointer will point to the letter H but if i puts() it, it will print Hello . here is what i tried to do : void myFunc(char** ptr , const char strng[] ) { *ptr=(char *) malloc(sizeof(strng)); char * tmp=*ptr; int i=0; while (1) { *ptr[i]=strng[i]; if (strng[i]=='\0') break; i++; } *ptr=tmp; } i know its a rubbish now, but i would like to understand how to do it right, my idea was to allocate the needed memory, copy a char and move forward with the pointer, etc.. also i tried to make the ptr argument byreferenec (like &ptr) but with no success due to a problem with the lvalue and rvalue . the only thing is changeable for me is the function, and i would like not to use strings, but chars as this is and exercise . thanks for any help in advance.

    Read the article

< Previous Page | 71 72 73 74 75 76 77 78 79 80 81 82  | Next Page >