Daily Archives

Articles indexed Monday May 31 2010

Page 19/98 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • Provisioning api jpa

    - by user268515
    Hi i tried the following code Appsprovisioning.java public void calluser() throws AppsForYourDomainExceptiion IOException, { for(UserEntry userEntry : retrieveAllUsers().getEntries()) { m[x]= userEntry.getTitle().getPlainText(); x++; } try { for(int i=0;i<x;i++) { String sd=m[i]; stud greeting1 = new stud(sd); em.persist(greeting1); System.out.println("jk"); } } finally { em.close(); } public UserFeed retrieveAllUsers()throws ,ServiceException, IOException{ userService = new UserService("Myapplication"); userService.setUserCredentials("[email protected]","xxxxxxxx"); URL retrieveUrl = new URL("https://www.google.com/a/feeds/montfortperungudi.edu.in/user/2.0/"); UserFeed allUsers = new UserFeed(); UserFeed currentPage; Link nextLink; do { currentPage = userService.getFeed(retrieveUrl, UserFeed.class); allUsers.getEntries().addAll(currentPage.getEntries()); nextLink = currentPage.getLink(Link.Rel.NEXT, Link.Type.ATOM); if (nextLink != null) { retrieveUrl = new URL(nextLink.getHref()); } } while (nextLink != null); return allUsers; } } Servlet.java public class servlet extends HttpServlet { private static final long serialVersionUID = 1L; private static final Logger log = Logger.getLogger(servlet.class.getName()); // EntityManager em=null; AppsProvisioning aa=new AppsProvisioning(); public void doGet(HttpServletRequest req, HttpServletResponse resp)throws IOException { //em = EMFService.get().createEntityManager(); try { aa.calluser(); }catch(Exception e){ System.out.println("SEF "+e);} finally { // em.clear(); // em.close(); } } } Table Creation import javax.persistence.Entity; import javax.persistence.Id; @Entity(name="stud") public class stud { @Id private String fathername; public stud(String fathername) {// TODO Auto-generated constructor stub this.fathername=fathername; } public void setFathername(String fathername) { this.fathername = fathername; } public String getFathername() { return fathername; } } I cant able to store all the users in the table.. Its returning Session out error.

    Read the article

  • Regasm writes mscoree.dll into Registry key InprocServer32

    - by Stiefel
    When I register my .NET Assembly with regasm.exe the registry key HKEY_CLASSES_ROOT\CLSID{111E32AD-4BF8-495F-AB4D-6C61BD463EA4}\InprocServer32 is set to "mscoree.dll". However, I am trying to mimic an existing COM-Server that was written in C. When registering this old COM-server the InprocServer32 is set to the full path to this component. Unfortunately the existing system (a plugin host that I can not change) reads and use this value - an is confused by the "mscoree.dll" value. My solution might be to patch this registry entry manually - but I would like to understand why regasm writes "mscoree.dll" into InprocServer32 .

    Read the article

  • Computer Science + CFA

    - by scatman
    I still have one semester to finish my MS in Computer Science, and I am already working for a software development company. I took some accounting courses as electives (accounting 1-2 and finance) and I found them interesting and easy. Is it worth it to do CFA? I don't want to change majors, i.e. I still want to be a developer, but would it help if I did CFA?

    Read the article

  • I want define tables from a part of my ER Diagram.

    - by M R Jafari
    I have a ER-Diagram (Show in http://www.4freeimagehost.com/show.php?i=f82997ca4d5d.png). In the diagram you see 2 entities and a 1:N relataion together. Project has 2 columns as ProjectID, ProjectName. Employee has 3 colums as EmployeeID, EmployeeName and ProjectID. A project has ONLY 1 project-manager and project-manager is a employee. What columns add them?

    Read the article

  • tag structured Filesystems

    - by A.Rashad
    I hope this is the correct site, I lose my way between the 4 sister sites :) Let me ask the question this way. all file systems I have seen before are hierarchical, that means a root directory, with some branched directories, and so on until we have files residing in these directories. except for AS/400 file structure, where it has a concept of a Library that serve somehow as a directory but one level only. Why not have directory-less filesystems where files are placed in a single location, but the file identifiers would be referenced by a database of tag/ file relation ships. This way there will be no need for symbolic links, one file may have multiple relations to multiple subjects, not only a single parent directory to contain. I hope the idea is clear.

    Read the article

  • Displaying the error message from web service in jquery validation custom method

    - by Mrt
    Hello, I'm adding a custom method to jquery validation that calls a webservice, but the web service returns more then just a boolean. Is it possible to show the error based on return call of the web service. e.g. say I want an email address to be valid & not in use, so my web service checks this an returns 0 - ok, 1 - not valid, 2 - in use. How can I get jquery to show to correct error message based in the response ?

    Read the article

  • Adding more namespace in the code file affects performace ?

    - by Harikrishna
    If we imports more namespace in the code file(cs file) then it affects on perfomance ? Like we should add namespace in the cs file as needed. That is adding more namespace in the cs file affects performance ? Like using System; using System.Data.Sql; using System.Collections.Generic; using System.Data; using System.IO; using System.Linq; using System.Text.RegularExpressions; using System.Windows.Forms; using System.Xml; using System.Data.SqlClient; using System.ComponentModel;

    Read the article

  • problem with my laptop start up

    - by jabsy
    my laptop is starting up and produces the normal screen due to abrupt power failure and when i click to start normally or in safe mode, the blue screen splashes and then disappears and then it tries to reboot again and the same problem takes place. it was running on xp service pack 2. could anyone help

    Read the article

  • Page Display problem in asp.net?

    - by Surya sasidhar
    hi, i developed a web application and it is working fine in local server. when i place the web application (copy paste the file of asp.net) in another local system it is working fine but the design of the page is (layout of the page) not as in the first server what could be the problem please help me.

    Read the article

  • javascript get attribution from select

    - by Yongwei Xing
    Hi all <select id="test"> <option attribut="1">test 1</option> <option attribut="2">test 2</option> <option attribut="3">test 3</option> <option attribut="4">test 4</option> <option attribut="5">test 5</option> </select> I want to get the selected item's attribute, is there any simple way to do it. The native javascript is fine. Best Regards,

    Read the article

  • Reading in a 5000 line text file on the Iphone

    - by howsyourface
    Gday, I am trying to create a tiled map for my game, i have had this previously working using other xml methods but i had memory leaks and all sorts of errors. However i had a map load time of about 2.5 - 3 seconds. So i rewrote all of the code using NSMutableStrings and NSStrings. After my best attempt at optomizing it i had a map load time of 10 - 11 seconds, which is far too slow. So i have now rewritten the code using char* arrays, only to now have a load time of 18 seconds -_-. Here is the latest code, i don't know much c so i could have easily botched the whole thing up. FILE* file = fopen(a, "r"); fseek(file, 0L, SEEK_END); length = ftell(file); fseek(file,0L, SEEK_SET); char fileText[length +1]; char buffer[1024];// = malloc(1024); while(fgets(buffer, 1024, file) != NULL) { strncat(fileText, buffer, strlen(buffer)); } fclose(file); [self parseMapFile:fileText]; - (void)parseMapFile:(char*)tiledXML { currentLayerID = 0; currentTileSetID = 0; tileX = 0; tileY = 0; int tmpGid; NSString* tmpName; int tmpTileWidth; int tmpTileHeight; int tilesetCounter = 0; NSString* tmpLayerName; int tmpLayerHeight; int tmpLayerWidth; int layerCounter = 0; tileX = 0; tileY = 0; int tmpFirstGid = 0; int x; int index; char* r; int counter = 0; while ((x = [self findSubstring:tiledXML substring:"\n"]) != 0) { counter ++; char result[x + 1]; r = &result[0]; [self substringIndex:tiledXML index:x newArray:result]; tiledXML += x+2; index = 0; if (counter == 1) { continue; } else if (counter == 2) { char result1[5]; index = [self getStringBetweenStrings:r substring1:"th=\"" substring2:"\"" newArray:result1]; if (r != 0); mapWidth = atoi(result1); r += index +1; index = 0; index = [self getStringBetweenStrings:r substring1:"ht=\"" substring2:"\"" newArray:result1]; if (r != 0); mapHeight = atoi(result1); r += index +1; index = 0; index = [self getStringBetweenStrings:r substring1:"th=\"" substring2:"\"" newArray:result1]; if (r != 0); tileWidth = atoi(result1); r += index +1; index = 0; index = [self getStringBetweenStrings:r substring1:"ht=\"" substring2:"\"" newArray:result1]; if (r != 0); tileHeight = atoi(result1); continue; } char result2[50]; char result3[3]; if ((index = [self getStringBetweenStrings:r substring1:" gid=\"" substring2:"\"" newArray:result3]) != 0) { tmpGid = atoi(result3); free(result2); if(tmpGid == 0) { [currentLayer addTileAtX:tileX y:tileY tileSetID:-1 tileID:0 globalID:0]; } else { [currentLayer addTileAtX:tileX y:tileY tileSetID:[currentTileSet tileSetID] tileID:tmpGid - [currentTileSet firstGID] globalID:tmpGid]; } tileX ++; if (tileX > [currentLayer layerWidth]-1) { tileY ++; tileX = 0; } } else if ((index = [self getStringBetweenStrings:r substring1:"tgid=\"" substring2:"\"" newArray:result2]) != 0) { tmpFirstGid = atoi(result2); r += index +1; index = 0; index = [self getStringBetweenStrings:r substring1:"me=\"" substring2:"\"" newArray:result2]; if (r != 0); tmpName = [NSString stringWithUTF8String:result2]; r += index +1; index = 0; index = [self getStringBetweenStrings:r substring1:"th=\"" substring2:"\"" newArray:result2]; if (r != 0); tmpTileWidth = atoi(result2); r += index +1; index = 0; index = [self getStringBetweenStrings:r substring1:"ht=\"" substring2:"\"" newArray:result2]; if (r != 0); tmpTileHeight = atoi(result2); } else if ((index = [self getStringBetweenStrings:r substring1:"rce=\"" substring2:"\"" newArray:result2]) != 0) { currentTileSet = [[TileSet alloc] initWithImageNamed:[NSString stringWithUTF8String:result2] name:tmpName tileSetID:tilesetCounter firstGID:tmpFirstGid tileWidth:tmpTileWidth tileHeight:tmpTileHeight spacing:0]; [tileSets addObject:currentTileSet]; [currentTileSet release]; tilesetCounter ++; } else if ((index = [self getStringBetweenStrings:r substring1:"r name=\"" substring2:"\"" newArray:result2]) != 0) { tileX = 0; tileY = 0; tmpLayerName = [NSString stringWithUTF8String:result2]; r += index +1; index = 0; index = [self getStringBetweenStrings:r substring1:"th=\"" substring2:"\"" newArray:result2]; if (r != 0); tmpLayerWidth = atoi(result2); r += index +1; index = 0; index = [self getStringBetweenStrings:r substring1:"ht=\"" substring2:"\"" newArray:result2]; if (r != 0); tmpLayerHeight = atoi(result2); currentLayer = [[Layer alloc] initWithName:tmpLayerName layerID:layerCounter layerWidth:tmpLayerWidth layerHeight:tmpLayerHeight]; [layers addObject:currentLayer]; [currentLayer release]; layerCounter ++; } } } -(void)substringIndex:(char*)c index:(int)x newArray:(char*)result { result[0] = 0; for (int i = 0; i < strlen(c); i++) { result[i] = c[i]; if (i == x) { result[i+1] = '\0'; break; } } } -(int)findSubstring:(char*)c substring:(char*)s { int sCounter = 0; int index = 0; int d; for (int i = 0; i < strlen(c); i ++) { if (i > 500)//max line size break; if (c[i] == s[sCounter]) { d = strlen(s); sCounter ++; if (d > sCounter) { } else { index = i - (d); break; } } else sCounter = 0; } return index; } -(int)getStringBetweenStrings:(char*)c substring1:(char*)s substring2:(char*)s2 newArray:(char*)result { int sCounter = 0; int sCounter2 = 0; int index = 0; int index2 = 0; int d; for (int i = 0; i < strlen(c); i ++) { if (index != 0) { if (c[i] == s2[sCounter2]) { d = strlen(s2); sCounter2 ++; if (d > sCounter2) { } else { index2 = i - (d); break; } } else sCounter2 = 0; } else { if (c[i] == s[sCounter]) { d = strlen(s); sCounter ++; if (d > sCounter) { } else { index = i; } } else sCounter = 0; } } if (index != 0 && index2 != 0) [self substringIndex:(c + index+1) index:index2-index-1 newArray:result]; return index; } (I know it's a lot of code to be putting in here) I thought the by using basic char arrays i could drastically increase the performance, at least over the initial node based code that i was replacing. Thanks for all your efforts.

    Read the article

  • Error appearing in application after updating cakePHP library files from 1.3.0 to 1.3.1

    - by Gaurav Sharma
    Hi everyone, I have just updated my cakephp library to latest version 1.3.1. Before this I was running v1.3.0 with no errors. After running the application I am given this error message. unserialize() [function.unserialize]: Error at offset 0 of 2574 bytes [CORE\cake\libs\cache\file.php, line 176] I updated the libraries simply by replacing the existing cake files with the new ones downloaded from the net. Is it the correct way of updating applications. I did'nt made any customizations to the core library of cakePHP. What is the problem ? Please help. Thanks

    Read the article

  • How Unicode strings can be passed from a managed to an unmanaged function...

    - by Who Cares
    I will really appreciate anybody's help about how a Unicode string can be passed (marshaled) from a managed (Delphi .NET) to an unmanaged (Delphi's Win32 DLL) function. The managed environment (Delphi .NET): ... interface ... const TM_PRO_CONVERTER = 'TM.PROFileConverter.dll'; function ImportLineworksFromPROFile(FileName :String; TargetFileNameDXF :String): Integer; ... implementation ... [DllImport(TM_PRO_CONVERTER, EntryPoint = 'ImportLineworksFromPROFile', CharSet = CharSet.Ansi, SetLastError = True, CallingConvention = CallingConvention.StdCall)] function ImportLineworksFromPROFile(FileName :String; TargetFileNameDXF :String): Integer; external; ... The unmanaged environment (Delphi's Win32 DLL): library TM.PROFileConverter; ... function ImportLineworksFromPROFile(FileName :String; TargetFileNameDXF :String) :Integer; stdcall; exports ImportLineworksFromPROFile; ... Thank you for your time.

    Read the article

  • How do I lock the layout of my android program to one orientation

    - by Mike V
    I'm trying to write a program that needs smooth orientation sensor samples as the phone is rotated all around. Every time the orientation of the phone is changed, it interrupts the data and freezes the program while the layout changes. How can I lock it in one orientation (landscape or portrait, it doesn't matter)? I assume it has something to do with android:layout in the xml file, but I can't find anything online.

    Read the article

  • indexing for faster search of lists in a file??

    - by kaushik
    i have a file having around 1 lakh lists and have a another file with again a list of around an average of 50.. I want to compare 2nd item of list in second file with the 2nd element of 1st file and repeat this for each of the 50 lists in 2nd file and get the result of all the matching element. I have written the code for all this,but this is taking a lot of time as it need to check the whole the 1lakh list some 50 times..i want to improve the speed... please tell me how can i do this.... i cant not post my code as it is part of big code and will be difficult to infer anything from that... please tell what can be done to improve the speed?? thank u,

    Read the article

  • Pidgin to pidgin, what protocol to chose?

    - by Johan
    Hi I and a friend need to start to use some instant messaging and it seem like pidgin is a nice program to use. However it supports quite a lot of different protocols. So my question is witch to choose? Since both parties can use the same program we don't have to use the same protocol as "all the rest", but can focus on what is best to use. As a side note both parties will be using Ubuntu based computers. Thanks Johan

    Read the article

  • Encoding Uncompressed video

    - by Sakamoto Kazuma
    I'd like to encode uncompressed video into compressed avi or mpeg4. Was wondering what program I should look at getting to do such a task. Videos are between 3 and 20 minutes long, and range anywhere from 1.3 to 10 GBs in uncompressed .avi form (fraps).

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >