How does a T9 dictionary work? What is the data structure behind it. If we type '4663' we get 'good' when we press down button we get 'gone' then 'home' etc...
Hello,
I'm a newbie whitebelt with WCF.
I have a namespace: http://schemas.datacontract.org/2004/07/System/ArgumentException.
I'm looking to take that string and convert it into a CLR type so that I end up with typeof(ArgumentException).
Is this possible? :)
Thank you,
MichaelD
I'm trying to learn Silverlight here, creating a custom control template, however VS2010 refuses to recognize the ControlTemplate type, even though I have referenced the System.Windows assembly (which is by default when basing the project on the standard Silverlight Application template). I'm trying to recreate this seen on another SO stack.
I have a Custom Post Type and I am going to customize it to show a list of some products with images. I have all text fields working fine but I need also an image to be attached to each item. How can I do this?
Why on earth won't this compile? Scala 2.8.0RC3:
Java
public interface X {
void logClick(long ts, int cId, String s, double c);
}
Scala
class Y extends X {
def logClick(ts: Long, cId: Int,sid: java.lang.String,c: Double) : Unit = {
...
}
}
Error
class Y needs to be abstract, since method logClick in trait X of type
(ts: Long,cId: Int,s: java.lang.String,c: Double)Unit is not defined
I am trying to execute following query through PgAdmin utility.
CREATE TABLE svcr."EventLogs" ("eventId" BIGINT NOT NULL,
"eventTime" TIMESTAMP WITH TIME ZONE NOT NULL, "userid" CITEXT,
"realmid" CITEXT NOT NULL, "onUserid" CITEXT, "description" TEXT,
CONSTRAINT eventlogs_pkey PRIMARY KEY ("eventId"));
And I get following error -
ERROR: type "citext" does not exist
SQL state: 42704
Character: 120
However, following query runs fine -
CREATE TABLE svcr."CategoryMap" ("category" INT NOT NULL,
"userData" INT NOT NULL);
What is wrong with the first query?
I just came across the following web site and noticed they had 2 map types I'm not certain on how to activitate from the Google Maps JavaScript API.
http://www.maps-for-free.com/index.html
It's the "Relief" and "OSM" Map Type as found on the link above.
Any ideas what the API call is to display "Relief" and "OSM" from a Google Map?
I am using JUnit 4 to test Dao Access with Spring (annotations) and JPA (hibernate). The datasource is configured through JNDI(Weblogic) with an ORacle(Backend). This persistence is configured with just the name and a RESOURCE_LOCAL transaction-type
The application context file contains notations for annotations, JPA config, transactions, and default package and configuration for annotation detection.
I am using Junit4 like so:
ApplicationContext
<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="persistenceUnitName" value="workRequest"/>
<property name="dataSource" ref="dataSource" />
<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="databasePlatform" value="${database.target}"/>
<property name="showSql" value="${database.showSql}" />
<property name="generateDdl" value="${database.generateDdl}" />
</bean>
</property>
</bean>
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>workRequest</value>
</property>
<property name="jndiEnvironment">
<props>
<prop key="java.naming.factory.initial">weblogic.jndi.WLInitialContextFactory</prop>
<prop key="java.naming.provider.url">t3://localhost:7001</prop>
</props>
</property>
</bean>
<bean id="txManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>
<bean class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor"/>
<bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />
JUnit TestCase
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:applicationContext.xml" })
public class AssignmentDaoTest {
private AssignmentDao assignmentDao;
@Test
public void readAll() {
assertNotNull("assignmentDao cannot be null", assignmentDao);
List assignments = assignmentDao.findAll();
assertNotNull("There are no assignments yet", assignments);
}
}
regardless of what changes I make I get:
No unique bean of type [javax.persistence.EntityManager] is defined
Any hint on what this could be. I am running the tests inside eclipse.
I lack understanding of some basic MVC concepts, despite all my searching.
I created an MVC project in Visual Studio, which contains the partial view _LogOnPartial.shtml. I just want to access information within the view pertaining to the user, to put in a user dropdown menu. When I try to put this at the top of the partial view cshtml page I get the above error:
@model MyProject_MVC.Models.UserRepository
When I try this I also get an error:
@Html.Partial("_LogOnPartial", MyProject_MVC.Models.UserRepository)
'MyProject_MVC.Models.UserRepository' is a 'type', which is not valid in the given context
I am not able to find an answer to this. Does anybody know this? I want to enable the download of .bak file and for that I need to know the mime type so that i configure the same in the IIS for .bak file.
Any help is appreciated.
Can someone point me at what I should be doing under scala 2.10 in place of this deprecated type witness on Manifest?
reflect.ClassManifest.singleType(foo) <:< barManifest
Honestly, my goal here is just to replace it with something that doesn't raise a deprecation warning. I'm happy to use the new reflection API.
Here's the code in question in context, if that's important:
https://github.com/azavea/geotrellis/blob/master/src/main/scala/geotrellis/feature/op/geometry/geometry.scala#L45
I have used a prototype plugin which filters the contents of a dropdown as you type. So for example if you typed 'cat' into the text box, only items containing the substring 'cat' would be left as options in the drop down.
Does anyone know of a jquery plugin which can do this?
There are situations that we like to ignore a specific exception type (commonly ObjectDisposedException). It can be achieved with those two methods:
try
{
// code that throws error here:
}
catch (SpecificException) { /*ignore this*/ }
catch (Exception ex)
{
// Handle exception, write to log...
}
or
try
{
// code that throws error here:
}
catch (Exception ex)
{
if (ex is SpecificException) { /*ignore this*/ }
else
{
// Handle exception, write to log...
}
}
What are the pros and cons of this two methods (regarding performance, readability, etc.)?
i am reading a csv file and i want to store this in datastore, but i am getting string from file for datetime field.
i want to type cast it to datetime
also same for date and time separately
error::BadValueError: Property HB_Create_Ship_Date must be a datetime
Hi, does anyone know of an API or where I could get hold of data/script to create a <select> drop down lists for occupation and job type?
Regards,
Phil
FileMerge.app fails with an odd message:
This file type cannot be merged.
when I try to save successfully merged text files, which definitely can be merged.
(I invoke FileMerge from git using opendiff tool on OS X 10.6.3)
Why is it happening? How can I avoid this problem?
class Message {};
class BuildSandCastle : public Message {};
class DigHole : public Message {};
Given an arbitrary Message* object, how can I call a function of the same name doMessage() without resorting to switch logic or making a MessageHandler class that has one 'do' function for every message name?
what data type shld i use for data that can be very short, eg. html link (think twitter), or very long eg. html blog post (think wordpress)
i am thinking if i use varchar(4000), it maybe too short for a html formated blog entry? but if i use text, it will take up more space and is less efficient?
Hi bit of a silly question.
Are there any png transparency issues with backgrounds to submit buttons or inputs of type image? Or do they behave fine just like img tags with a png image as the source.
I understand for IE6 you need a hack for png transparency to work.
I have tried to embed the icalendar code in a email to be sent via indy with a content type text/calendar but it just hangs on the encoding of the email when I add as an attachment it just arrives as an attachment and does not prompt as other calendar request do. Has any one got example code of how to do calendar requests via indy?
i have a file of this format:
3.334 1
2.345 1
1.453 1
3.343 1
and so on
but in middle at times in file there are few number which are not in float format and i receive type msg when i run them performation some operation..
I want to give a condition that:
if(not in float format):
continue
else:
perform operation
please tell me how to put the condtion
I have a ViewModel that, among other properties, contains an array of 'EmailAddress' objects. EmailAddress itself has properties such as "Address", and "IsPrimary". My view model breakdown is:
public class UserDetailsViewModel {
public BUser User { get; set; }
public string[] Roles { get; set; }
public EmailAddress[] EmailAddresses { get; set; }
}
I am showing a "User Details" page that is pretty standard. For example, I'm displaying data using @Html.DisplayFor(model => model.User.UserName) and @Html.DisplayFor(model => model.User.Comment) I also have a section on the page that lists all of the EmailAddress objects associated with the user:
@if(Model.EmailAddresses.Length > 0) {
foreach (var address in Model.EmailAddresses) {
<div>
@Html.DisplayFor(model => address.Address)
</div>
}
} else {
<div class="center">User does not have any email addresses.</div>
}
My problem is that I would like to show an "Add Email Address" form above the list of email addresses. I thought I would take the "normal" approach thusly:
@using(Html.BeginForm(new { id=Model.User.UserName, action="AddUserEmailAddress" })) {
<text>Address:</text> @Html.EditorFor(model => ** HERE I AM STUCK **)
<input type="submit" value="Add Email" class="button" />
}
As you may be able to tell, I am stuck here. I've tried model => Model.EmailAddresses[0] and model => Model.EmailAddresses.FirstOrDefault(). Both of these have failed horribly.
I am sure that I am going about this all wrong. I've even thought of adding a "dummy" property to my ViewModel of type EmailAddress just so that I can bind to that in my EditorFor - but that seems to be a really bad hack. There has to be something simple that I'm overlooking!
I would appreciate any help anyone can offer with this matter. Thank you in advance!
I write code below but it gives warning.. I identified dbdesc as a NSString but nothing changes.. How will I handle with this type of warnings?
**[self.searchDetailViewController setText:appDelegate.dbdesc];**
warning:'searchDetailViewController' may not respond to 'setText:'
(Messages without a message method signatures will be assumed to return (id) and accept '...'as arguments )