Search Results

Search found 775 results on 31 pages for 'mr tamer'.

Page 16/31 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • Where is the mistake ?

    - by mr.bio
    Hi ... i am implementing a simple linked list in c++. I have a mistake and i don't see it :( #include <stdexcept> #include <iostream> struct Node { Node(Node *next, int value): next(next), value(value) { } Node *next; int value; }; class List { Node *first; // Erstes Element , 0 falls die Liste leer ist int len; // Laenge der liste Node *nthNode(int index); // Hilfsfunktion : O( index ) public: // Default - Konstruktor ( Laenge 0): O (1) List():first(0),len(0){ } // Copy - Konstruktor : O(other.len) List(const List & other){ }; // Zuweisungs - Operator O(len +other.len) List &operator=(const List &other) { clear(); if(!other.len) return *this; Node *it = first = new Node(0,other.first->value); for (Node *n = other.first->next; n; n = n->next) { it = it->next = new Node(0, n->value); } len = other.len; return *this; } // Destruktor ( gibt den Speicher von allen Nodes frei ): O( len ) ~List(){ }; // Haengt der Liste ein Element hinten an: O( len ) void push_back(int value){ }; // Fuegt am Anfang der Liste ein Element ein : O (1) void push_front(int value){ Node* front = new Node(0,value); if(first){ first = front; front->next = 0; }else{ front->next = first; first = front; } len++; }; // gibt eine Referenz auf das index -te Element zurueck : O( index ) int &at(int index){ int count = 0 ; int ret ; Node *it = first; for (Node *n = first->next; n; n = n->next) { if(count==index) ret = n->value; count++; } return ret ; }; // Entfernt alle Elemente : O(len) void clear(){ }; // Zeigt alle Elemente an: hier : O( len * len ) void show() { std::cout << " List [" << len << " ]:{ "; for (int i = 0; i < len; ++i) { std::cout << at(i) << (i == len - 1 ? '}' : ','); } std::cout << std::endl; } }; /* * */ int main() { List l; // l. push_back(1); // l. push_back(2); l. push_front(7); l. push_front(8); l. push_front(9); l.show(); // List(l). show(); } it works ... but the output is : List [3 ]:{ 0,134520896,9484585}

    Read the article

  • How to extract paragraphs instead of whole texts only for XWPFWordExtractor (POI Library) Java

    - by Mr CooL
    Hello, I know the following code could extract whole texts of the docx document, however, I need to extract paragraph instead. Is there are possible way?? public static String extractText(InputStream in) throws Exception { JOptionPane.showMessageDialog(null, "Start extracting docx"); XWPFDocument doc = new XWPFDocument(in); XWPFWordExtractor ex = new XWPFWordExtractor(doc); String text = ex.getText(); return text; } Any helps would much appreciated. I need this so urgently.

    Read the article

  • NHibernate Oracle stored procedure problem

    - by Mr. Flint
    ------Using VS2008, ASP.Net with C#, Oracle, NHibernate---- I have tested my stored procedure. It's working but not with NHibernate. Here are the codes: Procedure : create or replace procedure ThanaDelete (id number) as begin delete from thana_tbl where thana_code = id; end Mapping File: <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="DataTransfer" namespace="DataTransfer"> <class name="DataTransfer.Models.Thana, DataTransfer" table="THANA_TBL"> <id name="THANA_CODE" column="THANA_CODE" type="Int32" unsaved-value="0"> <generator class="native"> <param name="sequence"> SEQ_TEST </param> </generator> </id> <property name="THANA_NAME" column="THANA_NAME" type="string" not-null="false"/> <property name="DISTRICT_CODE" column="DISTRICT_CODE" type="Int32" not-null="false"/> <property name="USER_ID" column="USER_ID" type="string" not-null="false"/> <property name="TRANSACTION_DATE" column="TRANSACTION_DATE" type="Date" not-null="false"/> <property name="TRANSACTION_TIME" column="TRANSACTION_TIME" type="string" not-null="false"/> <sql-delete>exec THANADELETE ? </sql-delete> </class> </hibernate-mapping> error: Message: could not delete: [DataTransfer.Models.Thana#10][SQL: exec THANADELETE ?] Source: NHibernate Inner Exception System.Data.OracleClient.OracleException Message: ORA-00900: invalid SQL statement

    Read the article

  • Android Status Bar Notifications - Opening the correct activity when selecting a notification

    - by Mr Zorn
    I have been having a problem with a notification not opening/going to the correct activity when it has been clicked. My notification code (located in a class which extends Service): Context context = getApplicationContext(); CharSequence contentTitle = "Notification"; CharSequence contentText = "New Notification"; final Notification notifyDetails = new Notification(R.drawable.icon, "Consider yourself notified", System.currentTimeMillis()); Intent notifyIntent = new Intent(context, MainActivity.class); PendingIntent intent = PendingIntent.getActivity(context, 0, notifyIntent, PendingIntent.FLAG_UPDATE_CURRENT | Notification.FLAG_AUTO_CANCEL); notifyDetails.setLatestEventInfo(context, contentTitle, contentText, intent); ((NotificationManager)getSystemService(NOTIFICATION_SERVICE)).notify(NOTIFICATION_ID, notifyDetails); If I click the notification while the application which created the service is open, the notification disappears (due to the FLAG_AUTO_CANCEL) but the activity does not switch. If I click the notification from the home screen, the notification disappears and my app is brought to the front, however it remains on the activity which was open before going to the home screen, instead of going to the main screen. What am I doing wrong? How do I specify the activity that will be pulled up?

    Read the article

  • Debugging SQL in PGAdmin3 when sql contains variables

    - by Mr Shoubs
    In SQL Server I could copy sql code out of an application and paste it into SSMS, declare & assign vars that exist in the sql and run.. yay great debugging scenario. e.g. (please note I am rust and syntax may be incorrect) declare @x as varchar(10) set @x = 'abc' select * from sometable where somefield = @x I want to do something simular with postgres in pgadmin3 (or another postgres tool, anyy reccomendations?) I realise you can create pgscript, but it doesn't appear to be very good, for example, if I do the equlivent of above, it doesn't put the single quotes around the value in @x, nor does it let me by doubling them up and you don't get a table out after - only text... Currently I have a peice of sql someone has written that has 3 unique varibles in it which are used around 6 times each... So the question is how do other people debug sql this sql EFFICIENTLY, preferably in a simular fashion to my sql server days.

    Read the article

  • IIS6 Metabase Compatiblity not installing correctly for Vista IIS7

    - by Mr Snuffle
    I've been bashing my head against this one for a few days, and haven't had any luck with it. I'm unable to get my VS2010 ASP.NET project to deploy to IIS. I receive the error "Unable to create the virtual directory. To access local IIS Web sites, you must install the following IIS Components IIS 6 Metabase and IIS 6 Configuration Compatibility ASP.NET In addition, you must run Visual Studio in the context of an Administrator Account" I've most certainly installed the metabase option, but it still shows up. I'm also not sure why it's telling me to install ASP.NET. Google is being entirely unhelpful, I was wondering if anyone here has any suggestions. I'm running Vista Ultimate 64Bit

    Read the article

  • Why are there so many Database Management Systems?

    - by mr.bio
    Why are there so many Database management systems? I am not an DB expert and I've never thought about using another Database other than mySQL. Programming languages offer different paradigms, so it makes sense to choose a specific language for your purpose. Question What are the factors in choosing a specific Database management system ?

    Read the article

  • iPhone Twitter Integration: Validating login.

    - by Mr. McPepperNuts
    The following code posts to twitter: NSString *compoundLoginString = [NSString stringWithFormat:@"http://%@:%@@twitter.com/statuses/update.xml",extractedUsername, extractedPassword]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL: [NSURL URLWithString:compoundLoginString] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:20.0]; // The text to post NSString *msg = tweetText; [request setHTTPMethod:@"POST"]; [request setHTTPBody:[[NSString stringWithFormat:@"status=%@", msg] dataUsingEncoding:NSASCIIStringEncoding]]; NSURLResponse *response; NSError *error; if ([NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error] != nil){ [self postSuccessfulAlert]; }else{ [self postNotSuccessfulAlert]; } I am curious as to how I could check if the username and password is correct before proceeding to the above piece of code. I found the following code in a tutorial, but am unsure how I would implement or call this function. - (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge { if ([challenge previousFailureCount] == 0) { NSURLCredential *newCredential; newCredential=[NSURLCredential credentialWithUser:[self username] password:[self password] persistence:NSURLCredentialPersistenceNone]; [[challenge sender] useCredential:newCredential forAuthenticationChallenge:challenge]; } else { [[challenge sender] cancelAuthenticationChallenge:challenge]; // inform the user that the user name and password // in the preferences are incorrect NSLog(@"Invalid Username or Password"); } } Any ideas? Please note, I have taken snippets of code from both of the following tutorials. http://iphonedevelopertips.com/networking/post-to-a-twitter-account-from-the-iphone.html and http://icodeblog.com/2009/07/09/integrating-twitter-into-your-applications/

    Read the article

  • Open PDF file on fly from Java application

    - by Mr CooL
    Is there any way to have a code where it can be used to open PDF file in Java application but do not side to any platform. I mean using batch file in Windows could do that. Can it be any other way to have platform independent code to open PDF on fly.

    Read the article

  • AS2 Play Movie Clip OnMouseUp not working

    - by Mr Vardermier
    My plan is to play mc_1 on MouseDown and mc_2 on MouseUp. The trouble I am having is that when I release, mc_2 is not playing. mc_1 plays fine when MouseDown is initiated. Here's my code: stop(); slide_mc.stop(); slideback_mc.stop(); onMouseDown = function() { _root.slide_mc.play(); } onMouseUp = function() { _root.slideback_mc.play(); } I am new to AS2, I have tried looking but can't seem to find anything like this... Many thanks in advance!

    Read the article

  • Access custom label property at didSelectRowAtIndexPath.

    - by Mr. McPepperNuts
    I have a UILabel for each cell at cellForRowAtIndexPath. UILabel *cellLabel = [[UILabel alloc] initWithFrame:frame]; cellLabel.text = myString; I want to access that string "myString" at didSelectRowAtIndexPath using indexpath. NSString *anotherString = cell.textLabel.text; returns null. Now if at cellForRowAtIndexPath, I did something like cell.textLabel.text = theString; then the didSelectRowAtIndexPath returns the appropriate cell. My question is, how can I access the text in the UILabel I apply to the cell, at didSelectRowAtIndexPath? Also, logging the cell in didSelectRowAtIndexPath returns cell: <UITableViewCell: 0x5dcb9d0; frame = (0 44; 320 44); autoresize = W; layer = <CALayer: 0x5dbe670>> Edit: NSString *myString = [[results objectAtIndex:indexPath.row] valueForKey:@"name"]; //cell.textLabel.text = myString; CGFloat width = [UIScreen mainScreen].bounds.size.width - 50; CGFloat height = 20; CGRect frame = CGRectMake(10.0f, 10.0f, width, height); UILabel *cellLabel = [[UILabel alloc] initWithFrame:frame]; cellLabel.text = myString; cellLabel.textColor = [UIColor blackColor]; cellLabel.backgroundColor = [UIColor whiteColor]; cellLabel.textAlignment = UITextAlignmentLeft; cellLabel.font = [UIFont systemFontOfSize:14.0f]; [cell.contentView addSubview:cellLabel]; [cellLabel release]; return cell;

    Read the article

  • How to: WCF XML-RPC client?

    - by mr.b
    I have built my own little custom XML-RPC server, and since I'd like to keep things simple, on both server and client side, what I would like to accomplish is to create a simplest possible client (in C# preferably) using WCF. Let's say that Contract for service exposed via XML-RPC is as follows: [ServiceContract] public interface IContract { [OperationContract(Action="Ping")] string Ping(); // server returns back string "Pong" [OperationContract(Action="Echo")] string Echo(string message); // server echoes back whatever message is } So, there are two example methods, one without any arguments, and another with simple string argument, both returning strings (just for sake of example). Service is exposed via http. Aaand, what's next? :) P.S. I have tried googling around for samples and similar, but all that I could come up with are some blog-related samples that use existing (and very big/numerous) classes, which implement appropriate IContract (or IBlogger) interfaces, so that most of what I am interested is hidden below several layers of abstraction...

    Read the article

  • Getting the first result from a LINQ query - why does ElementAt<T>(0) fails when First<T>() succeeds

    - by Mr Roys
    I have a method AddStudent() which looks for a student with the same name and returns an existing student from the database if there is a student with the same name, otherwise it creates a new student and adds it to the database. I'm curious why se = students.First<StudentEntity>(); succeeds when se = students.ElementAt<StudentEntity>(0); fails when I try to get the first result from the LINQ query. Aren't the two methods the same? The full code for the method is shown below. public Student AddStudent(string name) { using (SchoolEntities db = new SchoolEntities()) { // find student with same name via LINQ var students = from s in db.StudentEntitySet where s.name == name select s; StudentEntity se = default(StudentEntity); // if student with the same name is already present, return // that student if (students.Count<StudentEntity>() > 0) { // if i use ElementAt, if fails with a "LINQ to Entities does not // recognize the method 'StudentEntity ElementAt[StudentEntity] // (System.Linq.IQueryable`1[StudentEntity], Int32)' method, // and this method cannot be translated into a store expression.", // but not when I use First. Why? // se = students.ElementAt<StudentEntity>(0); se = students.First<StudentEntity>(); } else { // passing 0 for first parameter (id) since it's represented by // a BigInt IDENTITY field in the database so any value // doesn't matter. se = StudentEntity.CreateStudentEntity(0, name); db.AddToStudentEntitySet(se); db.SaveChanges(); } // create a Student object from the Entity object return new Student(se); } } Thanks!

    Read the article

  • .net difference between right shift and left shift keys

    - by Mr AH
    I am currently working on an application which requires different behaviour based on whether the user presses the right or left shift key (RShiftKey, LShiftKey), however when either of these keys is pressed I only see ShiftKey | Shift. Is there something wrong with my keyboard? (laptop) do I need a new keyboard driver/keyboard in order to send the different key commands maybe... This is a pretty massive problem at the moment, as there is no way of testing that the code works (apart from unit tests). Anyone had any experience of the different shift/alt/ctrl keys?

    Read the article

  • How to attach a sample grabber to the playcap sdk sample

    - by Mr Bell
    I want to get access to a webcam's frame image data so I can composite it with some other data. The playcap sample in the windows sdk directshow folder can show you a window streaming the webcam, but doesn't demonstrate access to the bytes. Someone mentioned that I could use a samplegrabber filter attached to a null rendered to gain access to the frame data. Unfortunately I haven't the first clue how to do this. How can I modify the playcap sample to attach a sample grabber and access the frame bytes? visual studio 2008 c++

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >