The Way to Programming
The Way to Programming
Their you go..code for your reference
Sub createsheets() Dim rng As Range, cell As Range, lrow As Long Dim ws As Worksheet, ws1 As Worksheet Dim str As String, lr As Long, str1 As String Set ws = Sheets("Title_Frame_Register") Sheets.Add after:=Sheets(Sheets.Count) Set ws1 = ActiveSheet ws.Select lrow = ws.Cells(Cells.Rows.Count, "r").End(xlUp).Row Set rng = ws.Range("B5:b" & lrow) For Each cell In rng If ws.Range("R" & cell.Row).Value = ws.Range("R" & cell.Row + 1).Value Then str1 = ws.Range("R" & cell.Row).Value If str = "" Then str = cell.Value & "-" & cell.Offset(1, 0).Value Else str = Left(str, InStr(1, str, "-", vbTextCompare) - 1) & "-" & cell.Offset(1, 0).Value End If Else If ws1.Range("A1").Value = "" Then lr = 1 Else lr = ws1.Cells(Cells.Rows.Count, "a").End(xlUp).Row + 1 End If If str <> "" And str1 <> "" Then ws1.Range("A" & lr).Value = str ws1.Range("B" & lr).Value = str1 str = "" str1 = "" Else ws1.Range("A" & lr).Value = cell.Value ws1.Range("B" & lr).Value = ws.Range("R" & cell.Row).Value End If End If Next cell ws1.Cells.EntireColumn.AutoFit End Sub
1st – Smoothing results
From what I understood you actually have to act upon the data you just received, not on historical data. So I don’t see how smoothing results will help you here.
If sometimes it takes 100ms and other times it takes 100ms between received messages, you might need to improve the frequency of data.
Let me put it this way, if what you actually had was data received every 10ms and wanted to process it in 100ms chunks then you could smooth it, with lack of data, there’s nothing to smooth.
2nd – The response time
I think the root cause is always the same. Your communication channel is not fast enough for JIT data receive/process/reply.
One “easy” solution could be slowing down the object so that it matches the communication channel capabilities.
Another solution can be to make the object wait for a reply before proceeding to the next move.
Yet another one would be to make the object work with late data instead of live, which means that it would be ok for the object to use data that is 200ms old, and take this in account for whatever that data is used at the object side.
All these and other possible solutions heavily depend on what you’re doing but in your case, unless I’m missing some key bit of information, I thing smoothing data is not the solution.
There are two ways to accomplish this. In server side code or client side code using a Javascript library like jquery. Do you have a preference?
Using client side code: `http://www.aspsnippets.com/Articles/Create-dynamic-textbox-using-JavaScript-in-ASP.Net.aspx
`
Using server side code: You’d just place them in a container and loop through the container on postback. Reading the control values.
The problem one is going from string format in one way to a string format in another.
If(hh >=12 ) { suffix = "PM"; hh= (hh>12) ? hh-12:hh; } else { suffix = "AM"; }
When you’re trying to understand something with as much deep background and subtlety as stateful vs stateless protocols, you need more than a little background in computer science. It’s only as recently as Roy Fielding’s dissertation that we got sturdy formal definitions of some of these concepts, and computers had been around for decades before that. There are some helpful pages on the wikipedia, but don’t be surprised if it doesn’t all sink in at one sitting. Most of us have to study this stuff in a few semesters of college to make sense of it.
https://en.wikipedia.org/wiki/Stateless_protocol
https://en.wikipedia.org/wiki/HATEOAS
In the case of HTTP, the server has data, but not request-to-request state. The client has stateful responsibility because it must send the entire request – GET, POST, Cookies, etc., all of the variables are the responsibility of the client.
While that is technically true, there is always more than one way to get a good result. You can (and should) use output buffering, almost without exception. In most cases it makes your site faster, and it solves the “header must come first” problem. The output buffer can hold your browser output until the PHP script ends, thus allowing you to write PHP logic out of the order required by traditional HTTP Client/Server protocols.
Going forward, you may want to learn about Twitter Bootstrap. It helps you build responsive, cross-platform web sites with a “mobile-forward” design approach. Nobody would start a web site any more with a “desktop-forward” design; we all need mobile to be our central design paradigm. Bootstrap can help you achieve that.
http://getbootstrap.com/
It was a problem with model mapping. on API side few request type properties are XML attributes and when it’s mapped with other class type using automapper, it looks unable to map it correctly. Now i have made all request type properties as XML elements and mapped it, now no media type error and works fine.
I had tried all the options with apostrophes and every time I ran it, it complained it couldn’t find the column ‘(whatever the formsecret value was at the time)’. Then I read something over at SQL Authority and wound up converting the statement to:
set @sql = 'select id, emailSent from ' + @tablename + ' WHERE formSecret = ' + CHAR(39) + @formSecret + CHAR(39)
– which worked.
I also implemented the Exec sp_executesql as suggested by ste5an – and learned in the implementing that the @sql needed to be an nvarchar to work properly – so multiple things learned.
As to the SQL injection, this is getting called from a web form that may get 100 uses on a really busy day. The form uses the php pdo module with stored procedures and parameterized queries all around. Each variable is bound to a specific datatype as well. I understand that is a very secure approach, but if that understanding is wrong, I have no problem switching it up as needed.
datetime dt2= DateTime,Parse(str.Substring(0, pos1).AddHours(15).AddMinutes(30);
DateTime smsTime = DateTime.Parse(str.Substring(0, pos1)).Add(new TimeSpan(9, 30, 0)).AddHours(6);
We record the result of the Parse in a datetime, not in a string as you do with your str2. And then we do all the operations through datetime methods, not string operations +” 9:30:00″. That way we are completely independent of the format, that might be different from one computer to another, from one database to another. When treating date and time through strings, you cannot be sure of the results because it depends on interpretation of the string, and this can be different depending on the environment.
How do you get 2015-04-01 03:30:00? Is this something that you get from some tool or from some code? It might be recorded as 15:30, but displayed with code that prevents the “PM” from showing.
Also, have you checked what is in str? What is the value of pos1? Did you verify that the date you get with your Substring does not already contain a time portion? Have you checked the content of str2 before building your SQL to make sure that the problem is not there instead?
When dealing with such problems, you need to use the debugger on all the values that you are dealing with in order to know where the thing starts to give incorrect results.
Try it like this
get { return string.Format("{0:C}", (MyMonetaryValue != null) ? MyMonetaryValue : 0); }
There are libraries to do this but it is actually quite simple to do.
Test Click meThis is the description
The OP’s pattern is not using the Deferred API. I still maintain that if the application needs to wait on a response, it needs to implement a synchronous call.. that’s the point of synchronous vs asynchronous.
please read this :
https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Synchronous_and_Asynchronous_Requests#Synchronous_request
and:
http://api.jquery.com/jquery.ajax/
There is this .Net Library for using Windows Task Scheduler
http://www.codeproject.com/Articles/2407/A-New-Task-Scheduler-Class-Library-for-NET
To improve the performance of PHP for a high traffic WordPress site, try using a PHP accelerator:
http://en.wikipedia.org/wiki/PHP_accelerator
Here is a list:
http://en.wikipedia.org/wiki/List_of_PHP_accelerators
Sign in to your account