<form action="/?wpmlmethod=offsite&list=2&wpmlformid=" method="post">
...
</form>
I tried:
<script type="text/javascript">document.forms[0].submit();</scrpit>
But it didn't work.
i'm trying to add a contextual action mode to a listview, but i'm having some problems with the selection, if i make aList1.setSelection(position) it doesn't select anything, and if i make List1.setItemChecked(position, true) it works but it only changes the font color a little and i want it to change the background or something more notable, is there any way to detect the selection and manually and change the background, or i'm missing something?
the list:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ListView
android:id="@+id/list1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:choiceMode="singleChoice"
android:drawSelectorOnTop="false">
</ListView>
</RelativeLayout>
the adapter:
public class ServicesRowAdapter extends ArrayAdapter<String[]> {
private final Activity context;
private final ArrayList<String[]> names;
static class ViewHolder {
public TextView Id;
public TextView Date;
public RelativeLayout statusbar,bglayout;
}
public ServicesRowAdapter(Activity context, ArrayList<String[]> names) {
super(context, R.layout.servicesrowlayout, names);
this.context = context;
this.names = names;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View rowView = convertView;
if (rowView == null) {
LayoutInflater inflater = context.getLayoutInflater();
rowView = inflater.inflate(R.layout.servicesrowlayout, null);
ViewHolder viewHolder = new ViewHolder();
viewHolder.Id = (TextView) rowView.findViewById(R.id.idlabel);
viewHolder.Date = (TextView) rowView.findViewById(R.id.datelabel);
rowView.setTag(viewHolder);
}
ViewHolder holder = (ViewHolder) rowView.getTag();
holder.Date.setText(names.get(position)[2]);
holder.Id.setText(names.get(position)[1]);
return rowView;
}
}
with the use of a layout:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/idlabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:gravity="right"
android:text="@+id/idlabel"
android:textSize="20dp"
android:width="70dp" >
</TextView>
<TextView
android:id="@+id/datelabel"
android:layout_centerVertical="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@+id/datelabel"
android:textSize="20dp"
android:layout_marginLeft="90dp" >
</TextView>
</RelativeLayout
This question is not about what is a cross-thread operation, and how to avoid it, but why internal mechanics of .NET framework does not allow a cross-thread operation.
I can`t understand why a SerialPort DataReceived event cannot update a simple text box on my form and why using delegates this is possible?
I'm trying to set the background of a webview to a drawable image resource in Android.
From the sdk it seems something like this would work but it doesn't.
WebView web = (WebView) findViewById(R.id.webView);
web.setBackgroundResource(R.drawable.backgroundmain);
web.loadData(profile, "text/html", "UTF-8");
Any idea's?
Hi All,
in my js I have a var in which i have stored innerHTML.
the var is having value something like
<h2>headline<h2>
<div>....</div>
...........
Now I want to retrieve value of h2 tag..what I am doing is
$(myvar).find("h2").text()
but its not working...what should be the exact syntax.
Thanks.
When you select text in an article on nytimes.com this little ? pops up at the end your selection:
What's the best way to implement something like this on my site? Are there any pre-rolled libraries for doing this?
I need to store authentication information and I rather not have the password in plain text:
<property name="user" value="theUser"/>
<property name="password" value="secret"/>
Has anyone figured out a way to encrypt property values in Nant?
I've looked in Nant and Nantcontrib docs but no mention of encryption. I am considering going the route of creating my own Nant Task.
Any suggestions?
I need to create a use case (using Selenium) in which I send HTTP calls with a Cookie through the browser and capture the return value in a text file.
What do I need to do this, I have run this using CURL in the command line, but we are encountering issues with the same, and hence wish to verify using a real UI browser.
I'm working on a website that has a lot of transparency involved, and I thought I would try to build it entirely in RGBA and then do fallbacks for IE. I need a "facebox" style border effect, where the outer border is rounded and is less opaque than the background of the box it surrounds.
The last example from http://24ways.org/2009/working-with-rgba-colour seems to suggest that it's possible, but I can't seem to get it to work. When I try the following:
<!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" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>RGBA Test</title>
<style type='text/css'>
body {
background: #000;
color: #fff;
}
#container {
width: 700px;
margin: 0 auto;
background: rgba(255, 255, 255, 0.2);
border: 10px solid rgba(255, 255, 255, 0.1);
padding: 20px;
}
</style>
</head>
<body>
<div id='container'>
This should look like a facebox.
</div>
</body></html>
It seems like the background "extends" underneath the border of the element, which causes the pixel values to get added together. Thus, when both the background and the border are semi-transparent, the border will ALWAYS be more opaque than the background of the element. This is exactly the opposite of what I am trying to achieve, but it seems like it should be possible based on the examples I've seen.
I should also add that I can't use another element inside the container, because I'm also going to use a border-radius on the container to get rounded corners, and webkit squares the corners of the child elements if they have a background assigned, which would essentially mean a rounded outer border with square contents.
Sorry I can't post an image of this... Apparently I don't have enough rep to post an image.
Hello,
I was wondering if anyone ever tried to extract/follow RSS links using
SgmlLinkExtractor/CrawlSpider. I can't get it to work...
I am using the following rule:
rules = (
Rule(SgmlLinkExtractor(tags=('link',), attrs=False),
follow=True,
callback='parse_article'),
)
(having in mind that rss links are located in the link tag).
I am not sure how to tell SgmlLinkExtractor to extract the text() of
the link and not to search the attributes ...
Any help is welcome,
Thanks in advance
I want to put a dynamically generated icon (not static image) + possibly a tiny bit of text in OSX menu bar.
If possible I'd prefer to do it from Ruby or some other convenient scripting language, but I'll deal with Objective C if that's the only way.
How do I do that?
I created several simple ggplot2 plots and saved them to PDF files using the following commands:
p <- ggplot(plotobject, aes(x=Pos, y=Pval),res=300)
ggsave(plot=p,height=6,width=6,dpi=200, filename="~/example.pdf")
If I now open this example.pdf in Adobe Illustrator I get the following error:
The font AdobePiStd is missing. Affected text will be displayed using
a substitute font.
Is there a way in ggplot2 to specify a font (I presume this is for the dots/points) that Adobe will understand or otherwise is there a way to get this font working in Adobe?
How do I get my .NET Winforms app 2.0 to automatically update it's publish revision integer subsequent to issuing the publish command from within VS08.
Trying to use the following C# as a guide
object[] attrs =
System.Reflection.Assembly.GetEntryAssembly().GetCustomAttributes(true);
foreach (object o in attrs)
if (o.GetType() == typeof(System.Reflection.AssemblyFileVersionAttribute))
label1.Text = ((System.Reflection.AssemblyFileVersionAttribute) o).Version;
Hi people, i was wondering if you know any tutorial or if you have any experience in doing an ebook reader.
Is it posible to read a pdf file and extract its pages for using them, or if i have to directly convert the pages to png and use them.
Also if it is posible to use the pdf data, can i somehow access the text within? Like for example for doing a word search?
Thanks!
I am using DotNetOpenAuth OpenIdLogin control, how do I customize the style of the text? there is a "CSSClass" attribute, is there a sample css stylesheet that I can use?
I'm using MigraDoc to create a pdf document.
I have business entities similar to the those used in MigraDoc.
public class Page{
public List<PageContent> Content { get; set; }
}
public abstract class PageContent {
public int Width { get; set; }
public int Height { get; set; }
public Margin Margin { get; set; }
}
public class Paragraph : PageContent{
public string Text { get; set; }
}
public class Table : PageContent{
public int Rows { get; set; }
public int Columns { get; set; }
//.... more
}
In my business logic, there are rendering classes for each type
public interface IPdfRenderer<T>
{
T Render(MigraDoc.DocumentObjectModel.Section s);
}
class ParagraphRenderer
: IPdfRenderer<MigraDoc.DocumentObjectModel.Paragraph>
{
BusinessEntities.PDF.Paragraph paragraph;
public ParagraphRenderer(BusinessEntities.PDF.Paragraph p)
{
paragraph = p;
}
public MigraDoc.DocumentObjectModel.Paragraph Render(MigraDoc.DocumentObjectModel.Section s)
{
var paragraph = s.AddParagraph(); // add text from paragraph etc
return paragraph;
}
}
public class TableRenderer : IPdfRenderer<MigraDoc.DocumentObjectModel.Tables.Table>
{
BusinessEntities.PDF.Table table;
public TableRenderer(BusinessEntities.PDF.Table t)
{
table =t;
}
public MigraDoc.DocumentObjectModel.Tables.Table Render(Section obj)
{
var table = obj.AddTable();
//fill table based on table
}
}
I want to create a PDF page as :
var document = new Document();
var section = document.AddSection();// section is a page in pdf
var page = GetPage(1); // get a page from business classes
foreach (var content in page.Content)
{
//var renderer = createRenderer(content); //
// get Renderer based on Business type ??
// renderer.Render(section)
}
For createRenderer() i can use switch case/dictionary and return type.
How can i get/create the renderer generically based on type ?
How can I use factory or abstract factory here?
Or which design pattern better suits this problem?
Hi. I'm working on a 64-bit Linux system, trying to build some code that depends on third-party libraries for which I have binaries. During linking, I get a stream of undefined reference errors for one of the libraries, indicating that the linker couldn't resolve references to standard C++ functions/classes, e.g.:
librxio.a(EphReader.o): In function `gpstk::EphReader::read_fic_data(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
EphReader.cpp:(.text+0x27c): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long)'
EphReader.cpp:(.text+0x4e8): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long)'
I'm not really a C++ programmer, but this looks to me like it can't find the standard library. Doing some more research, I got the following when I looked at librxio's dependency for the standard library:
$ ldd librxio.so.16.0
./librxio.so.16.0: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by ./librxio.so.16.0)
libm.so.6 => /lib64/libm.so.6 (0x00002aaaaad45000)
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00002aaaaafc8000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00002aaaab2c8000)
libc.so.6 => /lib64/libc.so.6 (0x00002aaaab4d7000)
/lib64/ld-linux-x86-64.so.2 (0x0000555555554000)
So I read that as saying that librxio (one of the third-party libraries) requires at least v3.4.9 of the standard library. But the version I have installed is 4.1.2:
$ rpm -qa | grep libstdc
compat-libstdc++-33-3.2.3-61.x86_64
libstdc++-devel-4.1.2-14.el5.i386
libstdc++-devel-4.1.2-14.el5.x86_64
libstdc++-4.1.2-14.el5.x86_64
libstdc++-4.1.2-14.el5.i386
Shouldn't this work? The shared object major number is 6, same as for v3.4.9. At this level, shouldn't this be backward compatible? It seems like the third-party library is looking for an earlier version of the standard library than what I have installed; but isn't there backward compatibility between versions with the same major number for the shared library? Again, I'm not really a C++ programmer; but I don't see what the problem is.
Any advice greatly appreciated. Thanks.
Hi,
I want to send the following JSON text {"Email":"[email protected]","Password":"123456"} to a web service and read the response. I know to how to read JSON. The problem is that the above jason object must be sent in a variable name jason. How can i do this from android? Like creating a request object setting content headers etc.
I have a SQL CLR dll I want to deploy, but have found you can embed the byte stream/varbinary_literal/ varbinary_expression/assembly bits into a text file to get around the messy hassle of packaging a DLL and making sure it's accessible for the CREATE ASSEMBLY command.
But what I have yet to find is how to get that byte stream/varbinary_literal/ varbinary_expression/assembly bits value. I haven't found any consistent terminology, and what I keep finding in using Load().
Help?
Hi!
I need to use NCurses, with Perl. I found some very short bits of text about it but no example at all.
Is there anyone aware of any existing guide online?
Thanks!
I'm just learning ROR and I came across the if / else statements. I also came across 'elseif' but my text editor (textmate) doesn't pick it up as a keyword, not does the program run properly.
if name == 'Chris'
puts 'What a lovely name.'
elseif name == 'Katy'
puts 'What a lovely name!'
end
I'm using the book, Learn to Program, which was written several years ago. I was wondering if the 'elseif' was changed because when I simply use 'else' it seems to function properly
Hi,
for example:
#!/usr/bin/python
print "This is python."
print "<script type="text/javascript">
var pass_to_python = new Number(7)
</script>"
the_number = pass_to_python???
How do i get the pass_to_python in python?
Thanks.
Hi,
I want to have a check box, like the standard one (first the check box and on the right its title) but I want it to be aligned from the right. If I change the alignment to the right then only the text will move to the right but the button itself will still be at the left..
How would I achieve this without knowing the bounds of the NSButton?
Thanks in advance.