I want to have automatic backup of some directories on my pendrive whenever I insert a pendrive to my laptop running Ubuntu 10.04. What whould be the simplest solution for that?
hello.
Is there macro, something like BOOST_AUTO, which would allow to emulate automatic return type deduction of function in C++?
I mean something like trailing-return-type, http://en.wikipedia.org/wiki/C%2B%2B0x#Alternative_function_syntax
thank you
Hi,
I have a template document with a simple macro to insert a file into a document. When i try to load this template file using Application.Addins.Add i am getting an error saying 'Word cannot open this document template'.
wordApplication.AddIns.Add( %template file path%, ref trueObj );
This works fine on some machines.
Also is there any way to make sure that we load the template file as a global Template always.
The DataContractJsonSerializer is not able to serialize Dictionaries properly.
Whereas JavaScriptSerializer serializes Dictionaries as {"abc":"xyz","def":42}
for example,
the DataContractJsonSerializer gives [{"Key":"abc","Value":"xyz"},{"Key":"def","Value":42}] instead.
This is really problematic and I want to know how can I serialize Dictionary objects correctly in my WCF service. I am looking for a solution that would require least amount of effort.
ref: http://msdn.microsoft.com/en-us/library/bb412170.aspx
I found email composer sample code from iphone OS Ref Library. Here is a code-
Code:
NSArray *toRecipients = [NSArray arrayWithObject:@"[email protected]"];
NSArray *ccRecipients = [NSArray arrayWithObjects:@"[email protected]", @"[email protected]", nil];
NSArray *bccRecipients = [NSArray arrayWithObject:@"[email protected]"];
My question is how to take user's input? Here all email address are predefined in code. so what are the IDs of to, CC, Bcc, subject and body fields?
What is the most effective and compatible automatic Python obfuscator? What are your experiences with using each?
And before anyone asks why I am obfuscating -- I am doing it simply because I can. Thanks.
whenever i run the unit testing application to find whether appdelegate is there r not using the test suit
-(void)testAppDelegate
{
id app_delegate=[[UIApplication sharedApplication]delegate];
STAssertNotNil(app_delegate,@"delegate not found");
}
i got this error. Please help.
"_OBJC_CLASS_$_UIApplication", referenced from:
objc-class-ref-to-UIApplication in Tests.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
Is it possible to override methids for db.Model in Google App Engine?
I want to declare beforeSave, afterSave methods, etc.. to create automatic tagging system.
I know there are hooks, but it seems to me a wrong way to solve this issue :)
Thanks!
Be gentle, as my macrofoo is weak.
What I'd like to do is something like this:
(defmacro foo [x] (dosync (alter x# conj x)))
(defmacro bar [] (let [x# (ref [])] (foo 3)))
Is this possible? I can't just (let [x ..] ..) because of symbol capturing.
NOTE: I'm aware this example is trivial and not macro-worthy, but it's the simplest example I could come up with.
I'm using ASp.Net MVC and EF 4.3.1.
Using POCO t4 template I'm able to create the POCO classes for my model but not validation.
At the moment I'm using Partial Classes with MetaData for adding the annotation (leaving intact the POCO auto generated).
My question: Could you point me out a tutorial, or show me an example of code or a link to a T4 template the also include automatic VALIDATION for my POCO?
THanks
i want to grap data from this site using RegExp
http://www.islamqa.com/en/ref/20494
specially data in div with class="subject-container"
i tried this
/<div class="subject-container">(.*?)<\/div>\s*/is
but it gave me Invalid RegExp
why?
Hi,
I am having trouble getting indentation to work in Vim. I am coding in C++.
I use vim.nox on ubuntu 9.10
I have filetype plugin indent on
I also tried set cident , set autoindent, set smartindent etc.
Automatic indentation does not seem to work.
I have a c script that I want to compile to a fastcgi script. Does anyone have a good ref or easy explanation on how to do this? I dont understand the docs...
I'd like to set the tick box options within the LAN settings of the Internet Options:
I'd prefer the code in a script or C#, but C/C++ would be fine as well. Please answer with the code/script to at least untick the "Use automatic configuration script" option.
THANKS!
I an using Spring 3.1 + Hibernate 4.x in my web application.
In my DAO, i am saving User type object as following
sessionFactory.getCurrentSession().save(user);
But getting following exception:
org.hibernate.HibernateException: save is not valid without active transaction
I googled and found similar question on SO, with following solution:
Session session=getSessionFactory().getCurrentSession();
Transaction trans=session.beginTransaction();
session.save(entity);
trans.commit();
That solves the problem. But in that solution, there is lot of mess of beginning and committing the transactions manually.
Can't i use sessionFactory.getCurrentSession().save(user); directly without begin/commit of transactions manually?
I try to use @Transactional on my service/dao methods too, but the problem persists.
EDIT : Here is my Hibernate Config File:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.1.xsd">
<!-- enable the configuration of transactional behavior based on annotations -->
<tx:annotation-driven transaction-manager="txManager"/>
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource"
p:driverClassName="${db.driverClassName}" p:url="${db.url}"
p:username="${db.username}" p:password="${db.password}" />
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="packagesToScan" value="com.myapp.entities" />
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
</bean>
<!--Transaction Manager Added -->
<bean id="txManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
</beans>
Please help.
I would like to switch my application to LARGEADDRESSAWARE. One of issues to watch for is pointer arithmetic, as pointer difference can no longer be represented as signed 32b.
Is there some way how to find automatically all instances of pointer subtraction in a large C++ project?
If not, is there some "least effort" manual or semi-automatic method how to achieve this?
Sql server 2005 (even 2008) strips the insignificant whitespaces by default. To keep one can use the CONVERT funtction with the last argument as '1' (Ref. Article). How can we do the same thing in Entity Framework?
thanks
I know that if you define a width in a table's column, you can get automatic word-wrapping.
However, I need to control where newlines should happen in a specific table cell.
Thus, how can I insert manual line breaks in a LaTeX table cell?
according to my code when my device are use in Landscape
when i pushViewController it will
automatic show in UIDeviceOrientationPortrait.
i need to rotate my device to Portrait and then rotate to Landscape,
then it will present in Landscape mode.
how can i rotate to current of Orientation with out use of private API(setOrientation)?
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (interfaceOrientation == UIDeviceOrientationPortrait) ||
(interfaceOrientation == UIInterfaceOrientationLandscapeRight));
}
mysql> EXPLAIN SELECT * FROM urls ORDER BY RAND() LIMIT 1;
+----+-------------+-------+------+---------------+------+---------+------+-------+---------------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------+------+---------------+------+---------+------+-------+---------------------------------+
| 1 | SIMPLE | urls | ALL | NULL | NULL | NULL | NULL | 62228 | Using temporary; Using filesort |
+----+-------------+-------+------+---------------+------+---------+------+-------+---------------------------------+
The above doesn't qualify as efficient,how should I do it properly?
Hi,
I love my Mac. But I have always found that my DNS lookups are as slow, even while flushing caches and I travel over know roads on the Internet. I was wondering if someone would know something a bit more automatic/intelligent than /etc/hosts and less complex and iron forged as BIND.
Thank you for your feedback and answers!
Most mature C++ projects seem to have an own reflection and attribute system, i.e for defining attributes which can be accessed by string and are automatically serializable. At least many C++ projects I participated in seemed to reinvent the wheel.
Do you know any good open source libraries for C++ which support reflection and attribute containers, specifically:
Defining RTTI and attributes via macros
Accessing RTTI and attributes via code
Automatic serialisation of attributes
Listening to attribute modifications (e.g. OnValueChanged)
I have some PHP creating automatic Twitter updates, which in the small print at the bottom reads "[date/n minutes ago] via API".
Is it possible to somehow change the "via API" part to something more useful and descriptive?
In ActionScript 3.0, is there an automatic way to calculate the number of days, hours, minutes and seconds between two specified dates?
Basicly, what I need is the ActionScript equivalent of the .NET Timespan class.
Any idea?