i have my table sorted by date - long format with time and everything. i want to format timeStamp to dd,mm,yyyy and send use it as titleforheaderinsection method...how and where do i do this?
What I'm trying to do: I have a page that consists of pairs of two sentences each. The pairs are separated by a whole line break. My problem is that when I have an odd number of pairs, the second sentence will automatically be placed on the next column.
How can I use LaTeX to make block structures that multicol does not ignore, to keep the two sentences together? If there's better code to solve this problem, or a better column implementation (though I don't believe I can use \twocolumn in the document declaration), please post it.
My current code:
\documentclass{article}
\usepackage{fullpage}
\usepackage{multicol}
\setlength{\parindent}{0pt}
\setlength{\parskip}{\baselineskip}
\newcommand{\pair}[2]{
\emph{#1}\\*
#2
}
\begin{document}
\begin{multicols}{2}
\pair{Sentence 1.}{Sentence 2.}
\pair{Sentence 2 (pair 2).}{Sentence 2 (pair 2).}
\pair{The last pair, first sentence.}{Last sentence.}
\end{multicols}
\end{document}
This generates: http://img541.imageshack.us/img541/3444/columns.png . The second pair is what I am trying to avoid.
:)
i have a DAL class file in my project, that my teacher sent me and explained to me but i did not really understand it. It has number of functions, and I understand only few of them, like with connecting to the database or creating a command object but there are 2 that I dont understand:
public static DataTable GetTable(string str)
{
OleDbConnection con = DAL.GetConnection();
OleDbCommand cmd = DAL.GetCommand(con, str);
DataTable dt = new DataTable();
OleDbDataAdapter adp = new OleDbDataAdapter();
adp.SelectCommand = cmd;
adp.Fill(dt);
return dt;
}
public static int ExecuteNonQuery(string str)
{
int num = -1;
OleDbConnection con = DAL.GetConnection();
con.Open();
if (con.State == ConnectionState.Open)
{
OleDbCommand cmd = DAL.GetCommand(con, str);
num = cmd.ExecuteNonQuery();
con.Close();
}
return num;
}
thank you :)
Consider the following imperative code which finds the largest palindrome among products of 3-digit numbers (yes, it's the one of the first tasks from "Project of [outstanding mathematician of 18th century]" site):
curmax = 0
for i in range(999,100):
for j in range(999,100):
if ((i*j) < curmax): break
if (pal(i*j)):
curmax = i*j
break
print curmax
As I'm learning Haskell currently, my question is, how do you translate this (and basically any imperative construct that contains something more complex than just plain iteration, e.g. breaks, continues, temporary variables and all this) to Haskell?
My version is
maxpal i curmax
| i < 100 = curmax
| otherwise = maxpal (i-1) (innerloop 999)
where
innerloop j
| (j < 100) || (p < curmax) = curmax
| pal p = p
| otherwise = innerloop (j-1)
where p = i*j
main = print $ maxpal 999 0
but this looks like we're still in imperative uglytown.
So what could you advise, what are the approaches of dealing with such cases FP-style?
Though I don't tolerate joomla for it's buggy 3rd party components , decided to look at it's core architecture, and any diagram would make my investigation efficient, thanks
What advantage is there to implementing the four delegate methods:
(void)controllerWillChangeContent:(NSFetchedResultsController *)controller
(void)controller:(NSFetchedResultsController *)controller didChangeSection:(id )sectionInfo atIndex:(NSUInteger)sectionIndex forChangeType:(NSFetchedResultsChangeType)type
(void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject atIndexPath:(NSIndexPath *)indexPath forChangeType:(NSFetchedResultsChangeType)type newIndexPath:(NSIndexPath *)newIndexPath
(void)controllerDidChangeContent:(NSFetchedResultsController *)controller
rather than implement:
(void)controllerDidChangeContent:(NSFetchedResultsController *)controller
Any help appreciated // :)
Where can I find a list of common medical drugs? Researching and typing 150+ drug names would be quite inefficient.
In general, are there any sites which have a list of items for developers to use in applications? For example, you can download dictionaries in specific formats (e.g. XML) for use in word games.
Hi,
Is it possible to set multiple properties of an NSManagedObject and have the NSFetchedResultsController call controllerDidChangeContent: only once?
In other words, is it possible to say something like:
[managedObject beginChanges];
[managedObject setPropertyA:@"Foo"];
[managedObject setPropertyB:@"Bar"];
[managedObject commitChanges];
and then have the NSFetchedResultsController call controllerDidChangeContent: (and the other methods) only one time?
Thanks!
I bought an IcyBox NAS a little while back, and it recently died on me. I have physical access to the disks inside (1.5TB RAID 1 array), and the box was running a version of Linux. I now have the difficulty of retrieving the data from the disks. All I have available are 2 Windows machines, one of which has sufficient free space to hold the data from the NAS. What would be the quickest and easiest way to retrieve the data from the disks?
Primarily this seems to be a technique used by games, where they have all the sounds in one file, textures in another etc. With these files commonly reaching the GB size.
What is the reason behind doing this over maintaining it all in subdirectories as small files - one per texture which many small games use this, with the monolithic system being favoured by larger companies?
Is there some file system overhead with lots of small files?
Are they trying to protect their property - although most just seem to be a compressed file with a new extension?
Hi everyone,
I have an entity which has relationships with other entities. Let say we have: user-menu-meal
My problem is that some of the users don't have a menu. So when I try to check: user.menu.meal == rice I get an error (path not found...)!
Thank you for your help!
this morning we had a big trouble with our iphone app. We had to even take it off the store.
The thing is that we made real small changes to our xcdatamodel. We thought that the update process is automatically taking care about exchanging it the right way until we found out something like CoreData migration exists.
We are using the UIManagedDocument to connect to the persistent store.
How is it possible to exchange this file with the new one? While we were developing we just uninstalled the whole app from the device and then installed it again and everything worked. How can we simulate this process in the app store with updates?
UPDATE
I try to set the migration option like this
_database = [[UIIManagedDocument alloc] init];
NSMutableDictionary *options = [[NSMutableDictionary alloc] init];
[options setObject:[NSNumber numberWithBool:YES] forKey:NSMigratePersistentStoresAutomaticallyOption],
_database.persistentStoreOptions = options;
but the app is still crashing with
** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'This
NSPersistentStoreCoordinator has no persistent stores. It cannot
perform a save operation.'
With the large amount of BCL types such as Dictionary, HashTable, List, all the IEnumerable types; I was curious to know what were some of the more advanced structures you've had to implement and for what algorithm/application.
Hello.
I want to modify MetaData. For example, let's work with Details.aspx page.
There have code:
protected void Page_Init(object sender, EventArgs e)
{
table = DynamicDataRouteHandler.GetRequestMetaTable(Context);
FormView1.SetMetaTable(table);
DetailsDataSource.EntityTypeName = table.EntityType.AssemblyQualifiedName;
}
Now, how to force to modify table.
Hi there,
I need to match a series of user inputed words against a large dictionary of words (to ensure the entered value exists).
So if the user entered:
"orange" it should match an entry "orange' in the dictionary.
Now the catch is that the user can also enter a wildcard or series of wildcard characters like say
"or__ge" which would also match "orange"
The key requirements are:
* this should be as fast as possible.
* use the smallest amount of memory to achieve it.
If the size of the word list was small I could use a string containing all the words and use regular expressions.
however given that the word list could contain potentially hundreds of thousands of enteries I'm assuming this wouldn't work.
So is some sort of 'tree' be the way to go for this...?
Any thoughts or suggestions on this would be totally appreciated!
Thanks in advance,
Matt
SEVERE: Local Exception Stack:
Exception [EclipseLink-7092] (Eclipse Persistence Services - 2.0.0.v20091127-r5931): org.eclipse.persistence.exceptions.ValidationException
Exception Description: Cannot add a query whose types conflict with an existing query. Query To Be Added: [ReadAllQuery(name="Voter.findAll" referenceClass=Voter jpql="SELECT v FROM Voter v")] is named: [Voter.findAll] with arguments [[]].The existing conflicting query: [ReadAllQuery(name="Voter.findAll" referenceClass=Voter jpql="SELECT v FROM Voter v")] is named: [Voter.findAll] with arguments: [[]].
I have some nested datastructures, each something like:
[ ('foo', [ {'a':1, 'b':2},
{'a':3.3, 'b':7} ]),
('bar', [ {'a':4, 'd':'efg', 'e':False} ]) ]
I need to compare these structures, to see if there are any differences. Short of writing a function to explicitly walk the structure, is there an existing library or method of doing this kind of recursive comparison?
Hi everybody,
I have tried for some time to work out a way of sorting nested categories with jQuery. I failed to build my own plugin to do this, so I tried to find something that were available already. Tried a few hours now with this one, http://www.jordivila.net/code/js/jquery/ui-widgetTreeList_inheritance/widgetTreeListSample.aspx and cant get it to work.
What are the alternatives of creating a jQuery / jQuery UI script that handles sorting children and parent categories in a way that can be combined with a AJAX PHP backend to handle the actual sorting in the database?
Thanks!
I have an application that uses CoreData and I'm trying to figure out the best way to implement tagging and filtering by tag. For my purposes, if I was doing this in raw SQLite I would only need three tables, tags, item_tags and of course my items table. Then filtering would be as simple as joining between the three tables where only items are related to the given tags. Quite straightforward.
But, is there a way to do this in CoreData and utilizing NSFetchedResultsController? It doesn't seem that NSPredicate give you the ability to filter through joins. NSPredicate's aren't full SQL anyway so I'm probably barking up the wrong tree there. I'm trying to avoid reimplementing my app using SQLite without CoreData since I'm enjoying the performance CoreData gives me in other areas. Yes, I did consider (and built a test implementation) diving into the raw SQLite that CoreData generates, but that's not future proof and I want to avoid that, too.
Has anyone else tried to tackle tagging/filtering with CoreData in a UITableView with NSFetchedResultsController
Hi everyone,
Let say I have an entity user which has a one to many relationship with the entity menu which has a one to many relationship with the entity meal which has a many to one relationship with the entity recipe which has a one to many relationship with the entity element.
What I would like to do is to select the elements which belong to a particular user (username = myUsername) and particular menu*s* (minDate < menu.date < maxDate).
Does anyone have an idea how to get them?
Thanks
I have a DataTemplate that contains an Expander with a border in the header. I want the header border to have round corners when collapsed and straight bottom corners when expanded. What would best practice be for achieving this (bonus points for code samples as I am new to XAML)?
This is the template that holds the expander:
<DataTemplate x:Key="A">
<StackPanel>
<Expander Name="ProjectExpander" Header="{Binding .}" HeaderTemplate="{StaticResource B}" >
<StackPanel>
<Border CornerRadius="0,0,2,2">
This is the expander datatemplate:
<DataTemplate x:Key="B">
<Border x:Name="ProjectExpanderHeader"
CornerRadius="{Binding local:ItemUserControl.ProjectHeaderBorderRadius, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ContentPresenter}}}"
Background="{StaticResource ItemGradient}"
HorizontalAlignment="{Binding HorizontalAlignment,
RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ContentPresenter}},
Mode=OneWayToSource}">
<local:ItemContentsUserControl Height="30"/>
</Border>
</DataTemplate>
Hi everyone,
I would like to use entity objects but not store them... I read that I could create them like this:
myElement = (Element *)[NSEntityDescription insertNewObjectForEntityForName:@"Element" inManagedObjectContext:managedObjectContext];
And right after that remove them:
[managedObjectContext deleteObject:myElement];
then I can use my elements:
myElement.property1 = @"Hello";
This works pretty well even though I think this is probably not the most optimal way to do it...
Then I try to use it in my UITableView... the problem is that the object get released after the initialization. My table becomes empty when I move it!
Thanks
edit: I've also tried to copy the element ([myElement copy]) but I get an error...
hi i have a weird problem and here we go:
i am redirecting using this command :
return RedirectToAction("ViewMessage", "Account", new {id = model.MessageId});
but in ViewMessage action when i try to get id, its null ?!?!?!?!??
string strMessageId = RouteData.Values["id"] as string;
i have done this code in lots of places and it works fine but i dont know what is going on here.... :(
i know i can use TempData but i dont want to :)
Okay, I want to have an app that takes phone numbers from an online database and displays them in a table view. When the user is not online, I want them to still be able to see the numbers they already got from the database in the table view. If the user manages to go back online, the database updates the view. My question is, is this possible to do and if so, what's the best way to approach it? (bit of a newbie, please help me out)