I'm on learning ruby and I took a already done IRC-Bot from the web which just connects to a given serven and not much more.
Then I added some features (in my case I try to implement a voting where to eat lunch).
Now these work fine so far but I don't know if the ruby script does something wrong or there is something wrong with the IRC-server.
On the one I tested the Bot it worked well, giving an output like this:
09:14 < Wayne> !EssNA
09:14 < EssNABot> [-=EssNA-Vote=-]
09:14 < EssNABot> Options are:
09:14 < EssNABot> McDonalds. 0
09:14 < EssNABot> Currywurst 0
09:14 < EssNABot> Hendl..... 0
09:14 < EssNABot> Salatbar.. 0
09:14 < EssNABot> Griechr... 0
09:14 < EssNABot> Metzger... 0
09:14 < EssNABot> Merowinger 0
09:14 < EssNABot> Lidl...... 0
09:14 < EssNABot> Voting time is 600 seconds.
The bot itself sees that like this:
--> PRIVMSG #test [-=EssNA-Vote=-]
--> PRIVMSG #test Options are:
--> PRIVMSG #test McDonalds. 0
--> PRIVMSG #test Currywurst 0
--> PRIVMSG #test Hendl..... 0
--> PRIVMSG #test Salatbar.. 0
--> PRIVMSG #test Griechr... 0
--> PRIVMSG #test Metzger... 0
--> PRIVMSG #test Merowinger 0
--> PRIVMSG #test Lidl...... 0
--> PRIVMSG #test Voting time is 600 seconds.
But on the irc which it should run on if its done the output users will see looks like this:
09:14 < Wayne> !EssNA
09:14 < EssNABot> [-=EssNA-Vote=-]
09:14 < EssNABot> are:
09:14 < EssNABot> 0
09:14 < EssNABot> 0
09:14 < EssNABot> 0
09:14 < EssNABot> 0
09:14 < EssNABot> 0
09:14 < EssNABot> 0
09:14 < EssNABot> 0
09:14 < EssNABot> 0
09:14 < EssNABot> seconds.
The output the bot gives is the same as on the server on which the output for users works.
Seems to me that the problem is the IRC-server, maybe someone can point me in the right direction?
Yours,
Marius
Hi !
I have an UITextField and I just would like that every tap on a character, the first character is deleted. So just have one character in my textField every time.
Moreover I would to to display every tap in the console log.
Have you got an idea?
Thanks!
I have 3 text boxes for a phone number. As the user types, it automatically moves from one textbox to the next. When the user presses backspace, I can move focus to the previous text box. The problem is that in IE, focus is set to the beginning of the text box. Here's my code, which works fine in chrome.
$('#AreaCode').live('keyup', function (event) {
if ($(this).val().length == $(this).attr("maxlength"))
$('#Prefix').focus();
});
$('#Prefix').live('keyup', function (event) {
if (event.keyCode == 8 && $(this).val().length == 0)
$('#AreaCode').focus();
if ($(this).val().length == $(this).attr("maxlength"))
$('#Number').focus();
});
$('#Number').live('keyup', function (event) {
if (event.keyCode == 8 && $(this).val().length == 0)
$('#Prefix').focus();
});
How do I make the focus set at the end of the contents when going backwards?
I'm trying to create a weekly calendar that looks like this: http://dhtmlx.com/docs/products/dhtmlxScheduler/sample_basic.html
How can I calculate every week date? For example, this week is:
Monday - Sunday
7 June, 8 June, 9 June, 10 June, 11 June, 12 June, 13 June
Hi,
For Sqilte3 C API, I would use sqlite3_last_insert_rowid. How to get this id when using ActiveRecord after insert a new record? I use following way to insert a new record :
Section.new |s|
s.a = 1
s.b = 2
#I expected the return value of save to be the last_insert_id, but it is NOT
s.save
end
I have processed a SSAS cube. After it was done processing, I hit the close button - and then realized that I should have saved the output.
I think SSAS stores the processing log as a text or XML file, but I do not know what folder to look into.
Can someone direct me to retrieving processing logs?
I need to create a php search function for names and need to change LastName, FirstName into LastName..FirstName to search the database. I don't know if this helps, but the string will originally be in the form a variable ($Client).
I need the syntax for the three statements that find the string, matches, and makes the changes.
I need some advice
I have two tables, one holds unique serial numbers of items (items) and the other holds status changes and other information for these items (details)
The Tables are set up as follows
Item
itemID
itemName
itemDate
details
detID
itemID
modlvl
status
detDate
All items have at least one record in the details table, but over time the status has changed or the modification level has changed (Both of these are identified by numbers which are held in other appropriate tables) and a new record is created each time the status/modlvl changes
I want to display a table on my webpage using php that identifies the different mod levels of the items and shows a count of each of the current status of the items
EDIT
Hi Ronnis,
This is an example of the data in the tables and what I want to achieve
The current Mod Levels range from 1 to 3
Status representations are
1 In Use
2 In Store
3 Being repaired
4 In Transit
5 For Disposal
6 Disposed
7 Lost
Item
itemID OrigMod created
1000 1 2009-10-01 22:12:12
1001 1 2009-10-01 22:12:12
1002 1 2009-10-01 22:12:12
1003 1 2009-10-01 22:12:12
1004 1 2009-10-01 22:12:12
1005 1 2009-10-01 22:12:12
1006 1 2009-10-01 22:12:12
1007 1 2009-10-01 22:12:12
1008 1 2009-10-01 22:12:12
1009 1 2009-10-01 22:12:12
1010 1 2009-10-01 22:12:12
Details
detID itemID modlvl detDate status
1 1000 1 2009-10-01 1
2 1001 1 2009-10-01 1
3 1002 1 2009-10-01 1
4 1003 1 2009-10-01 1
5 1004 1 2009-10-01 1
6 1005 1 2009-10-01 1
7 1006 1 2009-10-01 1
8 1007 1 2009-10-01 1
9 1008 1 2009-10-01 1
10 1009 1 2009-10-01 1
11 1010 1 2009-10-01 1
12 1001 1 2010-02-01 2
13 1001 1 2010-02-03 4
14 1001 1 2010-03-01 3
15 1000 1 2010-03-14 2
16 1001 2 2010-04-01 4
17 1006 1 2010-04-01 2
18 1001 2 2010-04-03 2
19 1006 1 2010-04-14 4
20 1006 1 2010-05-01 5
21 1002 1 2010-05-02 2
22 1003 1 2010-05-10 2
23 1010 1 2010-06-01 2
24 1006 1 2010-06-18 6
25 1010 1 2010-07-01 7
26 1007 1 2010-07-02 2
27 1007 1 2010-07-04 4
28 1003 1 2010-07-10 2
29 1007 1 2010-07-11 3
30 1007 2 2010-07-12 4
31 1007 2 2010-07-15 2
32 1001 2 2010-08-31 1
33 1001 2 2010-09-10 2
34 1001 2 2010-10-01 4
35 1008 1 2010-10-01 2
36 1001 2 2010-10-05 3
37 1008 1 2010-10-05 4
38 1008 1 2010-10-10 3
39 1001 3 2010-10-20 4
40 1001 3 2010-10-25 2
Using the tables above I want to get this result
MoLvl Use Store Repd Transit Displ Dispd Lost Total
1 3 3 1 0 0 1 1 9
2 0 1 0 0 0 0 0 1
3 0 1 0 0 0 0 0 1
Total 3 5 1 0 0 1 1 11
The webViewDidFinishLoad message seems to be sent each time any object in the page has been loaded. Is there a way to determine that all loading of content is done?
Please answear me how can i access the ListView in controlTemplate, or what event handler to use for extracting sender parameter that will be called every time my Collection is updated. Please give a solution! I make brainstorming for a week already!!
The documentation on Text Properties says:
Since text properties are considered part of the contents of the buffer (or string), and can affect how a buffer looks on the screen, any change in buffer text properties marks the buffer as modified.
First, I don't understand that policy. Can anyone explain? The text props are not actually saved in the file, when the buffer is saved. So why mark the buffer as modified? For me, buffer-modified indicates "some changes have not yet been saved." but understanding the policy is just for my own amusement.
More importantly, is there an already-established way that, in code, I can change syntax text properties on the text in a buffer, while keeping the buffer-modified flag set to whatever it was, prior to those changes? I'm thinking of something like save-excursion.
It would be pretty easy to write, but this seems like a common case and I'd like to use the standard function, if possible.
For more on the scenario - I have a mode that does a full text scan and sets syntax-tabe properties on the text. After opening a buffer, the scan runs, but it results in a buffer with buffer-modified set to t .
As always, thanks.
I have a whole bunch of percentages stored as XX% (e.g. 12%, 50%, etc..) I need to remove the percentage sign and then multiply the percent against another variable thats just a number (e.g. 1000, 12000) and then output the result. Is there a simple way to strip the percentage sign and then calculate the output with PHP? Or should I consider some sort of JS solution?
Hello,
This is the final output
My HTML
<li id='$id'>TEXT
<ul class='indent'>
<li id='$id'>TEXT</li>
<li id='$id'>TEXT</li>
<li class='formContainer'> FORM </li>
</ul>
</li>
I want to append a li between form after all other li So in this example new li will be appended between Test141 APPEND Input Box
The $id are db ids of li which are unique
Say you have an array, data, of unknown length. Is there a shorter method to get elements form a starting index to the end than
subdata = data(2:length(data))
Please consider the below simple code:
thrust::device_vector<int> positions(6);
thrust::sequence(positions.begin(), positions.end());
thrust::pair<thrust::device_vector<int>::iterator, thrust::device_vector<int>::iterator > end;
//copyListOfNgramCounteachdoc contains: 0,1,1,1,1,3
end.first = copyListOfNgramCounteachdoc.begin();
end.second = positions.begin();
for(int i =0 ; i < numDocs; i++){
end= thrust::unique_by_key(end.first, end.first + 3,end.second);
}
int length = end.first - copyListOfNgramCounteachdoc.begin() ;
cout<<"the value of end -s is: "<<length;
for(int i =0 ; i< length ; i++){
cout<<copyListOfNgramCounteachdoc[i];
}
I expected the output to be 0,1,1,3 of this code; however, the output is 0,1,1. Can anyone let me know what I am missing? Note: the contents of copyListOfNgramCounteachdoc is 0,1,1,1,1,3 . Also the type of copyListOfNgramCounteachdoc is thrust::device_vector<int>.
I am initialising a StringBuilder as follows:
StringBuilder builder = new StringBuilder("Symptoms are ");
After this I loop through a list and add each string item to the end using
foreach(var item in list)
{
builder.Append(item);
}
An example item would be something like "headache" but once i've appended it to "Symptoms are " and called builder.ToString() it shows:
"Symptoms areHeadache...etc"
as opposed to
"Symptoms are Headache...etc"
Why is it ignoring the space?
I would like to use the EmailField in a form. However, instead of only storing
[email protected]
I want to store
"ACME Support" <[email protected]>
The reason is, that when I send email, I would like a "friendly name" to appear.
Can this be done?
Hi,
This is the output of my 'git log'. But when I do a 'git pull' , the top commit causes conflict. So I did a 'git rebase -abort'
commit 7826b25db424b95bae9105027edb7dcbf94d6e65
commit 5d1970105e8fd2c7b30c232661b93f1bcd00bc96
But my question is Can I 'save' my commit to a patch and then do a git pull?
Just like I want to emulate
* I did not do a git commit, but I did a 'git stash' instead
* Do a git pull so that I should not get any merge error
So I need to somehow 'turn back the clock'. Is that possible in git?
Hi, i've got stuck with substring.
On input i've got a string that looks like Sometext (123456). Those digits at the end are random. I need to get only text from that string.
My ideal workflow would consist of the following steps
edit the code
compile
git commit -a -m "commit message"
start running the new binaries, tests, etc. (may take 10+ minutes)
start new changes, while the binaries are still running
when step # 4 is finished, edit the commit message from step # 3, without committing the changes introduced in step # 5, by adding, say, "test FOO failed"
I cannot use git commit -a --amend -m "new commit message", because this commits the new changes as well. I'm not sure that I want to bother with staging or branching. I wish I could just edit the commit message without committing any new changes. Is it possible?
I'm trying to download a lot of files after downloading a sql statement must insert a record.
I'm using System.Net.Client to download each file synchronously, still it could be done asynchronous. There's no relation or dependency between each download.
At first I just tried to use WebClient.DownloadFileAsync but that shutted the program down and killed all the download processes/threads. Second I tried to create a wait routine something like this;
while (processedFiles < totalFiles)
Thread.Sleep(1000)
This freezed everything. So could someone tell me which aproach to take to implement this Async?