15,922,015 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Visual Basic questions
View Javascript questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by amarasat (Top 124 by date)
amarasat
25-Jun-14 17:22pm
View
Can you give me an example on how to do it? Is this correct, am i getting the offset between the current server and the GMT?
$ServerTimeZone = date_default_timezone_get();
$ServerDateTimeZone = new DateTimeZone($ServerTimeZone);
$Offset = new DateTime('now', $ServerDateTimeZone);
echo $Offset->getOffset();
amarasat
24-Jun-14 17:51pm
View
I have a server which returns 2 hours of data. A webpage reads this data and displays on a trend. Now when i read the data and display it, the data is off by three hours because client is in EST and server is in PST. If i can get the time difference between server and client i can shift my data on the trend by that many hours.
One way is
On Client, Date.getTimezoneOffset() is giving the offset from UTC and GMT. Is there any function in php that gives same type of offset on the server side? If i echo that, i can get the difference in times.
amarasat
15-Nov-13 10:57am
View
Sorry SA, i think i updated the link after a while. Its
http://jsfiddle.net/GV4Ww/9/. Are you sure this is the link that did not work?
amarasat
15-Nov-13 10:31am
View
you said "Everything works". Ok may be i misunderstood strings. To explain this better i have constructed this jsfiddle.
http://jsfiddle.net/GV4Ww/8/
Can you make that work? When user types a time or date in the form i have shown in the input boxes in the same format and click apply, can you alert the date?
See how Show2 sjhows the date but Show shows and invalid date
amarasat
15-Nov-13 9:03am
View
No this didn't work either.
EndDateAndTime = "2013,11,14,03,00,00";
EndDateAndTime = EndDateAndTime.replace(/"/g, '');
var CurrentTime = (new Date(EndDateAndTime));
CurrentTime value is Date {Invalid Date}
amarasat
15-Nov-13 8:57am
View
CraigDJ, ofcourse i have used DateString = DateString.replace("\"","");. I just didn't copy and paste the whole line of code here.
DateString = DateString.replace("\"",""); This doesnt remove the double quotes
amarasat
15-Nov-13 8:55am
View
I dont understand, what do you mean by normal date formats? A user has entered the text (2013,11,14) in an html input text box. When i assign a variable (xyz) and get the value of the input text box from the DOM like xyz = element.value. Then xyz is "2013,11,14" with quotes, its not 2013,11,14
amarasat
31-Oct-13 10:57am
View
The easy solution i found for this one is trying to delete the TestDlg.exe file before launching it. If i was able to delete it, then copy it back from the backup file and launch it.
If i cannot delete it, that means its already running. Its working fine; just let me know if u see any issue with it.
amarasat
28-Oct-13 16:30pm
View
No, it didnt work. The same thing happens. cmd.exe is launched up in taskmessenger and the webpage hangs up and nothing happens after that. The xml http request hangs up.
I have already went through the manual and tried everything there. Nothing happens everything hangs up the page.
amarasat
28-Oct-13 15:43pm
View
No errors!! nothing happens!! cmd.exe shows up in task messenger in all cases and hangs up the webpage.
amarasat
28-Oct-13 15:42pm
View
Yes there was a executable like that. I have a xxx.bat and xxx.cmd files on desktop. The code inside them is Start OpcExecutable.exe!!
When webpage posts a launch event to php file, i want php file to run a .cmd or .bat file which inturn launches .exe.
amarasat
28-Oct-13 15:39pm
View
Ok, this code is not on a browser!! An xml http request will be posted to a php server file and the server php file will run this batch file or command file.
This batch or command file will inturn launch a .exe application file.
Do you still think this is a browser issue?
amarasat
20-Aug-13 9:32am
View
Thanks for your time SA. Unfortunately i tried debugging and i am sure Char* is causing the issue but don't know how to solve.
amarasat
20-Aug-13 9:31am
View
Thanks for the help nv3, i had problems in understanding local buffer, but Jochen's answer solved it.
amarasat
20-Aug-13 9:29am
View
Oh my God,
Thanks a lot for your solution. It has worked and solved my stupid stackoverflow problem that i have been sitting for almost a day. This is what i am trying to search online, some method to construct the Char* which does not cause StackOverFlow.
amarasat
23-May-13 11:11am
View
Unfortunately there is a memory leak. Most of it has been solved. I left an IE page open for 20 hours and the memory usage of IE has increased by 10 mb within 20 hours. I just have one question.
var xhrCheckRequestnew = new XMLHttpRequest(); and
var xhrCheckRequestnew = new ActiveXObject("Microsoft.XMLHTTP"); are two new objects created every one second.
xhrCheckRequestnew.open("GET", nuUrl, true); is an asynchronous operation, do you think the two new object are getting deleted. This is where the memory is not freed i guess. How do i delete or free xhrCheckRequestnew object in an asynchronous operation?
amarasat
22-May-13 12:27pm
View
I was able to solve the memeory leak in Firefox. All i did was these changes
I removed the variable "readValues" completely. I made nuUrl global variable so it is not created always. I moved the splitting of the array into the function "UpdateCurrentPage". The memory leak has been solved in FF.
However i still have the memory leak on Internet Explorer. I cannot make nuUrl global here because the time stamp is used to solve the cache issue of Internet Explorer. This is the code that is causing the issue.
var nuUrl = '../Ref.php' + '?ReadData=' + FileName + '&temptime=' + temptimestamp;
This local variable's memory is not cleaned in Internet Explorer at the time of sending xmlhttprequest. How do i clean this nuUrl memory in IE.
amarasat
22-May-13 12:27pm
View
I was able to solve the memeory leak in Firefox. All i did was these changes
I removed the variable "readValues" completely. I made nuUrl global variable so it is not created always. I moved the splitting of the array into the function "UpdateCurrentPage". The memory leak has been solved in FF.
However i still have the memory leak on Internet Explorer. I cannot make nuUrl global here because the time stamp is used to solve the cache issue of Internet Explorer. This is the code that is causing the issue.
var nuUrl = '../Ref.php' + '?ReadData=' + FileName + '&temptime=' + temptimestamp;
This local variable's memory is not cleaned in Internet Explorer at the time of sending xmlhttprequest. How do i clean this nuUrl memory in IE.
amarasat
21-May-13 14:24pm
View
- Windows XP service pack 3, browsers Firefox 21.0.
- yah i know
- The current code i gave you is in "testmemory.html", i opened 10 instances of it and kept them running. They are request a set of data 1,11111;2,11111;3,11111;4,11111;5,.....;1000,1111 from Ref.php. Ref.php reads this data from sqlite database file. When i check the taskmessenger, the memeroy usage of firefox.exe keeps on increasing at rate of 1MB per every 10 seconds and never comes down.
- using xhrCheckRequestnew after deleting it, may be but its always working fine, receiving the data always.
amarasat
21-May-13 13:56pm
View
I am making those changes and will update you soon.
- Result is a string with numbers from 1 to 1000 separated by ";".
-UpdateCurrentPage, i even disabled it and checked there are memory leaks.
-I need to split it, but let me try splitting in UpdateCurrentPage.
-S using task messenger.
amarasat
21-May-13 13:53pm
View
I am looking at the taskmessenger for firefox.exe or any other browser.
amarasat
13-May-13 12:06pm
View
Yes that's what i have tried and it has worked. I also have to turn off temp_store and synchronous to get a full journal less state. thanks for your help.
amarasat
9-May-13 10:57am
View
I understood the issue now, i asked for a solution in php pdo, but the solution you gave me is the regular php sqlite function. Please let me iknow how do i turn off journal mode using php pdo
amarasat
9-May-13 10:25am
View
$mainQuery = "sqlite_exec($database, PRAGMA journal_mode=OFF, $error)";
error:
<br />
Catchable fatal error
: Object of class PDO could not be converted to string in
C:\xx\xx\.php
on line
21
<br />
in both the comments line 21 is $mainQuery =
amarasat
9-May-13 10:14am
View
global $database, $error;
$database = new PDO($dir) or die("cannot open the database");
$mainQuery = sqlite_exec($database, "PRAGMA journal_mode=OFF", $error);
if(!$database->query($mainQuery))
{
echo "Unable to turn off journal";
}
error:
<br />
Warning
: sqlite_exec() expects parameter 1 to be resource, object given in
C:\xx\xx\.php
on line
21
<br />
Unable to turn off journal
amarasat
2-May-13 17:06pm
View
You are right, i solved the issue. It has nothing to do with the user login or session, i am getting the error because i am calling the wrong file in the code
amarasat
5-Nov-12 14:37pm
View
Is this a solution:
public:
function 1
function 2
function 3
bool arrayDeleted = false;
bool bArray[4];
Handle mainHandle;
function1()//called for every one second until DestroyTimer() is called
{
if(!arrayDeleted)
mainHandle = CreateThread(NULL, 0, ::function3, this, 0, NULL);
}
function3()
{
if(!arrayDeleted)
bArray[2] = false;
}
function2()
{
DestroyTimer();
arrayDeleted = true;
DWORD status = WaitForSingleObject(mainHandle,INFINITE);
if (status == WAIT_OBJECT_0)
{
bArray = NULL;
}
//here comes the problem, event though i called destroy timer there are threads that are already created and when they execute function3 they throw an assertion that bArray is NULL.
}
amarasat
5-Nov-12 14:32pm
View
This is what i was looking for:
""you simply set the signal for all of your threads, wait until they have terminated"": How do i achieve this, are you saying about "WaitForSingleObject(mainHandle,INFINITE)" and when it returns WAIT_OBJECT_0 then avoid creating new threads and destroy the array. or is there someother way?
Is this a solution:
public:
function 1
function 2
function 3
bool arrayDeleted = false;
bool bArray[4];
Handle mainHandle;
function1()//called for every one second until DestroyTimer() is called
{
if(!arrayDeleted)
mainHandle = CreateThread(NULL, 0, ::function3, this, 0, NULL);
}
function3()
{
if(!arrayDeleted)
bArray[2] = false;
}
function2()
{
DestroyTimer();
arrayDeleted = true;
DWORD status = WaitForSingleObject(mainHandle,INFINITE);
if (status == WAIT_OBJECT_0)
{
bArray = NULL;
}
//here comes the problem, event though i called destroy timer there are threads that are already created and when they execute function3 they throw an assertion that bArray is NULL.
}
amarasat
28-Sep-12 14:50pm
View
This is what i am explaining from the start:
1.) No i dont know the pixel height, since i am calculating it dynamically
2.) What you have suggested is not working and i already told that.
3.) Yes its parent elements height, that is the whole key y i ahve posted a question, get the parent elments height in pixel without quotations, that the whole reason for the question
amarasat
28-Sep-12 14:03pm
View
I am sorry, i misunderstood
yes i have tried now with single quotes in all possible ways, it didn't work still!!
amarasat
28-Sep-12 13:40pm
View
Yes ofcourse,
thats what i showed in the various ways, i tried both of them
amarasat
6-Sep-12 16:00pm
View
enhzflep,
Thanks a lot for your soultion and time, i was able to solve my issue by using the className attribute you have described in your solution. This way i was able to pull out all the elements by using "getElementsByClassName().
Your solution has solved my issue.
amarasat
6-Sep-12 15:58pm
View
Zoltan,
Thanks a lot for your help and time, i was able to solve my issue by using the className attribute of the tag <td>. This way i was able to pull out all the elements by using "getElementsByClassName();
amarasat
4-Sep-12 16:46pm
View
Thanks a lot, for the quick reply. I am very sorry to mention, the client does not want us to use jQuery. They have security issues, so it has to be a non jQuery solution. We can use DOM implementation methods though.
amarasat
4-Sep-12 16:46pm
View
Thanks a lot, for the quick reply. I am very sorry to mention, the client does not want us to use jQuery. They have security issues, so it has to be a non jQuery solution. We can use DOM implementation methods though.
amarasat
27-Aug-12 11:17am
View
it says, sqlite3_sql identifier not found, this is what i have referred
"http://www.sqlite.org/eqp.html", the step 2 sample code is what i am trying to implement.
amarasat
27-Aug-12 8:56am
View
I am very sorry, thats a typo, when editing one of the versions i forgot to put the Begin Transaction. I have updated the code now to reflect what i have.
amarasat
24-Aug-12 16:45pm
View
Thanks a lot, for the code snippet,
I did exactly what you have said, i have created an index just like you said, once per every database only the first time the database is opened.
I don't see an any change in the CPU usage.
I am still reading the Write Ahead Logging.
amarasat
24-Aug-12 15:40pm
View
Thanks for your reply!!
Can you give me an example of indexing in the database and indexing in querying, i searched everywhere and was not able to understand how to implement it, is there any good example you can point me out to or you can modify my code and implement it?
amarasat
20-Aug-12 14:49pm
View
Hai sorry to bother you again. I have two questions.
sqlite3_bind_text(stmt, 1, pChar1, strlen(pChar1), 0);
sqlite3_bind_text(stmt, 2, pChar2, strlen(pChar2), 0);
sqlite3_step(stmt);
sqlite3_reset(stmt);
sqlite3_exec(database, "COMMIT TRANSACTION", NULL, NULL, &errorMessage);
sqlite3_finalize(stmt);
1.)In the whole code if we consider the above statements, which is the statement that is actually writing to the database? Is it sqlite3_step(stmt) or sqlite3_finalize(stmt) or sqlite3_bind_text or "COMMIT TRANSACTION"?
Instead of writing the whole 400 entries at the same time, i jsu want to write only a chunk of 100 entries at a time and see if that makes a diff in the cu usage.
amarasat
8-Aug-12 14:46pm
View
Thanks a lot, your suggestions have helped me and solved my issues in attaining what i want, thanks a lot for your time and responses, i will accept your solution now, and also i will ask for more help here if i need and more info in the future, is it ok?
amarasat
8-Aug-12 14:17pm
View
Deleted
Ok, i am sorry for the confusion before, let me explain my situation with more info.
My CPU usage for above code for 4000 entries is 56%, everything working fine with no problem. Now i added these 4 statements as soon as i am opening the database
if(sqlite3_open(ch, &database) == SQLITE_OK) {
sqlite3_exec(database, "PRAGMA synchronous=OFF", NULL, NULL, &errorMessage);
sqlite3_exec(database, "PRAGMA count_changes=OFF", NULL, NULL, &errorMessage);
sqlite3_exec(database, "PRAGMA journal_mode=MEMORY", NULL, NULL, &errorMessage);
sqlite3_exec(database, "PRAGMA temp_store=MEMORY", NULL, NULL, &errorMessage);
Now my cpu usage is 76%, everything is working fine, there are no delays and everything looks normal like before. now i am trying to figure out, where this increase in cpu usage is coming from. Do you have any idea y these statements were causing increase in cpu usage?
amarasat
7-Aug-12 16:46pm
View
Ok, i got what you are saying, Just another question completely out of the discussion. Is there anyway to know, wehere is the maximum cpu usage in the above code?
In general do you have any idea if the cpu usage will be more for binding or preparing. The total cpu usage to execute above code for 400 entries is 57%, is there anyway to know how much cpu usage each statement is taking? Pls throw some suggestions on this.
amarasat
6-Aug-12 10:46am
View
This is what i have tried, there was still not much improvement, tell me if there is anything more i can do to improve the speed.
function()
{
if(sqlite3_open(ch, &database) == SQLITE_OK)
{
const char *pSQL[6];
pSQL[3] = "select * from TagValues";
sqlite3_stmt *statement, *statement4;
char* errorMessage;
CString csValue, queryStr, Tag;
if ( sqlite3_prepare(database, pSQL[3], -1, &statement, 0 ) == SQLITE_OK )
{
int ctotal = sqlite3_column_count(statement);
int res = 0;
char *szSQL;
sqlite3_stmt *stmt;
const char *pzTest;
szSQL = "update TagValues set Value = ? where Tag = ?";
int rcn = sqlite3_prepare(database, szSQL, strlen(szSQL), &stmt, &pzTest);
while ( 1 )
{
res = sqlite3_step(statement);
if ( res == SQLITE_ROW )
{
for ( int i = 0; i < 1; i++ )
{
Tag = (char*)sqlite3_column_text(statement, i);
char *pChar1;
char *pChar2;
USES_CONVERSION;
pChar1 = T2A(csValue);
pChar2 = T2A(Tag);
sqlite3_bind_text(stmt, 1, pChar1, strlen(pChar1), 0);
sqlite3_bind_text(stmt, 2, pChar2, strlen(pChar2), 0);
sqlite3_step(stmt);
sqlite3_reset(stmt);
}
}
if ( res == SQLITE_DONE)
{
sqlite3_finalize(stmt);
sqlite3_finalize(statement);
}
}
}
}
}
Now it takes 1.1secs to update 400 entries and sometimes lesser then that, but still that's too much time for just 400 entries, can you suggest me anything? or am i doing something wrong still?
amarasat
3-Aug-12 10:50am
View
can you suggest me which way to proceed to reduce the time when updating a sqlite database with c++. Or point me to a good example so that i can proceed myself.
Thanks a lot!!
amarasat
3-Aug-12 10:43am
View
I have been trying a lot , can you tell me how to do it? Or point me to a good example so that i can proceed myself.
Thanks a lot!!
amarasat
18-Jul-12 9:05am
View
I understand what you were saying, i can change the id of the control in runtime, but how would i know which controls id to change, i need to differentiate in which control he enters our address tag.
I think my question is to know how to create a custom HTML control and submit the control to them, so that whenever he drags and drops that control, i should set the id?
amarasat
6-Jul-12 14:17pm
View
Hello Alex,
I have a question:
$dir = 'sqlite:C:/Program Files/'.$DataBaseFileName.'.sqlite';
$database = new PDO($dir) or die("cannot open the database");//creates new or opens existing database.
I don't want to create a new database(if it does not exists), but opens if the database exists. What should i do?
amarasat
5-Jul-12 11:59am
View
Thanks a lot, using sqlite3_finalize has solved my issue!!
amarasat
29-Jun-12 14:08pm
View
Thanks alot for the information, i was able to solve my issue by using "pwasser's" piece of code
amarasat
29-Jun-12 14:06pm
View
Thanks a lot, you solution has solved my issue!!
amarasat
22-Jun-12 15:59pm
View
How do i solve this:
CString textvalue = _T("120");
CString Tag = _T("Plugin1@PLG.Value1@Value");
queryStr.Format(L"update Table set Value=%s where Tag=%s", textvalue, Tag);
char *pSQL[0] = T2A(queryStr);
int rc = sqlite3_exec(database, pSQL[i], callback, 0, &zErrMsg);
gives me an error: "near "@PLG": syntax error"
also for Tag = _T("Main Plugin1@PLG.Value1@Value");
gives me an error: "near "Plugin1": syntax error"
amarasat
22-Jun-12 10:29am
View
Thanks alot for your help!! Both ways have worked!!
My 5 too!
amarasat
8-Jun-12 14:44pm
View
got it thanks a lot for your help!! i have to use
"JSON.parse(Request.responseText);"
amarasat
8-Jun-12 14:29pm
View
I was able to remove the quotes in 2 ways,
1.)y = "100.12";
y = +y; //removes the quotes and gives 100.12
or
2.) y = "100.12";
y = parseInt(y, 10); //also removes the quotes and gives 100.
Now how do i do this:
3.) y = "[100.01, 101.23]";
now using above 2 ways, it gives (y = NaN)
how do i get y = [100.01, 101.23];
amarasat
7-Jun-12 10:54am
View
You are right, i started implementing it using synchronous "xmlHttpRequest" to call a php function to read the text file and return the value back.
Its working fine, but when php function returns the value it returns it as
request.responsetext = "100" instead of 100
How do i remove the quotes from the response text?
amarasat
7-Jun-12 10:51am
View
I am getting an error ActiveXObject not defined, do i have to include any packages or libraries etc?
amarasat
15-May-12 12:55pm
View
Yes, i am implementing it in windows, sorry i haven't noticed your comment before.
amarasat
15-May-12 12:46pm
View
Hello Aescleal,
Thanks for such a great answer, i am looking into everything you specified and will let you know how it goes.
amarasat
22-Nov-11 17:09pm
View
updated the question with extra code and info, thanks a lot.
amarasat
22-Nov-11 17:09pm
View
updated question with extra code and info, thanks a lot.
amarasat
22-Nov-11 17:08pm
View
updated question with extra info thanks a lot.
amarasat
22-Nov-11 16:54pm
View
Hello Richard, please give me 5 mins, i shall give you the rest of the code, sorry for the delay
amarasat
22-Nov-11 16:53pm
View
I have already stated that it is of type double, ofcourse i am a software developer, thats y i have specified that those variables are of type double twice in the whole question, and the values are the runtime values at which it is failing.
amarasat
22-Nov-11 15:28pm
View
sorry, i have mistyped a and b, now i updated the question.
amarasat
22-Nov-11 15:28pm
View
sorry, i have mistyped a and b, now i updated the question.
amarasat
25-Oct-11 14:50pm
View
Deleted
SAKryukov, Its been days and i am still trying to figure out what would be the method i can use for question 3.
You said yes for ""Is there any synchronous method i am missing in php like GET and POST that sends a request to a new page process.php and waits on the same page without navigating away and continue the process after receiving response from process.php? ""
Can i know what the method is?
amarasat
20-Oct-11 9:58am
View
Thanks a lot its working, in the way you suggested, if first threw an error documnt.form.0 is null, but after a while it worked, sounds strange to me. One more issue is, this loads up the new page "NewPhpWriteFile.php" and says, "Internet Explorer cannot display the page", can you help me with any one of this. 1.) To let the focus not shift to the "NewPhpWriteFile.php" in the browser.
((or))
2.) How to load another simple html page from the "NewPhpWriteFile.php" which says "Waiting for the report to be generated".
((or))
3.) To return the focus back to the Test.html page(parent) which is calling the "NewPhpWriteFile.php" in the above code.
amarasat
20-Oct-11 0:59am
View
Yah you are right, in this code there is no php code, but i am calling a PHP file with a POST action and passing value from variable "sometext", i will improve the question by adding the .php file code also
amarasat
19-Oct-11 10:46am
View
Sorry for troubling you, i got the solution, i have a problem with Apache configuration. I was able to achieve what i got.
The problem is i copied a wrong code from the web and try to make it work than working on my own.
Here is my 5
amarasat
19-Oct-11 9:02am
View
The example you are showing is modifying the inner html of a div element, you created a place holder and modified the same html file for an onclick event. But my situation is to create a text file in a folder may be in (C:\Documents\Test.txt) when a button is clicked on a html page. This is a JavaScript and PHP interaction. The idea i have is creating a HTMl file with a button on it.
<pre><html><head>
<script language="javascript" type="text/javascript">
function SayHello()
{ }
</script></head><body>
<input type="button" value="click me" önclick="SayHello()"/>
</body> </html></pre>
This file executes the SayHello function when the button is clicked. Now i have a php function to create a file in the c drive documents directory. <pre>
function CreateFile(){
$filename = "C:/Documents/test.txt";
$content = "Report Name";
$strlength = strlen($content);
$create = fopen($filename, "w");
$write = fwrite($create, $content, $strlength);
$close = fclose($create);}
</pre>
Now how do i call this php function when the user clicks the button in the HTML file (SayHello()) function. How do i achieve this?
amarasat
19-Oct-11 9:01am
View
Deleted
The example you are showing is modifying the inner html of a div element, you created a place holder and modified the same html file for an onclick event. But my situation is to create a text file in a folder may be in (C:\Documents\Test.txt) when a button is clicked on a html page. This is a JavaScript and PHP interaction. The idea i have is creating a HTMl file with a button on it. <pre><html><head> <script language="javascript" type="text/javascript">function SayHello() { }</script></head><body> <input type="button" value="click me" önclick="SayHello()"/></body> </html></pre> This file executes the SayHello function when the button is clicked. Now i have a php function to create a file in the c drive documents directory. <pre>function CreateFile(){$filename = "C:/Documents/test.txt"; $content = "Report Name";$strlength = strlen($content); $create = fopen($filename, "w");$write = fwrite($create, $content, $strlength); $close = fclose($create);}</pre> Now how do i call this php function when the user clicks the button in the HTML file (SayHello()) function. How do i achieve this?
amarasat
19-Oct-11 2:19am
View
Deleted
The example you are showing is modifying the inner html of a div element, you created a place holder and modified the same html file for an onclick event.
But my situation is to create a text file in a folder may be in (C:\Documents\Test.txt) when a button is clicked on a html page. This is a JavaScript and PHP interaction. The idea i have is creating a HTMl file with a button on it.
<pre><html><head>
<script language="javascript" type="text/javascript">function SayHello() {
}</script></head><body>
<input type="button" value="click me" önclick="SayHello()"/></body>
</html></pre>
This file executes the SayHello function when the button is clicked. Now i have a php function to create a file in the c drive documents directory.
<pre>function CreateFile(){$filename = "C:/Documents/test.txt";
$content = "Report Name";$strlength = strlen($content);
$create = fopen($filename, "w");$write = fwrite($create, $content, $strlength);
$close = fclose($create);}</pre>
Now how do i call this php function when the user clicks the button in the HTML file (SayHello()) function. How do i achieve this?
amarasat
19-Oct-11 2:14am
View
Deleted
The example you are showing is modifying the inner html of a div element, you created a place holder and modified the same html file for an onclick event. I know this already.
But my situation is to create a text file in a folder may be in (C:\Documents\Test.txt) when a button is clicked on a html page. This is a JavaScript and PHP interaction. The idea i have is creating a HTMl file with a button on it.
<html><head>
<script language="javascript" type="text/javascript">function SayHello() {
}</script></head><body>
<input type="button" value="click me" önclick="SayHello()"/></body>
</html>
This file executes the SayHello function when the button is clicked. Now i have a php function to create a file in the "C:\Documents\" directory.
Now how do i call this php function when the user clicks the button in the HTML file (SayHello()) function. How do i achieve this?
amarasat
18-Oct-11 18:20pm
View
All i need is, to have a blank page with a button on it, and when user clicks the button, a text file is created with the text "Hello" in it. I thought of doing this using JavaScript and PHP.
In the above example i used the button, to call a function that reloads the same page and calling a php function. This is done as specified at this forum "http://forums.devarticles.com/javascript-development-22/calling-php-functions-with-javascript-3471.html"
But it is not working. So i am trying to create a JavaScript function which loads a new url/php/html file and executes a php code on the "onload" event of the HTML page and its not working either.
So can you please give me an example or modify my code, so that when user clicks the HTML button, a java script function is executed to call a PHP function which creates a file and puts text in it
amarasat
10-Oct-11 13:22pm
View
Thanks a lot, your info has helped me and gave me the solution.
amarasat
23-Aug-11 12:18pm
View
Can anybody help me with error above, i am still not getting how to do this.
amarasat
23-Aug-11 10:31am
View
typedef CArray<gridproperty,gridproperty> GridPropertiesArray_t
CArray<gridpropertiesarray_t,gridpropertiesarray_t> GridPropertiesArrays;
CArray<gridproperty,gridproperty> DuplicatePropertiesArray; --- this CArray has 10 items in it. (I want to put all these 10 items as another array's first item).
Now the following line gives me an error
GridPropertiesArrays.Add(DuplicatePropertiesArray);
error:: C2664: 'CArray<type,arg_type>::Add' : cannot convert parameter 1 from 'CArray<type,arg_type>' to 'CSFT::cPropGrid::GridPropertiesArray_t'
with
[
TYPE=CSFT::cPropGrid::GridPropertiesArray_t,
ARG_TYPE=CSFT::cPropGrid::GridPropertiesArray_t
]
and
[
TYPE=CSFT::cPropGrid::GridProperty,
ARG_TYPE=CSFT::cPropGrid::GridProperty
]
No copy constructor available for class 'CArray<type,arg_type>' or constructor attempts to perform illegal conversion to non-__gc reference
with
[
TYPE=CSFT::cPropGrid::GridProperty,
ARG_TYPE=CSFT::cPropGrid::GridProperty
]
amarasat
16-Aug-11 15:53pm
View
I removed it in one of the file and its working, Thanks a lot. I just cant believe i missed a small thing and posted a question here. Thanks a lot again.
amarasat
16-Aug-11 15:46pm
View
Yes, i have eCellCheckStateType enum defined them in two classes.
in
1.)header1.h::
typedef enum {cstDisableState=0, cstUncheckedState=1, cstCheckedState} eCellCheckStateType;
2.)header2.h::
#include header1.h
typedef enum ....
amarasat
1-Aug-11 14:10pm
View
Struct helped me in solving my error.
amarasat
1-Aug-11 14:09pm
View
Thanks a lot for the reply and solution. I gave a 5 for clearing my problem and proposing a new solution, and understanding my situation.
Thanks again, its working well now.
amarasat
23-Jun-11 17:27pm
View
Thanks a lot Joan, Scrollable Dialog helped a lot.
amarasat
14-Jun-11 16:02pm
View
I was wrong this is not what i want, i implemented LBS_WANTKEYBOARDINPUT, it only captures events on a list box item from keyboard, but not a mouse click event.
I still need to know how to capture the mouse click event on a listbox item, is so how to get the index of the item that is selected or about to be selected. suggestions please
amarasat
14-Jun-11 14:53pm
View
i have already looked at this article, it has everything except LBS_WANTKEYBOARDINPUT
or VKeyToItem message examples. These are the thing i want exactly. Like i have already tried by adding LBS_WANTKEYBOARDINPUT to my ListBox styles and when i defined the function
int CGenerationDlg::VKeyToItem(UINT nKey, UINT nIndex) , i am getting error VKeyToItem is not a member of CGenerationDlg. Still searching how to declare that function.
amarasat
9-Jun-11 15:53pm
View
You were right, i was able to use the pt of PMsg and solve my issue
amarasat
26-Apr-11 10:13am
View
Thanks a lot the answer was solved, my bitmap is having bad dimensions
amarasat
26-Apr-11 10:13am
View
Thanks, The bitmap is having bad dimensions.
amarasat
21-Apr-11 14:24pm
View
But it is working always, only in this case its not working. This code is grabbed from
http://www.codeproject.com/KB/miscctrl/CustomToolTips.aspx.
The only thing i changed is adding the OnTimer function i gave above
amarasat
13-Apr-11 16:32pm
View
Thanks a lot for your help, if i run into some more problems in the future, then i will better switch the whole thing to CMAP, and if i have difficulty at that time in implementing CMAP, i will ask further assistance in this post only. thanks again a lot
amarasat
13-Apr-11 16:13pm
View
yes i think i should modify my position array whenever those positions are no more valid in the main array.
amarasat
13-Apr-11 16:13pm
View
Just for more info, according to my design, there is no way to remove points in between two other points, i only can remove the first points like may be first 100 or 900.
amarasat
13-Apr-11 16:09pm
View
Thanks a lot Nishant for your information, what you are saying makes complete sense. Now i understand my algorithm has some limitations. The whole problem is, i have saved 100th, 200th, 300th and 400th position, now i have removed 225 items, but i haven't modified my CArray. I think as soon as i remove 225 items, if i remove the first 2 positions(100th and 200th point reference) from my CArray, my problem would be solved i think.
After removing the first two items from the CArray, Since the 300th and 400th point positions from the CArray are still valid according to what you said, i should start iterating through the 300th point reference and 400th point reference.
In other words, u said "If you only add items or if you only remove items that are located before the starting position you should be okay", my question is if i remove 225 points and madify my starting point by removing the first two elements of CArray(msdn says if we remove an element in the array, it shifts down all the elements above the removed element(s). It decrements the upper bound of the array but does not free memory.) i should be good right?
amarasat
13-Apr-11 15:14pm
View
Were u able to understand my question Nishant?
amarasat
13-Apr-11 14:45pm
View
My CLIST is not based on index, i have to display the elements according to the timestamp, so u don't know at what index is an element with timestamp of may be 5 months back etc. Instead of iterating through whole LIST, i already have an array that has positions to the LIST, i check the timestamp of an element by using each position reference from the CARRAY.
Example: Out of all 1000 datapoints, i have to display a datapoint at April 4th 12:00 PM. Suppose this is the 999th point, i have to iterate through all 1000 points of my CLIST. But instead if i use my method, i will get the timestamp of the CLIST element at 100, 200, 300 etc using the reference positions stored in the CARRAY, check those timestamps and will find out which part i need to iterate.
** the timestamps are in increasing order, so to find 999th, i will find the 900th first and then iterate from there.
amarasat
28-Mar-11 10:32am
View
file_get_contents_curl worked like a charm, Thanks everyone
amarasat
22-Mar-11 16:48pm
View
Deleted
I captured the last error message and here is it:
last err msg:: file_get_contents(http://192.168.1.58/Reports/ReportList.php?&username=admin&cryptpass=%241%24745.CK2.%24k0028XJovI8AzaZEStgzX1&noredir=1) [
function.file-get-contents
]: failed to open stream: HTTP request failed!
And this is the value of the url:
http://192.168.1.58/Reports/ReportList.php?&username=admin&cryptpass=%241%24745.CK2.%24k0028XJovI8AzaZEStgzX1&noredir=1
Trying to work on this error, any suggestion pls?
amarasat
22-Mar-11 10:47am
View
You are right, the URL seems fine, now its working, seems like this is not the main problem.
I have a URL, that parses metatags from the reprots in a folder and display them. This is working fine, but if open the windows debugger, and attach the process to the Apache.exe, the URL hasn't finished loading up and the Windows debugger throws an error
(24c.294): Stack overflow - code c00000fd (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
eax=0528db40 ebx=0117f158 ecx=00000007 edx=011b5770 esi=00000007 edi=0528ddb0
eip=007b93a9 esp=01513000 ebp=00000001 iopl=0 nv up ei pl nz na po nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010202
*** WARNING: Unable to verify checksum for c:\php\php5ts.dll
*** ERROR: Symbol file could not be found. Defaulted to export symbols for c:\php\php5ts.dll -
php5ts!zend_hash_quick_add_or_update+0x9:
007b93a9 57 push edi
If i launch the URL without windows debugger its working fine, if i have the windows debugger its throwing the error. Any suggestions what this could be.
amarasat
11-Feb-11 10:02am
View
This works for C++ also right?
amarasat
11-Feb-11 9:58am
View
You are right, i am checking the Boolean value now!!
amarasat
11-Feb-11 9:57am
View
No Luck, even calling the FindNextFile to get the first file name, FindFileData.cFileName is "Manual" and my Local_result is 0.
The first problem is i have 4 PDF files with different names, but its returning Manual as the first file name. This is what i have. dwErr1 is 18.
<pre>hFind = FindFirstFile(lpath, &FindFileData);
BOOL Local_result = FindNextFile(hFind, &FindFileData);
DWORD dwErr1 = GetLastError();
while (hFind && Local_result) --> Local_result is zero here.
{
FoundFileName = FindFileData.cFileName;
found = FoundFileName.Find(L"Iv5-User Manual", 0);
Local_result = FindNextFile(hFind, &FindFileData);
}</pre>
amarasat
10-Feb-11 11:06am
View
Thanks,
i never knew ShellExecute is having a return value, i thoguht only ShellExecuteEx has it!!
amarasat
10-Feb-11 11:03am
View
I really like your suggestion:
But i am confused how do i use the ShellExecute on those commands u gave
<pre>ShellExecute(NULL, OpenAs_RunDLL, _T("C:\\Program Files\\...."), NULL, NULL, SW_SHOW); </pre>
is this what r u saying? Can you give me an example pls!!
amarasat
10-Feb-11 9:25am
View
This has worked for me without any errors:
ShellExecute(NULL, _T("open"), _T("C:\\Program Files\\...."), NULL, NULL, SW_SHOW);
But i am having a problem, what if the user doesn't have an associated viwer for the PDF
1.) In this case what would be the default PDF reader the ShellExecute will pick to open the PDF
2.) What if the user doesn't have any acrobat or PDF reader or PDF viewer installed? How do i ahndle this case?
amarasat
2-Feb-11 16:34pm
View
Am sorry, this question was a continuation of another question, so we were able to figure it out quick
amarasat
1-Feb-11 15:31pm
View
OK thanks a lot for your help in all the posts!! if i need anything i will post here.
thank you!!
amarasat
1-Feb-11 15:16pm
View
i got it!!
is there a way to check if spHst is pointing to a valid location? Other than to chack if it hasa value or not, is there any way to see if it is a valid pointer or not?
amarasat
1-Feb-11 15:04pm
View
This is what i have tried:
ICSFTHST* temp = spHst;
CString HSTPointer;
HSTPointer.Format(L"%temp", temp);
now the string HSTPointer has a value "temp".
is this correct, can you give me the solution for my code.
amarasat
1-Feb-11 14:38pm
View
Thanks a lot everyone, i have a question now!!
CComQIPtr<icsfthst> spHst;
HRESULT hr1 = CoCreateInstance(
CClsid::m_CSFTHST, NULL, CLSCTX_LOCAL_SERVER, IID_ICSFTHST,
(void **)&spHst);
Since the hr1 value is S_OK, Is there anyway i can check to see if the pointer &spHst is still valid:
like it is pointing to a valid location or not?
or can i put the value of the pointer into a CString and output it to a file:
spHst.p is the value, i have to check if this points to a valid location if not or so make a log of this value in a trace file.
amarasat
6-Dec-10 14:34pm
View
Thanks, posted there, should see what happens!!
amarasat
6-Dec-10 14:14pm
View
How to use it, can you please let me know for above example, i have been searching online to use that class but i don't see any examples!!
The only info i was able to get is to use JIVariant.OUTPARAMforType(...) method, but i am new to jave so was not able to implement i to above example!!
amarasat
2-Dec-10 15:12pm
View
Hello Arman,
Can you also help me in getting this to execute in eclipse:
I am using Eclipse SDK 3.6, i just opened the file from my C:\Documents and Settings\xxxx\Desktop\Java Files New\ location.
When i run the file using Ant Build i get the following error message:
java.lang.NullPointerException
at org.eclipse.ant.internal.ui.AntUtil.isKnownAntFile(AntUtil.java:593)
at org.eclipse.ant.internal.ui.launchConfigurations.AntLaunchShortcut.launch(AntLaunchShortcut.java:465)
at org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension.launch(LaunchShortcutExtension.java:424)
at org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.launchShortcut(ContextRunner.java:217)
at org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.showShortcutSelectionDialog(ContextRunner.java:286)
at org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.selectAndLaunch(ContextRunner.java:140)
at org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.launch(ContextRunner.java:82)
at org.eclipse.debug.ui.actions.AbstractLaunchToolbarAction.run(AbstractLaunchToolbarAction.java:79)
at org.eclipse.debug.ui.actions.AbstractLaunchHistoryAction.runWithEvent(AbstractLaunchHistoryAction.java:404)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:241)
at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:229)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:452)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
amarasat
2-Dec-10 14:03pm
View
Thanks alot, this one has helped finally, u helped a lot!!
C:\....\Java Files New>java mypackage.MSWord, i was able to execute it!!
amarasat
17-Nov-10 16:51pm
View
Were u able to resolve this?
amarasat
10-Nov-10 17:43pm
View
Hello Sandeep, i haven,t found a better place to ask you this question, i visited your CleintCallback article it is really a very good development article, its a good custom control.
I have a question:
I am a newbie to AJAX and Asp.Net, i have been working on windows forms from over an year!! We don't have a database, its all flat files, all the data is stored in the server.
Our exisitng implementation is if user wants to see the health of a plugin or loop or data at a node, we use to generate HTML reports for every 2 minutes and use to store them in the client server. This is pure HTML, increasing in size day by day and is annoying a lot.
Have installed MySQL database recently and now the database is having a part of the data from our server. I want to create a web page which takes data from my database and updates automatically whenever values in the table changes. I think this is what meant by updating without postback, i think your article helps here.
Can i use your article to do this, do i need to install Asp.Net separately or can i use my Visual Studio 2003 to generate the custom control you gave in the article?
Can you please give me some heads up on this, thanks alot for your time!!
amarasat
10-Nov-10 17:04pm
View
Hello Anurag,
Just saw this question, i am a newbie to AJAX and Asp.Net have been working on windows forms from an year!! We don't have a database, its all flat files, all the data is in the server.
My question is you said, "I had a Ajax enabled website uploaded at a server", is a database involved in the website you have done?, can i develop a Ajax based web page with out constructing a database, here are little more details:
** All the data is in the server and i have access to it.
** We don't have any database, only XML files stored in the server directory.
** I want to create a web page which display data from this XML files in the from of reports etc, do i need a SQL database for this or can AJAX directly communicate with my server and get the data?
** the data which is shown on the web page should update dynamically, if user wants to see the health of a plugin, until now we use to generate HTML reports for every 2 minutes and use to store them in the client server.
** now when ever the plugin health changes, the web page(AJAX based) should update automatically without postback, so basically saying to goodbye to large HTML reports.
Can you give me a heads up on this. thanks for your time!! If you need more info please let me know!!
amarasat
28-Sep-10 17:17pm
View
Thanks a lot for everything Eugen, all the suggestions you gave me worked well.
:-) !!
amarasat
28-Sep-10 17:16pm
View
Reason for my vote of 5
Automatic vote of 5 for accepting answer.
amarasat
24-Sep-10 10:49am
View
CCsTrendPoint* TrendPointPointer;
std::vector<ccstrendpoint*> m_TrendDisplayItemVect;
TrendPointPointer = &trendpoint; //pointer to the point that has been filtered and to be moved
m_TrendDisplayItemVect.push_back(TrendPointPointer);
this is buliding without any errors.
1.) Is this correct?
2.) how can i make m_TrendDisplayItemVect 2 dimensional, ie to push like m_TrendDisplayItemVect[pen].push_back(TrendPointPointer);
amarasat
24-Sep-10 10:00am
View
i meant i dont know, how to get the pointer for the trend point, do i have to use * or get the & value of it, i am confused.
amarasat
24-Sep-10 9:58am
View
No, this is not what i have asked for, we are still moving the points into a different array{the csopcvalue array} right?
I dont wna tot move any items or their values, so i dont wna t a CsOpcValue array may be, i want a regular array which stores the pointer to a value in the
m_TrendItems[pen].GetTrendPoints().GetPrev(pos);
the above code returns a trend point, when this point is valid, i have to move a pointer for this point, to a new array, the new array will not have any values, just pointers only.
and when i redraw, i refer to pointers in stead of filtering the whole
m_TrendItems[pen].GetTrendPoints(); again.
pls let me know if you need some more info. and pls let me know how to do this way, just to store pointers for the trend data points.
Thanks a lo for your time.
amarasat
1-Sep-10 11:54am
View
Deleted
I am creating the static control dynamically, but was not able to change the font. Pls help is there something wrong with the code below:
m_Font.CreateFont(-13, 0, 0, 0, FW_NORMAL, FALSE, FALSE,0,0,0,0,0,0, _T("Tahoma"));
m_Static[k] = new CStatic;
m_Static[k]->Create(m_PenLabel[k], WS_CHILD|WS_VISIBLE|SS_CENTER, rect, this);
m_Static[k]->SetWindowPos(NULL,100*i + 35,29*j,40,20,SWP_SHOWWINDOW);
m_Static[k]->SetFont(&m_Font, TRUE);
amarasat
30-Aug-10 11:35am
View
I created a dialog as suggested by christian, Is there anyways we can edit the LTEXT field of a dialog dynamically
LTEXT "Select From Available Pens",IDC_STATIC,6,5,100,8
amarasat
25-Aug-10 17:35pm
View
Thanks for the answer, i will do that.
A frameless dialog would be perfect, but i have a question, as soon as i jump into my dialog is there anyway that i can still showup menu1 on the trend control. I mean is there any option or style that shows the menu1 until the whole operation completes.
Sorry for such a lame question!!
Show More