I would like to create a form where a user can enter an arbitrary # of items in separate textboxes. The user could add (and potentially remove) fields as needed. Something like this:
I found the following different solutions:
http://www.eggdrop.ch/blog/2007/02/15/django-dynamicforms/
http://dewful.com/?p=100
Is there another best practice I might not be aware of?
Hi all,
I found a strange cookie problem on safari. If you surf to http://2much.ch you can enter with FF/IE and surf inside the site.
But if you use safari, you can enter only once; you can't surf inside the site. I found that Safari doesn't set the entered cookie, but FF/IE does.
What is wrong here?
I am curious if anyone have used UnderC, Cint, and Ch (or any other C++ interpreter) and could share their experience.
Thanks everyone for your valuable input.
/Allan
I am trying per instructions here:
http://www.innovation.ch/java/HTTPClient/advanced_info.html
However, if I am using HTTP Builder, the following lines
System.setProperty("HTTPClient.cookies.save","true")
System.setProperty("HTTPClient.cookies.jar","/home/misha/.httpclient_cookies")
do not seem to create a file:
~/.httpclient_cookies
I will post a solution as always when figure it out.
:)
Misha
Guys in one of excersises (ch.5,e.8) from TC++PL Bjarne asks to do following:
'"Run some tests to see if your compiler really generates equivalent code for iteration using pointers and iteration using indexing. If different degrees of optimization can be requested, see if and how that affects the quality of the generated code"'
Any idea how to eat it and with what?
Thanks in advice.
hi,
could you explain me why the following code doesn't work in Chrome and Safari, but only in Firefox ?
if ($(this).css("color") == "Fuchsia"){
$(this).css("color","#000000");
}
Website: http://www.sanstitre.ch/drupal/portfolio?tid[]=38&view_name=Portfolio&view_display_id=page_1&view_args=&view_path=portfolio&view_base_path=portfolio&view_dom_id=1&pager_element=0
Please scroll vertically to see Fuchsia colors to change
thanks
I have a problem with parseInt it throws the error: unable to parse 'null' as integer. My view flipper is also not working. Hopefully this is an easy enough question.
Here is my activity:
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.InputSource;
import org.xml.sax.XMLReader;
import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.ViewFlipper;
import xml.parser.dataset;
public class XmlParserActivity extends Activity implements OnClickListener {
private final String MY_DEBUG_TAG = "WeatherForcaster";
// private dataset myDataSet;
private LinearLayout layout;
private int temp= 0;
/** Called when the activity is first created. */
//the ViewSwitcher
private Button btn;
private ViewFlipper flip;
// private TextView tv;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
layout=(LinearLayout)findViewById(R.id.linearlayout1);
btn=(Button)findViewById(R.id.btn);
btn.setOnClickListener(this);
flip=(ViewFlipper)findViewById(R.id.flip);
//when a view is displayed
flip.setInAnimation(this,android.R.anim.fade_in);
//when a view disappears
flip.setOutAnimation(this, android.R.anim.fade_out);
// String postcode = null;
// public String getPostcode {
// return postcode;
// }
//URL newUrl = c;
// myweather.setText(c.toString());
/* Create a new TextView to display the parsingresult later. */
TextView tv = new TextView(this);
// run(0);
//WeatherApplicationActivity postcode = new WeatherApplicationActivity();
try {
/* Create a URL we want to load some xml-data from. */
URL url = new URL("http://new.myweather2.com/developer/forecast.ashx?uac=gcV3ynNdoV&output=xml&query=G41");
//String url = new String("http://new.myweather2.com/developer/forecast.ashx?uac=gcV3ynNdoV&output=xml&query="+WeatherApplicationActivity.postcode );
//URL url = new URL(url);
//url.toString( );
//myString(url.toString() + WeatherApplicationActivity.getString(postcode));
// url + WeatherApplicationActivity.getString(postcode);
/* Get a SAXParser from the SAXPArserFactory. */
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser sp = spf.newSAXParser();
/* Get the XMLReader of the SAXParser we created. */
XMLReader xr = sp.getXMLReader();
/* Create a new ContentHandler and apply it to the XML-Reader*/
handler myHandler = new handler();
xr.setContentHandler(myHandler);
/* Parse the xml-data from our URL. */
xr.parse(new InputSource(url.openStream()));
/* Parsing has finished. */
/* Our ExampleHandler now provides the parsed data to us. */
dataset parsedDataSet =
myHandler.getParsedData();
/* Set the result to be displayed in our GUI. */
tv.setText(parsedDataSet.toString());
} catch (Exception e) {
/* Display any Error to the GUI. */
tv.setText("Error: " + e.getMessage());
Log.e(MY_DEBUG_TAG, "WeatherQueryError", e);
}
temp = Integer.parseInt(xml.parser.dataset.getTemp());
if(temp <0){
//layout.setBackgroundColor(Color.BLUE);
//layout.setBackgroundColor(getResources().getColor(R.color.silver));
findViewById(R.id.flip).setBackgroundColor(Color.BLUE);
}
else if(temp > 0 && temp < 9)
{
//layout.setBackgroundColor(Color.GREEN);
//layout.setBackgroundColor(getResources().getColor(R.color.silver));
findViewById(R.id.flip).setBackgroundColor(Color.GREEN);
}
else
{
//layout.setBackgroundColor(Color.YELLOW);
//layout.setBackgroundColor(getResources().getColor(R.color.silver));
findViewById(R.id.flip).setBackgroundColor(Color.YELLOW);
}
/* Display the TextView. */
this.setContentView(tv);
}
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub onClick(View arg0) {
// TODO Auto-generated method stub
flip.showNext();
//specify flipping interval
//flip.setFlipInterval(1000);
//flip.startFlipping();
}
}
this is my dataset:
package xml.parser;
public class dataset {
static String temp = null;
// private int extractedInt = 0;
public static String getTemp() {
return temp;
}
public void setTemp(String temp) {
this.temp = temp;
}
this is my handler:
public void characters(char ch[], int start, int length) {
if(this.in_temp){
String setTemp = new String(ch, start, length);
// myParsedDataSet.setTempUnit(new String(ch, start, length));
// myParsedDataSet.setTemp;
}
the dataset and handler i only pasted the code that involves the temp as i no they r working when i take out the if statement. However even then my viewflipper wont work.
This is my main xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/linearlayout1"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="25dip"
android:text="Flip Example"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="25dip"
android:id="@+id/tv"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="25dip"
android:text="Flip"
android:id="@+id/btn"
android:onClick="ClickHandler"
/>
<ViewFlipper
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/flip">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="25dip"
android:text="Item1a"
/>
</LinearLayout>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="25dip"
android:id="@+id/tv2"
/>
</ViewFlipper>
</LinearLayout>
this is my logcat:
04-01 18:02:24.744: E/AndroidRuntime(7331): FATAL EXCEPTION: main
04-01 18:02:24.744: E/AndroidRuntime(7331): java.lang.RuntimeException: Unable to start activity ComponentInfo{xml.parser/xml.parser.XmlParserActivity}: java.lang.NumberFormatException: unable to parse 'null' as integer
04-01 18:02:24.744: E/AndroidRuntime(7331): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1830)
04-01 18:02:24.744: E/AndroidRuntime(7331): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1851)
04-01 18:02:24.744: E/AndroidRuntime(7331): at android.app.ActivityThread.access$1500(ActivityThread.java:132)
04-01 18:02:24.744: E/AndroidRuntime(7331): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1038)
04-01 18:02:24.744: E/AndroidRuntime(7331): at android.os.Handler.dispatchMessage(Handler.java:99)
04-01 18:02:24.744: E/AndroidRuntime(7331): at android.os.Looper.loop(Looper.java:150)
04-01 18:02:24.744: E/AndroidRuntime(7331): at android.app.ActivityThread.main(ActivityThread.java:4293)
04-01 18:02:24.744: E/AndroidRuntime(7331): at java.lang.reflect.Method.invokeNative(Native Method)
04-01 18:02:24.744: E/AndroidRuntime(7331): at java.lang.reflect.Method.invoke(Method.java:507)
04-01 18:02:24.744: E/AndroidRuntime(7331): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:849)
04-01 18:02:24.744: E/AndroidRuntime(7331): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:607)
04-01 18:02:24.744: E/AndroidRuntime(7331): at dalvik.system.NativeStart.main(Native Method)
04-01 18:02:24.744: E/AndroidRuntime(7331): Caused by: java.lang.NumberFormatException: unable to parse 'null' as integer
04-01 18:02:24.744: E/AndroidRuntime(7331): at java.lang.Integer.parseInt(Integer.java:356)
04-01 18:02:24.744: E/AndroidRuntime(7331): at java.lang.Integer.parseInt(Integer.java:332)
04-01 18:02:24.744: E/AndroidRuntime(7331): at xml.parser.XmlParserActivity.onCreate(XmlParserActivity.java:118)
04-01 18:02:24.744: E/AndroidRuntime(7331): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1072)
04-01 18:02:24.744: E/AndroidRuntime(7331): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1794)
I hope I have given enough information about my problems. I will be extremely grateful if anyone can help me out.
I would like to clip an image with path. In the book Programming with Quartz there is an example on how to draw a circle clipped by a rectangular path (p.37), and there is also a chapter on image masking with existing image as stencil (Ch.10). But I'm still not sure about how to clip an existing image using path. Is there any example or pointer?
I thought that oracle treats both "is" and "as" same for functions and procedures.I tried googling with "pl/sql is vs as" and got the following link which says both are the same.
http://stackoverflow.com/questions/2338408/is-vs-as-keywords-for-pl-sql-oracle-function-or-procedure-creation
But I found http://www.adp-gmbh.ch/ora/plsql/coll/declaration.html#index_by which seems to indicate there is a difference. Could somebody (list/point me to a link) the other contexts where using "is/as" makes a difference?.
Thanks.
Private Sub Command1_Click()
Dim dom As New DOMDocument
Dim http As New XMLHTTP
Dim strRet As String
If Not dom.Load("c:\\CH.xml") Then MsgBox "?????"
http.Open "Post", "http://172.31.132.173/u8eai/import.asp", True '?????ASP
http.send dom.xml '?xml????????
strRet = http.responseText 'strRet:???xml???????
MsgBox strRet
End Sub
The error message, in Chinese:
????
???????????????.
translated by google(To English):
Real-time error
The data needed to complete the operation can not be used also
I have observed that, very infrequently, Internet Explorer (7 or 8, it does not matter) displays our web pages (www.epsitec.ch) a short time without applying the CSS. The layout appears completely broken, with everything displayed sequentially from top to bottom. When the page has finished loading, everything finally gets displayed properly.
Our web pages do not use any fancy scripting, just two javascript inclusions for QuantCast and Google Analytics, done at the end of the page. By the way, we already had the issue before adding the QuantCast script. The CSS gets linked in the <head> section:
<head>
<title>Crésus Comptabilité</title>
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="http://www.epsitec.ch/favicon.ico" />
<link href="../../style.css" rel="stylesheet" type="text/css" />
...
</head>
and then follows static HTML up to the final chunk which includes the JavaScript:
...
<div id="account">
<a class="deselect" href="/account/login">Identifiez-vous</a>
<script type="text/javascript">
_qoptions={qacct:"..."};
</script>
<script type="text/javascript" src="http://edge.quantserve.com/quant.js">
</script>
<noscript>
<img src="..." style="display: none;" border="0" height="1" width="1"/>
</noscript>
</div>
<div id="contact">
<a href="/support/contact">Contactez-nous</a>
</div>
<div id="ending"><!-- --></div>
</div>
<script type="text/javascript">
...
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("...");
pageTracker._initData();
pageTracker._trackPageview();
</script>
</body>
As this is a very short visual glitch, I have no idea what provokes it. Worse, I cannot reproduce it and it appears only on seldom occasions. How can I further investigate the cause of the glitch? Are there any best practices I should be aware of?
hi, I'm using jquery-plugin columnizer
http://www.google.com/search?sourceid=chrome&ie=UTF-8&q=columnizer
for this website: http://donatellabernardi.ch/drupal
It is sometimes very slow to create the columns (you can try changing the browser window size, or selecting a filter.
Sometimes Firefox gives the error message: "Unresponsive Javascript script" and I have to press on continue to continue the navigation.
thanks
everyone!
I process video from IP cameras and have wrote a motion detection algorithm based on decompressed video analysis. But i really something more fast. I've found several papers about compressed domain analysis but have failed to find any implementations.
Can anyone recommend me some code?
found materials:
http://www.ist-live.org/intranet/school-of-informatics-university-of-bradford001-7/41410206.pdf/view
http://doc.rero.ch/lm.php?url=1000,43,4,20061128120121-NA/Bracamonte_Javier_-_A_Low_Complexity_Change_Detection_Algorithm_20061128.pdf
hi,
could you explain me why the following code doesn't work in Chrome and Safari, but only in Firefox ?
if ($(this).css("color") == "Fuchsia"){ $(this).css("color","#000000"); }
This is the link:
http://www.sanstitre.ch/drupal/portfolio?tid[0]=38
If you scroll down and up you'll see "Eternal Tour" becoming purple and black again, because it is not anymore selected. (with FIrefox)
With Chrome and Safari it remains black.
For example, I have a struct which is something like this:
struct Test
{
int i;
float f;
char ch[10];
};
And I have an object of this struct such as:
Test obj;
Now, I want to programmatically get the field names and type of obj. Is it possible?
This is C++ BTW.
I run the code coverage target:
<junit fork="yes" dir="${basedir}" failureProperty="test.failed">
<!--
Note the classpath order: instrumented classes are before the
original (uninstrumented) classes. This is important.
-->
<classpath path="${instrumented.dir}" />
<classpath path="${classes.dir}" />
<classpath refid="classpath" />
<!--
The instrumented classes reference classes used by the
Cobertura runtime, so Cobertura and its dependencies
must be on your classpath.
-->
<classpath refid="cobertura.classpath" />
<formatter type="xml" />
<!--<test name="${testcase}" todir="${reports.xml.dir}" if="testcase" />-->
<batchtest fork="yes" todir="${reports.xml.dir}">
<fileset dir="${classes.dir}">
<include name="**/generated/AllTests.class" />
</fileset>
</batchtest>
</junit>
<junitreport todir="${reports.xml.dir}">
<fileset dir="${reports.xml.dir}">
<include name="TEST-*.xml" />
</fileset>
<report format="frames" todir="${reports.html.dir}" />
</junitreport>
Then I get the following output ( when using fork="true"):
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at net.sourceforge.cobertura.util.FileLocker.lock(FileLocker.java:124)
at net.sourceforge.cobertura.coveragedata.ProjectData.saveGlobalProjectData(ProjectData.java:331)
at net.sourceforge.cobertura.coveragedata.SaveTimer.run(SaveTimer.java:31)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.io.IOException: No locks available
at sun.nio.ch.FileChannelImpl.lock0(Native Method)
at sun.nio.ch.FileChannelImpl.lock(FileChannelImpl.java:784)
at java.nio.channels.FileChannel.lock(FileChannel.java:865)
... 8 more
---------------------------------------
Unable to get lock on /vobs/rnc/rrt/roam2/roamSs/RoamMao_swb/RoamMao_bldu/ant_build/cobertura.ser.lock: null
This is known to happen on Linux kernel 2.6.20.
Make sure cobertura.jar is in the root classpath of the jvm
process running the instrumented code. If the instrumented code
is running in a web server, this means cobertura.jar should be in
the web server's lib directory.
Don't put multiple copies of cobertura.jar in different WEB-INF/lib directories.
Only one classloader should load cobertura. It should be the root classloader.
I am using Ant 1.7.0 and cobertura 1.9.2.
Any ideas why there is no coverage? Test run ok as I see in my target.
I have tried to switch java versions ( 1.5.0_06 and 1.6.0_10) but no difference.
Why MySQl don't wont to store unicode character ??? Yes, it is rare hieroglyph, you wouldn't see it in the browser.
UTF16 is U+2B5EE
Warning: #1366 Incorrect string value: '\xF0\xAB\x97\xAE' for column 'ch' at row 1
Is it possible to store this character in MySQL?
I was going to use the scuttle solution on: http://www.pui.ch/phred/archives/2005/04/tags-database-schemas.html for handling searches on my website. I was wondering how I could take the search input from a user and turn it into a single query.
For instance, let's say a user inputted 'blue dogs' in their search query... How could I dynamically update the query to include ('blue', 'dogs') in union and intersection queries?
When using ria service for SL app, I can issue following async call to get a group of entity list.
LoadOperation<Person> ch =
this.AMSContext.Load(this.AMSContext.GetPersonQuery().Where(a => a.PersonID == this.performer.PersonID));
But I want to get some calculation, for example, sum(Commission), sum(Salary), the result is not entity, just a scalar value. How can I do this?
hi,
I'm using Drupal for a website, and I've a link "Unselect All" to deselect all items.
How can I remove the dotted line around "Unselect All" when I click on it ?????
This is the link: http://www.sanstitre.ch/drupal/
thanks
hi,
How can I hide the small dots nearby each picture in IE7 ?
http://www.sanstitre.ch/drupal/portfolio?tid[0]=38
I've tried wiht text-decoration:none and list-style-type:none but it didn't work
thanks
I followed the tutorial
http://www.neoos.ch/news/46-development/54-uikeyboardtypenumberpad-and-the-missing-return-key
to dismiss the number pad,
this tutorial add the button as sub view to the number pad,
my problem is, in the same view i am using the text field to enter text also,so, how to differentiate the number field, and text field. so that i can hide the button view accordingly.
thanks in advance.
I'm developing a command line client (Java SE6) that now needs to talk to a Glassfish 2.1 server.
The code for setting up this connection is
try {
final InitialContext context = new InitialContext();
final String ejbName = GeneratorCancelledRemote.class.getName();
generatorCancelled = (GeneratorCancelledRemote) context.lookup(ejbName);
}
catch (Throwable t) {
System.err.println("--> Could not call server:");
t.printStackTrace(System.err);
runWithOutEJB = true;
}
I'm now testing it without a running server and the client (when run from Eclipse 4.2) just bombs with
31.10.2012 10:40:09 com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl
WARNUNG: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: localhost; port: 3700"
org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No
at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2783)
at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2804)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.(SocketOrChannelConnectionImpl.java:261)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.(SocketOrChannelConnectionImpl.java:274)
at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:130)
at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:192)
at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:184)
at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:328)
at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:134)
at com.sun.enterprise.naming.SerialContext.getCachedProvider(SerialContext.java:259)
at com.sun.enterprise.naming.SerialContext.getRemoteProvider(SerialContext.java:204)
at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:159)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:409)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at com.werkii.latex.generator.Generator.main(Generator.java:344)
Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused: connect
at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:347)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.(SocketOrChannelConnectionImpl.java:244)
... 14 more
Caused by: java.net.ConnectException: Connection refused: connect
at sun.nio.ch.Net.connect(Native Method)
at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:532)
at com.sun.corba.ee.impl.orbutil.ORBUtility.openSocketChannel(ORBUtility.java:105)
at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:332)
... 15 more
It's o.k. for now (while I'm still in development) that it bombs, but it does this repeatedly and the catch clause is never reached (even though I'm catching Throwable) - the message is not printed.
So how can I handle connection errors during lookup in my program?