Is there anyway to detect when a user logins if there is already another session with the same username, and block him from logging in again or send him a message?
I have quite a headache about this seemingly easy task: send a break signal to my device, like the wxTerm (or any similar Terminal application) does.
This signal has to be 125ms long, according to my tests and the devices specification.
It should result in a specific response, but what I get is a longer response than expected, and the transmitted date is false.
e.g.:
what it should respond 08 00 81 00 00 01 07 00
what it does respond 08 01 0A 0C 10 40 40 07 00 7F
What really boggles me is, that after I have used wxTerm to look at my available com-ports (without connecting or sending anything), my code starts to work! I can send then as many breaks as I like, I get my response right from then on. I have to reset my PC in order to try it again.
What the heck is going on here?!
Here is my code for a reset through a break-signal:
minicom_client(boost::asio::io_service& io_service, unsigned int baud, const string& device)
: active_(true),
io_service_(io_service),
serialPort(io_service, device)
{
if (!serialPort.is_open())
{
cerr << "Failed to open serial port\n";
return;
}
boost::asio::serial_port_base::flow_control FLOW( boost::asio::serial_port_base::flow_control::hardware );
boost::asio::serial_port_base::baud_rate baud_option(baud);
serialPort.set_option(FLOW);
serialPort.set_option(baud_option);
read_start();
std::cout << SetCommBreak(serialPort.native_handle()) << std::endl;
std::cout << GetLastError() << std::endl;
boost::posix_time::ptime mst1 = boost::posix_time::microsec_clock::local_time();
boost::this_thread::sleep(boost::posix_time::millisec(125));
boost::posix_time::ptime mst2 = boost::posix_time::microsec_clock::local_time();
std::cout << ClearCommBreak(serialPort.native_handle()) << std::endl;
std::cout << GetLastError() << std::endl;
boost::posix_time::time_duration msdiff = mst2 - mst1;
std::cout << msdiff.total_milliseconds() << std::endl;
}
Edit:
It was only necessary to look at the combo-box selection of com-ports of wxTerm - no active connection was needed to be established in order to make my code work.
I am guessing, that there is some sort of initialisation missing, which is done, when wxTerm is creating the list for the serial-port combo-box.
I'm a blind student currently in a system admin/shell programming class. Although ssh works fine for executing commands like ls, pwd, etc editors do not work well with my screen reader and an ssh session. I was wondering if it is possible to mount a Linux folder over ssh so it appears as a windows drive? This way I could edit any files I needed to with accessible software and not have to constantly use SCP to send files back and fourth.
hey all
i am trying to aggregate form elements into object and then send it via ajax here is the code that i start using but i cant figure out how to do the rest
$('.jcart').live('submit', function() {
});
Hi Guys
I have an idea, can u tel me what the procedure to do this?
In my incoming calls r outgng cal it should display the phone number as wel as with network name For eg: 9876543210,Airtel like that
How to do that i am new to android. So anybody help me. whats the way to develop it?
Send me reply soon its very urgent
I've got a template for a partial that I'd like to use and I'm wondering if it's possible to just render the thing without needing to send a mock request to a controller. I'm never going to need to render this to an AJAX call, so it seems silly to set up a controller and action, not to mention the security issues with making a private partial open to the world.
Hi all ,
I have to send a mail from the struts2 application using the Spring Framework email library how can i do that
any help can be appreciated ..
Thanks
How can I just check if a document exists, mabye get the revision, but not make couchdb send the body of the document?
I remember I saw this explained somewhere but I cannot find it.
Hello,
I am looking for some recommendations about compressing data in .NET, aside from using the GZipStream class.
I am looking for fast and high compression of byte arrays to be able to send them via tcp.
Thank you.
I want to give Microsoft certificate exam - 70-315.
Can you give me website for free download dumps or e books for 70-315.
Or can you send me mail dumps or e books for it.
Email id is [email protected]
I really appreciate your help.
Hello,
I used use Google’s slick interface to get my mail and It’s always going to be here:
https://mail.google.com/a/yourdomainhere.com
I want to write python script that send mail so i failed to configure server settings
smtp = smtplib.SMTP('what is mail server will be?', what is the port)
smtp.login('[email protected]', 'pass')
Please could any one help me ??
Thanks
I am trying to create a Exception class to get and send errors from client to server. I want to catch exception in javascript function and push the details to the web service to write to database.
But i couldn't get how to get which function/line throwed this exception. Is there any way to solve this?
I'm creating a search form using an asp:button control with the urlpostback set to a results page. The problem is, the asp:button uses Visual Basic and the search results from Google require Javascript.
Is there a way to take the data from an asp: textbox in VB and then send it to another page that uses Javascript and use the data?
I want to be able to send a message using the new messages framework. Something along the lines of :
...
if formset.is_valid
return HttpResponseRedirect( some page )
messages.add_message(request,messages.INFO, '%i objects added') %formset.number_of_forms
But two questions:
Im not sure if i should put the messages before or after the render to response
Is there a method akin to number_of_forms
I'm working to create an HTML email which includes 2 images. Currently, I'm using tags to place the image in the email. Problem is when users get the email, it's asking the user to "click to download" for security reasons.
Is there a way to embed the image in the email, to avoid this issue?
I'm using Coldfusion to send the email.
Thanks
IN my application i use MFMailComposeViewController class to send mail and i know in the case of sending mail through ipod is sucessfully when one account is already open in that but in my application I want to a message which alert the application to open ur account.......
I'm trying to add facebook connect button to my ZF web site. After i click on FB connect button the popup with email and password fields opens. But when i send email and password to login with facebook the popub don't close and reload the same page where the facebook connect button was.
Any idea?
Sorry for my english ..
I am trying to retrieve source code from a webpage with an already issued cookie and write the source code to a txt file. If I remove the cookies=cookie portion I can retrieve the source code but I need to somehow send the cookie with the http.request.
output = open('Filler.txt', 'w+')
http = urllib3.PoolManager()
cookie =('users' , '1597413515')
r = http.request('http://google.com' , 'GET' , cookies=cookie)
output.write(r.data)
output.close()
I get a KeyError: None
I have to encrypt XML file and send in network to place in a private server.
My other application will decrypt and import to SQL the file by giving the actual Public key.
Could you please suggest me best way for this.
File: XML Type
Possible size: Up to 250 MB
Technology: C#.NET 2008
I am very worried about the SQL Server 2012 Express instance on which my database is running: the SQL Server process memory usage is growing steadily (1.5GB after only 2 days working).
The database is made of seven tables, each having a bigint primary key (Identity) and at least one non-unique index with some included columns to serve the majority of incoming queries.
An external application is calling via Microsoft OLE DB some stored procedures, each of which do some calculations using intermediate temporary tables and/or table variables and finally do an upsert (UPDATE....IF @@ROWCOUNT=0 INSERT.....) - I never DROP those temporary tables explicitly: the frequency of those calls is about 100 calls every 5 seconds (I saw that the DLL used by the external application open a connection to SQL Server, do the call and then close the connection for each and every call).
The database files are organized in only one filgegroup, recovery type is set to simple.
Some questions to diagnose the problem:
is that steadily growing memory normal?
did I do any mistake in database design which probably lead to this behaviour? (no explicit temp-table drop, filegroup organization, etc)
can SQL Server manage such a stored procedure call rate (100 calls every 5 seconds, i.e. 100 upsert every 5 seconds, beyond intermediate calculations)?
do the continuous "open connection/do sp call/close connection" pattern disturb SQL Server?
is it possible to diagnose what is causing such a memory usage? Perhaps queues of wating requests? (I ran sp_who2, but I didn't see a big amount of orphan connections from the external application)
if I restrict the amount of memory which SQL Server is allowed to use, may I sooner or later get into trouble?
Hello! I'm using jQuery Form (http://jquery.malsup.com/form/) to get send data to a form - is there a way I can then, without refresh, put the results page that's generated by the form into a div on the page?
Any advice appreciated!
Is there any reason to not include pdb files in an installer? I have C++ logging functionality that walks the stack, and reports line numbers and file names. It would be great if my customers could send me logs with this information. However, they would need the pdb files. Is there any downside (other than installer package size) to deploying them?
Can JDBC component be used for inserting Java objects into a Mysql database ? I want to store Java objects that i am routing through message exchanges into a database using spring xml .
i have never used hibernate before , so cannot use the hibernate or JPA components
Ex Code :
<from uri="bean:MessageProducer?method=send" /> /* bean sending the objects */
/* what code do i need to write for insertion of these Objects into testdb */
<to uri="jdbc:testdb"/>
I'm hosting my own svn repository on ubuntu 8.04. Is there a way for svn to send emails to team members whenever a commit has happened?
If coding is required, the only language I'm able to use on a linux server is PHP. So I could write a php script to be triggered by svn.
Can anyone tell me how to hook up my php script to an svn commit? Or is there another way to do this?
I have a looping function creating:
<li id="id1" name="Tag1,Tag2,Tag3">
<li id="id2" name="Tag1,Tag2,Tag3">
$.each(data.posts, function(i, post){
$('<li >', {id: this.id , name: post.tags})
});
How do I replace the commas between the tags with spaces.
Also is there a way I can send the tags to a "class" attribute instead of "name". It seems to not work in Safari.