Search Results

Search found 40 results on 2 pages for 'munim abdul'.

Page 2/2 | < Previous Page | 1 2 

  • calling concurrently Graphics.Draw and new Bitmap from memory in thread take long time

    - by Abdul jalil
    Example1 public partial class Form1 : Form { public Form1() { InitializeComponent(); pro = new Thread(new ThreadStart(Producer)); con = new Thread(new ThreadStart(Consumer)); } private AutoResetEvent m_DataAvailableEvent = new AutoResetEvent(false); Queue<Bitmap> queue = new Queue<Bitmap>(); Thread pro; Thread con ; public void Producer() { MemoryStream[] ms = new MemoryStream[3]; for (int y = 0; y < 3; y++) { StreamReader reader = new StreamReader("image"+(y+1)+".JPG"); BinaryReader breader = new BinaryReader(reader.BaseStream); byte[] buffer=new byte[reader.BaseStream.Length]; breader.Read(buffer,0,buffer.Length); ms[y] = new MemoryStream(buffer); } while (true) { for (int x = 0; x < 3; x++) { Bitmap bmp = new Bitmap(ms[x]); queue.Enqueue(bmp); m_DataAvailableEvent.Set(); Thread.Sleep(6); } } } public void Consumer() { Graphics g= pictureBox1.CreateGraphics(); while (true) { m_DataAvailableEvent.WaitOne(); Bitmap bmp = queue.Dequeue(); if (bmp != null) { // Bitmap bmp = new Bitmap(ms); g.DrawImage(bmp,new Point(0,0)); bmp.Dispose(); } } } private void pictureBox1_Click(object sender, EventArgs e) { con.Start(); pro.Start(); } } when Creating bitmap and Drawing to picture box are in seperate thread then Bitmap bmp = new Bitmap(ms[x]) take 45.591 millisecond and g.DrawImage(bmp,new Point(0,0)) take 41.430 milisecond when i make bitmap from memoryStream and draw it to picture box in one thread then Bitmap bmp = new Bitmap(ms[x]) take 29.619 and g.DrawImage(bmp,new Point(0,0)) take 35.540 the code is for Example 2 is why it take more time to draw and bitmap take time in seperate thread and how to reduce the time when processing in seperate thread. i am using ANTS performance profiler 4.3 public Form1() { InitializeComponent(); pro = new Thread(new ThreadStart(Producer)); con = new Thread(new ThreadStart(Consumer)); } private AutoResetEvent m_DataAvailableEvent = new AutoResetEvent(false); Queue<MemoryStream> queue = new Queue<MemoryStream>(); Thread pro; Thread con ; public void Producer() { MemoryStream[] ms = new MemoryStream[3]; for (int y = 0; y < 3; y++) { StreamReader reader = new StreamReader("image"+(y+1)+".JPG"); BinaryReader breader = new BinaryReader(reader.BaseStream); byte[] buffer=new byte[reader.BaseStream.Length]; breader.Read(buffer,0,buffer.Length); ms[y] = new MemoryStream(buffer); } while (true) { for (int x = 0; x < 3; x++) { // Bitmap bmp = new Bitmap(ms[x]); queue.Enqueue(ms[x]); m_DataAvailableEvent.Set(); Thread.Sleep(6); } } } public void Consumer() { Graphics g= pictureBox1.CreateGraphics(); while (true) { m_DataAvailableEvent.WaitOne(); //Bitmap bmp = queue.Dequeue(); MemoryStream ms= queue.Dequeue(); if (ms != null) { Bitmap bmp = new Bitmap(ms); g.DrawImage(bmp,new Point(0,0)); bmp.Dispose(); } } } private void pictureBox1_Click(object sender, EventArgs e) { con.Start(); pro.Start(); }

    Read the article

  • GCC problem: in template

    - by Abdul jalil
    i have redhat with gcc 4.1.1 i have compile as "gcc test.c" and give the following error Error : expected '=' ,',' , ';' , ásm' or '__ attribute__' before '<' token the code in "test.c" is as follow template class A { public: T foo; };

    Read the article

  • pointer-to-pointer of derived class in multiple inheritance

    - by Abdul jalil
    i have 3 classes A,B and C. C is derived from A and B. i get pointer to pointer of class C and cast to A** , and B ** , the variable that hold the the B** has the address of A** in my example B ** BdoublePtr hold the address of A** .i am using the following code #include "conio.h" #include "stdio.h" #include "string.h" class A{ public: A() { strA=new char[30]; strcpy(strA,"class A"); } char *strA; }; class B { public: B() { strB=new char[30]; strcpy(strB,"class B"); } char *strB; }; class C :public A, public B { public: C() { strC=new char[30]; strcpy(strC,"class C"); } char *strC; }; int main(void) { C* ptrC=new C(); A * Aptr=(A*)ptrC; printf("\n class A value : %s",Aptr-strA); B * Bptr=(B*)ptrC; printf("\n class B value :%s",Bptr-strB); printf("\n\nnow with double pointer "); A ** AdoublePtr=(A **)&ptrC; Aptr=AdoublePtr; printf("\n class A value : %s",Aptr-strA); B * BdoublePtr=(B **)&ptrC; Bptr=*BdoublePtr; printf("\n class B value : %s",Bptr-strB); getch(); return 0; }

    Read the article

  • Correct display of a string...

    - by Jamal Abdul Nasir
    How to display a string in correct format as i enter it in the textarea in ruby on rails? actually i enter some string in the textarea as: my name is jamal. now there is a next line starting after name... but i get the following in the view... my name is jamal which i don't want to be like that... so, how to get the correct format..? i hope u understand...

    Read the article

  • Hiding Opetions of a Selection with JQuery

    - by Syed Abdul Rahman
    Okay, let's start with an example. <select id = "selection1">     <option value = "1" id = "1">Number 1</option>     <option value = "2" id = "2">Number 2</option>     <option value = "3" id = "3">Number 3</option> </select> Now from here, we have a dropdown with 3 options. What I want to do now is to hide an option. Adding style = "display:none" will not help. The option would not appear in the dropdownlist, but using the arrow keys, you can still select it. Essentially, it does exactly what the code says. It isn't displayed, and it stops there. A JQuery function of $("1").hide() will not work. Plus, I don't only want to hide the option, I want to completely remove it. Any possibility on doing so? Do I have to use parent/sibling/child elements? If so, I'm still not sure how. Any help on this would be greatly appreciated. Thanks.

    Read the article

  • Enable Datepicker only when first field has a value

    - by Syed Abdul Rahman
    Right now, the End Date selection is disabled. I want to only enable this when a Start Date is selected. if( $('#datepicker1').val().length === 0) { $('#datepicker2').datepicker("disable"); } else { $('#datepicker2').datepicker("enable"); } This clearly does not work. If I insert value = 'random date' into my first input field, it works fine. I'm not too sure on how do this. Clearly not as easy as I had hoped. My other problem, or hope, is to disable the dates including and before the first selection. You know, pick Start Date, and every date before and said date for the next picker would be disabled. But that is a whole other problem.

    Read the article

  • Hiding Options of a Select with JQuery

    - by Syed Abdul Rahman
    Okay, let's start with an example. Keep in mind, this is only an example. <select id = "selection1">     <option value = "1" id = "1">Number 1</option>     <option value = "2" id = "2">Number 2</option>     <option value = "3" id = "3">Number 3</option> </select> Now from here, we have a dropdown with 3 options. What I want to do now is to hide an option. Adding style = "display:none" will not help. The option would not appear in the dropdownlist, but using the arrow keys, you can still select it. Essentially, it does exactly what the code says. It isn't displayed, and it stops there. A JQuery function of $("#1").hide() will not work. Plus, I don't only want to hide the option, I want to completely remove it. Any possibility on doing so? Do I have to use parent/sibling/child elements? If so, I'm still not sure how. Any help on this would be greatly appreciated. Thanks.           Another question - It's related Ok, so I found out that there is a .remove() available in JQuery. Works well. But what if I want to bring it back? if(condition)     {     $(this).remove();     } I can loops this. Shouldn't be complicated. But the thing of which I am trying to do is this: Maximum Capacity of Class: (Input field here) Select Room: (Dropdown here) What I'd like for it to do is to update is Dropdown using a function such as .change() or .keyup. I could create the dropdown only after something is typed. At a change or a keyup, execute the dropdown accordingly. But what I am doing is this: $roomarray = mysql_query("SELECT *     FROM         (         SELECT *,         CASE         WHEN type = 'Classroom' THEN 1         WHEN type = 'Computer laboratory' THEN 2         WHEN type = 'Lecture Hall' THEN 3         WHEN type = 'Auditorium' THEN 4         END AS ClassTypeValue         FROM rooms         ) t     ORDER BY ClassTypeValue, maxppl, roomID"); echo "<select id = \"room\">"; while ($rooms = mysql_fetch_array($roomarray)) { ?> <option value=<?php echo $rooms['roomID']; ?> id=<?php echo $rooms['roomID']; ?>><?php echo $rooms['type']; echo "&nbsp;"; echo $rooms['roomID']; echo "&nbsp;("; echo $rooms['maxppl']; echo ")"; ?></option> <?php } echo "</select>"; Yes, I know it is very messy. I plan to change it later on. But the issue now is this: Can I toggle the removal of the options according to what has been typed? Is it possible to do so with a dropdown made from a loop? Because I sure as hell can't keep executing SQL Queries. Or is that even an option? Because if it's possible, I still think it's a bad one.

    Read the article

  • Real Time Sound Captureing J2ME

    - by Abdul jalil
    i am capturing sound in J2me and send these bytes to remote system, i then play these bytes on remote system.five second voice is capture and send to remote system. i get the repeated sound again .i am making a sound messenger please help me where i am doing wrong i am using the follown code . String remoteTimeServerAddress="192.168.137.179"; sc = (SocketConnection) Connector.open("socket://"+remoteTimeServerAddress+":13"); p = Manager.createPlayer("capture://audio?encoding=pcm&rate=11025&bits=16&channels=1"); p.realize(); RecordControl rc = (RecordControl)p.getControl("RecordControl"); ByteArrayOutputStream output = new ByteArrayOutputStream(); OutputStream outstream =sc.openOutputStream(); rc.setRecordStream(output); rc.startRecord(); p.start(); int size=output.size(); int offset=0; while(true) { Thread.currentThread().sleep(5000); rc.commit(); output.flush(); size=output.size(); if(size0) { recordedSoundArray=output.toByteArray(); outstream.write(recordedSoundArray,0,size); } output.reset(); rc.reset(); rc.setRecordStream(output); rc.startRecord(); }

    Read the article

  • function not printing out anything

    - by Abdul Latif
    I have the following function below: public function setupHead($title){ $displayHead .='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>'.$title.'</title>'; $displayHead .='<script type="text/javascript" src="'.PATH.'js/jquery-1.3.2.min.js"></script> <script type="text/javascript" src="'.PATH.'js/thickbox.js"></script> <script type="text/javascript" src="'.PATH.'js/ui.core.js"></script> <!--<script type="text/javascript" src="'.PATH.'js/js.js"></script>--> <link rel="stylesheet" href="'.PATH.'css/thickbox.css" type="text/css" media="screen" /> <link rel="stylesheet" type="text/css" href="'.PATH.'css/styles.css"> <link rel="stylesheet" type="text/css" href="'.PATH.'css/menu_allbrowsers.css"> <link rel="stylesheet" href="'.PATH.'css/news.css" type="text/css" media="screen" /> <link rel="stylesheet" href="'.PATH.'css/text.css" type="text/css" media="screen" /> <script type="text/javascript" src="'.PATH.'js/swfobject.js"></script> <!--[if IE 7]><link rel="stylesheet" type="text/css" href="'.PATH.'css/IE7menu.css" /><![endif]--> <!--[if IE 6]><link rel="stylesheet" type="text/css" href="'.PATH.'css/ie6.css" /><![endif]--> <!--[if IE 7]><link rel="stylesheet" type="text/css" href="'.PATH.'css/ie7.css" /><![endif]--> </head>'; return $displayHead; } but when it call is using: echo classname->setupHead($title); nothing gets displayed. doesn't php allow html in strings? Thanks in advance

    Read the article

  • Geo Fence: how to find if a point or a shape is inside a polygon using oracle spatial

    - by Abdul
    Hi Folks, How do i find if a point or a polygon is inside another polygon using oracle spatial SQL query Here is the scenario; I have a table (STATE_TABLE) which contains a spatial type (sdo_geometry) which is a polygon (of say a State), I have another table (UNIVERSITY_TABLE) which contains spatial data (sdo_geometry) (point/polygon) which contains Universities; Now how do i find if a selected University('s) are in a given State using SQL select statement. Primarily i want to locate existence of given object(s) in a geofence. Thanks.

    Read the article

  • iOS dynamic object creation

    - by Abdul Ahmad
    I've worked with Xcode and iOS on a few personal projects and have always used non-object-oriented designs for everything... just because I've been doing mostly learning/experimenting with things. Now I've been trying to implement some object oriented design into one game I've made previously. The idea is, I have a space ship that can shoot bullets. In the past I basically added the UIImageView to the storyboard and then connected it to the .h file and from there did things on it like move it around or whatever (using CGPointMake). The idea now is to make a method (and a whole other class soon) that will create a UIImageView programmatically, allocate it, add it to the superview etc... I've got this working so far, easy stuff, but the next part is a bit harder. Where do I store this local variable "bullet"? I've been saving it to an NSMutableArray and doing the following: (actually here are the methods that I have) -(void)movement { for (int i = 0; i < [array1 count]; i ++) { UIImageView *a = [array1 objectAtIndex:i]; a.center = CGPointMake(a.center.x + 2, a.center.y); if (a.center.x > 500) { [array1 removeObjectAtIndex:i]; [a removeFromSuperview]; } } } -(void)getBullet { UIImageView *bullet = [[UIImageView alloc] initWithFrame:CGRectMake(ship.center.x + 20, ship.center.y - 2, 15, 3)]; bullet.image = [UIImage imageNamed:@"bullet2.png"]; bullet.hidden = NO; [self.view addSubview:bullet]; [array1 addObject:bullet]; } (by the way, array1 is declared in the .h file) and theres a timer that controls the movement method timer = [NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(movement) userInfo:nil repeats:YES]; first question is: what is the correct way of doing this? Storing a bullet for example until it is removed from the superview, should I store it another way? and another question is, when I remove a UIImageView from the superview, does that remove it from memory so its not using up system resources? Thank you for the help! (will update if I Think of other questions

    Read the article

  • excel - generate a username from a full name field

    - by mheavers
    I'm trying to generate a username using a single name field in excel which has the person's first name and last name. I'm open to what the username would be, as long as its intuitive for the user. The name fields can be tricky, as the data looks like this: Albert Abongo (2 names) Stephen Michael Essuah Ackah (4 names) Alhaji Iddrisu Abdul-KArim (3 names) I guess my ideal usernames for these people would be aabongo sackah aabdul-karim

    Read the article

  • MySQL consuming all system memory on INSERT ... SELECT

    - by siete
    The mysql daemon is getting killed because Linux is reaching out of memory: Oct 24 07:41:23 <hostname> kernel: [82297.673701] Out of memory: kill process 13816 (mysqld) score 1839626 or a child There is a link with some workaround on this. That only happen when executing a query INSERT ... SELECT with a very huge resulset. MySQLTuner script displays that maximum theorical memory is less than 8GB, but top and munim shows that is getting over all RAM and swap available: [--] Total buffers: 560.0M global + 72.2M per thread (100 max threads) [OK] Maximum possible memory usage: 7.6G (43% of installed RAM) I'm tried to tune some options with not results, there are the relevant ones: skip-locking max_connections = 100 key_buffer_size = 512M max_allowed_packet = 32M table_open_cache = 2000 open_files_limit = 3000 sort_buffer_size = 16M read_buffer_size = 16M read_rnd_buffer_size = 8M myisam_sort_buffer_size = 64M thread_cache_size = 4 query_cache_size = 16M query_cache_limit = 2M thread_concurrency = 4 join_buffer_size = 32M tmp_table_size = 32M max_heap_table_size = 32M query_cache_limit = 8M bulk_insert_buffer_size = 64M myisam_max_sort_file_size = 50GB myisam_mmap_size = 10GB And there is a system resume: OS: Linux Debian "Squeeze" 6.0.8 (upgraded yesterday) RAM: 18GB Swap: 18GB MySQL: 5.1.72-2 (official Debain release) At this moment, update or change OS or MySQL version is not possible, there is any option that can help and i missed? Sorry by my english, and thank you in advance! Edit: I'm only using MyISAM tables, and cannot change to InnoDB.

    Read the article

  • ADNOC talks about 50x increase in performance

    - by KLaker
    If you are still wondering about how Exadata can revolutionise your business then I would recommend watching this great video which was recorded at this year's OpenWorld. First a little background...The Abu Dhabi National Oil Company for Distribution (ADNOC) is an integrated energy company that was founded in 1973. ADNOC Distribution markets and distributes petroleum products and services within the United Arab Emirates and internationally. As one of the largest and most innovative government-owned petroleum companies in the Arab Gulf, ADNOC Distribution is renowned and respected for the exceptional quality and reliability of its products and services. Its five corporate divisions include more than 200 filling stations (a number that is growing at 8% annually), more than 150 convenience stores, 10 vehicle inspection stations, as well as wholesale and retail sales of bulk fuel, gas, oil, diesel, and lubricants. ADNOC selected Oracle Exadata Database Machine after extensive research because it provided them with a single platform that can run mixed workloads in a single unified machine: "We chose Oracle Exadata Database Machine because it.offered a fully integrated and highly engineered system that was ready to deploy. With our infrastructure running all the same technology, we can operate any type of Oracle Database without restrictions and be prepared for business growth," said Ali Abdul Aziz Al-Ali, IT division manager, ADNOC Distribution. ".....we could consolidate our transaction processing and business intelligence onto one platform. Competing solutions are just not capable of doing that." - Awad Ahmed Ali El-Sidiq, Senior Database Administrator, ADNOC Distribution In this new video Awad Ahmen Ali El Sidddig, Senior DBA at ADNOC, talks about the impact that Exadata has had on his team and the whole business. ADNOC is using our engineered systems to drive and manage all their workloads: from transaction systems to payments system to data warehouse to BI environment. A true Disk-to-Dashboard revolution using Engineered Systems. This engineered approach is delivering 50x improvement in performance with one queries running 100x faster! The IT has even revolutionised some of their data warehouse related processes with the help of Exadata and now jobs that were taking over 4 hours now run in a few minutes.  To watch the video click on the image below which will take you to our Oracle YouTube page: (if the above link does not work, click here: http://www.youtube.com/watch?v=zcRpxc6u5Ic) Now that queries are running 100x faster and jobs are completing in minutes not hours, what is next for the IT team at ADNOC? Like many of our customers ADNOC is now looking to take advantage of big data to help them better align their business operations with customer behaviour and customer insights. To help deliver this next level of insight the IT team is looking at the new features in Oracle Database 12c such as the new in-memory feature to deliver even more performance gains.  The great news is that Awad Ahmen Ali El Sidddig was awarded DBA of the Year - EMEA within our Data Warehouse Global Leaders programme and you can see the badge for this award pop-up at the start of video. Well done to everyone at ADNOC and thanks for spending the time with us at OOW to create this great video.

    Read the article

< Previous Page | 1 2