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?
I want to create asp.net 4.0 dynamic pages loaded from my MS SQL server. Basically, its a list of locations with informations. For example:
Location1 would have the page www.site.com/location/location1.aspx
Location44 would have the page www.site.com/location/location44.aspx
I dont even know where to start with this, url writting maybe?
:)
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 :)
I use the python rsvg bindings to render an svg image into cairo and save to file, which mostly works. But if the svg file contains a linked image, like so:
<image href="static/usrimgs/tmpDtIKpx.png" x="10" y="10" width="600px" height="400px"></image>
the image doesn't show up in the final file (the rest of the svg renders just fine). The relative path is correct based on where the script is running, but I'm guessing there's some problem with the fact that it would normally be a relative URL, not a relative filepath. How do I get around this?
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 :)
I have the same query in a stored procedure that needs to be executed on different servers and databases according to parameters.
How can I arrange this without exec or sp_executesql?
I'm using SQL Server 2008.
Thank you.
UPDATE
I've found some links
http://www.eggheadcafe.com/software/aspnet/29397800/dynamically-specify-serve.aspx
http://www.sommarskog.se/dynamic_sql.html
Is using SYNONYM possible solution? If yes, than how?
UPDATE 2
I forgot to mention that all this servers are linked to the server where stored procedure is stored.
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)
I have an AUDIO class. This audio has a SOUND_A subclass and a SOUND_B subclass. This is all done correctly and is working fine.
I have another model, lets call it PLAYLIST_JOIN, and this can contain (in the real world) SOUND_A's and SOUND_B's, so we give it a relationship of AUDIO and PLAYLIST.
This all works in the app.
The problem I am having now is querying the PLAYLIST_JOIN table with an NSPredicate. What I want to do is find an exact PLAYLIST_JOIN item by giving it 2 keys in the predicate
sound_a._sound_a_id = %@ && playlist.playlist_id = %@
and
sound_b.sound_b_id = %@ && playlist.playlist_id = %@
The main problem is that because the table does not store sound_a and sound_b, but stored audio, I cannot use this syntax. I do not have the option of reorganizing the sound_a and sound_b to use the same _id attribute name, so how do I do this?
Can I pass a method to the predicate? something like this:
[audio getID] = %@ && playlist_id = %@