Tanveer’s Weblog

C++/CLI: Object Clone

May 8, 2009 · Leave a Comment

Basically, Clone can be implemented either as a deep copy or a shallow copy. In a deep copy, all objects are duplicated; whereas, in a shallow copy, only the top-level objects are duplicated and the lower levels containreferences.

But here we work under System::Runtime::Serialization::Formatters::Binary

Step 1: Serialize your object
Step 2: And then Deserialize  your object
Step 3: Close you MemoryStream instance
Step 4: Return Object
That’s it..

So here is the method,

public: System::Object^ Clone(System::Object^ apObj )
{
MemoryStream^ ms = gcnew MemoryStream();
BinaryFormatter^ bf = gcnew BinaryFormatter();
bf->Serialize( ms, apObj );
ms->Position = 0;
System::Object^ obj = bf->Deserialize( ms );
ms->Close();
return obj;
}

This is most fast way to clone your object very easily. So fulks ..

enjoy ;)

→ Leave a CommentCategories: .NET · C++/CLI · Tips' n Tricks'

Communicating with C++/CLI to ActionScript

March 1, 2009 · Leave a Comment

Inspired by Gabe Wishnie
As a matter of fact, i was tried to implement C# and the Flash Player 8 External API with my C++/CLI project. However,  i was using Visual Studio 2005.
My main goal of this post is to aware what is the most basic part to implement this kind of staff in project.
Troubleshooting
1. To begin porting over the FLVPlayer it will be batter to use the most updated flash player.
2. Most of the time people ask about the problem with CallFunction method as it said this method is not a member.
3. If this kind of ambiguous problem faced then re-check your Flash Virsion. Flash 6,7 will the main cause of this error. Upgrade it into 8, 9 or 10
4. In ActionScript you must add these lines first

import flash.external.ExternalInterface;
ExternalInterface.addCallback("YourMethod", null, YourMethod);
function YourMethod(uri:String):Void
{
if(uri == "TANVEER")
{
// something my logic will be applicable;
}
}

5. In C++/CLI

private: AxShockwaveFlashObjects::AxShockwaveFlash^ mpAxShockwaveFlashBee;
private: System::Void mpButtonClick_Click(System::Object^ sender, System::EventArgs^ e)
{

mpAxShockwaveFlashBee->CallFunction(“<invoke” + ” name=\”loadAndPlayVideo\” returntype=\”xml\”><arguments><string>TANVEER</string></arguments></invoke>”);

}

6. Done! It is now that easy to pass data back ActionScript and C++/CLI.

My Source code:needbee.rar.pdf

rename it as needbee.rar

→ Leave a CommentCategories: .NET · C++/CLI · Tips' n Tricks'

error PRJ0002 : Error result -1073741701 returned from ‘C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\bin\resgen.exe’

December 23, 2008 · Leave a Comment

;) SOLVED!!

While working with C++/CLI .NET  in Visual Studio 2005 and suddenly i got this compilation error.

error PRJ0002 : Error result -1073741701 returned from ‘C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\bin\resgen.exe’

I don’t know why? but after googled some while i found that it was because of  some virus. huh! :(

But I solved this in my style. What i did just rreplace the file Resgen.exe in the same folder.

Just download this resgenexe2 and rename it as ResGen.exe and replace the file ResGen.exe file into your /*C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin*/ directory if you have this compilation problem.


enjoy ;)

→ Leave a CommentCategories: .NET · C++/CLI

বাংলা ফোনেটিক কি-প্যাড

November 3, 2008 · Leave a Comment

আজ অনেক দিন পর আমর ব্লগে লিখছি। আর সবচেয়ে মজার ব্যাপার হল… এই প্রথম আমি আমার ব্লগে লিখছি বাংলায় । খুবই ভাল লাগছে। একদম অন্য রকম। তাই আজ থেকে নতুন একটি ক্যারাগরি তৈরি করলাম আর নাম দিলাম ‘আমার বাংলা’। আর আমার ধারণা আমার মতন অনেকেই আছে যারা বাংলা লিখতে কি-বোর্ডের কি খুলে ফেলবার মতন অবস্থা … হা: হা: হা: ..। তাদের জন্য আছে বেশ ভাল কিছু উপায়। আর তা হল ওয়েব-বেস্ড বাংলা ফোনেটিক কি-প্যাড অথবা অথবা অভ্র ফোনেটিক কি-বোর্ড। এই কি-প্যাড গুলো খুবই উন্নত মানের এবং ফ্রি-সফ্টওয়্যার লাইসেন্স এর আওতা ভুক্ত। তাই সহজেই ব্যবহার যোগ্য। প্রথম দিকে লিখতে যদিও একটু কষ্ট হয়েছে তবে এখন পুরোপুরি হাতে চলে এসেছে ।  তাই এই লিংক গুলো সংগ্রহে রাকছি।
১। ত্রিভুজ প্যাড
২। বাংলা অনলাইন টুল
৩। ভার্চুয়াল কি-বোর্ড
মাত্র ১০ মিনিট একটু মনযোগ দিয়ে প্র্যাকটিস করলেই আমার মনে হয় বাংলায় খুব সহজেই লিখতে পারা সম্ভব। যদি কার সত্যি ইচ্ছা হয় তাহলে একবার অন্তত সাইট গুলো ঘুরে আসতে পারেন।
কষ্ট করে আমার এই লিখাটি পড়বার জন্য অনেক অনেক ধন্যবাদ।
:)

→ Leave a CommentCategories: আমার বাংলা
Tagged: , ,

Ubuntu 8.10 (Intrepid Ibex) will be released on October 30th, 2008

October 6, 2008 · Leave a Comment

“The most notable plans for subnotebook supremacy in Intrepid are better support for mobile networking, improved startup time, and official support for USB installation images. Network configuration in the current version of Ubuntu is handled by NetworkManager, which offers simple point-and-click support for connecting to WiFi access points. The new version of NetworkManager, which will be included in Ubuntu 8.10, adds basic support for 3G networking. In addition to integrating the new version of NetworkManager, the Ubuntu developers will also conduct testing to ensure compatibility with the most commonly used 3G networking devices and services.”

  • 3GNetworking – https://wiki.ubuntu.com/3GNetworkingIntrepid
    • Ship network-manager .7 and get as many 3G options fixed. Network-manager .7 already has basic support for CDMA and GSM connections.
    • Assemble a list of frequently used hardware and 3G providers in the markets with the highest 3G penetration.
    • Get most important hardware and subscriptions early in the release cycle to ensure that as many options as possible can be verified and get fixed.
  • Education Edition
    • GUI for dynamic menus – The current edubuntu-menus package installs a fixed set of menus bound to Unix groups. To maintain the menus it is currently necessary to edit the .menu files by hand. The menu group also doesn’t show up in the ubuntu users and groups tool yet.
  • Firefox KDE Integration – https://wiki.ubuntu.com/Firefox3KDEIntegrationIntrepid
    • Discussion for improving Firefox integration in KDE (mimetypes, setting the desktop background, protocols schemes)
  • Boot Performance
    • Prefetch, better multithreading, dbus and hal moving to upstart, look at kernel based modesetting (ongoing)
  • Ubuntu Distributed Development
    • Aim to have all of Ubuntu, possible Debian imported in Bazaar during the Intrepid cycle and use the upcoming features in Bazaar and Launchpad to make it quick to make small changes.
  • Improve Flash Experience – https://wiki.ubuntu.com/FlashExperienceIntrepid

    • Provide the user with a seamless Flash experience; this includes ease of install as well as a pleasant Flash user-experience.
    • Support Free Flash as much as possible; the long-term goal is to ship a free Flash alternative by default.
  • OpenOffice.org Upload Schedule – https://wiki.ubuntu.com/OOoIntrepidUploadSchedule

    • Barring major problems the currently scheduled release date for OpenOffice.org 3.0 is September 2 and Intrepid release is scheduled for Oct 30.

  • X.org in Intrepid – https://blueprints.launchpad.net/ubuntu/+spec/xorg-intrepid

    • We do not anticipate xserver 1.6 to be delivered in time for Intrepid, so we will focus on having xserver 1.5.
    • Upstream is developing two memory managers – TTM and GEM. We will wait to see which one is taken upstream, and pull that into Intrepid if there is time.
    • We have over 1600 Xorg bugs presently. Reducing this to <1000 is a stretch goal for Intrepid.

  • Wubi (Windows-based installer)
    • Possible new features: Online resizing, hibernation with swap files, support for DVD and larger distributions like Ubuntu Studio, bittorrent support for download manager, built in CD burner, native migration.
  • Font Selector discussions, removing cruft after upgrades, DVD live installation performance hacks, gathering translation statistics, USB installation images, Python 3 support, and more.

Ref : Horny for Ubuntu 8.10: first look at Intrepid Ibex

wiki.ubuntu.com

→ Leave a CommentCategories: UBUNTU
Tagged:

Thinking Ruby on Rails

September 7, 2008 · Leave a Comment

After quite a bit of time; holding my breadth I scramble down with new dream that I have to know somthing new. Ruby on Rails makes me that choise. I googled and found some really interesting tutorials, e-books and some realy quality disscussion about Rails. And gathered all that tricks and tips on my hand to make my Thinking of Ruby on Rails (RoR). However, this is only for my personal interest. ;)
Thinking Ruby on Rails
If any one has some interest please don’t hesitate to download.

Enjoy :D

→ Leave a CommentCategories: Ruby
Tagged:

[HotFixer] Transparent PNG support into IE6 using TwinHelix

July 29, 2008 · 2 Comments

Couple of days ago one of my colleague asked my why ie6 couldn’t be able to show a trasparent png image ! He was so rock n roll mood about this matter ! :D n asked me is there any solution to fix this crap!! Unfortunatly i dont have any thing to say. So i googled for a while n got the answer. Here is the key things we can do to fix this bug.

1. Download TwinHelix iepngfix.zip v1.0 (37kb) under GNU LGPL, version 2.1 or later. After that you can open “iepngfix.html” in a browser; to find the step by step instructions.

2. Copy and paste iepngfix.htc and blank.gif into your website folder.

3. Copy and paste this into your website’s CSS or HTML:

<style type="text/css">
img, div { behavior: url(iepngfix.htc) }
</style>

That CSS selector must include the tags/elements on which you want PNG support — basically, give it a comma-separated list of tags you use. It must also include the correct path to the .HTC relative to the HTML document location (not relative to the CSS document!). For instance, yours may look like this:

<style type="text/css">
img, div, a, input { behavior: url(/css/resources/iepngfix.htc) }
</style>

4. If your site uses subfolders, open the .HTC file in a text editor like Windows Notepad and change the blankImg variable to include a correct path to blank.gif like so:

var blankImg = '/images/blank.gif';

Again the path is relative to the HTML file. Otherwise, you will see a “broken image” graphic!

Now if you would like to use this behavior in your defined css class just use something like

<style type="text/css">
.myimg{ behavior: url(/css/resources/iepngfix.htc);padding-left:5px ... }
</style>

That’s it ! You are done. Now you can enjoy any transparent png image file any where in your web derictory

;)

Ref: twinhelix

→ 2 CommentsCategories: Fun · Tips' n Tricks'
Tagged: , , ,

[Tips] MP3 support, DVD playback in Ubuntu

July 19, 2008 · 1 Comment

Some times it is really disturbing after installed a new Ubuntu/Linux and cant play mp3 files. That’s why i need to make a note down here :D

1. MP3 support, DVD playback, Java plugin, and Flash plugin

To install ubuntu-restricted-extras package. In terminal window, command is:

sudo apt-get install ubuntu-restricted-extras

For Kubuntu, command is :

sudo apt-get install kubuntu-restricted-extras

For Xubuntu, command is:

sudo apt-get install xubuntu-restricted-extras

2. Install w32codecs

This non-free multimedia codecs will be used for MPlayer and Xine. To install w32codecs, you can see also here.

3. Install CompizConfig Settings Manager

sudo apt-get install compizconfig-settings-manager

4. Install Opera 9.24

To use commercial repository for Ubuntu 7.10.

sudo gedit /etc/apt/sources.list

Add this line:

deb http://archive.canonical.com/ gutsy partner

After save file, run these commands:

sudo apt-get update
sudo apt-get install opera

5. Clean up Ubuntu

To clean up Ubuntu 7.10, run the following commands:

sudo apt-get autoclean
sudo apt-get clean

Or use:

sudo apt-get autoremove

Done!

→ 1 CommentCategories: Linux · Tips' n Tricks' · UBUNTU
Tagged:

[Apache] Loopback Interface Testing

July 15, 2008 · 2 Comments

Sometimes it’s really important to test multiple websites on localhost. How we can do that? Very easy! ;) .. Yes we can use different port for each site. Some days ago i found one of the windows hosting server did this for their different users. So we can also be able to to it in apache..

What we need is to initialize the port for each site.. here is an example

We need to edit our httpd.conf file and paste these code in the suitable place

Listen 127.0.0.1:8000
Listen 127.0.0.1:1111
BindAddress 127.0.0.1

Port 1111
Port 8000

ServerName 127.0.0.1

NameVirtualHost *

<VirtualHost *:8000>
DocumentRoot “/home/username/test/example.org/htdocs”
<Directory “/home/username/test/example.org/htdocs”>
Options Indexes FollowSymLinks MultiViews
AllowOverride None

Order allow,deny
Allow from all
</Directory>
</VirtualHost>

<VirtualHost *:1111>
DocumentRoot “/home/username/test/example.com/htdocs/”
<Directory “/home/username/test/example.com/htdocs/”>
Options Indexes FollowSymLinks MultiViews
AllowOverride None

Order allow,deny
Allow from all
</Directory>
</VirtualHost>

done, now port 8000 is for our development and 1111 is for testing purpose

enjoy ;)

Ref: Security Tips for Server Configuration

→ 2 CommentsCategories: Apache · Linux · Tips' n Tricks'
Tagged: ,

SAJAX : Synchronizes the Asynchronous JavaScript and XML

July 11, 2008 · Leave a Comment

” What is Sajax?
The Simple Ajax Toolkit (Sajax) is synchronous asynchronous JavaScript and XML. What makes it synchronous is that the details of the XML HTTP object used in your current Ajax application are abstracted away using the Sajax.php library file. This makes developing Ajax applications much easier because the chance of programming errors are reduced. Your links will also be much simpler because they will contain only function calls. Basically, Sajax is a modular way of making Ajax applications through defined and dynamic function calls, making the application development process smoother. “

Overview of Ajax technology

Overview of Ajax technology

1. Download Sajax

2. See this simple example to have an idea

3. Let’s start playing with the example code. Just copy and paste into your workplace

Interested more ? then download this ibm-sajax.pdf

enjoy ;)

Ref: modernmethod.com

→ Leave a CommentCategories: SAjax
Tagged: ,