I don't understand why this doesn't work:
[abc = ([def intValue] - 71) * 6];
'*' should be the viable way of doing multiplication and 'abc' is defined as an NSInteger. ('def' is an NSString)
Is there any way to run the gcc preprocessor, but only for user-defined macros? I have a few one-liners and some #ifdef etc... conditionals, and I want to see what my code looks like when just those are expanded. As it is, the includes get expanded, my fprintf(stderr)s turn into fprintf(((__getreeent())-_stderr), etc...
I have been put on to a project using Nuxeo, late in it's lifecycle and need to change a few things before it goes live.
I am having trouble finding out where I need to look to lock down a Nuxeo based application so that a user is redirected to the login page if they are unauthorised and access a restricted page.
Can someone please shoot my some direction on where this sort of logic is kept or defined?
some times i see that functions are defined as below:
read_dir(dir)
char *dir;
{
DIR * dirp;
struct dirent *d;
/* open directory */
dirp = opendir(dir);
......... so on
here what is the importance of the statement
char *dir;
what is the intension behind declaring the pointer soon after the function name and then starting the function body.
Hello,
I have a maven pom.xml file with multiple instances of a same goal defined (inside with different s).
I'm wondering how I can run a specific goal via maven command line. I've tried mvn --help, but I couldn't find an entry regarding this.
Try running this in a .VBS file
MsgBox(545.14-544.94)
You get a neat little answer of 0.199999999999932!
This rounding issue also occurs unfortunately in Sin(2 * pi) since VB can only ever see the (user defined) variable pi as accurate as 3.14159265358979.
Is rounding it manually (and loosing accuracy) the only way to improve the result? What is the most effective way of dealing with this kind of problem?
When I read a sheet into a DataTable using the OleDbDataReader, floating point numbers loose their precision.
I tried forcing OleDb to read the excel data as string, but although the data is now contained in a DataRow with each Column defined as System.String it looses precision (18.125 - 18.124962832).
Any idea how to avoid this behaviour?
I have some popup dialogs on my webpage, in each of this dialogs i have defined some click event with jquery :
$(".links_view").click(function(e){ //code });
But the problem is when i activate one this click event, it will be executed in each dialog...
Arrays, functions, pointers, references, classes, unions, enumerations and pointers to members are compound types.
My understanding of a compound type is that is based on other type(s). For example, T[n], T* and T& are all based on T. Then what other type(s) is an enumeration based on?
Or if my understanding of compound types is incorrect, what exactly is it about a type that makes it a compound type? Is compound simply a synonym for user-defined?
In Oracle I've created a data type:
TABLE of VARCHAR2(200)
I want to have a variable of this type within a Stored Procedure (defined locally, not as an actual table in the DB) and fill it with data.
Some online samples show how I'd use my type if it was filled and passed as a parameter to the stored procedure:
SELECT column_value currVal FROM table(pMyPassedParameter)
However what I want is to fill it during the PL/SQL code itself, with INSERT statements.
Anyone knows the syntax of this?
I have 10 instances of the class movie which I wish to add to an Arraylist named Catalogue1
in a class containing a main method I write the following
ArrayList catalogue1= new ArrayList ()
//the class movie is defined in another class
Movie movie1= new Movie ()
Movie movie2= new Movie ()
Catalogue.Add (1, movie1)
What is wrong? Should I define somewhere what kind of Objects this arraylist named catalogue should contain?
Thank you in advance
I'm trying to configure GIT on my Windows XP machine, but SSH keeps creating and looking for the public/private key pair in non-sensical places, e.g. /.ssh/id_rsa
Is there a configuration file in the GIT Installation for Windows where I can switch this to my home directory, or another user defined place? By default, it offers to create new key pairs at //.ssh/id_rsa but that gives me the error "Could not create directory '//.ssh'." And when I'm able to find a directory I can create it in, GIT won't look there.
I am able to retrieve all the posts from a custom category with this call to WP_Query
$q = new WP_Query(array( 'taxonomy' => 'jh-portfolio-category',
'term' => 0, 'post_type' => 'jh-portfolio' ));
However, let say within the jh-portfolio-category taxonomy I have defined some sub-categories, how do I specify I wish to have posts from a specific sub-category? Changing the 'term' property to the term_id as presented in wp_term_taxonomy doesn't seem to work.
Let A be a class with some members as x, y, z:
Class A {
int x;
int y;
String z;
...
}
A is an Object so it inherits the "Equals" functions defined in Object.
What is the default behavior of this function? Does it check for the equality of members or does it check for reference equality?
I have a list of strings and a list of filters (which are also strings, to be interpreted as regular expressions). I want a list of all the elements in my string list that are accepted by at least one of the filters. Ideally, I'd write
[s for s in strings if some (lambda f: re.match (f, s), filters)]
where some is defined as
def some (pred, list):
for x in list:
res = pred (x)
if res:
return res
return False
Is something like that already available in Python, or is there a more idiomatic way to do this?
I have a jquery-tmpl defined:
<script id="postTemplate" type="text/x-jquery-tmpl">
<div class="div-msg-actions-inner">
@Html.ActionLink("Edit", "Edit", "Post", new { postId = "${PostId}" }, new { @class = "button" })
@Html.ActionLink("Reply", "Reply", "Post", new { topicId = "${TopicId}" }, new { @class = "button" })
</div>
</script>
The action link results in the "$" being encoded into "%24". Is there a way around this so the ID in my action link will get replaced correctly?
Hi,
I want an open source/free tool which can test the schema, data, user defined functions, views and stored procedures between two different databases or two different versions of the databases. I am using MySQL database.
Currently I am using DB Solo which is a 30 day trail version.
Thanks in advance.
How do I create a custom Visual Studio 2008 UI designer for a C# file?
For example, when you double click on a DataSet in the Solution Explorer, a UI screen appears that allows you to edit the DataSet, even though it is defined in XML/code (which you can right click and "View Code").
Usually this code is separated from user code in some way, either by region ("Windows Forms Designer Generated Code"), by codegen (".g.cs" for WPF XAML files), or some other means like partial classes.
Backbone's documentation states:
The events property may also be defined as a function that returns an events hash, to make it easier to programmatically define your events, as well as inherit them from parent views.
How do you inherit a parent's view events and extend them?
Parent View
var ParentView = Backbone.View.extend({
events: {
'click': 'onclick'
}
});
Child View
var ChildView = ParentView.extend({
events: function(){
????
}
});
Hi all
What I am trying to achieve might be trivial, however I am loading a PNG mask which does not have a transparent background, but rather a black background, with the shape defined on top in white (the actual mask which needs to be applied). Apparently Flex expects me to provide a mask with a transparent background for it to work, or am I missing something?
If that's the case, could I transform the bitmapData which I am loading so that it treats black color as transparent?
thanks in advance.
from google.appengine.ext import db
class Log(db.Model):
content = db.StringProperty(multiline=True)
class MyThread(threading.Thread):
def run(self,request):
#logs_query = Log.all().order('-date')
#logs = logs_query.fetch(3)
log=Log()
log.content=request.POST.get('content',None)
log.put()
def Log(request):
thr = MyThread()
thr.start(request)
return HttpResponse('')
error is :
Exception in thread Thread-1:
Traceback (most recent call last):
File "D:\Python25\lib\threading.py", line 486, in __bootstrap_inner
self.run()
File "D:\zjm_code\helloworld\views.py", line 33, in run
log.content=request.POST.get('content',None)
NameError: global name 'request' is not defined
hi
I m new in network programming.I want to traverse NAT using Stun .I use the stun client application defined in code project Stun Client .It returned me a mapped ip and port.But i don't know how to use this ip and port for p2p communication in c#.net.
Pls Help me .
Any help will be appriciated
In my application I have a class which has properties of user-defined types like this:
class MyType
{
public A MyProperty
{
get;
set;
}
}
class A
{
.....some methods and proeprties
}
for some operations that I need to perform from my main program, I create a List of MyProperty whenever creating object of MyType and pass it to my main program and there I perform different operation on these properties which reflects in there instances also. Is there any way by which I could get the object instance for any particular MyProperty from that property in the list.
Basically I don't know from where to start, I need to add a line script for my application that is not so complicated, just to execute pre-defined commands, for instance:
command New Invoice -- create new invoice
command customer profile -- open customer form where cust id = CustID
command run End-Of-Day - run the end of day process
command scr 1020 -- open form id = 1020
How can I start?
I have no problem of recommending any third party components (parsers,evaluators,etc..).
whats missing is the basic structure no details, just a theory for implementation.
Thanks,
Objectberg