w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Change Text of server Control in static Web Method
AJAX call will update control text in client side only. If you want to change label's text after post back , bind the changed value again to the control while page posts back. Like you can call function which binds changed value to label in postback event OR in page load wherever seems fit.

Categories : C#

Server Sent Events, server-side code
Your understanding is correct. PHP needs to keep running, and in PHP you will need a loop, and you'll quickly run out of free Apache threads. If you need to handle lots of connections you need to use event-based server like Node.js or Tornado that can handle lots of open connections. If you'd rather use PHP, then a partial solution is to close connection after few seconds. The browser will reconnect, so you'll get a hybrid of polling and SSE. In PHP you can check sys_getloadavg() to decide whether you can keep connection open or you're running short on free processes.

Categories : PHP

RequiredFieldValidator Control displays the Error Text on Page_Load
Set the RequiredFieldValidator this way. Remove the property: 'TextRequired' & put a * inbetween the opening and closing tag. <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="email_Text">*</asp:RequiredFieldValidator> Also, Do not set the ErrorMessage property as this will again not fit your requirements.

Categories : Asp Net

find a control with no runat='server' from server side
You could do conversationdiv.InnerHtml... in this specific case it would return the HTML of the table. You could then use HTML Agility Pack to query or manipulate the said table. Example var html = new HtmlAgilityPack.HtmlDocument(); html.LoadHtml(conversationdiv.InnerHtml); var table = html.DocumentNode.SelectNodes("table").FirstOrDefault(); var tr = table.SelectNodes("tr").FirstOrDefault(); var td = tr.SelectNodes("td").FirstOrDefault(); var blahBlah = td.InnerText;

Categories : C#

Socket.io emitting and broadcasting events but wont "hear" events from the server
You are mixing up your client and server logic. This code (from your template): socket.on('addUser', function (data) { console.log("ADDING NEW USER:"); req.session.user = data; console.log(data); $("#usernames").append('<p>'+data+'</p>'); }); Is executing on the client side where there is not req object available. By default, socket.io and express sessions don't play together - you need to add some additional logic to your app. There are several projects that aim to make this easier such as: express.io session.socket.io

Categories : Node Js

C TCP Echo Server - Data displays only on close()
Examples for python send are of the following variety: def mysend(self, msg): totalsent = 0 while totalsent < MSGLEN: sent = self.sock.send(msg[totalsent:]) if sent == 0: raise RuntimeError("socket connection broken") totalsent = totalsent + sent The reason for that is the data may not be sent until the socket is closed or a newline is encountered. See Python Socket Programming HOW-TO for more information

Categories : Python

SQL Server linked server error locating server in sql server 2005
http://blog.sqlauthority.com/2009/05/21/sql-server-fix-error-provider-named-pipes-provider-error-40-could-not-open-a-connection-to-sql-server-microsoft-sql-server-error/ i think this will help you...

Categories : Mysql

Get HTML control in formview control on server
If you added html controlls with runat="server" you can access it with Request.Form[ControlName.UniqueID] otherwise, you need to add name="yourcontrol" and you will get the controls in Request.Form["YourControlName"].

Categories : Asp Net

Text following jquery hyperlink is converted to hyperlink
You have a javascript error there...why are you doing a replace for newlines? event_contents.replace(/ /g, + "</a>") should be event_contents.replace(/ /g, "</a>") I don't think that's what you want. If you want to just get rid of the newlines, change it to this: event_contents.replace(/ /g, "") + "</a>";

Categories : Jquery

Javascript - Div Box as a HyperLink + Nested Text HyperLink - Possible?
You should remove the A from around the inner DIV, give it a bigger z-index than the outer, and handle the inner click event with calling event.stopPropagation to prevent bubbling of the event to the outer div. Here is a fiddle to solve the task. Sample for the inner handler: $('.content-link-page-b').click(function(e){ alert("page-b.html"); e.stopPropagation(); }); EDIT: In my comment above, I mentioned e.preventDefault() call. I didn't mean that, because that means the native DOM element's handler will be prevented, and not the jQuery event bubbling.

Categories : Javascript

This version of Microsoft SQL Server Management Studio Express can only be used to connect to SQL Server 2000 and SQL Server 2005 servers
I just ran in to this issue as well but then was able to find the solution. You just need the newer version of SSMSE which is now 2008! Here's the MS download page: http://www.microsoft.com/en-us/download/details.aspx?id=7593

Categories : Misc

com.microsoft.sqlserver.jdbc.SQLServerException: The server version is not supported. The target server must be SQL Server 2000 or later
Try to update your driver to Version 4. Version 3.0 is very old. Alternatively you can use jTDS JDBC Driver. This is a third-party driver but supports much more versions of Microsoft SQLServer.

Categories : Java

Server sent events and browser limits
You are right about the number of simultaneous connections. You can check this list for max values: http://www.browserscope.org/?category=network And unfortunately, I never found any work around, except multiplexing and/or using different hostnames.

Categories : Javascript

Sending Server-Sent-Events through a socket in C
Each line in an HTTP header needs to be terminated using . See rfc2616 section 2.2 Basic Rules CR = <US-ASCII CR, carriage return (13)> LF = <US-ASCII LF, linefeed (10)> HTTP/1.1 defines the sequence CR LF as the end-of-line marker for all protocol elements except the entity-body Your example just uses so the headers may appear to all be part of a single line to some simple http clients. Try changing to ending each line that isn't part of the entity using

Categories : C

Server Sent Events and Rails Streaming
The way that SSEs are built is by the client opening a connection to the server, which is then left open until the server has some data to send. This is part of the SSE spec, and not a thing specific to ActionController::Live. It's effectively the same as long-polling, but with the connection not being closed after the first bit of data is returned, and with the mechanism built into the browser. As such, the only way it can be implemented is by having multiple open client connections to the webserver which sit there indefinitely. As to what resources are required to deal with them, I'm not sure, as I've not yet tried to benchmark this, but it'll need enough servers for Puma to keep open thousands of connections if you have that many users with a page open. The default limit for puma is 1

Categories : Ruby On Rails

iOS events to load data from server
You should have a method applicationWillEnterForeground: in your AppDelegate. This method is called each time the app comes back to the foreground - (void)applicationWillEnterForeground:(UIApplication *)application { // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. }

Categories : IOS

How to load test Server Sent Events?
I took a simple path of creating a shell script that initiates N background jobs of cURL which connected to the SSE endpoint of my service. To get the exact cURL syntax, open your Chrome web dev tools -> Network tab -> right click on the entry of the request to the SSE endpoint and choose from the context menu "Copy as cURL" Then you paste that command in a shell script that roughly looks like: #!/bin/bash i=0; while [ $i -lt 50 ] ;do [PASTE YOUR cURL COMMAND HERE] -s -o /dev/null & i=`expr $i + 1`; done This will add 50 background cURL jobs each time it's run. Notice that I added to Chrome's cURL command the params -s -o /dev/null. This is to run cURL in silent mode and to suppress any output. In my case the service was implemented in NodeJs, so I used process.hrtime()

Categories : Misc

how to export or import sql server database from sql server to mysql server through network
Try to use this script, which allows you to import data. You must specify the table name and run the generated code on your MySQL server. DDL: CREATE TABLE Labour.Employee ( EmployeeID INT IDENTITY (1, 1) PRIMARY KEY NOT NULL , IsMainWorkPlace BIT NOT NULL , TabelNumber VARCHAR(6) NULL , PersonID INT NOT NULL , DepartmentUID UNIQUEIDENTIFIER NOT NULL , DateIn DATETIME NOT NULL , DateOut DATETIME NULL , PositionID INT NULL , DatePension DATETIME NULL , IsLabourUnionMember BIT NOT NULL , FiringReasonID INT NULL ) Query: DECLARE @Table NVARCHAR(50) , @Schema NVARCHAR(50) , @ObjectID INT , @IsImportIdentity BIT = 1 , @IsCreateTable BIT = 1 DECLARE [tables] CURSOR READ_ONLY FAST_FORWARD LOCAL FOR SELECT t.name

Categories : Mysql

How to handle events from Server in each Client thread
Implement a pub/sub pattern. You can use MemBus for in-process message bus. It can be easily configured and supports both synchronous and asynchronous processing. Your Server will be pushing IData events to the bus and multiple Clients that subscribe to the same bus will receive the messages in the same order as the server sent them. Each Client instance can be called on a separate thread.

Categories : C#

How do you create and detect one-time Server Sent Events?
You likely want to use Web Sockets. Socket.io is great if you're using node.js but there are also php libraries to help you out,

Categories : PHP

Server sent events - cross domain safari
WebKit doesn't support CORS in SSE yet. Solutions: Fetch from the same origin, new EventSource("/app.php"); Use CORS-aware polyfill for Safari. https://github.com/Yaffle/EventSource Create iframe at same origin that your SSE stream (http://mydomain.org/iframe.html), read same-origin stream in the iframe, and use postMessage() to send events to other origins.

Categories : PHP

How does Ember.js listen to events fired off from the server?
I don't think ember can listen to the callback event. However, within your callback you can update a value in an ember object. For example, here's some code of an ember controller, and a callback Ember controller App.MyController = Em.ObjectController.extend({ authenticated: false, updateAuthStatus: function() { Em.debug("We're auth status updated and is now: " + this.get('authenticated'); }.observes('authenticated') }); Callback function(authenticated) { if (!authenticated) { alert("Authentication failed") } else { App.__container__.lookup("controller:my").set('authenticated', true); } } Better yet, have your passport authentication run from within an ember controller then you won't have to find the controller using the lookup function (and will probably al

Categories : Node Js

Browser requests file, server downloads pdf, browser displays pdf in iframe
Probably what you meant was simply: var uri = '/viewer/loaddrawing/'; document.getElementById('iframetitle').src = uri + '?key=' + value; There is no JSON involved, so the iframe will get a PDF directly. However, notice that the client must have a PDF-viewer plugin, otherwise the browser will ask for a download prompt.

Categories : Javascript

Handling events from out-of-proc COM server in managed STA application
I've found the following excerpt from Adam Nathan's ".NET and COM: The Complete Interoperability Guide": If the COM object lives in an STA, any calls from MTA threads are marshaled appropriately so the COM object remains in its world of thread affinity. But, in the other direction, no such thread or context switch occurs. Thus, this is the expected behavior. So far, that's the only (semi-official) source on the subject I could find.

Categories : C#

HTML5 Server Sent Events using Java Servlet 3 and tomcat
I don't know about EventResource, but I understand that, if you are able to open resource in browser, it should take you one step ahead. Make changes as under in web.xml :- <servlet-class> Give full path to your servlet with package name like - com.test.sse <url-pattern> You can make /* here so it will work for every URL. After making this changes, try to open resource in browser and see if this helps.

Categories : HTML

Handling Onload events to add server side logic in ADF
There are multiple ways of doing this, including doing this in a method call in the taskflow before you reach the page. Some options: https://blogs.oracle.com/adf/entry/an_epic_question_how_to

Categories : Oracle

Fetch Google Calendar Events on PHP server after authenticating on iOS app
Finally I am able to answer my own question. Hope this helps someone else. Step 1 & 2. I got the Google OAuth protocol working in my iOS App following the instructions in this excellent tutorial on mobiletuts. Step 3. I saved the access token and refresh token in database on my web server. Step 4. Using the refresh token I got from iOS App I connected to the Google calendar API with this code... require_once(APPPATH . "libraries/Google/Google_Client.php"); require_once(APPPATH . "libraries/Google/contrib/Google_CalendarService.php"); /* setup google client object */ $client = new Google_Client(); $client->setClientId(GOOGLE_CLIENT_ID); /* refresh access token */ $client->refreshToken($google_refresh_token); $newToken = $client->getAccessToken(); $client->setAccessToke

Categories : PHP

HTTP: what are the relations between pipelining, keep-alive and Server Sent Events?
Yes, FIFO. TCP/IP guarantees delivering data in-order, so responses can't arrive in a different order (if the server/proxy is buggy and sends responses in wrong order then you're totally screwed). I don't recall any reason per HTTP spec. It may be just caution, because pipelining is poorly implemented in some proxies/servers. HTTP spec suggests 2 connections per server, browsers have settled on 6-8 connections per server, but there is no fixed limit. Running out of connections is a real problem for Apache, and for high-load situations it's recommended to disable KeepAlive in Apache and use a proxy (e.g. HAProxy) that can cheaply provide Keep-Alive functionality to clients. The benefit of a proxy is that one proxy can distribute connections to several servers (helps scaling), or can modif

Categories : Http

Rails: I want Server Sent Events. Do I have to drop Phusion Passenger?
Server Side Events works great on Phusion Passenger. I wrote a demo for you. Check out https://github.com/phusion/passenger-ruby-server-side-events-demo Hongli Lai, Phusion CTO Phusion Passenger developer

Categories : Ruby On Rails

Backbone.js: How to queue pending sync events to server?
You can use two Backbone.sync methods and swap them out depending on offline/online state: // Detect sync however you want here var state = getInternetConnectivityState(); // Save off a local copy of the default Backbone.sync var ajaxSync = Backbone.sync; // Create a new Backbone.sync function that works with local storage. I would suggest // using store.js as it works x-browser, takes care of JSON serialization and is well // supported var localSync = function(method, model, options) { if ('GET' === method) { model.set('name', store.get(model.id).name); } ... } Backbone.sync = function() { if ('offline' === getInternetConnectivityState()) { localSync.call(this, arguments); } else { ajaxSync.call(this, arguments); } }

Categories : Javascript

iOS: Handle remote-control events and then relay the events to music apps
Make sure you call the following methods to begin receiving the events. [[UIApplication sharedApplication] beginReceivingRemoteControlEvents]; [self becomeFirstResponder]; Then in your application delegate you need to listen for the events. -(void)remoteControlReceivedWithEvent:(UIEvent *)event{ if (event.type == UIEventTypeRemoteControl){ switch (event.subtype) { case UIEventSubtypeRemoteControlTogglePlayPause: break; default: break; } } }

Categories : IOS

How to use ASP.NET tag in a server control?
It's a shame that ListItem doesn't have a Visibility property that you could bind to. The best solution I can think of is to write a class that extends DropDownList; add a method that inserts the "All Records" item before rendering. public class ExtendedList : DropDownList { protected override void OnLoad(EventArgs e) { if (Convert.ToInt32(Session["user_level"]) == 1) { Items.Insert(0, new ListItem { Value = "NULL", Text = "All Records" }); } } }

Categories : Asp Net

Why can't have control with ID "Server"
Server is one of a number of predefined properties in the base class of any ASP.Net page - this list also includes Response, Request, etc. By calling your own control Server, you are overriding the default properties and rendering meaningless certain .Net calls including, in this case, Server.ScriptTimeout.

Categories : Asp Net

Insert data from a server to another server No linked sql server 2008
This may be a controversial suggestion, but consider using MS Access as an intermediary. Access will let you link both tables, and write a query to copy from one to the other. It certainly won't be fast, and you may have timeout issues you'll have to address, but you'll get your automatic column-mapping, and if you have MS Office then you'll already have it. I'm NOT suggesting you download all your data to your PC, but I am suggesting that you try linking both tables into an Access database and copying data from one to the other. If your target database doesn't have the target tables (though it sounds like it does) you'd have to create them via scripting first, but Access does an adequate job copying data from place to place. I call it "the poor man's SSIS". It has the advantag

Categories : SQL

migrating multiple linked server from one server to another on sql server 2008 R2
If you're dealing with linked servers that have specific users specified with password then I don't think you'll be able to preserve that password information. Since linked servers are at the server level that information wouldn't be in any db backup. But, you could run queries like the one below to get the list of linked servers and check which ones use pass-through credentials. For the ones that do, just create new linked server definitions in the new database (you can easily get this SQL by right-clicking on the linked server in SSMS and generating the script). For the ones that don't, you can create the linked server via TSQL but you'll have to give them new credentials. SELECT serv.NAME, serv.product, serv.provider, serv.data_source, serv.catalog, prin.name,

Categories : SQL

Server sent events with Flask/Redis: how can more than one client view a stream?
It turns out that this is something to do with the Chromium web browser, where I was testing. It holds back on making the request until the first one completes, for some reason. Using curl, or an incognito browser session allowed multiple sessions to run at the same time. This means that my problem doesn't really exist in reality, it just appears that way because of the way that Chromium handles simultaneous requests to the same resource. I'm not sure quite why Chromium behaves this way, it seems weird. Either way, this isn't a real problem, only a perceived one by my browser.

Categories : Python

jquery full calendar displays events next day
According to the chapter MySQL 5.6 Reference Manualp - 12.7 Date and Time Functions UNIX_TIMESTAMP() assumes that its argument is a datetime value in the current time zone. Key Question: Are the dates inserted into the database via the browser - using the same time zone as PHP and MySQL? Are datetimes being inserted without considering the timezone, leading to offsets and errors? Is the browsers time being considered both when inserting but also viewing previous events? Actions/Points: Requires a review of your event insertion code (javascript and PHP). Requires check to see which timezone your server is operating in. This can either be done through a console command (linux) or directly in php with [date_default_timezone_get()] (http://php.net/manual/en/function.date-default-

Categories : PHP

Using a web server to control an arduino
Either connect via RS232 to arduino. I don't know wheter this is possible at all from node.js. The other option is to put a ethernet shield on your arduino, implement a simple web service and call this from node.js. With the second option it's just calling an URL to connect to the arduino.

Categories : Node Js

VisualSVN Server, control from C#
Argument Object in VisualSVN_SecurityDescriptor.SetSecurity() method should be reference to WMI object (object path), not WMI object itself. Try ManagementPath .NET class should help.

Categories : C#

How to use asp:CustomValidator server control?
Make sure you also set the property : ValidateEmptyText to True for custom validator in case you don't want to allow the same. <asp:CustomValidator ValidateEmptyText="True" ...

Categories : Asp Net



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.