Search Results

Search found 168 results on 7 pages for 'imran omar bukhsh'.

Page 5/7 | < Previous Page | 1 2 3 4 5 6 7  | Next Page >

  • C++ classes with members referencing each other

    - by Saad Imran.
    I'm trying to write 2 classes with members that reference each other. I'm not sure if I'm doing something wrong or it's just not possible. Can anyone help me out here... Source.cpp #include "Headers.h" using namespace std; void main() { Network* network = new Network(); system("pause"); return; } Headers.h #ifndef Headers_h #define Headers_h #include <iostream> #include <vector> #include "Network.h" #include "Router.h" #endif Network.h #include "Headers.h" class Network { protected: vector<Router> Routers; }; Router.h #include "Headers.h" class Router { protected: Network* network; public: }; The errors I'm getting are: error C2143: syntax error : missing ';' before '<' error C2238: unexpected token(s) preceding ';' error C4430: missing type specifier - int assumed. I'm pretty sure I'm not missing any semicolons or stuff like that. The program works find if I take out one of the members. I tried finding similar questions and the solution was to use pointers, but that's what I'm doing and it does't seem to be working!

    Read the article

  • How to find relation between change in latitudes at centre of map and top/bottom

    - by Imran
    Hi, Im having little trouble finding a relation between the movement at centre and edge of a circle, Im doing for panning world map,my map extent is 180,89:-180,-89, my map pans by adding change(dx,dY) to its extents and not its centre. Now a situation has arrrised where I have to move the map to a specific centre, to calculate the change in longitudes is very easy and simple, but its the change in lattitudes that has caused problem. It seems the change in centreY of map is more than the change at edge of the mapY, or simply if I have to move the map centre from 0long,0lat to 73long,33lat, for dX I simply get 73, but for dY apparently it looks 33 but if i add 33 to top of map that is 89 , it will be 122 which is incorrect since Latitudes are between 90 and -90 . It seems a case a projection of a circle on 2D plane where the edge of circle since is moving backward due to angle expereinces less change and the centre expereinces more change, now is there a relation between these two factors? I tried converting the difference between OriginY and destinationY into radians and then add to Top and Bottom of Map, but it did'nt really work for me. Please note that the map is project on a virtual canvas whose width starts from 256 and increases by 256*2^z , z=0 is default and whole world is visible at that extent of canvas code: public void moveMapTo(double destinationLongitude,double destinationLattitude) // moves map to the new centre { double dXLong=destinationLongitude-centreLongitude; double atanhsinO = atanh(Math.sin(destinationLattitude * Math.PI / 180.00)); double atanhsinD = atanh(Math.sin(centreLatitude * Math.PI / 180.00)); double atanhCentre = (atanhsinD + atanhsinO) / 2; double latitudeSpan =destinationLattitude - centreLatitude; double radianOfCentreLatitude = Math.atan(Math.sinh(atanhCentre)); double dXLat=latitudeSpan / Math.cos(radianOfCentreLatitude); dXLat*=getLattitudeSpan()*(Math.PI/180); <--- HERE IS THE PORBLEM System.out.println("dxLong:"+dXLong+"_dxLat:"+dXLat); mapLeft+=dXLong; mapRight+=dXLong; mapTop+=dXLat; mapBottom+=dXLat; } ////latitude span function private double getLattitudeSpan() { double latitudeSpan = mapTop - mapBottom; latitudeSpan = latitudeSpan / Math.cos(radianOfCentreLatitude); return Math.abs(latitudeSpan); } //ht

    Read the article

  • Oracle why does creating trigger fail when there is a field called timestamp?

    - by Omar Kooheji
    I've just wasted the past two hours of my life trying to create a table with an auto incrementing primary key bases on this tutorial, The tutorial is great the issue I've been encountering is that the Create Target fails if I have a column which is a timestamp and a table that is called timestamp in the same table... Why doesn't oracle flag this as being an issue when I create the table? Here is the Sequence of commands I enter: Creating the Table: CREATE TABLE myTable (id NUMBER PRIMARY KEY, field1 TIMESTAMP(6), timeStamp NUMBER, ); Creating the Sequence: CREATE SEQUENCE test_sequence START WITH 1 INCREMENT BY 1; Creating the trigger: CREATE OR REPLACE TRIGGER test_trigger BEFORE INSERT ON myTable REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT test_sequence.nextval INTO :NEW.ID FROM dual; END; / Here is the error message I get: ORA-06552: PL/SQL: Compilation unit analysis terminated ORA-06553: PLS-320: the declaration of the type of this expression is incomplete or malformed Any combination that does not have the two lines with a the word "timestamp" in them works fine. I would have thought the syntax would be enough to differentiate between the keyword and a column name. As I've said I don't understand why the table is created fine but oracle falls over when I try to create the trigger... CLARIFICATION I know that the issue is that there is a column called timestamp which may or may not be a keyword. MY issue is why it barfed when I tried to create a trigger and not when I created the table, I would have at least expected a warning. That said having used Oracle for a few hours, it seems a lot less verbose in it's error reporting, Maybe just because I'm using the express version though. If this is a bug in Oracle how would one who doesn't have a support contract go about reporting it? I'm just playing around with the express version because I have to migrate some code from MySQL to Oracle.

    Read the article

  • Which syntax is better for return value?

    - by Omar Kooheji
    I've been doing a massive code review and one pattern I notice all over the place is this: public bool MethodName() { bool returnValue = false; if (expression) { // do something returnValue = MethodCall(); } else { // do something else returnValue = Expression; } return returnValue; } This is not how I would have done this I would have just returned the value when I knew what it was. which of these two patterns is more correct? I stress that the logic always seems to be structured such that the return value is assigned in one plave only and no code is executed after it's assigned.

    Read the article

  • Processing XML form input in ASP

    - by Omar Kooheji
    I'm maintaining a legacy application which consists of some ASP.Net pages with c# code behinds and some asp pages. I need to change the way the application accepts it's input from reading a set of parameters from some form fields to reading in one form field which contains contains some XML and parsing to get the parameters out. I've written a C# class that takes an The NameValueCollection from the C# HttpRequest's Form Element. Like so NameValueCollection form = Request.Form; Dictionary<string, string> fieldDictionary = RequestDataExtractor.BuildFieldDictionary(form); The code in the class looks for a particular parameter and if it's there processes the XML and outputs a Dictionary, if its not there it just cycles through the Form parameters and puts them all into the dictionary (Allowing the old method to still work) How would I do this in ASP? Can I use my same class, or a modified version of it? or do I have to write some new code to get this working? If I have to write ASP code Whats the best way to process the XML in ASP? Sorry if this seems like a stupid question but I know next to nothing about ASP and VB.

    Read the article

  • comparing two fields in djano

    - by imran-glt
    Hi can any body suggest me any idea about how can i compare two fields in django. as i have two password fields in my forms.py file. now i want to compare the two fields and if both are same then save the user in database else append an error message to reenter the values again. thanks

    Read the article

  • Google app engine or Amazin ec2 for Restful services and direct access to datastore

    - by imran
    I'm thinking of building a Restful app on either App engine or ec2 devloped in Java. I'm interested in opinions/experience of using the two options for this. The primary purpose is to create web services to write and retrieve data through a mobile device...basically creating an API for the service I want to create. It seems to me it would be quicker and cheaper in the beginning to go with google app engine using either restlet or grails.But I also think that I could run into problems in the future when I want to so somthing more advanced and might be restricted by app engines environment. I also want to be able to do data analysis on the data in the datastore as well. It seems that with app engine this would be hard as I don't have direct access to the datastore ( in Amazon I could still have access to the underlying db if I go with MySQL ) .

    Read the article

  • What is a RECURSIVE Function in PHP?

    - by Imran
    Can anyone please explain a recursive function to me in PHP (without using Fibonacci) in layman language and using examples? i was looking at an example but the Fibonacci totally lost me! Thank you in advance ;-) Also how often do you use them in web development?

    Read the article

  • How to Stich multiple java.awt.Image objects

    - by Imran
    Refereing to my previous question, http://stackoverflow.com/questions/2682364/how-to-stich-to-image-objects-in-java I successfully stiched two java.awt.Image objects, now I need to stich multiple objects of the same type. Is there any API or library available for that

    Read the article

  • is Web Development moving too fast?

    - by Imran
    I find myself constantly learning new things in web development and there is always soo much to learn in general. Currently i work with PHP and have tried to keep up with Ruby on Rails(RoR) but it's moving so fast i'm not sure i can keep up with the latest changes. Does anyone else have trouble keeping up with so much innovation in web development or is it just me? And how do you guys cope with the never ending learning process especially with Rails? Just looking for tips Tricks and personal experiences really Thanks in advance;-)

    Read the article

  • richfaces 3.3.3 problem with ie6

    - by Omar K
    Hi everyone, I am working using richfaces 3.3.3 , tomcat 6. when i try to access my application using IE6 and the windows language is set to arabic, i get the following exception: IllegalArgumentException: Parameter "size" for convert from HTML to java can not be decoded: [1px], reason: Unparseable number: "1px". when i change the windows language back to english, restart the server and try to log in again everything works fine.. Can anybody please help me with this issue

    Read the article

  • Character Sets explained for Dummies!

    - by Imran
    I don't think i fully understand character sets so i was wondering if anyone would be kind enough to explain it in layman's terms with examples ( for Dummies).I know there is utf8, latin1, ascii ect The more answers the better really. Thank you in advance;-)

    Read the article

  • Best practice for error handling in an Android Service

    - by Omar Kohl
    I have an Android Service that does some background processing on an image using a separate Thread. If an error occurs in this Service or even worse in the thread, what is the best practice to inform the launching Activity of the problem and allow the application to recover to a stable state (i.e. the state it was in before launching the service). From within the Service I could post a Toast or a Notification, but that doesn't help me. I would like to inform the user about the problem but at the same time recover the application to a stable state.

    Read the article

  • visual c# 2008 database application examples

    - by Omar
    hi, i just have a few weeks programming with vc# (2008) and i'm trying to build an application (winforms) and i have the following problem... i need my application to work with and without connection to the mssql database, this sounds like piece of cake for our friend DataSet right? i can persist the data as XML or binary until i can reach the database and the DataSet will magically sync; all without bothering the user. The problem is... the few books i have read just mention that logic like a fairy tale but dont give any practical example of how to do it, can you point me to one example/demo/whatever i can read or download of an application with (equal or) similar logic?

    Read the article

  • Syntactical analysis with Flex/Bison part 2

    - by Imran
    Hallo, I need help in Lex/Yacc Programming. I wrote a compiler for a syntactical analysis for inputs of many statements. Now i have a special problem. In case of an Input the compiler gives the right output, which statement is uses, constant operator or a jmp instructor to which label, now i have to write so, if now a if statement comes, first the first command (before the else) must be give out when the assignment of the if is yes then it must jump to the end because the command after the else isnt needed, so after this jmp then the second command must be give out. I show it in an example maybe you understand what i mean. Input adr. Output if(x==0) 10 if(x==0) Wait 5 20 WAIT 5 else 30 JMP 50 Wait 1 40 WAIT 1 end 50 END like so. I have an idea, maybe i can do it whith a special if statement like IF exp jmp_stmt_end stmt_seq END when the if statement is given in the input the compiler has to recognize the end ofthe statement and like my jmp_stmt in my compiler ( you have to download the files from http://bitbucket.org/matrix/changed-tiny) only to jump to the end. I hope you understand my problem.thanks.

    Read the article

  • How to get repository for core-plot

    - by Omar
    I am not able to get the repository for core-plot. What I am doing is that I am typing this in the terminal: hg clone https://core-plot.googlecode.com/hg/ core-plot and this is what I get: Traceback (most recent call last): File "/usr/local/bin/hg", line 25, in mercurial.util.set_binary(fp) File "/Library/Python/2.5/site-packages/mercurial/demandimport.py", line 75, in __getattribute__ self._load() File "/Library/Python/2.5/site-packages/mercurial/demandimport.py", line 47, in _load mod = _origimport(head, globals, locals) File "/Library/Python/2.5/site-packages/mercurial/util.py", line 93, in _encoding = locale.getlocale()[1] File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/locale.py", line 460, in getlocale return _parse_localename(localename) File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/locale.py", line 373, in _parse_localename raise ValueError, 'unknown locale: %s' % localename ValueError: unknown locale: UTF-8 I can't seem to get it to install. Please give me guidance on how to install the repository.

    Read the article

  • JMP instruction in Flex/bison

    - by Imran
    Hallo everybody, Can someone help me out of my situation, im searching for a instrucior that implements the JMP (Jump) instructior like in Assembler. I've found out that it could be withe the goto function of Flex/Bison but i have no really idea how to do. Have got anyone idea. Im very grateful of yours help. Thanks. Here is an example how it looks like. with the JMP instructor, he goes to the label L1. :L1 IF FLAG AND X"0001" EVT 23; ELSE WAIT 500 ms; JMP L1; END IF;

    Read the article

  • Upload images to a specific Facebook Album

    - by Imran Naqvi
    Hi stackoverflow, i can create an album using facebook graph api by posting data to http://graph.facebook.com/PROFILE_ID/albums it returns an id, which is not the album id. I confirmed it in two ways by going to that album, aid is different than what id i received and by posting http://graph.facebook.com/{ALBUM_ID_I_RECIEVED/photos, but the photo is never published to newly created album instead it is published to a default application album. I need to know the real album id so that i can upload images to newly created album. Please Help

    Read the article

  • MySQL Paritioning performance

    - by Imran Pathan
    Measured performance on key partitioned tables and normal tables separately. But we couldn't find any performance improvement with partitioning. Queries are pruned. Using MySQL 5.1.47 on RHEL 4. Table details: UserUsage - Will have entries for user mobile number and data usage for each date. Mobile number and Date as PRI KEY. UserProfile - Queries prev table and stores summary for each mobile number. Mobile number PRI KEY. CREATE TABLE `UserUsage` ( `Msisdn` decimal(20,0) NOT NULL, `Date` date NOT NULL, . . PRIMARY KEY USING BTREE (`Msisdn`,`Date`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 PARTITION BY KEY(Msisdn) PARTITIONS 50; CREATE TABLE `UserProfile` ( `Msisdn` decimal(20,0) NOT NULL, . . PRIMARY KEY (`Msisdn`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 PARTITION BY KEY(Msisdn) PARTITIONS 50; Second table is updated by query select and order by date in first table in a perl program, query is select * from UserUsage where Msisdn=number order by Date desc limit 7 [Process data in perl] update UserProfile values(....) where Msisdn=number explain partition for select, shows row being scanned in a particular partition only. Is something wrong with partition design or queries as partitioning is taking almost same or more time compared to normal tables?

    Read the article

  • Retrieving information with Python's urllib from a page that is done via __doPostBack()?

    - by Omar
    I'm trying to parse a page that has different sections that are loaded with a Javascript __doPostBack() function. An example of a link is: javascript:__doPostBack('ctl00$cphMain$ucOemSchPicker$dlSch$ctl03$btnSch','') As soon as this is clicked, the browser doesn't fetch a new URL but a section of webpage is updated to reflect new information. What would I pass into a urllib function to complete the operation?

    Read the article

  • Extjs 4.1 How to call controller action method from form

    - by Omar Faruq
    Extjs 4.1 How to call controller action method from form which is already use in a button action but i want this method reuse from a form field but do not how i can do? // here is my controller code init: function() { this.control({ 'itemsgrid': { removeitem: this.removeUser }, 'salewindow button[action=resetAll]': { click: this.resertform }, 'salewindow button[action=saveOrder]' : { click : this.onsaveOrder }, 'salewindow button[action=PDF]' : { click : this. pdfreport } }); }, resertform : function(button){ var store = Ext.data.StoreManager.get('Items'); store.destroy(); var vatstore = Ext.data.StoreManager.get('Vats'); vatstore.reload(); var rebatestore = Ext.data.StoreManager.get('Rebates'); rebatestore.reload(); Ext.getCmp('calculation-form').getForm().reset(); Ext.getCmp('itemform2').getForm().reset(); Ext.getCmp('itemsgrid').subtotalquantity(p=0); store.reload(); var co=store.getCount(); console.log(co); Ext.getCmp('customerID').setValue('0'); var a = Ext.getCmp('customerID').getValue(); Ext.getCmp('itemform2').customerinfo(a); } //and here is my from field listener { xtype : 'textfield', name : 'BranchId', fieldLabel : 'Branch Id', allowNegative : false, id : 'branchid', value : '1', onBlur: function(){ restoreItem();// i want call this method from here whis is stay in controller } }

    Read the article

  • Complaint management system

    - by Omar
    HI everyone, I was asked to develop a complaint/suggestion management system, I was wondering if anybody has an idea about what features should be there, if there is an already made system that i can view its documentation to help that will be great Thanks

    Read the article

< Previous Page | 1 2 3 4 5 6 7  | Next Page >