Hi all
In a switch view mode in iPad, is it possible to maintain the two views in landscape mode and also in portrait mode without having to use the popover?(Maybe just adjust the width of each views in portrait, instead of the popover) How would I do that?
I have two arrays. I need to check and see if the elements of one appear in the other one.
Is there a more efficient way to do it than nested loops? I have a few thousand elements in each and need to run the program frequently.
-Alex
I've got two instances of a SessionScoped CDI bean for the same session. I was under the impression that there would be one instance generated for me by CDI, but it generated two. Am I misunderstanding how CDI works, or did I find a bug?
Here is the bean code:
package org.mycompany.myproject.session;
import java.io.Serializable;
import javax.enterprise.context.SessionScoped;
import javax.faces.context.FacesContext;
import javax.inject.Named;
import javax.servlet.http.HttpSession;
@Named @SessionScoped public class MyBean implements Serializable {
private String myField = null;
public MyBean() {
System.out.println("MyBean constructor called");
FacesContext fc = FacesContext.getCurrentInstance();
HttpSession session = (HttpSession)fc.getExternalContext().getSession(false);
String sessionId = session.getId();
System.out.println("Session ID: " + sessionId);
}
public String getMyField() {
return myField;
}
public void setMyField(String myField) {
this.myField = myField;
}
}
Here is the Facelet code:
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<f:view contentType="text/html" encoding="UTF-8">
<h:head>
<title>Test</title>
</h:head>
<h:body>
<h:form id="form">
<h:inputText value="#{myBean.myField}"/>
<h:commandButton value="Submit"/>
</h:form>
</h:body>
</f:view>
</html>
Here is the output from deployment and navigating to page:
INFO: Loading application org.mycompany_myproject_war_1.0-SNAPSHOT at /myproject
INFO: org.mycompany_myproject_war_1.0-SNAPSHOT was successfully deployed in 8,237 milliseconds.
INFO: MyBean constructor called
INFO: Session ID: 175355b0e10fe1d0778238bf4634
INFO: MyBean constructor called
INFO: Session ID: 175355b0e10fe1d0778238bf4634
Using GlassFish 3.0.1
i have money field in sql table when i m extracting record by table and binding it to datagrid it show money as well 100.0000 four character from decimal i need only two .
Plz suggest.
I have two eclipse directories, both are Galileo. One has plugin A installed, the another has plugin B. Now I want to have just one eclipse, is it save to just copy the plugins directory from one of the eclipses to the other?
What is the best way to touch two following values in an numpy array?
example:
npdata = np.array([13,15,20,25])
for i in range( len(npdata) ):
print npdata[i] - npdata[i+1]
this looks really messed up and additionally needs exception code for the last iteration of the loop.
any ideas?
Thanks!
Is there a way to fire a twoway data bind when the key up event fires in Silverlight. Currently I have to lose focus on the textbox to get the binding to fire.
<TextBox x:Name="Filter" KeyUp="Filter_KeyUp" Text="{Binding Path=Filter, Mode=TwoWay }"/>
when ping for two different ip address say 202.177.251.xxx and 59.183.5.yyy one after other one of it always fails.
say if i ping one ip address it does not receive packet back and then i ping second one in a loop it receives the packet back though both are connected.
Hi,
I need huffman code(best in python or in java), which could encode text not by one character (a = 10, b = 11), but by two (ab = 11, ag = 10). Is it possible and if yes, where could i find it, maybe it's somewhere in the internet and i just can'd find it?
I have two applications each pointing to a different database. when I deploy these applications to Tomcat at the same time, whichever datasource gets loaded first is the same datasource that gets used for both apps. I am using the latest Tomcat and Grails.
Hi!
Is there an easy way to get the relative compliment of two sets? Perhaps using LINQ?
http://en.wikipedia.org/wiki/Complement_(set_theory)
I have to find the relative compliment of a set A relative to B. Both A and B are of type HashSet but I think the algorithm could be made more generation (IEnumerable or even ISet)?
I could use a solution in either vb.net or C#.
Can i pass two string as eventargs on a button click
internal void OnSaveComm(string strTitle,string strLink)
{
WorkItem.EventTopics[EventTopicNames.AgentRecentComm].Fire(this,new EventArgs<> XYZ,WorkItem,Microsoft.Practices.CompositeUI.EventBroker.PublicationScope.Global);
}
Using Event broker to pass string to subscribing event to display in a different view.
I have a third party api, which has a class that returns an enumerator for different items in the class.
I need to remove an item in that enumerator, so I cannot use "for each". Only option I can think of is to get the count by iterating over the enum and then run a normal for loop to remove the items.
Anyone know of a way to avoid the two loops?
Thanks
I've got two unmanaged C++ functions, Compress and Decompress. The arguments and returns go as followed:
unsigned char* Compress (unsigned char*,int)
unsigned char* Decompress (unsigned char*,int)
Where all uchars are arrays of uchars.
Could someone please help me lay out a way to convert these into managed C# code using the Byte[] array instead of unsigned char*? Thank you very much!
How do I generate a transformation matrix for rotating points/others by the angle between two lines/vectors/directions in CGAL?
2D is what I need. 3D is what I love.
i like to find the greatest of two nos without using < this relational operator.
i tired this
int a,b;
if(a/b==0)
{
b is greater
}
else
{
a is greater
}
but this not working for negative nos .please help for this
Hi,
is it possible to have two detail view controllers for a SplitViewController(not with the use of Interface Builder, pure programmatically) or can we add one more splitviewcontroller in place of a splitviewcontroller's detailviewcontroller. If yes, please explain me with an example.
Thanks In Advance!
Hi
I have a table with a column event_time. How can I select two rows right before NOW() and the next one after NOW(), ordered by event_time?
Is is possible with a single query?
Is there any way (or calculator) to determine the relationship between two numbers.
For example on one the temporary event ID cards, the Unique ID is 20309825 but the barcode when decoded reads 8336902052. What could be the relationship between these numbers, if any?
Thanks in advance for your help!
Consider I have two arrays:
$friends = Array('foo', 'bar', 'alpha');
$attendees = Array('foo', 'bar');
Now I need to populate a new array $nonattendees which contains only the elements which are in $friends array and not in $attendees array. i.e, $nonattendees array should be populated with 'alpha'.
Is there any in built array operation available in PHP to achieve the above functionality or should I write my own for loops?
hi, i've got two lists A and B, B = A + C - D. All elements are unique, no duplicates. How do i get the lists of:
(1) the new items added, C
(2) the old items removed, D
C and D aren't more than 10000 elements or so.
Edit
Crap, sorry guys - forgot the important detail - these are both text files, not in memory elements.
string a="I am comparing 2 string";
string b="I am comparing 2 string";
if(a==b)
return true;
else
return false;
How does a .NET compiler compare two strings? Is string work like a struct or like an int?
Is there a way in Groovy to get the duration between two Date objects? The duration format I'm looking for would be something like: 2 days, 10 hours, 30 minutes...
Thanks