Daily Archives

Articles indexed Friday May 14 2010

Page 25/116 | < Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >

  • Modify the windows style of another application using winAPI

    - by karthik
    My application starts up another application. whereby, i want to remove the title bar of the application which is started using c#. How can i do this, starting up with the piece of code below ? //Get current style lCurStyle = GetWindowLong(hwnd, GWL_STYLE) //remove titlebar elements lCurStyle = lCurStyle And Not WS_CAPTION lCurStyle = lCurStyle And Not WS_SYSMENU lCurStyle = lCurStyle And Not WS_THICKFRAME lCurStyle = lCurStyle And Not WS_MINIMIZE lCurStyle = lCurStyle And Not WS_MAXIMIZEBOX //apply new style SetWindowLong hwnd, GWL_STYLE, lCurStyle //reapply a 3d border lCurStyle = GetWindowLong(hwnd, GWL_EXSTYLE) SetWindowLong hwnd, GWL_EXSTYLE, lCurStyle Or WS_EX_DLGMODALFRAME //redraw SetWindowPos hwnd, 0, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE Or SWP_FRAMECHANGED

    Read the article

  • tabs problem in java swings

    - by charan
    hi all... i had created 8 tabs in tabbed panel using java swings. the problem is when i enter data in any tab and click the save button. after clicking it leaves the present tab/panel and going to first tab. i have to retain on the same tab after clicking the save button.. so please help me on this

    Read the article

  • Alternative of custom attrbutes for tags to store some information in HTML 4

    - by Ashwani K
    Hello All: Can some body tell me any alternative to store some information for a particular tag in HTML 4. For example If I have a drop down like <select> <option value="0" regionId="1">Test1</option> <option value="1" regionId="2">Test2</option> </select> Here regionId is a custom attribute, I am able to access the attribute but the W3C HTML validation is failing. Any suggestion on this?

    Read the article

  • Store CSPC and UPC Codes in Rails

    - by Kevin Sylvestre
    What the best way to store CSPC and UPC codes are in Rails? I used integers with SQLite, but had overflow issues when moving to production. I've since switch to strings, but am not sure if a better generic datatype (needs to support SQLite, MySQL and PostgreSQL). Thanks.

    Read the article

  • TVirtualStringTree - resetting non-visual nodes and memory consumption

    - by Remy Lebeau - TeamB
    I have an app that loads records from a binary log file and displays them in a virtual TListView. There are potentially millions of records in a file, and the display can be filtered by the user, so I do not load all of the records in memory at one time, and the ListView item indexes are not a 1-to-1 relation with the file record offsets (List item 1 may be file record 100, for instance). I use the ListView's OnDataHint event to load records for just the items the ListView is actually interested in. As the user scrolls around, the range specified by OnDataHint changes, allowing me to free records that are not in the new range, and allocate new records as needed. This works fine, speed is tolerable, and the memory footprint is very low. I am currently evaluating TVirtualStringTree as a replacement for the TListView, mainly because I want to add the ability to expand/collapse records that span multiple lines (I can fudge it with the TListView by incrementing/decrementing the item count dynamically, but this is not as straight forward as using a real tree). For the most part, I have been able to port the TListView logic and have everything work as I need. I notice that TVirtualStringTree's virtual paradigm is vastly different, though. It does not have the same kind of OnDataHint functionality that TListView does (I can use the OnScroll event to fake it, which allows my memory buffer logic to continue working), and I can use the OnInitializeNode event to associate nodes with records that are allocated. However, once a tree node is initialized, it sees that it remains initialized for the lifetime of the tree. That is not good for me. As the user scrolls around and I remove records from memory, I need to reset those non-visual nodes without removing them from the tree completely, or losing their expand/collapse states. When the user scrolls them back into view, I can re-allocate the records and re-initialize the nodes. Basically, I want to make TVirtualStringTree act as much like TListView as possible, as far as its virtualization is concerned. I have seen that TVirtualStringTree has a ResetNode() method, but I encounter various errors whenever I try to use it. I must be using it wrong. I also thought of just storing a data pointer inside each node to my record buffers, and I allocate and free memory, update those pointers accordingly. The end effect does not work so well, either. Worse, my largest test log file has ~5 million records in it. If I initialize the TVirtualStringTree with that many nodes at one time (when the log display is unfiltered), the tree's internal overhead for its nodes takes up a whopping 260MB of memory (without any records being allocated yet). Whereas with the TListView, loading the same log file and all the memory logic behind it, I can get away with using just a few MBs. Any ideas?

    Read the article

  • Array Intersect giving wrong output

    - by Pankaj Khurana
    Hi, I need to find common elements between two arrays. My code is: $sql="SELECT DISTINCT fk_paytbl_discounts_discountid as discountid from paytbl_discounts_students WHERE fk_vtiger_cf_601='".$categoryid."'"; $discountstudentinfo=$objdb->customQuery($sql,false); $sql1="SELECT DISTINCT fk_paytbl_discounts_discountid as discountid from paytbl_discounts_variants WHERE fk_vtiger_products_productid='".$variantid."'"; $discountvariantinfo=$objdb->customQuery($sql1,false); $commondiscount=array_intersect($discountvariantinfo,$discountstudentinfo); First array Array ( [0] => Array ( [discountid] => 2 ) [1] => Array ( [discountid] => 8 ) [2] => Array ( [discountid] => 5 ) [3] => Array ( [discountid] => 4 ) ) Second array Array ( [0] => Array ( [discountid] => 1 ) [1] => Array ( [discountid] => 5 ) ) Common array Array ( [0] => Array ( [discountid] => 1 ) [1] => Array ( [discountid] => 5 ) ) Common array should have only discountid 5 but its showing 1 also. Please help me on this Thanks

    Read the article

  • Pattern Recognition for image comparision in .net

    - by vinod R
    hi Can anybody share code or algorithm(using pattern recognition) for image comparision in .net . I need to compare 2 images of different resolution and textures and the find the difference . Now i have code to find the difference between 2 images using C# // Load the images. Bitmap bm1 = (Bitmap) (Image.FromFile(txtFile1.Text)); Bitmap bm2 = (Bitmap) (Image.FromFile(txtFile2.Text)); // Make a difference image. int wid = Math.Min(bm1.Width, bm2.Width); int hgt = Math.Min(bm1.Height, bm2.Height); Bitmap bm3 = new Bitmap(wid, hgt); // Create the difference image. bool are_identical = true; int r1; int g1; int b1; int r2; int g2; int b2; int r3; int g3; int b3; Color eq_color = Color.Transparent; Color ne_color = Color.Transparent; for (int x = 0; x <= wid - 1; x++) { for (int y = 0; y <= hgt - 1; y++) { if (bm1.GetPixel(x, y).Equals(bm2.GetPixel(x, y))) { bm3.SetPixel(x, y, eq_color); } else { bm1.SetPixel(x, y, ne_color); are_identical = false; } } } // Display the result. picResult.Image = bm1; Bitmap Logo = new Bitmap(picResult.Image); Logo.MakeTransparent(Logo.GetPixel(1, 1)); picResult.Image = (Image)Logo; //this.Cursor = Cursors.Default; if ((bm1.Width != bm2.Width) || (bm1.Height != bm2.Height)) { are_identical = false; } if (are_identical) { MessageBox.Show("The images are identical"); } else { MessageBox.Show("The images are different"); } //bm1.Dispose() // bm2.Dispose() BUT this compare if the 2 images are of same resolution and size.if some shadow is there on one image(but the 2 images are same) it shows the difference between the image..so i am trying to compare using pattern recognition. Thanks in advance

    Read the article

  • django forms doubt

    - by webvulture
    Here, I am a bit confused with forms in Django. I have information for the form(a poll i.e the poll question and options) coming from some db_table - table1 or say class1 in models. Now the vote from this poll is to be captured which is another model say class2. So, I am just getting confused with the whole flow of forms, here i think. How will the data be captured into the class2 table? I was trying something like this. def blah1()     get_data_from_db_table_1()     x = blah2Form()     render_to_response(blah.html,{...})

    Read the article

  • Query regarding the Nhibernate many to many mapping

    - by Pramod
    Hi, I have a requirement where i have 3 dimension tables (employee, project, technology) and a common fact table which has the key id's of all these three tables. My question goes like this... How do i create a mapping table (fact table) having these three columns - emp_id, proj_i and tech_i. I know we can achieve this for two tables using the below syntax: HasManyToMany(x = x.Empl) .Table("Emp_Proj") .ParentKeyColumn("Emp_i") .ChildKeyColumn("Proj_I") .Inverse() .Cascade.All(); How can i add another child key column (tech_i) to the above mapping table?

    Read the article

  • How to redirect to the current page with form in php?

    - by garcon1986
    Hello, I tried to redirect to the current page with form in my php application. Now i have met a problem. <form name="myform" action="?page=matching" method="GET"> <input id="match_button" type="submit" name="button" value="button" onClick="func_load3()" /> </form> action="?page=matching" means the current page, because i use the single entry in my php application. With the code upon, When i click the button, it redirects to the homepage. And I tried to use: <form name="myform" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="GET"> but it still doesn't work. So i have to ask for help from you. Do you have any ideas about that? How to fix it? Thanks in advance.

    Read the article

  • Cross Thread Exception in PropertyChangedEvent in WPF

    - by Ashish Ashu
    I have a ListView that is binded to my custom collection. At run time , I am updating the certain properties of my entity in my custom collection in my ViewModel. At the same time , I am also doing the custom sorting in the listview. The custom sorting is applicable when I click on the any column header of the listview. For example, I am updating the current datetime on my entity on every 5 seconds and simulaneously , I am applying custom sorting based on DateTime. (The Listview is third party control). Hence I am doing two operations on my custom collection at the same time. Should I pass the dispatcher of my control in the view model and call any methods ( which updates any entity in my custom collection ) through UI dispatcher ?

    Read the article

  • In game programming are global variables bad?

    - by Joe.F
    I know my gut reaction to global variables is "badd!" but in the two game development courses I've taken at my college globals were used extensively, and now in the DirectX 9 game programming tutorial I am using (www.directxtutorial.com) I'm being told globals are okay in game programming ...? The site also recommends using only structs if you can when doing game programming to help keep things simple. I'm really confused on this issue, and all the research I've been trying to do is very confusing. I realize there are issues when using global variables (threading issues, they make code harder to maintain, the state of them is hard to track etc) but also there is a cost associated with not using globals, I'd have to pass a loooot of information around very often which can be confusing and I imagine time-costing, although I guess pointers would speed the process up (this is my first time writing a game in C++.) Anyway, I realize there is probably no "right" or "wrong" answer here since both ways work, but I want my code to be as proper as I can so any input would be good, thank you very much!

    Read the article

  • asp.net mvc, jquery dialog + select + getJson (different results in ff, ie and chrome)

    - by vbobruisk
    Hi everybody. i'm using jquery 1.3.2, and have a problem in situatsuin where i fill select via getJson $.each(data, function() { $("#select_elem").append("<option value='"+this.Value+"'>" + this.Value + "</option>"); }); and after, when i try to get selected value : var sel_val = $("#select_elem"); alert(sel_val.val()); in IE it works, in FF it always shows the first value in list, in chrome it's always null. is there any way to fix this? Thank You !

    Read the article

  • tabs problem in Java Swing

    - by charan
    I have created 8 tabs in a tabbed panel using Java Swing. The problem is when I enter data in any tab and click the save button. After clicking it leaves the present tab/panel and goes to the first tab. I have to retain on the same tab after clicking the save button. Please help me on this.

    Read the article

  • Why border of <tr> not showing in IE?

    - by metal-gear-solid
    Why border of tfoot tr:first-child not showing in IE. I'm checking in IE7. font-weight:bold; background:yellow is showing in IE but border not table { border-collapse: collapse; border-spacing: 0; } table tfoot tr:first-child {font-weight:bold; background:yellow; border-top:2px solid red; border-bottom:2px solid red;}

    Read the article

  • Implementing java FixedTreadPool status listener

    - by InsertNickHere
    Hi there, it's about an application which is supposed to process (VAD, Loudness, Clipping) a lot of soundfiles (e.g. 100k). At this time, I create as many worker threads (callables) as I can put into memory, and then run all with a threadPool.invokeAll(), write results to file system, unload processed files and continue at step 1. Due to the fact it's an app with a GUI, i don't want to user to feel like the app "is not responding" while processing all soundfiles. (which it does at this time cause invokeAll is blocking). Im not sure what is a "good" way to fix this. It shall not be possible for the user to do other things while processing, but I'd like to show a progress bar like "10 of 100000 soundfiles are done". So how do I get there? Do I have to create a "watcher thread", so that every worker hold a callback on it? I'm quite new to multi threading, and don't get the idea of such a mechanisem.. If you need to know: I'm using SWT/JFace. Regards, InsertNickHere

    Read the article

  • Google Maps Polygon - Not creating independent

    - by ferronrsmith
    I am basically populating a map with polygons, I am using the flex sdk. The problem I am having is that each time it adds a parish it keep adding to the previous polygons and treating it as one. HELP!! <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <maps:Map xmlns:maps="com.google.maps.*" id="map" mapevent_mapready="onMapReady(event)" width="100%" height="100%" key="ABQIAAAAGe0Fqwt-nY7G2oB81ZIicRT2yXp_ZAY8_ufC3CFXhHIE1NvwkxRcFmaI_t1gtsS5UN6mWQkH9kIw6Q"/> <mx:Script> <![CDATA[ import com.google.maps.Color; import com.google.maps.LatLng; import com.google.maps.Map; import com.google.maps.MapEvent; import com.google.maps.MapType; import com.google.maps.controls.ZoomControl; import com.google.maps.overlays.Polygon; import com.google.maps.overlays.PolygonOptions; import com.google.maps.styles.FillStyle; import com.google.maps.styles.StrokeStyle; import mx.controls.Alert; import mx.utils.ColorUtil; import mx.utils.object_proxy; private var polys:Array = new Array(); private var labels:Array = new Array(); // private var pts:Array = new Array(); // private var poly:Polygon; // private var map:Map; private function onMapReady(event:Event):void { map.setCenter(new LatLng(18.070146,-77.225647), 9, MapType.NORMAL_MAP_TYPE); map.addControl(new ZoomControl()); map.enableScrollWheelZoom(); map.enableContinuousZoom(); getXml(); } public function getXml():void { var xmlString:URLRequest = new URLRequest("parish.xml"); var xmlLoader:URLLoader = new URLLoader(xmlString); xmlLoader.addEventListener("complete", readXml); } private function readXml(event:Event):void { var markersXML:XML = new XML(event.target.data); var markers:XMLList = markersXML..parish; //var markersCount:int = markers.length(); var i:Number; var t:Number; for(i=0; i < markers.length(); i++) { var marker:XML = markers[i]; var name:String = marker.@name; var colour:String = marker.@colour; // Alert.show(""); var the_p:XMLList = markers..point; var pts:Array = []; for(t=0; t < the_p.length(); t++) { var theparish:XML = the_p[t]; pts[t] = new LatLng(theparish.@lat,theparish.@lng); // Alert.show("working" + theparish.@lat); // var pts.push(new LatLng(theparish.@lat,theparish.@lng)); } var poly:Polygon = new Polygon(pts, new PolygonOptions({ strokyStyle: new StrokeStyle({ color: colour, thickness: 1, alpha: 0.2}), fillStyle: new FillStyle({ color: colour, alpha: 0.2}) })); //polys.push(poly); //labels.push(name); Alert.show("this"); pts = [] map.addOverlay(poly); } } /* public function createMarker(latlng:LatLng, name:String, address:String, type:String): Marker { var marker:Marker = new Marker(latlng, new MarkerOptions({icon: new customIcons[type], iconOffset: new Point(-16, -32)})); var html:String = "<b>" + name + "</b> <br/>" + address; marker.addEventListener(MapMouseEvent.CLICK, function(e:MapMouseEvent):void { marker.openInfoWindow(new InfoWindowOptions({contentHTML:html})); }); return marker; } */ ]]> </mx:Script> </mx:Application>

    Read the article

  • Asp.net 3.5 Deployment issue

    - by peter
    For deploying my website in server by using IIS 5.1,,i created virtual directory,,i browsed in to my application and selected asp.net 2.0 tab(application is framework3.5)..I reset framwork configuratio 2,0 Runtime security Policy Enterprise,Machine,User tab,,What ever things i can do i did Still also application is working properly,,but i am not able to deploy it in IIS i am getting this error If i browse Login.aspx i am getting ** Server Application Unavailable The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser to retry your request. Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur. ** Is it with IIS 5.1?? Here my machine is acting as server ,It has xp professional 2002 service pack 2 and IIS 5.1

    Read the article

  • Software Engineering Papers

    - by kunjaan
    Please recommend me software engineering/methodology/practices paper. So far I have enjoyed: 1968 Dijkstra : Go To Statement Considered Harmful Nikalus Wirth : Program Development by Stepwise Refinement 1971 David Parnas : Information Distribution Aspects of Design Methodology 1972 Liskov : Design Methodology for Reliable Software Systems Extensible Language : Schuman and P Jourrand R. Balzer Structured Programming : Dahl - Hierarchical Program StructuresImplementation Patterns 1971 Jim Morris Protection in Programming Languages 1973 Bill Wulf and Mary Shaw Global Variable Considered Harmful 1974 : Lisko and Zilles ADTs

    Read the article

< Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >