In my last question i asked how to best send a string from one view controller to another, both which were on a navigation stack:
http://stackoverflow.com/questions/2898860/pass-string-from-tableviewcontroller-to-viewcontroller-in-navigation-stack
However I just realised I can either pass the path to the file in the app's document's folder as the first (the table view) has already accessed the data in the file should I pass viewcontroller the data to the pushed VC?
Hi,
I have a sharepoint List.We will get the data from TEAMCENTER from there we will enter manually into the List.
Inorder to automatically update the sharepoint List with Teamcenter data is there any way????
Hi
What are the possible ways of representing data in memory in .Net (or in general)?
It would be great if data could be sorted and looked up by key (or multiple keys).
We are thinking to use collections, arrays, list of collections/arrays. One object would be in several collections (one sorted asc, other desc, etc.).
Maybe this is not a good idea, and we would like to hear some other possible solutions.
Thank you
I would like to change the formatting on my BASH prompt from this:
[email protected]:~/some/very/annoying/long/path$
to something like this:
[email protected]:~/some/very/annoying/long/path
$
The idea is that I would be able to type a reasonably long command on one line without it wrapping to the next line so quickly.
I have a server running an older version of Ubuntu and with /var stored on a separate partition on a separate hard drive. I am attempting to update Ubuntu to 10.04, but I still want to store /var on a separate partition and hard drive. However, I don't want to format the drive which currently contains /var, as it has important data.
Is there some way to have 10.04 set up the new /var on this separate drive at installation, without formatting the drive and losing the old /var?
I have a problem on conditional formatting with date and time.
I hava a cell A1 that has date and time and I want to conditionally format its adjecent cell if the value of cell A1 is greater than 3 days compared to today, then cell A2 should show as "Follow-up Required" and cell colour should turn red no. if cell value of A1 is less than 3 days compared to today, no action is required.
Please help.
Regards,
Kiran
i need functionality of this tool in Autohotkey keyboard shortcut. If i would select all code and press AHK key combination then code should be set like this tool does. single line/ multiline.
Need to AHK script for both multiline and single line
http://www.newmediacampaigns.com/files/posts/css-formatting/clean.php
while formatting and reinstalling windowsxp, normally when the drivers are being installed it restarts on its own, but this time instead of restart it shutdown. Can anyone please let me know what the actual problem is ???
While attempting to transfer data from Salesforce using Apex Data Loader to Oracle Keep getting the following error:
26937 [databaseAccountExtract] FATAL com.salesforce.dataloader.dao.database.Data
baseContext - Error getting value for SQL parameter: nkey__c. Please make sure
that the value exists in the configuration file or is passed in. Database conf
iguration: insertAccount.
The database-conf.xml has the following beans:
<bean id="insertAccount"
class="com.salesforce.dataloader.dao.database.DatabaseConfig"
singleton="true">
<property name="sqlConfig" ref="insertAccountSql"/>
<property name="dataSource" ref="dbDataSource"/>
</bean>
<bean id="insertAccountSql" class="com.salesforce.dataloader.dao.database.SqlConfig" singleton="true">
<property name="sqlString">
<value>
INSERT INTO VANTROPO.SF_ACCOUNTCHANNEL (nkey__c)
VALUES (@nkey__c@)
</value>
</property>
<property name="sqlParams">
<map>
<entry key="nkey__c" value="java.lang.String"/>
</map>
</property>
</bean>
The SDL (mapping file) has the following values:
# Account Insert Mapping values for query from Salesforce (left) and insert/update to Oracle (right)
# SalesforceFieldName=OracleFieldName
nkey__c=NKEY__C
Any help appreciated.
I am trying to use the ASP.NET Dynamic Data Filtering project, but I'm running into a problem during the configuration.
I'm following the instructions on the author's blog, and everything works like described. Then it tells me to change the datasource using the designer view. I am told to select the "GridDataSource" in the "Configure data source" wizard. This option is not there though.
I get all of the classes in my project, including the DataContext that was generated by Linq. When I choose "Show only DataContext objects", the dropdown ("Choose your context object:") is completely empty.
When I turn of the checkbox and choose my DataContext class, I get asked which table I want and all that. But, as the whole purpose of a Dynamic Data site is NOT to use one single table, that's not much help.
So I've looked at the instructions again and copied the resulting datasource from the example:
<asp:DynamicLinqDataSource ID="GridDataSource" runat="server"
EnableDelete="True" EnableUpdate="True"></asp:DynamicLinqDataSource>
Which is exactly what I had, without the "WhereParameters" nodes in there.
Now, when I run the list page however, I get an exception about a missing datasource from the filtering component. Of course when I remove the DynamicFilterRepeater, it works again.
This is the meat of the exception:
[InvalidOperationException: Missing DataSource]
Catalyst.Web.DynamicData.DynamicFilterRepeater.GetTable() in D:\Catalyst\Projects\DynamicData\Project\Trunk\DynamicData\DynamicData\DynamicFilterRepeater.cs:74
Catalyst.Web.DynamicData.DynamicFilterRepeater.GetFilters() in D:\Catalyst\Projects\DynamicData\Project\Trunk\DynamicData\DynamicData\DynamicFilterRepeater.cs:81
Catalyst.Web.DynamicData.DynamicFilterRepeater.OnInit(EventArgs e) in D:\Catalyst\Projects\DynamicData\Project\Trunk\DynamicData\DynamicData\DynamicFilterRepeater.cs:106
How do I make the DynamicFilterRepeater recognize my datasource?
I'm using VS2010 Pro, on a Win7 machine.
Hello,
I'm searching info about configuring own MetaData in asp.NET Dynamic Site.
For example. I have a table in MS Sql Server with structure shown below:
CREATE TABLE [dbo].[someTable](
[id] [int] NOT NULL,
[pname] [nvarchar](20) NULL,
[FullName] [nvarchar](50) NULL,
[age] [int] NULL)
and I there are 2 Ms Sql tables (I've created), sysTables and sysColumns.
sysTables:
ID sysTableName TableName TableDescription
1 | someTable |Persons |All Data about Persons in system
sysColumns:
ID TableName sysColumnName ColumnName ColumnDesc ColumnType MUnit
1 |someTable | sometable_pname| Name | Persona Name(ex. John)| nvarchar(20) | null
2 |someTable | sometable_Fullname| Full Name | Persona Name(ex. John Black)| nvarchar(50) | null
3 |someTable | sometable_age| age | Person age| int | null
I want that, in Details/Edit/Insert/List/ListDetails pages use as MetaData sysColumns and sysTableData. Because, for ex. in DetailsPage fullName, it is not beatiful as Full Name .
someIdea, is it possible?
thanks
Updated::
In List Page to display data from sysTables (metaData table) I've modified <h2 class="DDSubHeader"><%= tableName%></h2>.
public string tableName;
protected void Page_Init(object sender, EventArgs e)
{
table = DynamicDataRouteHandler.GetRequestMetaTable(Context);
//added by me
uqsikDataContext sd=new uqsikDataContext();
tableName = sd.sysTables.Where(n => n.sysTableName == table.DisplayName).FirstOrDefault().TableName;
//end
GridView1.SetMetaTable(table, table.GetColumnValuesFromRoute(Context));
GridDataSource.EntityTypeName = table.EntityType.AssemblyQualifiedName;
if (table.EntityType != table.RootEntityType)
{
GridQueryExtender.Expressions.Add(new OfTypeExpression(table.EntityType));
}
}
so, what about sysColums? How can I get Data from my sysColumns table?
Hi,
I'd like to implement a REST api to an existing ASP.NET MVC website. I've managed to set up WCF Data services so that I can browse my data, but now the question is how to handle authentication.
Right now the data service is secured via the site's built in forms authentication, and that's ok when accessing the service from AJAX forms. However, It's not ideal for a RESTful api.
What I would like as an alternative to forms authentication is for the users to simply embed the user name and password into the url to the web service or as request parameters.
For example, if my web service is usually accessible as
http://localhost:1234/api.svc
I'd like to be able to access it using the url
http://localhost:1234/api.svc/{login}/{password}
So, my questions are as follows:
Is this a sane approach?
If yes, how can I implement this? It seems trivial redirecting GET requests so that the login and password are attached as GET parameters. I also know how to inspect the http context and use those parameters to filter the results. But I am not sure if / how the same approach could be applied to POST, PUT and DELETE requests.
Thanks,
Adrian
Hi there. This question comes from a previous one I asked about handling NSData objects: http://stackoverflow.com/questions/2453785/converting-nsdata-to-an-nsstring-representation-is-failing.
I have reached the point where I am taking an NSImage, turning it into NSData and uploading those data bytes to the LDAP server. I am doing this like so;
//connected successfully to LDAP server above...
struct berval photo_berval;
struct berval *jpegPhoto_values[2];
photo_berval.bv_len = [photo length];
photo_berval.bv_val = [photo bytes];
jpegPhoto_values[0] = &photo_berval;
jpegPhoto_values[1] = NULL;
mod.mod_type = "jpegPhoto";
mod.mod_op = LDAP_MOD_REPLACE|LDAP_MOD_BVALUES;
mod.mod_bvalues = jpegPhoto_values;
mods[0] = &mod;
mods[1] = NULL;
//perform the modify operation
rc = ldap_modify_ext_s(ld, givenModifyEntry, mods, NULL, NULL);
That happens with no errors, and you can see a big blob of data when you're in the command line.
My problem is, when I go to access the same data at a later stage, I am getting an image file back that's about 120 times smaller than the original image.
//find the jpegPhoto attribute
photoA = ldap_first_attribute(ld, photoE, &photoBer);
while (strcasecmp(photoA, "jpegphoto") != 0)
{
photoA = ldap_next_attribute(ld, photoE, photoBer);
}
//get the value of the attribute
if ((list_of_photos = ldap_get_values_len(ld, photoE, photoA)) != NULL)
{
//get the first JPEG
photo_data = *list_of_photos[0];
selectedPictureData = [NSData dataWithBytes:&photo_data length:sizeof(photo_data)];
[selectedPictureData writeToFile:@"/Users/username/Desktop/Photo 2.jpg" atomically:YES];
NSLog (@"%@", selectedPictureData);
Has anyone successfully done this before or can anyone see what I might be doing wrong? I appreciate anyone's help. Sorry to post so many questions!
Ricky.
I have a report to be exported in excel, pdf and word using jasper reports. I use xml file as the DataSource for the report, but when the data increases jasper report exports empty file in only for PDF format, when i reduce the data content it export the data available correctly. is there any limitation to pdf size? , how can we manage the size in jasper reports from java?
My jrxml is really big, so i cannot add it here, i have added my java code which i use to export the content:-
JRAbstractExporter exporter = null;
if (format.equals("pdf")) {
exporter = new JRPdfExporter(); jasperPrint.setPageWidth(Integer.parseInt( pWidth ));
} else if (format.equals("xls")) {
exporter = new JRXlsExporter();
} else if (format.equals("doc")) { jasperPrint.setPageWidth(Integer.parseInt( pWidth ));
}
exporter.setParameter(JRExporterParameter.JASPER_PRINT,
jasperPrint);
exporter.setParameter(JRExporterParameter.OUTPUT_STREAM,
outputStream_);
exporter.exportReport();
contents = outputStream_.toByteArray();
response.setContentType("application/"+format);
response.addHeader("Content-disposition",
"attachment;filename=" + name.toString() + "."+format);
Question
Is it a good rule of thumb for database IDs to be "meaningless?" Conversely, are there significant benefits from having IDs structured in a way where they can be recognized at a glance? What are the pros and cons?
Background
I just had a debate with my coworkers about the consistency of the IDs in our database. We have a data-driven application that leverages spring so that we rarely ever have to change code. That means, if there's a problem, a data change is usually the solution.
My argument was that by making IDs consistent and readable, we save ourselves significant time and headaches, long term. Once the IDs are set, they don't have to change often and if done right, future changes won't be difficult. My coworkers position was that IDs should never matter. Encoding information into the ID violates DB design policies and keeping them orderly requires extra work that, "we don't have time for." I can't find anything online to support either position. So I'm turning to all the gurus here at SA!
Example
Imagine this simplified list of database records representing food in a grocery store, the first set represents data that has meaning encoded in the IDs, while the second does not:
ID's with meaning:
Type
1 Fruit
2 Veggie
Product
101 Apple
102 Banana
103 Orange
201 Lettuce
202 Onion
203 Carrot
Location
41 Aisle four top shelf
42 Aisle four bottom shelf
51 Aisle five top shelf
52 Aisle five bottom shelf
ProductLocation
10141 Apple on aisle four top shelf
10241 Banana on aisle four top shelf
//just by reading the ids, it's easy to recongnize that these are both Fruit on Aisle 4
ID's without meaning:
Type
1 Fruit
2 Veggie
Product
1 Apple
2 Banana
3 Orange
4 Lettuce
5 Onion
6 Carrot
Location
1 Aisle four top shelf
2 Aisle four bottom shelf
3 Aisle five top shelf
4 Aisle five bottom shelf
ProductLocation
1 Apple on aisle four top shelf
2 Banana on aisle four top shelf
//given the IDs, it's harder to see that these are both fruit on aisle 4
Summary
What are the pros and cons of keeping IDs readable and consistent? Which approach do you generally prefer and why? Is there an accepted industry best-practice?
I'd like to implement a ADO.NET/WCF DataService and I am wondering what's the best way to setup a project in VS2008 SP1 for this purpose.
Currently I have an ASP.NET web application project (not of "WebSite" project type). The data access layer is an Entity model (EF version 1) with SQL Server database. I have the Entity Model in a separate DLL project and the web application project references to this assembly for all data accesses.
The ADO.NET/WCF DataService needs to communicate with the Entity model/database as well. It has to be hosted on the same web server (IIS 7.5) together with the web application.
Since the DataService is not directly related to that specific web application (though it will provide and modify data from/in the same database the web application uses as well) my basic idea was to separate the DataService in its own new project (which also references the Entity Model DLL).
Now I have seen that there is no project type "ADO.NET/WCF DataService" in VS2008 SP1. It seems only possible to add a DataService as an element to other existing projects, for instance Web Application projects.
Why isn't there a separate DataService project type? Does this mean now that I have to add the DataService as an element to my Web Application project? Or shall I create a new Web Application project and add a DataService to it? (I could delete the pregenerated default.aspx since I do not need any web pages in this project.) What's the best way?
Thank you for suggestions in advance!
Hi:
I struggle with Core Data on the iPhone about the following:
I have a 1-to-many relationship in Core Data. Assume the entities are called recipe and category. A category can have many recipes.
I accomplished to get all recipes listed in a UITableView with section headers named after the category.
What i want to achieve is to list all categories as section header, even those which have no recipe:
category1 <--- this one should be displayed too
category2
recipe_x
recipe_y
category3
recipe_z
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
NSEntityDescription *entity = [NSEntityDescription entityForName:@"Recipe" inManagedObjectContext:managedObjectContext];
[fetchRequest setEntity:entity];
[fetchRequest setFetchBatchSize:10];
NSSortDescriptor *sortDescriptor1 = [[NSSortDescriptor alloc] initWithKey:@"category.categoryName" ascending:YES];
NSSortDescriptor *sortDescriptor2 = [[NSSortDescriptor alloc] initWithKey:@"recipeName" ascending:YES];
NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptor1,sortDescriptor2, nil];
[fetchRequest setSortDescriptors:sortDescriptors];
NSFetchedResultsController *aFetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:managedObjectContext sectionNameKeyPath:@"category.categoryName" cacheName:@"Recipes"];
What is the most elegant way to achieve this with core data?
I designing the new App now and giving the following question a lot of thought. I consume a lot of data from the warehouse, and the entities have a lot of dictionary based values (currency, country, tax-whatever data) - dimensions. I cannot be assured though that there won't be nulls. So I am thinking:
create an empty value in each of teh dictionaries with special keyID - ie. -1
do the ETL (ssis) do the correct stuff and insert -1 where it needs to
let the DAL know that -1 is special (Static const whatever thing)
don't care in the code to check for nullness of dictionary entries because THEY will always have a value
But maybe I should be thinking:
import data AS IS
let the DAL do the thinking using empty record Pattern
still don't care in the code because business layer will have what it needs from DAL.
I think is more of a approach thing but maybe i am missing something important here... What do You think? Am i clear? Please don't confuse it with empty record problem. I do use emptyCustomer think all the time and other defaults too.
I have set up my data model in xcode like so
EntityA
AttA1
AttA2
EntityB
AttB1
AttB2
AttB3
I then set up the relationships
EntityA
Name: rlpToEntityB
Destination: EntityB
Inverse: rlpToEntityA
To Many: Checked
EntityB
Name: rlpToEntityA
Destination: EntityA
Inverse: rlpToEntityB
To Many: UnChecked
i.e. relationship between the two where Each one of EntityA can have many EntityB's
It is my understanding that if i fetch a subset of EntityB's I can then retrieve the values for the related EntityA's.
I have this working so that i can retrieve the EntityB values using
NSManagedObject *objMO = [fetchedResultsController objectAtIndexPath:indexPath];
strValueFromEntityB = [objMO valueForKey:@"AttB1"];
However, if I try to retrieve a related value from EntityA by doing the following
strValueFromEntityA = [objMO valueForKey:@"AttA1"];
I get the error "The entity EntityB is not Key value coding-compliant for the key Atta1"
Not surprisingly i suppose if i switch things around to fetch from EntityA i cannot access attributes of EntityB So it appears the defined relationshipare being ignored.
Can anyone spot what i am doing wrong?
I confess im very new to iPhone programming and especially to Core Data so please go easy on me and provide verbose explanations or point me in the direction a specific resource. I have downloaded the apple sample apps (Core Data Books, Top Songs and recipes) but I still can't work this out.
Thanks in advance,
Nev.
I am building a school management app where they track student tardiness and absences. I've got three entities to help me in this. A Students entity (first name, last name, ID, etc.); a SystemAbsenceTypes entity with SystemAbsenceTypeID values for Late, Absent-with-Reason, Absent-without-Reason; and a cross-reference table called StudentAbsences (matching the student IDs with the absence-type ID, plus a date, and a Notes field).
What I want to do is query my entities for a given student, and then add up the number of each kind of Absence, for a given date range. I prepare my currentStudent object without a problem, then I do this...
Me.Data.LoadProperty(currentStudent, "StudentAbsences") 'Loads the cross-ref data
lblDaysLate.Text = (From ab In currentStudent.StudentAbsences Where ab.SystemAbsenceTypes.SystemAbsenceTypeID = Common.enuStudentAbsenceTypes.Late).Count.ToString
...and this second line fails, complaining it has no value for an object.
I presume the problem is that while it DOES see that there are (let's say) four absences for the currentStudent (ie, currentStudent.StudentAbsences.Count = 4) -- it can't yet "peer into" each one of the absences to look at its type.
How do I use .Expand or .LoadProperty to make this happen? I tried fiddling with .LoadProperty but it doesn't take a two-level syntax like so...
Data.LoadProperty(currentStudent,"StudentAbsences.SystemAbsenceTypeID") or the like.
Is there some other technique?
I have a Core Data document-based app which support undo/redo via the built-in NSUndoManager associated with the NSManagedObjectContext. I have a few actions set up which perform numerous tasks within Core Data, wrap all these tasks into an undo group via beginUndoGrouping/endUndoGrouping, and are processed by the NSUndoManager.
Undo works fine. I can perform several successive actions, and each then undo each one of them successively and my app's state is maintained correctly. However, the "Redo" menu item is never enabled. This means that the NSUndoManager is telling the menu that there are no items to redo.
I am wondering why the NSUndoManager is seemingly forgetting about items once they are undone, and not allowing redos to occur?
One thing I should mention is that I'm disabling undo registration after a document is opened/created. When I perform an action, I call enableUndoRegistration, beginUndoGrouping, perform the action, then call processPendingChanges, setActionName:, endUndoGrouping, and finally disableUndoRegistration. This makes sure that only specific actions are undoable, and any other data changes I make outside of these go unnoticed to the NSUndoManager. This may be a part of the issue, but if so I'm wondering why it's affecting redo?
Thanks in advance.
Hey Guys,
thanks to your help I succesfully managed all my databases! I am now looking at a panel data set on which I have to regress. Since I only started my Phd this semester together with the econometrics courses I am still new to many statistic applications and regression methods.
I want to do a simple regression as in Y = x1 x2 x3 etc, now I already browsed through some literature and found that for panel data it's common to do a fixed effects regression. Also, my Y variable only has positive values so I was thinking in the direction of a Tobit model?
I'm doing some research concerning the coverage of analysts in the financial business. My independent variable is the coverage of analysts on a certain firm, so per observation i have 1 analyst and 1 firm, together with different characteristics(market cap and betas etc) of the firm. All this data is monthly. As coverage cannot become negative (only 0) I was thinking of a Tobit model?
Do you guys have any ideas what would be a good regression method? Or have some good sources (e books, written books, through university I have access to almost anything concerning my field of work) of information (cause I do have to learn these things for future research)?
Thanks!