Thursday, 3 October 2013

'xmlrpclib.Fault: Request contains to few param' error when using ldtp

'xmlrpclib.Fault: Request contains to few param' error when using ldtp

I've been trying to use the Windows implementation of LDTP (Cobra) for
testing a stand-alone application within Python. It seems to work fine at
first, albeit running slow most of the time. For example I was able to
select menu items:
selectmenuitem('Sample App','File;New')
However, when I tried to execute any of the following lines:
waittillguiexist('Sample App', 'btnOK')
rightclick('Sample App','tblcBRANCH')
I get the following error in Python:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build\bdist.win-amd64\egg\ldtp\client.py", line 69, in __call__
File "C:\Python27\lib\xmlrpclib.py", line 1578, in __request
verbose=self.__verbose
File "build\bdist.win-amd64\egg\ldtp\client.py", line 186, in request
xmlrpclib.Fault: <Fault 0: 'Request contains too few param elements based on
method signature.'>
I assume that I may still encounter this error with other functions. Are
there any problems with my installation of LDTP? Any help is very much
appreciated.

Wednesday, 2 October 2013

SVN TO GIT Convert

SVN TO GIT Convert

Just want to how can I convert the below SVN Command into GIT
ssh user@server svn info svn+ssh://svn/TPTDev/MyProject/trunk

Xcode 5 iOS7 Storyboard Examples

Xcode 5 iOS7 Storyboard Examples

I am fairly new to Xcode/iOS.Objective C. Writing a new iPad app and I
want to use Storyboards. For the life of me I cannot find any tutorials or
examples of Storyboards in Xcode 5/iOS7. It seems Storyboards have changed
quite a bit.
Any pointers to where to begin?

How to show money format in C#

How to show money format in C#

Hi I am having a problem in displaying the amount using this kind of
format: 0,000.00 . I am using a grid view and data reader to show the
amount from mySQL Database with Decimal as my datatype, my output only
shows 0000.00
Can you help me how to resolve this problem? Thank You.
private void DisplayOrderDetails(int nOrderNo)
{
OpenConnection();
SqlCommand cmdSelect = new SqlCommand();
cmdSelect.Connection = cn;
cmdSelect.CommandType = CommandType.Text;
cmdSelect.Transaction = trnOrder;
cmdSelect.CommandText =
"SELECT OrderDetailNo, OrderNo, PackagingOutside,
Quantity, Unit, ProductNo, ProductName, " +
"ProductSize, PackagingInside, " +
"SellingDiscount1, SellingDiscount2, SellingDiscount3,
SellingDiscount4, " +
"SellingPrice, Amount FROM OrderDetails WHERE OrderNo = '"
+ nOrderNo + "'";
SqlDataAdapter daDetail = new SqlDataAdapter();
daDetail.SelectCommand = cmdSelect;
DataSet ds = new DataSet();
daDetail.Fill(ds, "OrderDetails");
grdDetails.DataSource = null;
grdDetails.DataSource = ds.Tables["OrderDetails"];
DisplayTotal();
}
private void DisplayTotal()
{
double dTotal = 0;
//for encountering errors in the future
try
{
for (int nRow = 0;
nRow <= dsDetail.Tables["OrderDetails"].Rows.Count - 1;
nRow++)
{
dTotal = dTotal +
Convert.ToDouble(dsDetail.Tables["OrderDetails"].Rows[nRow]["Amount"].ToString());
}
}
catch //(Exception ex)
{
//MessageBox.Show(ex.Message);
}
lblTotal.Text = String.Format("{0:#,###,##0.00}", dTotal);
}

How can I launch an activity from a location on the screen, like on the home screen or in recent apps?

How can I launch an activity from a location on the screen, like on the
home screen or in recent apps?

I want to create a "maximizing" effect from a dialog into my full
activity, so I want the opening animation to show the activity expanding
from a box to full size.
The stock launcher has done this this since Jelly Bean (pressing an app
shortcut will zoom into the application from that icon's location and the
Recent Apps menu has done this since ICS.

Tuesday, 1 October 2013

Extern variable has different values in different C files

Extern variable has different values in different C files

I'm trying to use a shared variable in multi C files. So, I write a
program to use its value:
In the path: sonnh\epan\dissectors\socket_sonnh.h , I defined a extern
variable: extern int ServerSocket;
In the path: sonnh\tshark.c , after #include
<epan/dissectors/socket_sonnh.h> I create the init value ServerSocket =
socket(AF_INET,SOCK_STREAM,IPPROTO_IP);
In the path: sonnh\epan\dissectors\packet-camel.c, after #include
"socket_sonnh.h" I want to use the value of ServerSocket by command i =
send(ServerSocket, cSendBuff, 20, 0);
The flow of code is: after creation of ServerSocket in tshark.c --> (call
func in other file) --> (somewhere I don't know) --> call func in
packet-camel.c to send socket. I know this because i check the log.
But actually, I check the value of ServerSocket at the top and bottom of
tshark.c, it is always 336, but the value of this in packet-camel.c is
always 0. i think it is extern variable , so it keeps its value while
running in different files but in this case, i cannot see the value of
ServerSocket being the same with the value of 336 as seen in tshark.c.
Could you please help me to find out why and how can I solve this problem
to have the value of ServerSocket in packket-camel.c (using shared
variable). Thank you so much.

For a 2nd order linear ODE,find the interval where some non-trivial solutions remain bounded and some become unbounded

For a 2nd order linear ODE,find the interval where some non-trivial
solutions remain bounded and some become unbounded

$$y^{''}+(2\alpha-3)y^{'}+\alpha(\alpha-3)y = 0$$
Determine all values of $\alpha$, if any, for which some non-trivial
solutions remain bounded and some become unbounded as $t \rightarrow
\infty$.
The general solution I got is
$$y(t) = C_1e^{(3-\alpha)t}+C_2e^{-at}$$
And I think the interval is $(-\infty,3]$, but this is not the correct
answer. Can anyone help me?

How to enable log messages during boot process

How to enable log messages during boot process

I'm using Linaro Raring Ubuntu for Cubieboard A20.
How can I enable the log messages in boot process?
I've already read this post:
How to enable boot messages to be printed on screen during boot up?
But I don't have grub, it's a SDCARD boot with a DOS partition and .scr,
.bin files and uDev.txt file.

How to solve this question(set cardinality)?

How to solve this question(set cardinality)?


about the cardinality and power set, how to find the bijection?

Monday, 30 September 2013

Is there a continuous bijection between an interval and a square: $[0=?iso-8859-1?Q?=2C1]_\mapsto_[0=2C1]_\times_[0=2C1]$=3F_=96_math.stackexc?=hange.com

Is there a continuous bijection between an interval and a square: $[0,1]
\mapsto [0,1] \times [0,1]$? – math.stackexchange.com

Is there a continuous bijection from $[0,1]$ onto $[0,1] \times [0,1]$?
That is with $I=[0,1]$ and $S=[0,1] \times [0,1]$, is there a continuous
bijection $$ f: I \to S? $$ I know there is a ...

Transferring data from one table to another, some relational columns

Transferring data from one table to another, some relational columns

Table 1 - this table is completely populated from an XLSX file...

Tables 2 and 3 - contain 1-1 references for a couple of the columns in the
final table.

Table 3 - the on I am trying to get populated with first three tables....

As you can see, the tables are sensible, there is no einsteinic equations
or conversions going on. Here is the code that I have already tried,
unsuccessfully:
INSERT INTO att_oem_orders SELECT NULL, ost.om_or_po, (SELECT j.job_id
FROM jobs j WHERE j.project_number = project_no), NULL, (SELECT ao.id FROM
att_oem WHERE ao.item_no = item_no), ost.po_number, (SELECT ol.id FROM
order_lsc WHERE STATUS = ol.line_status_code), ost.ordered_date,
ost.shipment_date, NULL, NULL, ost.item_qty, NULL, NULL, NULL, NULL,
ost.shipping_to, ost.tracking_number, ost.carrier) FROM oem_temp_sync
WHERE ost.item_qty > 0

How to reload view asynchronously when carrierwave_backgrounder processing completes?

How to reload view asynchronously when carrierwave_backgrounder processing
completes?

I am using the carrierwave_backgrounder gem in a Rails 3.2 app to handle
background processing of image files and transfer to S3 via queue_classic.
The gem sets a file_processing boolean to null when processing is
complete, enabling the following:
#partial
<% if file.file_processing.nil? %>
<%= image_tag file %>
<% else %>
<p>processing</p>
<% end %>
I am using jquery to handle multiple file uploads (jquery-fileupload).
When a file upload completes, it triggers an ajax response via create.js
to render the partial.
This is fine, but means I end up with a long list of 'processing'.
Is there a callback I can take advantage of to reload the partial when
background processing is complete?

How To Use MySql in Html Button with php

How To Use MySql in Html Button with php

PHP
$con=mysqli_connect("localhost","root","","mmogezgini");
$menuler = mysqli_query($con,"SELECT * FROM menuler");
while($menu = mysqli_fetch_array($menuler))
{
echo "<button class=\"ust_link\"
onClick=\"window.location.href='Menu_Url.php'\">Menu_Name</button>";
}
mysqli_close($con);
Mysql codes are ready and mysql connection is successful just i dont know
how to place menu['name'] and menu['url'] instead of Menu_Name and
Menu_Url

Sunday, 29 September 2013

Resharper ToString Format Completion

Resharper ToString Format Completion

In the Reshaper 8.1 the new ToString() Format Completion is great, but for
DateTime all the options seem to be in America culture, eg month/ day
/year, being in Australia this is not very useful is there any way you can
chnage the default completion options so that day/month/year and
day-month-year could be added or replace the current list of formats,
If not how can I turn off only the datetime toString code completion ?

Error in copying of an class object in another window of application

Error in copying of an class object in another window of application

I am stuck. Even don't know what it might be. I trying to use properties
of an object in Main Window on its copy in child window, but this action
gives me an error. Link to download My project
Fragment of code where an error appears: public double this[int index_row,
int index_column] { get { return
double.Parse(data.Rows[index_row][index_column] + ""); } set {
data.Rows[index_row].SetField<double>(index_column, value); } }

how do I set the right side container to scroll in it's own place

how do I set the right side container to scroll in it's own place

So here's the link to my site. I wanted the right container to scroll in
place. How can I do this? I tried adding position: fixed to the right
column but then that destroys the layout. Right now the overflow always
scrolls all the way to the top.. Basically I wanted insta-shop-grid to
scroll inside that container itself.

Autocomplete, problems with source link (MVC, Knockout)

Autocomplete, problems with source link (MVC, Knockout)

I have working autocomplete. My Search Method is situated in
HomeController, but I want to do some changes. I created api controller
named "Vacancy" and transfered Search method there but I can't make it
work: Status Code:404 Not Found (Search method doesn't even start). After
transfering all changes I've made is:
Changed source link in View:
autocomplete="@Url.Action("Search", "Vacancy")"
Changed Search Method:
public object Search(string term)
{
var vacancyHeaders =
new UnitOfWork().Repository<Vacancy>()
.Get()
.Where(v =>
v.Header.ToLower().Contains(term.ToLower()))
.Select(v => new { label = v.Header })
.Distinct()
.Take(10);
return vacancyHeaders;
}
Please, help, why my Search method doesn't start? Below is my working code
without api controller:
View:
<form data-bind="submit: search">
<input data-bind="value: SearchArgument, valueUpdate: 'blur'"
data-autocomplete="@Url.Action("Search", "Home")"
class="form-text" name="search" size="32" maxlength="64"
placeholder="Search"/>
<input type="submit" value="search" />
</form>
Script
$(":input[data-autocomplete]").each(function() {
$(this).autocomplete({ source:
$(this).attr("data-autocomplete")});
});
Search Method
public ActionResult Search(string term)
{
var vacancyHeaders =
new UnitOfWork().Repository<Vacancy>()
.Get()
.Where(v =>
v.Header.ToLower().Contains(term.ToLower()))
.Select(v => new { label = v.Header })
.Distinct()
.Take(10);
return Json(vacancyHeaders, JsonRequestBehavior.AllowGet);
}

Saturday, 28 September 2013

How to add jquery to jasmine/angularjs unittests

How to add jquery to jasmine/angularjs unittests

I have a project which is builded on plain angular.js code. We creates
unittest with jasmine. But now we need to grab some 3rd party components
(some directives from Angular-Bootstrap), which is also pure angular.js
inside, but for testing that components some jQuery code and methods calls
used. And now a lot of 3rd party tests failed with exception like [object]
had no method 'trigger' and stuff like that
So my question is how to include jquery to my tests, to make 3rd party
unitests valid. I run tests with Karma.

Understanding php class structure from a javascript OOP background (how to adapt code workflow)

Understanding php class structure from a javascript OOP background (how to
adapt code workflow)

I have been attempting to write a simple RESTful api in php. Part of my
goal in doing this is to get a good grasp on how to approach php OOP
projects. In javascript, I have no issue with encapsulation, inheritance,
etc. I generally start out with a single object (maybe even just as a
namespace) that I will nest everything in, i.e.var appName = {}. A simpler
object may just be a group of methods...then are a few typical needs like
an init function to set things up and/or execute/run function in which I
can detail a flow. I like to use a few general functions there that
summarize everything that will happen, then detail them, then detail
those, etc, so it is always easy to see how the result is produced, and
you can investigate the details further as needed. I also keep everything
independent so that each function doesn't have to worry about how it gets
its dependencies, etc. So, I hope that gives you an idea of where I'm
coming from.. I am utterly lost in the world of oop php.
I went ahead and wrote a simple api in js just to demonstrate what I'm
trying to do. It could be better, but this is just a quick example.
http://jsbin.com/AmIfApO/3/edit I'll include that code at the end of my
post. I have attempted for weeks to achieve this functionality in php, and
have failed, failed, failed. I can make it work, but it's just awful code
and I am determined to write it using best practices. For the sake of not
appearing lazy, here's the latest php rewrite I tried....ended in disaster
like always http://pastebin.com/cKw9YeVz.
With js, I eventually saw the right example/ got the right advice and the
idea became pretty clear. I think that seeing even just the basic design
flow of how this would be done in php would probably help me tie in
everything I've learned. Something just hasn't clicked. If you can give me
an example of what classes I should have here or how to divide things up,
I would be so appreciative.
var request1 = {
collection: 'articles',
item: null,
verb: 'GET',
format: 'json'
};
var request2 = {
collection: 'articles',
item: null,
verb: 'DELETE',
format: 'json'
};
var api = {
request : (function() {
//parse url into collection, item, format, verb
return request1; //change to request2 for error test
}()),
output : {
data: {},
errors: []
},
respond : function() {
var handler = this.handler(this.request);
this.output.data = this.format(handler());
console.log(this.output);
},
error : function(msg) {
this.output.errors.push(msg);
},
handler : function(request) {
var handler;
if (request.collection) {
if (request.item) {
handler = this.handlers[request.collection].item;
}
else {
handler = this.handlers[request.collection].collection;
}
}
else {
handler = this.handlers.def;
}
return handler[request.verb];
},
format : function(output) {
return output;
},
handlers : {
def: {
collection : {
GET : function() {
return 'generic test data!';
},
POST : function() {
},
PUT : function() {
},
DELETE : function() {
api.error("Collection can't be deleted");
}
},
item : {
GET : function() {
},
POST : function() {
},
PUT : function() {
},
DELETE : function() {
}
}
}
}
};
api.handlers.articles = Object.create(api.handlers.def);
api.handlers.articles.collection.GET = function() {
return 'specific test data!';
};
api.respond();

Different increment on a for loop depending on a boolean

Different increment on a for loop depending on a boolean

How can i select the increment on a for loop depending on a boolean,i am
trying to do something like this:
for (int y = iniY; isdown? (y >= endY): (y <= iniY+dy) ; isdown?
--y:y++);
the for loop accepts the termination but not the increment...
The working code i currently have is something like this:
if(isdown)
for (int y = iniY; y >= endY; --y) {
code lines...
}
else
for (int y = iniY; y <= iniY+dy; ++y) {
code lines...
}
the code can not be extracted to a new method because it works on many
variables...