I need it in FlexUnit to test private methods. Is there any possibility to do this via reflection by using describeType or maybe flexUnit has some build in facility? I dislike artificial limitation that i cannot test private functions, it greatly reduces flexibility. Yes it is good design for me to test private functions, so please do not advise me to refactor my code. I do not want to break the encapsulation for the sake of unit testing.
Hi!
I need to get an item's position in spinner knowing it's ID. I've tried to do it with Spinner and SpinnerAdapter classes but there are no corresponding methods there.
Thanks,
Aleksander
Hi again,
I have this PHP one dimensional array:
Array
(
[Female--N] => 11
[Male--N] => 11
[Humans--N] => 11
[Adult--N] => 8
[Adolescent--N] => 8
[Reaction Time-physiology--N] => 6
[Acoustic Stimulation-methods--N] => 6
[Schizophrenia-genetics--Y] => 5
[Motion Perception--N] => 3
)
And i want a new array from this that looks like (i think this tow-dimensional..?):
Array
(
[Female][N] => 11
[Male][N] => 11
[Humans][N] => 11
[Adult][N] => 8
[Adolescent][N] => 8
[Reaction Time-physiology][N] => 6
[Acoustic Stimulation-methods][N] => 6
[Schizophrenia-genetics][Y] => 5
[Motion Perception][N] => 3
)
Can i use split method on key elements?
Little bit harder... i also need to split on the single '_' underscore, i did this to prevent the columns getting mixed up... But the example below doesn't do the job right...
$new_array = array();
foreach($MeshtagsArray as $key => $value) {
$parts = explode('__', $key, 2);
$parts2 = explode('_', $key, 2);
$new_array[] = array(
'discriptor' => $parts[0],
'qualifier' => $parts2[1],
'major' => $parts[1],
'#occurence' => $value
);
So the output should be something like:
[0] => Array
(
[discriptor] => Female
[qualifier] =>
[major] => N
[#occurence] => 11
........
[5] => Array
(
[discriptor] => Reaction Time
[qualifier] => physiology
[major] => N
[#occurence] => 6
Best regards,
Thijs
I have a laptop, with Screen Resolution - 1366x768 (most common) - I want to increase it further to 1600x900 (or higher), in the same ratio. I want to scale the higher resolution on my current screen to fit it.
I found xrandr with command xrandr --output LVDS1 --scale 1.4x1.4, this worked but again resulted to another problem, it does the scaling thing but the cursor is still blocked into the native screen resolution and I am not able to move it further, I found that the bug is already filed here.
Also this command was only for Linux, I wanted to do this thing with both Linux and Windows (including Windows 8). I want a similar software that is bug free (at least not a major bug like this) and that supports Windows as well (or two separate software for Windows and Linux).
Any help is appreciated and Thanks in advance.
I having problems saving many to many relationships to a pivot table.
The way the pojos are created is unfortunately a pretty long process which spans over a couple of different threads which work on the (to this point un-saved) object until it is finally persisted. I associate the related objects to one another right after they are created and when debugging I can see the List of related object populated with their respective objects. So basically all is fine to this point. When I persist the object everything get saved except the relations in the pivot table.
mapping files:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="com.thebeansgroup.jwinston.plugin.orm.hibernate.object">
<class name="ShowObject" table="show_object">
<id name="id">
<generator class="native" />
</id>
<property name="name" />
<set cascade="all" inverse="true" name="venues" table="venue_show">
<key column="show_id"/>
<many-to-many class="VenueObject"/>
</set>
</class>
</hibernate-mapping>
and the other
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="com.thebeansgroup.jwinston.plugin.orm.hibernate.object">
<class name="VenueObject" table="venue_object">
<id name="id">
<generator class="native"/>
</id>
<property name="name"/>
<property name="latitude" type="integer"/>
<property name="longitude" type="integer"/>
<set cascade="all" inverse="true" name="shows" table="venue_show">
<key column="venue_id"/>
<many-to-many class="ShowObject"/>
</set>
</class>
</hibernate-mapping>
pojos:
public class ShowObject extends OrmObject
{
private Long id;
private String name;
private Set venues;
public ShowObject()
{
}
public Long getId()
{
return id;
}
public void setId(Long id)
{
this.id = id;
}
public String getName()
{
return name;
}
public void setName(String name)
{
this.name = name;
}
public Set getVenues()
{
return venues;
}
public void setVenues(Set venues)
{
this.venues = venues;
}
}
and the other:
public class VenueObject extends OrmObject
{
private Long id;
private String name;
private int latitude;
private int longitude;
private Set shows = new HashSet();
public VenueObject()
{
}
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
public Long getId()
{
return id;
}
public void setId(Long id)
{
this.id = id;
}
public int getLatitude()
{
return latitude;
}
public void setLatitude(int latitude)
{
this.latitude = latitude;
}
public int getLongitude()
{
return longitude;
}
public void setLongitude(int longitude)
{
this.longitude = longitude;
}
public String getName()
{
return name;
}
public void setName(String name)
{
this.name = name;
}
public Set getShows()
{
return shows;
}
public void setShows(Set shows)
{
this.shows = shows;
}
}
Might the problem be related to the lack of annotations?
Does android expose an API or somesuch for the development of thirdparty keyboard applications? There are several existing apps which can replace the default input methods, however I cannot seem to find any information about it.
Hi all,
I am asking this here in the hope that someone has maybe come across this situation too... I have posted this on the SmartGWT forum:
I am having an issue when trying to instantiate a ListGridRecord object on my server side. I am using the ListGrid on the client side, I want to use GWT's RPC to pass back an array of ListGridRecord objects to populate the grid with. I know that SmartGWT is designed to link to a datasource but I want full control over when I populate the grid and this shouldn't be as much of a nightmare as it is to do.
I have searched high and low and cannot find anyone complaining about the same thing. The exception however (listed below) has come up (in my search findings) as a possible memory error - where increasing the memory (-Xmx512m argument) has apparently solved the problem. It did not, however, sort out mine.
If anyone can shed any light on this I would greatly appreciate it!
Here are my details:
Developing using Eclipse Galileo on Ubuntu 9.04 (Jaunty) and GWT 2.0.3, I built the initial GWT project using the webAppCreator bundled with the GWT 2.0.3 release and imported the project into Eclipse as described on the GWT Getting Started Page (as using the GWT Eclipse plugin caused even more nightmares when trying to connect to a database - this is apparently due to using the Google App Engine and turning it off as all the posts suggested only causes ClassNotFound exceptions).
The line that causes the error is literally:
ListGridRecord a = new ListGridRecord();
The error I get is the following:
00:00:25.916 [WARN] Exception while dispatching incoming RPC call
com.google.gwt.user.server.rpc.UnexpectedException : Service method 'public abstract java.lang.String za.co.company.product.client.service.EmployeeServi ce.getAllEmployeeAsListGridRecord()' threw an unexpected exception: java.lang.UnsatisfiedLinkError: com.smartgwt.client.util.LogUtil.setJSNIErrorHandl er()V
at com.google.gwt.user.server.rpc.RPC.encodeResponseF orFailure(RPC.java:378)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncode Response(RPC.java:581)
at com.google.gwt.user.server.rpc.RemoteServiceServle t.processCall(RemoteServiceServlet.java:188)
at com.google.gwt.user.server.rpc.RemoteServiceServle t.processPost(RemoteServiceServlet.java:224)
at com.google.gwt.user.server.rpc.AbstractRemoteServi ceServlet.doPost(AbstractRemoteServiceServlet.java :62)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
at org.mortbay.jetty.servlet.ServletHolder.handle(Ser vletHolder.java:487)
at org.mortbay.jetty.servlet.ServletHandler.handle(Se rvletHandler.java:362)
at org.mortbay.jetty.security.SecurityHandler.handle( SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(Se ssionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(Co ntextHandler.java:729)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebA ppContext.java:405)
at org.mortbay.jetty.handler.HandlerWrapper.handle(Ha ndlerWrapper.java:152)
at org.mortbay.jetty.handler.RequestLogHandler.handle (RequestLogHandler.java:49)
at org.mortbay.jetty.handler.HandlerWrapper.handle(Ha ndlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(Htt pConnection.java:505)
at org.mortbay.jetty.HttpConnection$RequestHandler.co ntent(HttpConnection.java:843)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser. java:647)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpPa rser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnec tion.java:380)
at org.mortbay.io.nio.SelectChannelEndPoint.run(Selec tChannelEndPoint.java:395)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run (QueuedThreadPool.java:488) Caused by: java.lang.UnsatisfiedLinkError: com.smartgwt.client.util.LogUtil.setJSNIErrorHandl er()V
at com.smartgwt.client.util.LogUtil.setJSNIErrorHandl er(Native Method)
at com.smartgwt.client.core.JsObject.(JsObjec t.java:30)
at za.co.company.product.server.service.EmployeeServi ceImpl.getAllEmployeeAsListGridRecord(EmployeeServ iceImpl.java:83)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncode Response(RPC.java:562)
at com.google.gwt.user.server.rpc.RemoteServiceServle t.processCall(RemoteServiceServlet.java:188)
at com.google.gwt.user.server.rpc.RemoteServiceServle t.processPost(RemoteServiceServlet.java:224)
at com.google.gwt.user.server.rpc.AbstractRemoteServi ceServlet.doPost(AbstractRemoteServiceServlet.java :62)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
at org.mortbay.jetty.servlet.ServletHolder.handle(Ser vletHolder.java:487)
at org.mortbay.jetty.servlet.ServletHandler.handle(Se rvletHandler.java:362)
at org.mortbay.jetty.security.SecurityHandler.handle( SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(Se ssionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(Co ntextHandler.java:729)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebA ppContext.java:405)
at org.mortbay.jetty.handler.HandlerWrapper.handle(Ha ndlerWrapper.java:152)
at org.mortbay.jetty.handler.RequestLogHandler.handle (RequestLogHandler.java:49)
at org.mortbay.jetty.handler.HandlerWrapper.handle(Ha ndlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(Htt pConnection.java:505)
at org.mortbay.jetty.HttpConnection$RequestHandler.co ntent(HttpConnection.java:843)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser. java:647)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpPa rser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnec tion.java:380)
at org.mortbay.io.nio.SelectChannelEndPoint.run(Selec tChannelEndPoint.java:395)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run (QueuedThreadPool.java:488)
Thanks in advance!
Xandel
If I have a class "person" with a property $name and its getter(get_name()) and setter(set_name()) methods, then after instantiating the objects and setting the property i.e.
$paddy = new person();
$paddy->set_name("Padyster Dave");
echo "Paddy's full name: ".$paddy->name; //WHY THIS IS NOT RECOMMENDED...
In the above code $paddy->name;WHY THIS IS NOT RECOMMENDED?
Seems like a simple thing but I can't seem to find a way to do it.
I saw this but it doesn't seem to work:
NSDate *date = [NSDate dateWithNaturalLanguageString:@"07/17/07"];
It would be great to see a couple different methods.
Thanks,
Nick
If ObjectAlloc cannot deduce type information for the block, it uses 'GeneralBlock'. Any strategies to get leaks from this block that may eliminate the need of my 'trial and error' methods that I use? The Extended Detail thing doesn't really do it for me as I just keep guessing.
Hi there
Can someone explain the differences between an Observable and a ConnectableObservable? The Rx Extensions documentation is very sparse and I don't understand in what cases the ConnectableObservable is useful.
This class is used in the Replay/Prune methods.
I've been trying to learn PHP OOP and have looked at multiple articles, but have yet to find a good resource for learning. I want to learn from the user of setters and getters, $this-, constructors, and so on...! Can anyone please suggest me something? I noticed MOST teachings leave out the explanation of $this-. I want to learn magic methods, decorators, encapsulation, etc... Feel free to suggest something that I haven't explicitly listed.
When pushing a viewcontroller using UINavigationController into the view:
What is necessary for it to trigger
viewDidAppear: and viewWillAppear: ?
What makes it fail to not trigger viewDidAppear: and viewWillAppear: ?
We are having a hard time relying on wether those methods gets triggered or not.
Hello everybody
It's really dream to be programmer for me.So i always wanted to be .I had so small knowledges from commodore basic which i couldn't figure out anything in it .Then i tried to learn Visual basic 6 by myself and result wasn't good as i expected because i even didn't understand classes.Then i left to learning programming and to dream to be programmer.
But challenge hadn't finished yet . After all of these i started to learn c# and i did chess engine which i hadn't believe that i can create one.I sometimes feel that i understand many thing about programming like knowing classes ,inheritance,abstract class and methods why exist , interfaces ,extension methods ,static classes ,threads. but i am not expert all in it . i just know that as i need . i don't know still i will learn many thing about these.i have also learned html, css2 , php and database concepts a little sql ,tables relations between primary keys etc but i haven't used them in praticaly . i just did some samples so i feel i am lack of knowledges.
As a result still i can't evaluate my skills and can't decide what is my level.I just feel myself one step ahead of junior sometimes :) . Still can't decide that it is time to job seeking. While searching job on web i have never seen a junior advertisement. All looking for a good experiencing one.Nobody care about juniors.
When found job advertisement which i feel sufficient myself a little then i start to feel that i think i can't do what they want from me and loosing job after have it in short time would leave many crap feelings into my low self-confidence.
Please advise me something ...
Also i want to ask some of concentrate questions.
1) If i enter a job which i can't provide their expectations should be in employers responsibility to test me while apply the job ?
2) If i answer "yes , i can " questions which is abstract(for example: can u do something like this) would be my responsibility ? Because such abstract questions is not clear and can't know before start it what i really can or not .
3) i have no professional experiences in this job so i even don't know how teams working on projects but a friend of me said that programmers only write method bodies while seniors create all project.So it looks what i can do really easy but i feel that small companies doesn't work like this so it is better work in a big company for starting who has seniors?
4)last applied job was looking for c# . net developer but then i learn that they need .net web developer.Does it take long time to learn specific sides of web programming while knowing c# desktop programming ?
Thanks for all answers since now.
I'm trying to set a page that displays the visitor's IP. All the methods I have tried show an IP different from the IP my computer has. I've tried:
Looking up http://www.whatismyip.com/automation/n09230945.asp
Using socket.getaddrinfo(socket.gethostname(), None)[0][4][0]
How can I find the real IP of the visitor?
I draw figure in Flsh ID with JSFL methods, for example
// draw rectangle
doc.addNewLine({x:0, y:0}, {x:2000, y:0});
doc.addNewLine({x:2000, y:0}, {x:2000, y:500});
doc.addNewLine({x:2000, y:500}, {x:0, y:500});
doc.addNewLine({x:0, y:500}, {x:0, y:0});
// how can I fill it, because this way doesn't work
doc.setFillColor('#0000ff');
I create a document using HTML markup. I want to use Palatino, which is called Palatino on Windows and Palatino Linotype on Mac, so I specify my CSS accordingly: font-family: Palatino Linotype, Palatino, serif;. I then print to a PDF using PrimoPDF under Windows. It all looks good when viewed in Windows.
But I want this PDF to look the same on a Mac, and the resulting file size (94KB) would suggest that the font (size 460KB) is not getting embedded by Primo, perhaps because it is a native font. How will this look? Will the PDF file format resolve this, or will the format of my PDF be wang when viewed under OSX?
Please note that I do not want to embed the font. I used a web-safe font to avoid this need, and it just so happens that the one I picked does not have the same name in OSX as in Windows.
I'm new to Python 3 and so far it seems like a decent language. I really like the string manipulation methods you can use and they are pretty radical. :)
I'm stuck however in thinking of a project to do with Python. Is there a site similar to Coding4Fun but for Python?
Community Wiki because I think this question is really interesting. :D
Hi,
I just bought an 1TB External Hard drive with eSATA, USB, FW400/800 (LaCie if you are interested).
I already put the windows 7 installation in a FAT32 active partition so i can plug the HDD via USB, since my notebook or other computers doesn't support boot via eSATA commonly, and it works.
Now i want to do more partitions so i'm looking for a way to have a boot manager as active partitions that allows me to boot from different partitions in my HDD (win7, ubuntu installations for example)
I want to know if you know any software to do this or you already have this system.
Thanks and sorry i have too many grammar errors because english is not my native language :)
Hello, I have an application that have EF 16 classes that share this information: They all are classes only with a key field and a description.
I think it should be a waste if I make a controller with just 1 method just to present a form to fill these classes info, then I was thinking in to make a generic form(with key, description) and dynamically fill the right class through a sort of selection the selected info in any way, any good suggestion or pattern to do that? Where the generic methods should be located.
Is there a way to query an embedded flash element to determine the available methods that can be executed on it via JavaScript?
Edit:
It appears that in IE it's as simple as
for ( i in flashNode ) {
alert(i);
}
After much clicking, they will be some of the very last members enumerated.
Still not able to determine this in Firefox though.
I just bought a 1080p 22" Samsung Syncmaster 2333HD (connected via HDMI) and the picture and video quality is great but the text quality is absolutely horrible. This monitor has a built in HD TV tuner.
Even as I type now all the text in this text box as well as in the browser toolbar and start menu, etc looks weird - like it all has a white outline around it that makes it jagged and hard to read. It hurts my eyes just to look at it.
I am running my PC in the suggested native resolution of 1920x1080, so what's the problem?
Is this one of the unavoidable downsides of using a HD monitor? Is there a solution to the problem?
Actually I want to serialize my data using Google's java implementation and then deserialize using C# implementation?
I have chosen portobuf-net as it seems to be more stable (porto# is still v0.9 or I would have gone for it). Before I start working on it I wanted to be sure that I can achieve this (serializing data using java implementation and deserializing it using potobuf-net). Or is there any list of methods that are specific to portobuf-net implementation?