I have a weird issue (weird because it is specific to one component) with applicationComplete in a fairly simple application. All the UI components are declared in MXML. I can access them all in applicationComplete, but not a spark.components.TextArea component, named taStatus here; it is null in the handler.
MXML looks sort of like this (there are lots of other components, but nothing special)
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="710" minHeight="640" applicationComplete="onApplicationComplete(event)" width="710" height="640">
<mx:TabNavigator left="15" right="15" top="15" bottom="340" paddingTop="0">
<s:NavigatorContent label="General" width="100%" height="100%">
<s:Label x="93" y="71" text="Label" id="lblTest"/>
</s:NavigatorContent>
<s:NavigatorContent label="Status" width="100%" height="100%">
<s:TextArea id="taStatus" width="100%" height="100%" text="Startup." editable="false"/>
</s:NavigatorContent>
</mx:TabNavigator>
<fx:Script source="main.as" />
</s:Application>
Here is the handler in main.as
protected function onApplicationComplete(event: FlexEvent) : void
{
lblTest.text = 'abc789'; // OK
taStatus.text = 'abc789'; // Fail
}
TypeError: Error #1009: Cannot access a property or method of a null object reference. So taStatus is null... What is so special about this TextArea?
I'm trying to prove the following in Coq:
Goal (forall x:X, P(x) /\ Q(x)) - ((forall x:X, P (x)) /\ (forall x:X, Q (x))).
Can someone please help? I'm not sure whether to split, make an assumption etc.
My apologies for being a complete noob
What's the story behind the ::'s sometimes token name
T_PAAMAYIM_NEKUDOTAYIM
I'm mainly interested in knowing if
This is an abbreviation for something else
This is a phrase in a language other than English, and if so what's the language and what's a rough translation
This is some obscure-to-me programming term
Drunk Developers
Thanks!
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'm already a professional J2EE developer by day, and Rails developer by night. I'm planning on adding Python to my list of skills. I'm already convinced a language is just a tool, so I'm not interested in a religious war. I agree with the Pragmatic Programmers that learning one language/year is a good thing for your professional development
So, in your considered opinion, what kinds of applications does Python hit the sweet spot? And why? What advantages does it have, and why do these advantages outweigh the costs in adopting Python?
ADD: I also plan on learning a pure functional language like Scheme.
I had a phone screen the other day with a company that I really want to work for. It went pretty well, based on cues from the HR person, such as "Next step we're going to send you a programming test," and "Well, before I get ahead of myself, do you want to continue the interviewing process." and "We'll send out the test later this afternoon. It doesn't sound like you'll have trouble with it, but I want to be honest we do have a high failure rate on it."
The questions asked weren't technical, just going down my resume, and talking about the work I've done, and how it relates to the position. Nothing I couldn't talk through.
This was last Thursday.
It's now Tuesday, and haven't received the test yet. I sent a follow up email yesterday to the lady who interviewed me, but haven't gotten a response.
Anyone had a similar experience? Am I reading too much into this? Or was I off the mark by thinking I had moved on to the next step in the interview process.
Since this is a company I really want to work for, I'm driving myself insane enumerating all the various what-if scenarios.
say I have the following code:
char[5][5] array;
for(int i =0; i < 5; ++i)
{
for(int j = 0; j < 5; ++i)
{
array[i][j] = 'X';
}
}
Would there be a benefit for initializing each row in this array in a separate thread?
Imagine instead of a 5 by 5 array, we have a 10 by 10?
n x n?
Also, this is done once, during application startup.
I just deployed an application to a new server, and although I'm using virtualenv, I had to install a new environment on the production server, which has a different architecture.
Anyway, I received no TemplateSytaxErrors in development, but on the production server, I get:
Exception Type: TemplateSyntaxError
Exception Value: Caught SyntaxError while rendering: invalid syntax (views.py, line 25)
The offending line is:
{% url admin:password_change as password_change_url %}
Upon removing that line, the TemplateSyntaxError hops to the next line that has a colon in it (and lets other template tags work fine).
So my question is this: is there some discrepancy in versions of Python/Django that would allow or disallow the namespacing syntax?
The template tags are in django-grappelli (http://code.google.com/p/django-grappelli/), so I'd rather not go through their code and rewrite all the template tags.
Development server:
32-bit Debian
Python 2.5.5
Django 1.2.1
Production server:
64-bit CentOS
Python 2.4.3
Django 1.2.1
Any ideas?
I am trying to reproduce a SQL query using a LINQ to Entities query. The following SQL works fine, I just don't see how to do it in LINQ. I have tried for a few hours today but I'm just missing something.
SELECT
h.ReqID,
rs.RoutingSection
FROM ReqHeader h
JOIN ReqRoutings rr ON rr.ReqRoutingID = (SELECT TOP 1 r1.ReqRoutingID
FROM ReqRoutings r1
WHERE r1.ReqID = h.ReqID
ORDER BY r1.ReqRoutingID desc)
JOIN ReqRoutingSections rs ON rs.RoutingSectionID = rr.RoutingSectionID
Edit***
Here is my table scema-
Requisitions:
ReqID PK string
ReqDate datetime
etc...
ReqRoutings:
ID PK int
ReqID FK
RoutingSection FK int
RoutingDate
ReqRoutingSections:
Id PK int
RoutingSection string
The idea is that each Requisition can be routed many times, for my query I need the last RoutingSection to be returned along with the Requisition info.
Sample data:
Requisitions: - 1 record
ReqID 123456
ReqDate '12/1/2012'
ReqRoutings: -- 3 records
id 1
ReqID 123456
RoutingSection 3
RoutingDate '12/2/2012'
id 2
ReqID 123456
RoutingSection 2
RoutingDate '12/3/2012'
id 3
ReqID 123456
RoutingSection 4
RoutingDate '12/4/2012'
ReqRoutingSections: -- 3 records
id 2
Supervision
id 3
Safety
id 4
Qaulity Control
The results of the query would be
ReqID = '123456'
RoutingSection = 'QualityControl' -- Last RoutingSection requisition was routed to
Hi,
I'm writing a light remoting app to assist in debugging a problem with remoting communication. This app mimics much of what a larger application does:
Periodically sends a heartbeat to
another peer application, and
periodically verifies that a heartbeat
has been received within some time
threshold.
What we're seeing is in our big application, the heartbeats seem to get dropped. One peer will go for long periods of time without seeing heartbeats from another peer, until the peer that is "dead" is restarted. The big application is responsive in all other ways. We believe it has something to do with the network setup. We were able to repro the problem locally, and fixed it by making some configuration changes to our test environment.
To help our customer diagnose the issue, the mini-remoting app needs to log as much information as possible.
So, is there a way to get the underlying socket for the remoting connection? I'm aware that I could write a custom sink for this, but I'd like to keep the actual remoting process as close to what is implemented in the big app as possible.
Also as an aside, any ideas why the big-app might be "dropping" heartbeats?
Is there a place where I can add code that will be executed before unit initialization?
The reason I want to do this is I need to change the DecimalSeparator, this has to be done before the initialization of some units. I have put it in the project source, before Application.Initialize but it is too late by then.
As I see it the only choice I have is to put it in the initialization of the unit that needs the DecimalSeparator to be changed, is this the case?
Thanks in advance for any advice.
I'm looking in to Magento's filtering options (Ecommerce System and PHP Framekwork with an expansive ORM system). Specifically the addFieldToFilter method. In this method, you specify a SQLish filter by passing in a single element array, with the key indicating the type of filter. For example,
array('eq'=>'bar') //eq means equal
array('neq'=>'bar') //neq means not equal
would each give you a where clause that looks like
where field = 'bar';
where field != 'bar';
So, deep in the bowels of the source, I found a comparison type named
'moreq'
that maps to a = comparison operator
array('moreq'=>'27')
where field >= 27
The weird thing is, there's already a 'gteq' comparision type
array('gteq'=>'27')
where field >= 27
So, my question is, what does moreq stand for? Is is some special SQL concept that's supported in other databases that the Magento guys wants to map to MySQL, or is it just "more required" and an example what happens when you're doing rapid agile and trying to maintain backwards compatibility.
I was wondering if anyone can tell me if MongoDB or CouchDB are ready for a production environment.
I'm now looking at these storage solutions (I'm favouring MongoDB at the moment), however these projects are quite young and so I foresee that I'm going to have to work quite hard to convince my manager that we should adopt this new technology.
What I'd like to know is:
1) Who is using MongoDB or CouchDB today in a production environment?
2) How are you using MongoDB/CouchDB?
3) What problems (if any) did you come across when you adopted this new storage mechanism (and how did you overcome them)?
4) How did you deal with any migration issues that you had to deal with?
5) Do you have any good/bad experiences with either of these solutions that you'd like to share?
Thanks.
We are doing a migration of our Sybase database that has a utf8 encoding to a server with iso 1 encoding. We are just using char and Varchar for our strings. Will doing backup and restore not truncate any strings? I was thinking that Char and Varchar are just single byte characters.
For a database I'm building, I've decided to use natural numbers as the primary key. I'm aware of the advantages that GUID's allow, but looking at the data, the bulk of row's data were GUID keys.
I want to generate XML records from the database data, and one problem with natural numbers is that I don't want to expose my database key's to the outside world, and allow users to guess "keys." I believe GUID's solve this problem.
So, I think the solution is to generate a sparse, unique iD derived from the natural ID (hopefully it would be 2-way), or just add an extra column in the database and store a guid (or some other multibyte id)
The derived value is nicer because there is no storage penalty, but it would be easier to reverse and guess compared to a GUID.
I'm (buy) curious as to what others on SO have done, and what insights they have.
I want to detect an extended mousedown.
The following code works in Firefox and Safari...
var mousedownTimeout;
$('#testButton').mousedown(function(){
mousedownTimeout = window.setTimeout(function(){
alert("Hey, let go.");
}, 2000);
});
$('#testButton').mouseup(function(){
window.clearTimeout(mousedownTimeout);
});
... but not on the iPhone because (quoting quirksmore.org)...
The iPhone fires the mousedown,
mouseup and click events in the
correct order on a click (tap), but it
either fires all three or none at all.
Is there a way around this?
I have a verb conjugation app that displays verb translations in the first cell of a table. At present the translation list is just a string (comma-separated list) but I'd like to change it to have clickable buttons. I had a play around adding buttons to the cell view without too much success but my only experience with custom cells has been using specific positioning so I'm unsure as to how to achieve a dynamic list of buttons (varying widths) within a cell.
Any help greatly appreciated.
Cheers.
A bit of background. I would like to be able to process text for the line that the caret is on in a WPF RichTextBox. Please see my earlier question about the TextPointer class: http://stackoverflow.com/questions/3046162/how-to-keep-track-of-textpointer-in-wpf-richtextbox.
I know how to get the TextPointer at the start of the current line by using GetLineStartPosition with 0 as the argument but would now like to get the TextPointer at the end of the line. It was suggested in my previous question that this is possible using the GetLineStartPosition method.
I would appreciate it if someone can explain a bit about how the GetLineStartPosition works with regard to end of line pointers.
Thanks in advance for any help.
I'm working with an existing database schema, and trying to setup two Doctrine models with a Many to Many relationship, as described in this document
When creating tables from scratch, I have no trouble getting this working. However, the existing join tables use a different naming convention that what's described in the Doctrine document. Specifically
Table 1
--------------------------------------------------
table_1_id
....other columns....
Table 2
--------------------------------------------------
table_2_id
....other columns....
Join Table
--------------------------------------------------
fktable1_id
fktable_2_id
Basically, the previous developers prefaced all forign keys with an fk.
From the examples I've seen and some brief experimenting with code, it appears that Doctrine 1.2 requires that the join table use the same column names as the tables it's joining in
Is my assumption correct?
If so, has the situation changed in Doctrine 2?
If the answers to either of the above are true, how do you configure the models so that all the columns "line up"
hi guys,
I have a recuring method which shows up many times in my code its basically checking to make sure that the connection to the odbc is ok and then connects but each time this method is called it calls another method and each instance of the main method this one is different, as each method is about 8 lines of code having it 8 times in the code isnt ideal.
so basically i would like to have just one method which i can call passing the name of the new method as an arguement.
so basically like:
private void doSomething(methodToBeCalled)
{
if(somthingistrue)
{
methodToBeCalled(someArgument)
}
}
is this possible?
thanks in advance
Hi,
I have a list of records that all need their individual TTLs modified. I can't seem to find a way with this odd syntax to do so, however. Any recommendations? Would I have to delete them all and then re-add after with the correct settings?
I can't seem to find a "modifyrecord" option unfortunately :(
Consider the following code:
List<double> l = new List<double>();
//add unknown number of values to the list
l.Add(0.1); //assume we don't have these values ahead of time.
l.Add(0.11);
l.Add(0.1);
l.ToArray(); //ultimately we want an array of doubles
Anything wrong with this approach? Is there a more appropriate way to build an array, without knowing the size, or elements ahead of time?
Since boost::shared_ptr could be called very frequently and simply returns a pointer, isn't the -> operator a good candidate for being inlined?
T * operator-> () const // never throws
{
BOOST_ASSERT(px != 0);
return px;
}
Would a good compiler automatically inline this anyway?
Should I lose any sleep over this? :-)
In my plugin code I would like to perform a WP_Query (or similar) which returns all posts matching a given query string, as if the user typed that same string into the WordPress search form. Perhaps I'm just being dense, but I cannot seem to find a way to do so. I would expect to have a special parameter for WP_Query, such as matching, but I see no evidence of one.
I'll start going through the WordPress codebase to see how it's done internally, and I'll post the answer here if I find it. I just thought someone might happen to know offhand.