Forum Replies Created

SapnaVishwas Member

I used to LOVE programming in ASSEMBLER! Even when I started programming in C I couldn’t resist the temptation to best the compiler with my own embedded ASSEMBLY code.

Programming in ASSEMBLY takes a completely different mindset from traditional Procedural Programming or Object Oriented Programming or 4GL (not the next BIG thing that everybody thought it was going to be) languages.

Programming in ASSEMBLY Language means you are a bit twiddler. You have to do everything (at least at first until you develop some procedural constructs) you have to move things in and out of Registers, Jump to locations in code, manage all resources without any of the automatic garbage collection, push and pop things off of the stack.

It’s not for the feint of heart that’s for sure. I had an Engineer friend back in the early 90’s that could look at the HEX of an Executable and insert things into THAT to make the program work the way he wanted it to. Understand what I’m saying there. He’d open up the executable file in a HEX Editor and cobble away.

I was always astonished at that. It was his ‘savant’ ability.

I found a decent pdf file you can look at

http://www.tik.ee.ethz.ch/education/lectures/TI1/materials/assemblylanguageprogdoc.pdf

SapnaVishwas Member

Script and html not allow in admin panel that because of sanitization
here is script to work

/*
 * This is an example of how to override a default filter
 * for 'textarea' sanitization and $allowedposttags + embed and script.
 */
add_action('admin_init','optionscheck_change_santiziation', 100);
function optionscheck_change_santiziation() {
    remove_filter( 'of_sanitize_textarea', 'of_sanitize_textarea' );
    add_filter( 'of_sanitize_textarea', 'custom_sanitize_textarea' );
}
function custom_sanitize_textarea($input) {
    global $allowedposttags;
      $custom_allowedtags["script"] = array( "src" => array() );
      $custom_allowedtags = array_merge($custom_allowedtags, $allowedposttags);
      $output = wp_kses( $input, $custom_allowedtags);
    return $output;
}
SapnaVishwas Member

Here it is. It is done in Visual studio. Works perfectly except the first cycle. ( it opens and closes the first driver without delay). But after that it just does what is suppose to do.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        [System.Runtime.InteropServices.DllImport("winmm.dll", EntryPoint = "mciSendStringA")]
        public static extern void mciSendStringA(string lpstrCommand, string lpstrReturnString, long uReturnLength, long hwndCallback);

       

        string rt = "";


        private void button1_Click(object sender, EventArgs e)
        {           
            timer1.Interval = 1000 * 5; //timer to open first and close second
            timer1.Enabled = true;
            timer1.Start();
            timer2.Interval = 1000 * 5; //revers timer
            timer2.Enabled = true;
            mciSendStringA("open D: type CDAudio alias driveD", rt, 127, 0); //defining driver
            mciSendStringA("open E: type CDAudio alias driveE", rt, 127, 0);
        }

        private void button2_Click(object sender, EventArgs e)
        {           
            //test button

            mciSendStringA("set driveF door open", rt, 127, 0);
            MessageBox.Show("Radi li");
        }       

       
        private void timer1_Tick(object sender, EventArgs e)
        {
            //open first close second
            mciSendStringA("set driveE door closed", rt, 127, 0);
            mciSendStringA("set driveD door open", rt, 127, 0);
            //MessageBox.Show("start");
            timer1.Stop();
            timer2.Start();
        }

        private void timer2_Tick(object sender, EventArgs e)
        {
            //open second close first
            mciSendStringA("set driveD door closed", rt, 127, 0);
            mciSendStringA("set driveE door open", rt, 127, 0);
            //MessageBox.Show("stop");
            timer2.Stop();
            timer1.Start();
        }

    }
}
SapnaVishwas Member

in python using pygame

import pygame.cdrom as cdrom
cdrom.init()
cd = cdrom.CD(0) # 0 = first cdrom device
cd.init()
cd.eject()
cd.quit()
cdrom.quit()
SapnaVishwas Member

I’m not familiar with Android but I did do a lot of programming in C a long time ago.
The only questionable discrepancies I see are these:

Line 4:

you use rManager.getInstance().carArray.length

Line 6:

rManager.getInstance().iceArray.length;

You have arrays without indexes and then on line 15 is the first time I see an Indexes (I & j) for the array.

rManager.getInstance().iceArray[j].getIceSprite().collidesWith(rManager.getInstance().carArray[i].getCarSprite
SapnaVishwas Member

So why i am telling to switch linux environment is, when you deal an issue about operating system, you are involving software topics, maybe some coding etc. Ofc linux doesnt make you “code master” but it forces you to learn topics in software engineering. What i mean is:

  • When you have an issue about some software, you go to project web site, you fill bug report, and you are actually dealing with bug tracking system which gives you experience about bug tracking systems.
  • You have an option to compile a program from source and use it even modifying it is allowed. There are thousands of tutorials available.
  • You have well around 40.000 software (in debian repos) with their source code available. You can download source packets and /inspect/compile/debug/trace them.

There are a lot of advantages of choosing Linux as a development platform that why i said “ask google”

Well, I strongly against this idea:

The reason I suggested that is that it can be very satisfactory for a complete beginner once they see the final product - an actual Windows application and *.exe file.

C# is very user-friendly, in my opinion, especially since Visual Studio let's you just drag all the GUI elements you want into your application and the auto-complete features can be very useful too.

If you don’t have full control on your source code, and you dont have any knowledge about delivering a software to final product and choosing a crappy IDE to do this delivering job for you, well forget about being code master. First you have to learn basics like build your GUI from scratch and learn how GUI logic works, how layout managers handles components etc, how software is delivered to target platform? After you learn those stuffs then you can use “wizards”, “gui designers” to increase your productivity.

SapnaVishwas Member

There is no point reading any of these as your first books. You will just think that its too hard and lose interest. Start slow, maybe by learning a high level interpreted language like Python or PHP. Then, work your way from there to C#, Java and the likes. Once you’re comfortable, move down to C++ and C (the third book). And then, if you feel that you can handle anything, try assembly. But, let me warn you, you won’t be getting there anytime soon. And as you’ll go deeper, you will start realizing that you have done blunders in your past programs and then won’t repeat it again. The key is to get results as soon as you can so that the motivation to code remains.

The first two books come in handy when you want to work with more than your trivial algorithms. But I’d say forget them for now, you’ll only end up confusing yourself. Believe me, when you actually need the knowledge they contain, you will end up reading them but not any time sooner. You simply won’t be motivated enough to slog through hundreds of pages of complex mathematics and higher-order thinking.

SapnaVishwas Member

First thing: Is directory 'C:\temp' exist? If not, StreamWriter constructor will break execution of your function on line 2. You can catch that exception if you surround your code with try-catch block (that even recommended for I/O operations)

Second thing: You not close your stream. StreamWriter is buffered by default, meaning it won’t output until it receives a Flush() or Close() call.
So proper code should look something like this:

public void saveSudokuList()
{
 try{
   if(!Directory.Exists(@"C:\temp"))
      Directory.CreateDirectory(@"C:\temp");
   System.Xml.Serialization.XmlSerializer x = new System.Xml.Serialization.XmlSerializer(head.GetType());
   StreamWriter writer = new StreamWriter(@"C:\temp\sudoku.xml");
   x.Serialize(writer, head);
   writer.Close();
 }
 catch (Exception e)
 {
   MessageBox.Show(e.Message);
 }
}

Last thing: Default serialization had some limitation, if above tips dont help, post code of ‘head’ object class.

SapnaVishwas Member

I assume that in your Web.config, you have added a <location> directive for which pages you want to “protect”.

You must add Register.aspx as an exempt, or only require authentication for specific pages only.
http://stackoverflow.com/questions/2540744/asp-net-disabling-authentication-for-a-single-aspx-page-custom-error-page

SapnaVishwas Member

Check out RapidLeech.
If they’ve improved their code at all, you may be able to use some sort of API.

OR

You can use curl, but you also need to pass the cookies with a valid login session.
So first, use curl to login and save the cookie to a file. Next, use curl and pass that cookie along while requesting the download link.

I use this with my own upload/download script and it works pretty simply.

SapnaVishwas Member

You need to get a list of files in the directory/directories that you want and then loop through the writing function with each of the files.

psuedocode:

files = allFilesInThisDirectory("c:\scripts\")
for i = 0 to files.count-1
objFile = files(i)
objFile.write "whatever"
objFile.close
next i
SapnaVishwas Member

Use eclipse.And android SDK.It’s simple as it is.Can use Java and C++.But if you use java you can find lot of online materials and can use android sdk(software development kit).If your application needs more efficiency can use c++.If you use c++ you should use NDK(Native Development Kit)

SapnaVishwas Member

well, without knowing the way the vote has been implemented, a rudimentary voting would look something like :


something like that ...

SapnaVishwas Member

Remove line 10:

chdir(constant("PHP_DIR")) or die("Fatal Runtime Error.");?>
SapnaVishwas Member

U NuSphere PHPEd it is very easy to use code igniter on it.

Viewing 15 posts - 46 through 60 (of 156 total)
en_USEnglish