My miniproject is based on C. My application written in C accepts a keyboard input as scancodes(for example b=48,n=49...like that)
Can anybody pls let me know,what scancodes are, briefly...
folks, i have a string like
AxxBCyyyDEFzzLMN
I want to replace all x and y and z with _ so that the output is
A_BC_DEF_LMN
How to do that?
I know a series of tr 'x' '' | tr 'y' '' will work, but I want to do taht in one go, without using pipes
thanks in advance
i am using this code::
http://stackoverflow.com/questions/3033324/c-serialport-question/3033402#3033402
to check what port my USB phone is connected to.
supposedly USB would be a virtual com, but this seems to be incorrect
i used the above code to detect where my phone is and the output is just garbage.
is there a way for me to get c# to speak to my usb port so that i can speak to the gsm phone connected to it?
Hi i am developing an app for my QA department. I need to programically get how many phone numbers are there in the entire address book. No user input. Just click a button and then get how many phonenumbers are there in the ENTIRE addressbook.
Please email me at [email protected]
i have a script in jquery (that grabs a value from a select field and transfers it to an input field) that i need to do in mootools...i love jquery... mootools i dont know...
not having much luck...
here is the code:
- Select an Article -Acetaia LeonardiEsperidiaFrescobaldi LaudemioPrimitiviziaPrincipato LucedioRustichella d'Abruzzo
--
Sometimes integration tests are rather complex to write or developers have no enough time to check output - does it make sense to write tests that make sure "no exceptions are thrown" only? Such tests provide some input parameters set(s) and doesn't check the result, but only make sure code not failed with exception?
May be such tests are not very useful but appropriate in situations when you have no time?
When I select an NUnit test in the Unit Test Sessions window and click debug, the window disappears. My breakpoints are hit, but if I hit F5, the Unit Test Sessions window does not return until the test returns a result or I stop the debugging session. This is preventing me from viewing any console output during tests. Any ideas?
How does one go about publishing different subsets (or "views") of a single collection on the server as multiple collections on the client?
Here is some pseudo-code to help illustrate my question:
items collection on the server
Assume that I have an items collection on the server with millions of records. Let's also assume that:
50 records have the enabled property set to true, and;
100 records have the processed property set to true.
All others are set to false.
items:
{
"_id": "uniqueid1",
"title": "item #1",
"enabled": false,
"processed": false
},
{
"_id": "uniqueid2",
"title": "item #2",
"enabled": false,
"processed": true
},
...
{
"_id": "uniqueid458734958",
"title": "item #458734958",
"enabled": true,
"processed": true
}
Server code
Let's publish two "views" of the same server collection. One will send down a cursor with 50 records, and the other will send down a cursor with 100 records. There are over 458 million records in this fictitious server-side database, and the client does not need to know about all of those (in fact, sending them all down would probably take several hours in this example):
var Items = new Meteor.Collection("items");
Meteor.publish("enabled_items", function () {
// Only 50 "Items" have enabled set to true
return Items.find({enabled: true});
});
Meteor.publish("processed_items", function () {
// Only 100 "Items" have processed set to true
return Items.find({processed: true});
});
Client code
In order to support the latency compensation technique, we are forced to declare a single collection Items on the client. It should become apparent where the flaw is: how does one differentiate between Items for enabled_items and Items for processed_items?
var Items = new Meteor.Collection("items");
Meteor.subscribe("enabled_items", function () {
// This will output 50, fine
console.log(Items.find().count());
});
Meteor.subscribe("processed_items", function () {
// This will also output 50, since we have no choice but to use
// the same "Items" collection.
console.log(Items.find().count());
});
My current solution involves monkey-patching _publishCursor to allow the subscription name to be used instead of the collection name. But that won't do any latency compensation. Every write has to round-trip to the server:
// On the client:
var EnabledItems = new Meteor.Collection("enabled_items");
var ProcessedItems = new Meteor.Collection("processed_items");
With the monkey-patch in place, this will work. But go into Offline mode and changes won't appear on the client right away -- we'll need to be connected to the server to see changes.
What's the correct approach?
Hi, i'm trying to get min-width to work on ie7, funny thing is it works correctly on ie6 using this script http://code.google.com/p/ie7-js/ but it doesn't work on ie7 even with the ie8 or ie9 scripts from the same site, any ideas on how to make this property work on a SELECT input?
thanks in advance.
I've been struggling a bit with the jQuery Form plugin. I want to create a file upload form that posts the data (JSON, from the chosen file) into a REST service exposed by a servlet. The URL for the POST is calculated from what the user chooses in a SELECT dropdown. When the upload is complete, I want to notify the user immediately, AJAX-style.
The problem is that the POST header has a Content-Length of 0 and contains no data. I would appreciate any help!
<html>
<head>
<script type="text/javascript" src="js/jquery-1.4.2.min.js">/* ppp */</script>
<script type="text/javascript" src="js/jquery.form.js">/* ppp */</script>
<script type="text/javascript">
function cb_beforesubmit (arr, $form, options) {
// This should override the form's action attribute
options.url = "/rest/services/" + $('#selectedaction')[0].value;
return true;
}
function cb_success (rt, st, xhr, wf) {
$('#response').html(rt + '<br>' + st + '<br>' + xhr);
}
$(document).ready(function () {
var options = {
beforeSubmit: cb_beforesubmit,
success: cb_success,
dataType: 'json',
contentType: 'application/json',
method: 'POST',
};
$('#myform').ajaxForm(options);
$.getJSON('/rest/services', function (data, ts) {
for (var property in data) {
if (typeof property == 'string') {
$('#selectedaction').append('<option>' + property + '</option>');
}
}
});
});
</script>
</head>
<body>
<form id="myform" action="/rest/services/foo1" method="POST" enctype="multipart/form-data">
<!-- The form does not seem to submit at all if I don't set action to a default value? !-->
<select id="selectedaction">
<script type="text/javascript">
</script>
</select>
<input type="file" value="Choose"/>
<input type="submit" value="Submit" />
</form>
<div id="response">
</div>
</body>
</html>
Hi,
with html forms we can upload a file from a client to a server with enctype="multipart/form-data", input type="file" and so on.
Is there a way to have a file already ON the server and transfer it to another server the same way?
Thanks for hints.
I'm creating a game where players can make an alloy. To make it less predictable and more interesting, I thought that the durability and hardness of an alloy should not be calculated by a simple formula, because it will be extremely easy to find extrema, where alloy have best statistics.
So the questions is, is there any formula for a function where extrema can be found only by investigating all points? Input values will be in percents: 0.0%-100.0%. I think it should look like this: half sound wave
Hi,
I have a WPF user control ...which is in MVVM. The user control(which contains a listview) need data from the page (where it is included). I have to set a property to get this data input. Will this comply with MVVM...if not, what is the way for the same?
Hi,
I have here a view with an image and the text view (with finite frame size) .
I've already implemented the textview keyboard notification but the problem is that when inputting in the textview it still behind the keyboard (the text is not visible). It seems this problem occur when I have an Image view as background.
Pls advise me how to fix this.
Here's my sample code:
http://snipplr.com/view/35758/textview-input-is-behind-the-keyboard/
Thanks
I'm building an ASP.Net MVC project in TeamCity.
Can I somehow call the Publish target and get the output copied to a folder under IIS? or do I need to write an msbuild script for this?
I'm trying to figure out how to get the name and parameters of a parent function.
Example:
function foo($a,$b){
bar();
}
function bar(){
// Magic Print
}
foo('hello', 'world');
Output:
foo('hello','world')
Any tips?
I'm trying to figure out how to use sprintf to print at least two decimal places and no leading zeros. For instance
input:
23
23.0
23.5
23.55
23.555
23.0000
output:
23.00
23.00
23.50
23.55
23.555
23.00
any formatting help would be appreciated
I have following data and using SQL Server 2005
UserID UserName LogTime LogDate
1 S 9:00 21/5/2010
1 S 10:00 21/5/2010
1 S 11:00 21/5/2010
1 S 12:00 21/5/2010
1 S 14:00 21/5/2010
1 S 17:00 21/5/2010
Need Output as:-
1 S 9:00 10:00 21/5/2010
1 S 11:00 12:00 21/5/2010
1 S 14:00 17:: 21/5/2010
I had used ROW_NUMBER function in query but its showing error
Hi,
how can i call a function which computes with input parameters from an another static function.
say,
class X
{
static void xyz();
static int pqr(int, int);
};
static X::void xyz()
{
...pqr(10,20);
}
int X::pqr(int t1, int t2)
{
return t1*t2;
}
Im not exactly adept at coding so Im probably missing something, but my view here is failing to refuse submission when one or both of the fields are empty. I have a feeling something isnt connected right to my template for the row and the view of the form
Form = Backbone.View.extend({ //form vie
el: '.item-form',
initialize: function(){
},
events: {
'click #additem': 'addModel'
},
addModel: function(itemName, price){
// simple validation before adding to collection
if (itemName !="" && price !="" ){
var item = new Item({
itemName: this.$("#item").val(),
price: this.$("#price").val()});
items.add(item);
$("#message").html("Please wait; the task is being added.");
item.save(null, {success:
function (item, response,options) {
item.id= item.attributes._id.$id;
item.attributes.id = item.attributes._id.$id;
new ItemsView({collection: items});
$("#message").html("");
}
});
this.$("#item").val('');
this.$("#price").val('');
} else {
alert('Please fill in both fields');
}
}
});
and HTML
<table class="itemTable">
<thead>
<tr>
<th>Item</th>
<th>Price</th>
<th></th>
</tr>
</thead>
<tbody class="tableBody">
<script type="text/template" id="table-row">
<td><%= itemName %></td> <td><%= price %></td> <td><button class="complete">Complete</button> <button class="remove">Remove</button></td>
</script>
</tbody>
</table>
<form class="item-form">
<input type="text" name="item" id="item" placeholder="Item"/> <!-- goes to itemName in the template for the body -->
<input type="text" name="price" id="price" placeholder="Price" /><!--goes to price in the template for the body -->
<button type="button" id="additem">Add</button>
</form>
<div id="message"></div>
I want to add a possibility of restoring mappings overwritten by my plugin. But the problem is that I cannot distinguish between the following mappings:
inoremap <expr> @ test
and
inoremap @ test
First mapping inserts the contents of the variable test, while second inserts text «test». Both mappings give maparg("@", 'i')=="test" and identical output of inoremap i.
My custom callback class implements AsyncCallback
(like MyAsyncCallback implements AsyncCallback) and planning use single instance of MyAsyncCallback for multiple rpc method executions. Is this approach safe?. Or should have to create new instance of MyAsyncCallback for every interaction from browser to server?.
I am kind of tired of seeing so many anonymous AsyncCallback code blocks.
Thanks for your input
How can I validate a form using regex in codeiginiter. I'd like to check the input against:
^([0-1][0-9]|[2][0-3]):([0-5][0-9])$
I'm assuming the best way is in some sort of callback. I tried a bunch of ideas on the web but I can't seem to get any working.