Search Results

Search found 21430 results on 858 pages for 'message digest'.

Page 114/858 | < Previous Page | 110 111 112 113 114 115 116 117 118 119 120 121  | Next Page >

  • iPhone FBConnect, dashboard.addnews

    - by Dmitry
    Hi, The question is: how to add news via FBConnect?? I have the following code: NSString *newsBody = @"[{\"message\": \"News message\" }]"; NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObject:newsBody forKey:@"news"]; [[FBRequest requestWithDelegate:self] call:@"facebook.dashboard.addnews" params:params dataParam:nil]; After I sent the request I received the success responce. But I can't see the new news in the facebook account!! Also, I tried to add full info into news parameter (http://wiki.developers.facebook.com/index.php/Dashboard.addNews):: NSString *newsBody = @"[{\"message\": \"News message\",\"action_link\": {\"text\": \"link text\", \"href\": \"http: //google.com\"} }]"; But this request returns error :( Thanks in advance!

    Read the article

  • Help needed with InvokeRequired for Web.UI

    - by Ali
    I have a multi-threaded application in C# which tries to write to a TextBox in a Windows.Forms created by another thread. As threads cannot modify what has not been created by them, I was using InvokeRequired as shown on the code below, to solve this problem. public delegate void MessageDelegate(Communication message); void agent_MessageReceived(Communication message) { if (InvokeRequired) { BeginInvoke(new MessageDelegate(agent_MessageReceived), new object[] { message }); } else { TextBox1.Text += message.Body; } } Now I need to do the same for a TextBox in an ASP.NET app, but apparently neither InvokeRequired nor BeginInvoke exist for TextBox in a Web.UI. What can I do?

    Read the article

  • WCF Security in a Windows Service

    - by Alphonso
    I have a WCF service which can run as Console App and a Windows Service. I have recently copied the console app up to a W2K3 server with the following security settings: <wsHttpBinding> <binding name="ServiceBinding_Security" transactionFlow="true" > <security mode="TransportWithMessageCredential" > <message clientCredentialType="UserName" /> </security> </binding> </wsHttpBinding> <serviceCredentials> <userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="Common.CustomUserNameValidator, Common" /> </serviceCredentials> Security works fine with no problems. I have exactly the same code, but running in a windows service and I get the following error when I try to call any of the methods from a client: System.ServiceModel.Security.MessageSecurityException was unhandled Message="An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail." Source="mscorlib" StackTrace: Server stack trace: at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.ProcessReply(Message reply, SecurityProtocolCorrelationState correlationState, TimeSpan timeout) ...... (lots of stacktrace info - not very useful) InnerException: System.ServiceModel.FaultException Message="An error occurred when verifying security for the message." The exception tells me nothing. I'm assuming that it has something to do with acces to system resources from the Windows Service. I've tried running it under the same account as the console app, but no luck. Does anyone have any ideas?

    Read the article

  • python Socket.IO client for sending broadcast messages to TornadIO2 server

    - by Alp
    I am building a realtime web application. I want to be able to send broadcast messages from the server-side implementation of my python application. Here is the setup: socketio.js on the client-side TornadIO2 server as Socket.IO server python on the server-side (Django framework) I can succesfully send socket.io messages from the client to the server. The server handles these and can send a response. In the following i will describe how i did that. Current Setup and Code First, we need to define a Connection which handles socket.io events: class BaseConnection(tornadio2.SocketConnection): def on_message(self, message): pass # will be run if client uses socket.emit('connect', username) @event def connect(self, username): # send answer to client which will be handled by socket.on('log', function) self.emit('log', 'hello ' + username) Starting the server is done by a Django management custom method: class Command(BaseCommand): args = '' help = 'Starts the TornadIO2 server for handling socket.io connections' def handle(self, *args, **kwargs): autoreload.main(self.run, args, kwargs) def run(self, *args, **kwargs): port = settings.SOCKETIO_PORT router = tornadio2.TornadioRouter(BaseConnection) application = tornado.web.Application( router.urls, socket_io_port = port ) print 'Starting socket.io server on port %s' % port server = SocketServer(application) Very well, the server runs now. Let's add the client code: <script type="text/javascript"> var sio = io.connect('localhost:9000'); sio.on('connect', function(data) { console.log('connected'); sio.emit('connect', '{{ user.username }}'); }); sio.on('log', function(data) { console.log("log: " + data); }); </script> Obviously, {{ user.username }} will be replaced by the username of the currently logged in user, in this example the username is "alp". Now, every time the page gets refreshed, the console output is: connected log: hello alp Therefore, invoking messages and sending responses works. But now comes the tricky part. Problems The response "hello alp" is sent only to the invoker of the socket.io message. I want to broadcast a message to all connected clients, so that they can be informed in realtime if a new user joins the party (for example in a chat application). So, here are my questions: How can i send a broadcast message to all connected clients? How can i send a broadcast message to multiple connected clients that are subscribed on a specific channel? How can i send a broadcast message anywhere in my python code (outside of the BaseConnection class)? Would this require some sort of Socket.IO client for python or is this builtin with TornadIO2? All these broadcasts should be done in a reliable way, so i guess websockets are the best choice. But i am open to all good solutions.

    Read the article

  • Vector of pointers to base class, odd behaviour calling virtual functions

    - by Ink-Jet
    I have the following code #include <iostream> #include <vector> class Entity { public: virtual void func() = 0; }; class Monster : public Entity { public: void func(); }; void Monster::func() { std::cout << "I AM A MONSTER" << std::endl; } class Buddha : public Entity { public: void func(); }; void Buddha::func() { std::cout << "OHMM" << std::endl; } int main() { const int num = 5; // How many of each to make std::vector<Entity*> t; for(int i = 0; i < num; i++) { Monster m; Entity * e; e = &m; t.push_back(e); } for(int i = 0; i < num; i++) { Buddha b; Entity * e; e = &b; t.push_back(e); } for(int i = 0; i < t.size(); i++) { t[i]->func(); } return 0; } However, when I run it, instead of each class printing out its own message, they all print the "Buddha" message. I want each object to print its own message: Monsters print the monster message, Buddhas print the Buddha message. What have I done wrong?

    Read the article

  • Run time error: what's wrong?

    - by javacode
    I am getting run time error import javax.mail.*; import javax.mail.internet.*; import java.util.*; public class SendMail { public static void main(String [] args)throws MessagingException { SendMail sm=new SendMail(); sm.postMail(new String[]{"[email protected]"},"hi","hello","[email protected]"); } public void postMail( String recipients[ ], String subject, String message , String from) throws MessagingException { boolean debug = false; //Set the host smtp address Properties props = new Properties(); props.put("mail.smtp.host", "webmail.emailmyname.com"); // create some properties and get the default Session Session session = Session.getDefaultInstance(props, null); session.setDebug(debug); // create a message Message msg = new MimeMessage(session); // set the from and to address InternetAddress addressFrom = new InternetAddress(from); msg.setFrom(addressFrom); InternetAddress[] addressTo = new InternetAddress[recipients.length]; for (int i = 0; i < recipients.length; i++) { addressTo[i] = new InternetAddress(recipients[i]); } msg.setRecipients(Message.RecipientType.TO, addressTo); // Optional : You can also set your custom headers in the Email if you Want msg.addHeader("MyHeaderName", "myHeaderValue"); // Setting the Subject and Content Type msg.setSubject(subject); msg.setContent(message, "text/plain"); Transport.send(msg); } } Error Exception in thread "main" java.lang.NoClassDefFoundError: SendMail Caused by: java.lang.ClassNotFoundException: SendMail at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) Could not find the main class: SendMail. Program will exit.

    Read the article

  • How do I close a database connection in a WCF service?

    - by Dan
    I have been unable to find any documentation on properly closing database connections in WCF service operations. I have a service that returns a streamed response through the following method. public virtual Message GetData() { string sqlString = BuildSqlString(); SqlConnection conn = Utils.GetConnection(); SqlCommand cmd = new SqlCommand(sqlString, conn); XmlReader xr = cmd.ExecuteXmlReader(); Message msg = Message.CreateMessage( OperationContext.Current.IncomingMessageVersion, GetResponseAction(), xr); return msg; } I cannot close the connection within the method or the streaming of the response message will be terminated. Since control returns to the WCF system after the completion of that method, I don't know how I can close that connection afterwards. Any suggestions or pointers to additional documentation would be appreciated. Dan

    Read the article

  • Digitally Sign Parts of a XML document

    - by Eros
    I have an XML document having structure similar to the following <envelop> <header>blaa</header> <message>blaa blaa</message> <footer></footer> </envelop> I want to digitally sign the header and message elements and add the signature to the footer element. How can I sign the elements and then later verify the signature (using .net c#) ?

    Read the article

  • Jquery display image problem

    - by Sergio
    Hello, I have PHP page where users can upload photos (using Ajax & PHP script). Those uploaded photos (thumbs) are shown after upload in DIV below upload field. Then, after hitting send button I want to clone that DIV at that same page at message board, bellow other messages with or without uploaded photos. When I try to do that with: var pht = $("#photos").clone().addClass('p_pht'); and try to display sent photos bellow sent message like this: $("div#wall").append('<div class=msg>'+ message +'</div><div class=n_pht>'+ pht +'</div>'); I get Jquery error message "[object Object]" in place where the photos should be displaying. What am I doing wrong?

    Read the article

  • Informational messages returned with WCF involved

    - by DT
    This question is about “informational messages” and having them flow from a “back end” to a “front end” in a consistent manner. The quick question is “how do you do it”? Background: Web application using WCF to call back end services. In the back end service a “message” may occur. Now, the reason for this “message” may be a number of reasons, but for this discussion let’s assume that a piece of data was looked at and it was determined that the caller should be given back some information regarding it. This “informational” message may occur during a save and also may occur during retrieval of information. Again, the message is not what is important here, but the fact that there is some informational messages to give back under a number of different scenarios. From a team perspective we all want to return these “messages” in a standard way all of the time. Now, in the past this “standard way” has been done different ways by different people. Here are some possibilities: 1) Every operation has a “ref” parameter at the end that contains these messages 2) Every method returns these messages… however, this only kind of works for “Save” methods as one would think that “Retrieve” methods should return actual data and not messages 3) Some approach using the call context so as to not "pollute" all message signatures with something; however, with WCF in the picture this complicates things. That is, going back to the messages go on a header? Question: Back to my question then… how are others returning “messages” such as what was described above back through tiers of an application, over WCF and back to the caller?

    Read the article

  • .NET Exception error, what does this error means?

    - by gsvirdi
    I've tried to develop a simple winform utility which is using xml file as its database. I've used VS 2008 express edition, C#. When this utility tries to write into the xml file then this error is displayed on other computer. I've tried to provide System.Xml.dll & System.Xml.Linq.dll in the same folder on the other computer but no use. What does it means? Any solution? See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ************** Exception Text ************** System.MissingMethodException: Method not found: 'Void System.Xml.XmlReaderSettings.set_MaxCharactersFromEntities(Int64)'. at System.Xml.Linq.XNode.GetXmlReaderSettings(LoadOptions o) at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options) at System.Xml.Linq.XDocument.Load(String uri) at Issues.Form1.button1_Click(Object sender, EventArgs e) at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) ************** Loaded Assemblies ************** mscorlib Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.832 (QFE.050727-8300) CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll ---------------------------------------- Issues Assembly Version: 1.0.0.0 Win32 Version: 1.0.0.0 CodeBase: file:///C:/Documents%20and%20Settings/sumsnl.LTSLFBD/Desktop/Process%20Improvement/Issues%20Register/Issues.exe ---------------------------------------- System.Windows.Forms Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.832 (QFE.050727-8300) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll ---------------------------------------- System Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.832 (QFE.050727-8300) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll ---------------------------------------- System.Drawing Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.832 (QFE.050727-8300) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll ---------------------------------------- System.Xml Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.832 (QFE.050727-8300) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll ---------------------------------------- System.Configuration Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.832 (QFE.050727-8300) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll ---------------------------------------- 4u_pgrmq Assembly Version: 1.0.0.0 Win32 Version: 2.0.50727.832 (QFE.050727-8300) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll ---------------------------------------- ************** JIT Debugging ************** To enable just-in-time (JIT) debugging, the .config file for this application or computer (machine.config) must have the jitDebugging value set in the system.windows.forms section. The application must also be compiled with debugging enabled. For example: <configuration> <system.windows.forms jitDebugging="true" /> </configuration> When JIT debugging is enabled, any unhandled exception will be sent to the JIT debugger registered on the computer rather than be handled by this dialog box.

    Read the article

  • HTML / PHP from

    - by user317128
    I am trying to code an all in one HTML/PHP contact from with error checking. When I load this file in my browser there is not HTML. I am a newb php programmer so most likely forgot something pretty obvious. <!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=utf-8" /> <title>All In One Feedback Form</title> </head> <body> <? $form_block = " <input type=\"hidden\" name=\"op\" value=\"ds\"> <form method=\"post\" action=\"$server[PHP_SELF]\"> <p>Your name<br /> <input name=\"sender_name\" type=\"text\" size=30 value=\"$_POST[sender_name]\" /></p> <p>Email<br /> <input name=\"sender_email\" type=\"text\" size=30 value=\"$_POST[sender_email]\"/></p> <p>Message<br /> <textarea name=\"message\" cols=30 rows=5 value=\"$_POST[message]\"></textarea></p> <input name=\"submit\" type=\"submit\" value=\"Send This Form\" /> </form>"; if ($_POST[op] != "ds") { //they see this form echo "$form_block"; } else if ($_POST[op] == "ds") { if ($_POST[sender_name] == "") { $name_err = "Please enter your name<br>"; $send = "no"; } if ($_POST[sender_email] == "ds") { $email_err = "Please enter your email<br>"; $send = "no"; } if ($_POST[message] == "ds") { $message_err = "please enter message<br>"; $send = "no"; } if ($send != "no") { //its ok to send $to = "[email protected]"; $subject = "All in one web site feed back"; $mailheaders = "From: website <some email [email protected]> \n"; $mailheaders .= "Reply-To: $_POST[sender_email]\n"; $msg = "Email sent from this site www.ccccc.com\n"; $msg .= "Senders name: $_POST[senders_name]\n"; $msg .= "Sender's E-Mail: $_POST[sender_email]\n"; $msg .= "Message: $_POST[message]\n\n"; mail($to, $subject, $msg, $mailheaders); echo "<p>Mail has been sent</p>"; } else if ($send == "no") { echo "$name_err"; echo "$email_err"; echo "$message_err"; echo "$form_block"; } } ?> </body> </html> FYI I am trying the example from a book named PHP 6 Fast and Easy Wed Development

    Read the article

  • HTML / PHP form

    - by user317128
    I am trying to code an all in one HTML/PHP contact from with error checking. When I load this file in my browser there is not HTML. I am a newb php programmer so most likely forgot something pretty obvious. <!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=utf-8" /> <title>All In One Feedback Form</title> </head> <body> <? $form_block = " <input type=\"hidden\" name=\"op\" value=\"ds\"> <form method=\"post\" action=\"$server[PHP_SELF]\"> <p>Your name<br /> <input name=\"sender_name\" type=\"text\" size=30 value=\"$_POST[sender_name]\" /></p> <p>Email<br /> <input name=\"sender_email\" type=\"text\" size=30 value=\"$_POST[sender_email]\"/></p> <p>Message<br /> <textarea name=\"message\" cols=30 rows=5 value=\"$_POST[message]\"></textarea></p> <input name=\"submit\" type=\"submit\" value=\"Send This Form\" /> </form>"; if ($_POST[op] != "ds") { //they see this form echo "$form_block"; } else if ($_POST[op] == "ds") { if ($_POST[sender_name] == "") { $name_err = "Please enter your name<br>"; $send = "no"; } if ($_POST[sender_email] == "ds") { $email_err = "Please enter your email<br>"; $send = "no"; } if ($_POST[message] == "ds") { $message_err = "please enter message<br>"; $send = "no"; } if ($send != "no") { //its ok to send $to = "[email protected]"; $subject = "All in one web site feed back"; $mailheaders = "From: website <some email [email protected]> \n"; $mailheaders .= "Reply-To: $_POST[sender_email]\n"; $msg = "Email sent from this site www.ccccc.com\n"; $msg .= "Senders name: $_POST[senders_name]\n"; $msg .= "Sender's E-Mail: $_POST[sender_email]\n"; $msg .= "Message: $_POST[message]\n\n"; mail($to, $subject, $msg, $mailheaders); echo "<p>Mail has been sent</p>"; } else if ($send == "no") { echo "$name_err"; echo "$email_err"; echo "$message_err"; echo "$form_block"; } } ?> </body> </html> FYI I am trying the example from a book named PHP 6 Fast and Easy Wed Development

    Read the article

  • C# StripStatusText Update Issue

    - by ikurtz
    I am here due to a strange behaviour in Button_Click event. The code is attached. The issue is the first StripStatus message is never displayed. any ideas as to why? private void FireBtn_Click(object sender, EventArgs e) { // Control local controls for launching attack AwayTableLayoutPanel.Enabled = false; AwayCancelBtn.Enabled = false; FireBtn.Enabled = false; ////////////// Below statusBar message is never displayed but the folowing sound clip is. GameToolStripStatusLabel.Text = "(Home vs. Away)(Attack Coordinate: (" + GameModel.alphaCoords(GridLock.Column) + "," + GridLock.Row + "))(Action: Fire)"; //////////////////////////////////////////// if (audio) { SoundPlayer fire = new SoundPlayer(Properties.Resources.fire); fire.PlaySync(); fire.Dispose(); } // compile attack message XmlSerializer s; StringWriter w; FireGridUnit fireGridUnit = new FireGridUnit(); fireGridUnit.FireGridLocation = GridLock; s = new XmlSerializer(typeof(FireGridUnit)); w = new StringWriter(); s.Serialize(w, fireGridUnit); ////////////////////////////////////////////////////////// // send attack message GameMessage GameMessageAction = new GameMessage(); GameMessageAction.gameAction = GameMessage.GameAction.FireAttack; GameMessageAction.statusMessage = w.ToString(); s = new XmlSerializer(typeof(GameMessage)); w = new StringWriter(); s.Serialize(w, GameMessageAction); SendGameMsg(w.ToString()); GameToolStripStatusLabel.Text = "(Home vs. Away)(Attack Coordinate: (" + GameModel.alphaCoords(GridLock.Column) + "," + GridLock.Row + "))(Action: Awaiting Fire Result)"; } EDIT: if I put in a messageBox after the StripStatus message the status is updated.

    Read the article

  • How do I close a database connection being used to produce a streaming result in a WCF service?

    - by Dan
    I have been unable to find any documentation on properly closing database connections in WCF service operations. I have a service that returns a streamed response through the following method. public virtual Message GetData() { string sqlString = BuildSqlString(); SqlConnection conn = Utils.GetConnection(); SqlCommand cmd = new SqlCommand(sqlString, conn); XmlReader xr = cmd.ExecuteXmlReader(); Message msg = Message.CreateMessage( OperationContext.Current.IncomingMessageVersion, GetResponseAction(), xr); return msg; } I cannot close the connection within the method or the streaming of the response message will be terminated. Since control returns to the WCF system after the completion of that method, I don't know how I can close that connection afterwards. Any suggestions or pointers to additional documentation would be appreciated.

    Read the article

  • Strange Apache Webdav situation (OSX Will connect, Ubuntu will not)

    - by mewrei
    So basically my situation is that I have an Apache 2.2 webserver running on Linux on another box, and I have it configured to serve up webdav. Now here's the weird part, I can access the server just fine on my Mac using the "Connect to Server" dialog (even moved like 5GB of files over the connection). On my Ubuntu desktop cadaver will connect as well and allow me to browse. However when I try to use Xmarks (BYOS Edition) or the GNOME "Connect to Server" dialog, it gives me a 403 Forbidden error. My server does digest authentication if that makes any difference. Here's part of my apache2.conf file <VirtualHost *:80> DocumentRoot "/path" <Directory "/path"> Dav on AuthType Digest AuthName iTools AuthDigestDomain "/" AuthUserFile /path/to/WebDavUsers Options None AllowOverride None <LimitExcept GET HEAD OPTIONS> require valid-user </LimitExcept> Order allow,deny Allow from All </Directory> <Directory "/path/*/Public"> Options +Indexes </Directory> <Directory "/path/user"> <LimitExcept GET HEAD OPTIONS> require user user </LimitExcept> </Directory> </VirtualHost>

    Read the article

  • Rails escape_javascript creates invalid JSON by escaping single quotes

    - by Arrel
    The escape_javascript method in ActionView escapes the apostrophe ' as backslash apostrophe \', which gives errors when parsing as JSON. For example, the message "I'm here" is valid JSON when printed as: {"message": "I'm here"} But, <%= escape_javascript("I'm here") %> outputs "I\'m here", resulting in invalid JSON: {"message": "I\'m here"} Is there a patch to fix this, or an alternate way to escape strings when printing to JSON?

    Read the article

  • deny custom role

    - by kusanagi
    how can i deny access to call method. something like this [HandleError] [Authorize(Roles = "role1, role2")] public class AdminController : Controller { [Deny(Roles = "role2")] public ActionResult ResultPage(string message) { ViewData["message"] = message; return View(); } }

    Read the article

  • jQuery show div click to hide then do not show again

    - by Jonny Wood
    I am using jQuery to hide a div on my page: $(document).ready(function(){ $('#message').hide(); When a certain part of the page scrolls into view the div shows using $(window).scroll(function() { var top = 0; top = $(window).scrollTop(); if((top >= 1000) && (top < 2000)){ $('#message').fadeIn('slow'); } } I want to add a close button to this as follows $('a#message-hide').click(function() { $('#message').hide('fast'); return false; All good so far but the part I cannot figure out is how to then STOP the div re-appearing when the user scrolls back to the trigger position on the page...?

    Read the article

  • Generate a Version.java file in Maven

    - by Ralph
    I have a Java project that I build using an Ant script. I am trying to convert the project to Maven. One of the tasks generates a Java source file called Version.java that contains a static String representation of the compilation timestamp, as follows: package com.foo.bar; public final class Version { public static String VERSION="100301.1046"; } The Ant task is very simple: <target name="version" depends="init" description="Create Version.java"> <echo file="src/${package.dir}/Version.java" message="package ${package.name};${line.separator}" /> <echo file="src/${package.dir}/Version.java" append="true" message="public final class Version {${line.separator}" /> <echo file="src/${package.dir}/Version.java" append="true" message=" public static String VERSION=&quot;${buildtime}&quot;;${line.separator}" /> <echo file="src/${package.dir}/Version.java" append="true" message="}${line.separator}" /> <echo message="BUILD ${buildtime}" /> </target> Is it possible to do something similar in Maven, using generate-sources, or some other simple method?

    Read the article

  • PHP jQuery Long Polling Chat Application

    - by Tejas Jadhav
    I've made a simple PHP jQuery Chat Application with Short Polling (AJAX Refresh). Like, every 2 - 3 seconds it asks for new messages. But, I read that Long Polling is a better approach for Chat applications. So, I went through some Long Polling scripts. I made like this: Javascript: $("#submit").click(function(){ $.ajax({ url: 'chat-handler.php', dataType: 'json', data: {action : 'read', message : 'message'} }); }); var getNewMessage = function() { $.ajax({ url: 'chat-handler.php', dataType: 'json', data: {action : 'read', message : 'message'}, function(data){ alert(data); } }); getNewMessage(); } $(document).ready(getNewMessage); PHP <?php $time = time(); while ((time() - $time) < 25) { $data = $db->getNewMessage (); if (!empty ($data)) { echo json_encode ($data); break; } usleep(1000000); // 1 Second } ?> The problem is, once getNewMessage() starts, it executes unless it gets some response (from chat-handler.php). It executes recursively. But if someone wants to send a message in between, then actually that function ($("#submit").click()) never executes as getNewMessage() is still executing. So is there any workaround?

    Read the article

  • Performance Tricks for C# Logging

    - by Charles
    I am looking into C# logging and I do not want my log messages to spend any time processing if the message is below the logging threshold. The best I can see log4net does is a threshold check AFTER evaluating the log parameters. Example: _logger.Debug( "My complicated log message " + thisFunctionTakesALongTime() + " will take a long time" ) Even if the threshold is above Debug, thisFunctionTakesALongTime will still be evaluated. In log4net you are supposed to use _logger.isDebugEnabled so you end up with if( _logger.isDebugEnabled ) _logger.Debug( "Much faster" ) I want to know if there is a better solution for .net logging that does not involve a check each time I want to log. In C++ I am allowed to do LOG_DEBUG( "My complicated log message " + thisFunctionTakesALongTime() + " will take no time" ) since my LOG_DEBUG macro does the log level check itself. This frees me to have a 1 line log message throughout my app which I greatly prefer. Anyone know of a way to replicate this behavior in C#?

    Read the article

  • Making two Windows using CreateWindowsEx() - C

    - by Jamie Keeling
    Hello, I have a windows form that has a simple menu and performs a simple operation, I want to be able to create another windows form with all the functionality of a menu bar, message pump etc.. as a separate thread so I can then share the results of the operation to the second window. I.E. 1) Form A opens Form B opens as a separate thread 2)Form A performs operation 3)Form A passes results via memory to Form B 4)Form B display results I'm confused as to how to go about it, the main app runs fine but i'm not sure how to add a second window if the first one already exists. I think that using CreateWindow will allow me to make another window but again i'm not sure how to access the message pump so I can respond to certain events like WM_CREATE on the second window. I hope it makes sense. Thanks! Edit: I've attempted to make a second window and although this does compile, no windows show atall on build. ////////////////////// // WINDOWS FUNCTION // ////////////////////// LRESULT CALLBACK WindowFunc(HWND hMainWindow, UINT message, WPARAM wParam, LPARAM lParam) { //Fields WCHAR buffer[256]; struct DiceData storage; HWND hwnd; // Act on current message switch(message) { case WM_CREATE: AddMenus(hMainWindow); hwnd = CreateWindowEx( 0, "ChildWClass", (LPCTSTR) NULL, WS_CHILD | WS_BORDER | WS_VISIBLE, 0, 0, 0, 0, hMainWindow, NULL, NULL, NULL); ShowWindow(hwnd, SW_SHOW); break; Any suggestions as to why this happens?

    Read the article

< Previous Page | 110 111 112 113 114 115 116 117 118 119 120 121  | Next Page >