• Amused
  • Angry
  • Bored
  • Busy
  • Cheeky
  • Cold
  • Confused
  • Cool
  • Devilish
  • Fine
  • Hacker
  • Happy
  • In Love
  • Innocent
  • Lonely
  • Nerdy
  • Pensive
  • Roflol
  • Sad
  • Starving
  • Stressed
  • Yeehaw
  • Page 2 of 79 FirstFirst 12341252 ... LastLast
    Results 11 to 20 of 782

    Thread: The Official Programming Thread

    1. #11
      Dota 2 Freak

      I am:
      Busy
       
      Steam ID: rage_7d
      MainMy Activity InfoMy PG Info
      Posts
      456
      Daily Activity
      0%
      Lv. Percent
      42.32%
      A PHP Program on current political situation of Pakistan
      Code:
      <?php
      
      $nawaz = "Corrupt leader";
      $imran = "Mujahid-True Democatic Leader";
      $raheelshreef = "Martial Law";
      $resign = "resign";
      if($nawaz = $resign || $raheelshareef = "Martial Law"){
      
      echo "Nawaz Shareef in Jail";
      echo "Imran Khan : President Of Pakistan";
      }
      else {
      
      echo " We are f..kd up ";
      echo " Corruption";
      echo "Terrorism";
      echo "Law and order disruption";
      }
      
      ?>
      Last edited by babarali124; 22-08-14 at 08:36 AM.

    2. #12
      PG LEGENDARY

      I am:
      Hacker
       
      MainMy Activity InfoMy PG Info
      Posts
      3,276
      Daily Activity
      0%
      Lv. Percent
      56.94%
      Quote Originally Posted by babarali124 View Post
      A PHP Program on current political situation of Pakistan
      <?php

      $nawaz = "Corrupt leader";
      $imran = "Mujahid-True Democatic Leader";
      $raheelshreef = "Martial Law";
      $resign = "resign";
      if($nawaz = $resign || $raheelshareef = "Martial Law"){

      echo "Nawaz Shareef in Jail";
      echo "Imran Khan : President Of Pakistan";
      }
      else {

      echo " We are f..kd up ";
      echo " Corruption";
      echo "Terrorism";
      echo "Law and order disruption";
      }

      ?>

    3. #13
      PG Juggernaut

      I am:
      Busy
       
      Steam ID: Str1k3rX
      MainMy Activity InfoMy PG Info
      Posts
      6,606
      Daily Activity
      0%
      Lv. Percent
      96.77%
      Post whatever code you're posting in [code] [ /code] tags

      Sent from my Nexus 5 using Tapatalk

    4. #14
      lulz

      I am:
      Confused
       
      PSN ID: iAbyss-Walker Steam ID: hotgamerft
      MainMy Activity InfoMy PG Info
      Posts
      4,573
      Daily Activity
      0%
      Lv. Percent
      19.93%
      Quote Originally Posted by Eternal Blizzard View Post
      @hotgamerft

      do you know Ruby? Im currently learning it from codeacademy... if i'll run into any problem i'll be sure to ask here....
      Nope haven't used Ruby, but have heard about it.

      I know C. C++, C#, Java, PHP, ASP .Net, VB .Net and have worked a little in WCF & WF
      Likes Cerberus, Kashan123999 liked this post
       


    5. #15
      King Of The Kings

      I am:
      ----
       
      MainMy Activity InfoMy PG Info
      Posts
      414
      Daily Activity
      0%
      Lv. Percent
      9.71%
      python - udacity.com best training available on internet.

    6. #16
      PG Juggernaut

      I am:
      Pensive
       
      PSN ID: megamanexe95 Steam ID: www.steamcommunity.com/id/MegamanEXE
      MainMy Activity InfoMy PG Info
      Posts
      1,961
      Daily Activity
      0%
      Lv. Percent
      66.89%
      Programming thread? There's a whole separate section on PG about programming.
      Software/Game Development and Programming

    7. #17
      Muhmmed Umair (PG Xtremist)

      I am:
      Busy
       
      Steam ID: umair23
      MainMy Activity InfoMy PG Info
      Posts
      787
      Daily Activity
      0%
      Lv. Percent
      36.15%
      If anybody needs Raspberry pi (a modern sexy controller with hdmi output) then contact me. I bought it last year for my Final Year Project and programmed it in python. It still has the programming of my FYP that is Heads Up Display. Ill post a picture of the controller and video of my project.



    8. #18
      Muhmmed Umair (PG Xtremist)

      I am:
      Busy
       
      Steam ID: umair23
      MainMy Activity InfoMy PG Info
      Posts
      787
      Daily Activity
      0%
      Lv. Percent
      36.15%

    9. #19
      L'obscurité vous entoure

      I am:
      Bored
       
      MainMy Activity InfoMy PG Info
      Posts
      736
      Daily Activity
      0%
      Lv. Percent
      30.6%
      Ok so here is some really stupid problem i am stuck at. If someone could help it would be really appreciated.
      I am working on a test android app just for learning purposes. The first two activities work fine, the translation animations work fine, opacity animations work fine, database works fine. But when I jump to the third activity, it pops up and is blank.
      here is the XML code for UI
      Code:
      <?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@+id/layout_base"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:orientation="vertical"
           android:paddingBottom="@dimen/activity_vertical_margin"
          android:paddingLeft="@dimen/activity_horizontal_margin"
          android:paddingRight="@dimen/activity_horizontal_margin"
          android:paddingTop="@dimen/activity_vertical_margin" >
          
          <LinearLayout 
              android:id="@+id/layout_optionToInsert"
              android:orientation="vertical"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:visibility="visible">
              
              <Button
                  android:id="@+id/btnInsertShirt"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="@string/btnTextInsertShirt"
                  />
              <Button 
                  android:id="@+id/btnInsertTrousers"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="@string/btnTextInsertTrouser"/>
              
              <Button
                  android:id="@+id/btnInsertSuit"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="@string/btnTextInsertSuit"
                  />
              
              <Button android:id="@+id/btnInsertTie"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="@string/btnTextInsertTie"
                  />
      
      
              <Button
                  android:id="@+id/btnBack3"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="@string/btnTextBack3" />
        
          </LinearLayout>
          
          <LinearLayout
              android:id="@+id/layout_InsertShirt"
              android:orientation="vertical"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:visibility="gone"
              >
              
              <EditText
                  android:id="@+id/InsertShirtColor"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:hint="@string/insertshirthere" />
              <Spinner
                  android:id="@+id/spinner_color"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  />
              
               <EditText
                  android:id="@+id/InsertShirtTexture"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:hint="@string/insertshirttexture" />
               <Spinner
                  android:id="@+id/spinner_texture"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  />
               
                <EditText
                  android:id="@+id/InsertTextureColor"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:hint="@string/inserttexturecolor" />
                <Spinner
                  android:id="@+id/spinner_texture_color"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  />
              
          </LinearLayout>
      I am using Layouts within Layout. Overlapping Layout would be appropriate? Anyway the purpose is to slide the above layout so that the layout underneath appears.

      Here is the code in my java class.
      Code:
      public class UpdateInventory extends Activity {
      
      	Button insertShirt, insertTrouser,insertSuit, insertTie,back;
      	EditText shirtColor,shirtTexture,TextureColor;
      	Spinner color,texture,textureColor;
      	LinearLayout optionToInsert,InsertShirt,InsertTrouser,InsertSuit,InsertTie,layout_base;
      	
      	private String[] shirtColors={"Beige","Tan","Khaki","Gray","Charcoal","Navy Blue","Medium Blue","Azure","Cyan","Forest Green","Olive","Light Green",
      			"Lime","Coral","Pink","Light Purple","Purple","Indigo","Maroon","Crimson","Red","White","Brown","Black"};
      	
      	protected void OnCreate(Bundle savedInstanceState){
      		super.onCreate(savedInstanceState);
      		setContentView(R.layout.update_inventory);
      		
      		insertShirt=(Button) findViewById(R.id.btnInsertShirt);
      		insertTrouser=(Button) findViewById(R.id.btnInsertTrousers);
      		insertSuit=(Button) findViewById(R.id.btnInsertSuit);
      		insertTie=(Button) findViewById(R.id.btnInsertTie);
      		back=(Button) findViewById(R.id.btnBack3);
      		
      		color=(Spinner) findViewById(R.id.spinner_color);
      		texture=(Spinner) findViewById(R.id.spinner_texture);
      		textureColor=(Spinner) findViewById(R.id.spinner_texture_color);
      		
      		shirtColor=(EditText) findViewById(R.id.InsertShirtColor);
      		shirtTexture=(EditText) findViewById(R.id.InsertShirtTexture);
      		TextureColor=(EditText) findViewById(R.id.InsertTextureColor);
      		
      		optionToInsert=(LinearLayout) findViewById(R.id.layout_optionToInsert);
      		InsertShirt=(LinearLayout) findViewById(R.id.layout_InsertShirt);
      		InsertTrouser=(LinearLayout) findViewById(R.id.layout_InsertTrouser);
      		InsertSuit=(LinearLayout) findViewById(R.id.layout_InsertSuit);
      		InsertTie=(LinearLayout) findViewById(R.id.layout_InsertTie);
      		layout_base=(LinearLayout) findViewById(R.id.layout_base);
      		layout_base.setBackgroundColor(Color.RED);
      		
      		insertShirt.setOnClickListener(new View.OnClickListener() {
      			
      			@Override
      			public void onClick(View v) {
      				// TODO Auto-generated method stub
      				TranslateAnimation animate= new TranslateAnimation(0,optionToInsert.getWidth(),0,0);
      				animate.setDuration(500);
      				//animate.setFillAfter(true);
      				optionToInsert.startAnimation(animate);
      				optionToInsert.setVisibility(View.GONE);
      				fadein(InsertShirt);
      				InsertShirt.setVisibility(View.VISIBLE);
      			}
      		});
      	}
      	
      	public void fadein(View v)
      	{
      		Animation animation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.fadein);
      		v.startAnimation(animation);
      	}
      }
      here is the android Manifest Code, which of course works fine for previous two activities and this one loads fine as well

      Code:
      <manifest xmlns:android="http://schemas.android.com/apk/res/android"    package="com.example.suitup"
          android:versionCode="1"
          android:versionName="1.0" >
      
      
          <uses-sdk
              android:minSdkVersion="14"
              android:targetSdkVersion="19" />
      
      
          <application
              android:allowBackup="true"
              android:icon="@drawable/ic_launcher"
              android:label="@string/app_name"
              android:theme="@style/AppTheme" >
              <activity
                  android:name=".MainActivity"
                  android:label="@string/app_name" >
                  <intent-filter>
                      <action android:name="android.intent.action.MAIN" />
      
      
                      <category android:name="android.intent.category.LAUNCHER" />
                  </intent-filter>
              </activity>
              
              <activity
                  android:name="com.example.suitup.MainMenu"
                  android:label="@string/app_name" >
                  <intent-filter>
                      <action android:name="android.intent.action.MainMenu" />
      
      
                      <category android:name="android.intent.category.DEFAULT" />
                  </intent-filter>
              </activity>
              
              <activity
                  android:name="com.example.suitup.UpdateInventory"
                  android:label="@string/app_name" >
                  <intent-filter>
                      <action android:name="android.intent.action.UpdateInventory" />
      
      
                      <category android:name="android.intent.category.DEFAULT" />
                  </intent-filter>
              </activity>
              
          </application>
      
      
      </manifest>
      I don't understand where the problem is? I have spent almost two hours but I cannot understand why the contents in the third activity won't appear?
      It would be great if someone would help!







    10. #20
      PG Juggernaut
      Team PG Emeritus

      I am:
      Starving
       
      Gamertag: Gizmo the Gamer
      MainMy Activity InfoMy PG Info
      Posts
      12,884
      Daily Activity
      0%
      Lv. Percent
      17.27%
      I have a C++ problem. I'm learning about pointers atm and I did this:


      Code:
      int Table(int a, int b){
      
      int **p_p_table;
      
       p_p_table = new int*[a];
      
       for(int i=0; i<a; i++){
      
          p_p_table[a] = new int[b];
      
      
       }
      
       for(int i=0; i<a; i++){
      
          for(int j=0; j<b; j++){
      
      
              p_p_table[i][j] = i*j;
          }
          }
      
          for(int i=0; i<1; i++){
      
              for(int j=0; j<b; j++){
      
                  cout << p_p_table[i][j] << "  ";
              }
              cout << " " << endl;
          }
      
      
      
      
      }
      
      int main ()
      {
       int height;
       int width;
      
       cout << "Enter the Dimensions of the table: ";
       cin >> height;
       cin >> width;
      
        Table(height,width);
      
      
      }

      Basically, It's suppossed to be a function that let's the user create a multiplication table of their desired dimensions but whenever I run it and entert he dimension the program crashes because I'm not allocatting the memory correctly, How exactly do I do that?
      @StrikerX ........ Batao mujhe


     

     

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •  
    All times are GMT +5. The time now is 07:56 PM.


    Back to Top Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
    Shoutbox provided by vBShout (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
    Copyright © 2018 PakGamers. All rights reserved.