Search Results

Search found 133 results on 6 pages for 'sajid ahmad'.

Page 4/6 | < Previous Page | 1 2 3 4 5 6  | Next Page >

  • What are common anti-patterns when using VBA

    - by Ahmad
    I have being coding a lot in VBA lately (maintenance and new code), specifically with regards to Excel automation etc. = macros. Typically most of this has revolved around copy/paste, send some emails, import some files etc. but eventually just ends up as a Big ball of mud As a person who values clean code, I find it very difficult to produce 'decent' code when using VBA. I think that in most cases, this is a direct result of the macro-recorder. Very helpful to get you started, but most times, there are one too many lines of code that achieve the end result. Edit: The code from the macro-recorder is used as a base to get started, but is not used in its entirety in the end result I have already created a common addin that has my commonly used subroutines and some utility classes in an early attempt to enforce some DRYness - so this I think is a step in the right direction. But I feel as if it's a constant square peg, round hole situation. The wiki has an extensive list of common anti-patterns and what scared me the most was how many I have implemented in one way or another. The question Now considering, that my mindset is OO design, what some common anti-patterns and the possible solutions when designing a solution (think of this - how would designing a solution using Excel and VBA be different from say a .net/java/php/.../ etc solution) ; and when doing common tasks like copying data, emailing, data importing, file operations... etc An anti-pattern as defined by Wikipedia is: In software engineering, an anti-pattern (or antipattern) is a pattern that may be commonly used but is ineffective and/or counterproductive in practice

    Read the article

  • WCF Service Throttling

    - by Mubashar Ahmad
    Dear All I have a WCF Service Deployed in a Console App with BasicHTTPBinding and SSL enabled on port using NetSH command and more over following attribute is set as well. [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] And also i have set the Throttling behavior as <serviceThrottling maxConcurrentCalls="2147483647" maxConcurrentSessions="2147483647" maxConcurrentInstances="2147483647" /> On the other hand i have created a Test Client(for load test) that initiates multiple clients simultaneously(multiple threads) and performs transactions on server. everything seems fine and working properly but on server the CPU utilization is doesn't grow so i added some logging to view the number of concurrent calls to the server and found that its never went over 6. i have reviewed the performance counter logging code more than twice and it seems fine to me. So i want to ask where is the problem in this situation and one more thing i haven't specified any kind of ContextMode or ConcurrencyMode yet. After this Post I noticed that whenever i start another Intance of Test Client my concurrent Server Calls counter increase to 2 like if i am running only 1 instance the maximum Concurrent Rcvd Calls will be 2 and if there are two instance the same value goes to 4 and so on. Is there any limit of Number of WCF Calls from once process? Looking for help Mubashar *Added on 17-March******************* Today i ran another test with one test client(with 50 concurrent users) on the same machine on which the server is running this time i am getting exact result what i wanted it to show i.e. Maximum concurrent Calls Rcvd by Server = 50 but i need to do it the same on others machines as well. Can anybody help me on this.

    Read the article

  • Jasper report not showing detail section

    - by Jawad Ahmad
    I have designed a report in iReport and now I am using it in my application. The problem is that the report is generated showing all the data except the detail section data. There is no database connectivity problem, as the column header shows data which is coming from database. Only the detail section of the report shows nothing, neither data from database nor any static data. What is going on?

    Read the article

  • Looking for OnLog Event - log4net

    - by Mubashar Ahmad
    Dear Devs I am using Log4net to produce different kind of logs and using RollingFileAppenders which rolls on a given size. Now i have a new requirement that a log should be visible on a windows form therefore i am looking for some event that can be handled on each log entry within my application so i can display that particular log entry in my form as well. Or there may be some appender which gives such functionality. Any idea on this?

    Read the article

  • Nature of Lock is child table while deletion(sql server)

    - by Mubashar Ahmad
    Dear Devs From couple of days i am thinking of a following scenario Consider I have 2 tables with parent child relationship of kind one-to-many. On removal of parent row i have to delete the rows in child those are related to parents. simple right? i have to make a transaction scope to do above operation i can do this as following; (its psuedo code but i am doing this in c# code using odbc connection and database is sql server) begin transaction(read committed) Read all child where child.fk = p1 foreach(child) delete child where child.pk = cx delete parent where parent.pk = p1 commit trans OR begin transaction(read committed) delete all child where child.fk = p1 delete parent where parent.pk = p1 commit trans Now there are couple of questions in my mind Which one of above is better to use specially considering a scenario of real time system where thousands of other operations(select/update/delete/insert) are being performed within a span of seconds. does it ensure that no new child with child.fk = p1 will be added until transaction completes? If yes for 2nd question then how it ensures? do it take the table level locks or what. Is there any kind of Index locking supported by sql server if yes what it does and how it can be used. Regards Mubashar

    Read the article

  • Websphere MQ using JMS, closed connections stuck on the MQ

    - by Ahmad
    I have a simple JMS application deployed on OC4J under AIX server, in my application I'm listening to some queues and sending to other queues on a Websphere MQ deployed under AS400 server. The problem is that my connections to these queues are terminated/closed when it stays idle for some time with the error MQJMS1016 (this is not the problem), and when that happens I attempt to recover the connection and it works, however, the old connection is stuck at the MQ and would not terminate until it is terminated manually. The recovery code goes as follows: public void recover() { cleanup(); init(); } public void cleanup(){ if (session != null) { try { session .close(); } catch (JMSException e) { } } if (connection != null) { try { connection.close(); } catch (JMSException e) { } } } public void init(){ // typical initialization of the connection, session and queue... }

    Read the article

  • Using Logger Filter with Not Equal condition Log4net

    - by Mubashar Ahmad
    Dears I am using log4net in my c# application i have different logger which insert text lines in my single log file. But now i wanted to add a new logger which should not post log entries in the same file rather i should log in a different file so i configured a new fileAppender, After doing whatever i found on the net i am able to create a different file for my new logger but it echoes the same value in first log file too. so please if anybody knows about the use of LogFilters so that i could add "Logger < New logger " match in previously configured appender. Regards Mubashar

    Read the article

  • OTA plist app install from within phonegap app for iPad

    - by Farhan Ahmad
    I am trying to initiate a OTA app install from within a phonegap iPad app. I have tried this: var url = "http://www.example.com/test.plist"; window.open("itms-services://?action=download-manifest&url=" + url, "_blank"); This works in iOS 5 but NOT iOS 6. I have also tried using the ChildBrowser plugin to point to a page with a link to the OTA app install but that doesn't work either. (If I visit the webpage directly from within the native iPad browser, it works fine) Does anyone know how I can initiate a OTA app install from within the phonegap iPad app? (must work in iOS 5 and iOS 6) I am trying to implement an auto update feature within a Ad-Hock iPad app (not through App Store). So when the app detects that there is a new update, it will prompt the user to install the new update and thats where I need this functionality.

    Read the article

  • Sharepoint and SQL server Endpoint

    - by Usman Ahmad
    I created a LinkedServer on MS SQL Server 2005 pointing to my Active Directory. Nothing too fancy. Simple LinkedServer with ReadOnlyAdmin Account assigned to CONNECTAS Property. Then I created some storedprocedures to retreive some data from the LinkedServer. Again nothing too fancy. Just a few simple LDAP Queries. Then I created a SQL Endpoint to expose these stored procedures as Web services. Using Visual Studio 2008, everything is fine and dandy. It finds the endpoint, gets the list of the methods available and runs smoothly. Cool. But the Sharpeoint Add Web Service somehow doesn't work! It finds the WSDL file no prob. Retrieves the list of functions and parameterss n all but just simply doesn't run them! Any advice or where I should start checking?

    Read the article

  • How to effectively use WorkbookBeforeClose event correctly?

    - by Ahmad
    On a daily basis, a person needs to check that specific workbooks have been correctly updated with Bloomberg and Reuters market data ie. all data has pulled through and that the 'numbers look correct'. In the past, people were not checking the 'numbers' which led to inaccurate uploads to other systems etc. The idea is that 'something' needs to be developed to prevent the use from closing/saving the workbook unless he/she has checked that the updates are correct/accurate. The numbers look correct action is purely an intuitive exercise, thus will not be coded in any way. The simple solution was to prompt users prior to closing the specific workbook to verify that the data has been checked. Using VSTO SE for Excel 2007, an Add-in was created which hooks into the WorkbookBeforeClose event which is initialised in the add-in ThisAddIn_Startup private void wb_BeforeClose(Xl.Workbook wb, ref bool cancel) { //.... snip ... if (list.Contains(wb.Name)) { DailogResult result = MessageBox.Show("some message", "sometitle", MessageBoxButtons.YesNo); if (result != DialogResult.Yes) { cancel = true; // i think this prevents the whole application from closing } } } I have found the following ThisApplication.WorkbookBeforeSave vs ThisWorkbook.Application.WorkbookBeforeSave which recommends that one should use the ThisApplication.WorkbookBeforeClose event which I think is what I am doing since will span all files opened. The issue I have with the approach is that assuming that I have several files open, some of which are in my list, the event prevents Excel from closing all files sequentially. It now requires each file to be closed individually. Am I using the event correctly and is this effective & efficient use of the event? Should I use the Application level event or document level event? Is there a way to prevent the above behaviour? Any other suggestions are welcomed VS 2005 with VSTO SE

    Read the article

  • DDB unknown file

    - by Ahmad Hajou
    I have a .ddb file that is used as a telephone directory for an application written in flash/VB.net (i guess). The problem is that the application is crashing and my only was to access the application is through the mysterious (*.ddb) file (99% of the application size.) The application contains an also mysterious dll (NK_SQLite.dll). So far I have tried: SQLite Browser tried opening the file in PL/SQL tried opening the file in SQL Server Any ideas about how to solve this issue,

    Read the article

  • Facing Memory Leaks in AES Encryption Method.

    - by Mubashar Ahmad
    Can anyone please identify is there any possible memory leaks in following code. I have tried with .Net Memory Profiler and it says "CreateEncryptor" and some other functions are leaving unmanaged memory leaks as I have confirmed this using Performance Monitors. but there are already dispose, clear, close calls are placed wherever possible please advise me accordingly. its a been urgent. public static string Encrypt(string plainText, string key) { //Set up the encryption objects byte[] encryptedBytes = null; using (AesCryptoServiceProvider acsp = GetProvider(Encoding.UTF8.GetBytes(key))) { byte[] sourceBytes = Encoding.UTF8.GetBytes(plainText); using (ICryptoTransform ictE = acsp.CreateEncryptor()) { //Set up stream to contain the encryption using (MemoryStream msS = new MemoryStream()) { //Perform the encrpytion, storing output into the stream using (CryptoStream csS = new CryptoStream(msS, ictE, CryptoStreamMode.Write)) { csS.Write(sourceBytes, 0, sourceBytes.Length); csS.FlushFinalBlock(); //sourceBytes are now encrypted as an array of secure bytes encryptedBytes = msS.ToArray(); //.ToArray() is important, don't mess with the buffer csS.Close(); } msS.Close(); } } acsp.Clear(); } //return the encrypted bytes as a BASE64 encoded string return Convert.ToBase64String(encryptedBytes); } private static AesCryptoServiceProvider GetProvider(byte[] key) { AesCryptoServiceProvider result = new AesCryptoServiceProvider(); result.BlockSize = 128; result.KeySize = 256; result.Mode = CipherMode.CBC; result.Padding = PaddingMode.PKCS7; result.GenerateIV(); result.IV = new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; byte[] RealKey = GetKey(key, result); result.Key = RealKey; // result.IV = RealKey; return result; } private static byte[] GetKey(byte[] suggestedKey, SymmetricAlgorithm p) { byte[] kRaw = suggestedKey; List<byte> kList = new List<byte>(); for (int i = 0; i < p.LegalKeySizes[0].MaxSize; i += 8) { kList.Add(kRaw[(i / 8) % kRaw.Length]); } byte[] k = kList.ToArray(); return k; }

    Read the article

  • Internationalization & Localization issue

    - by Ahmad
    Hi all, My application supports internationalization and localization, each user can choose his preference language and the application will reflect it perfectly. the issue is when the first user selects English and the second one selects French the resource bundle for the first user will read from the French resource after refreshing his page. I am using the following code to change between the two languages: public void changeToEnglish() { FacesContext context = FacesContext.getCurrentInstance(); Locale currentLocale = context.getViewRoot().getLocale(); String locale = "en_US"; Locale newLocale = new Locale(locale); if(!currentLocale.equals(newLocale)) context.getViewRoot().setLocale(newLocale); } I have the following in my faces_config.xml: <locale-config> <default-locale>en</default-locale> <supported-locale>fr</supported-locale> </locale-config> the application respond very well to changing languages but I think when setting the locale from the FacesContext it reflects all the users locales. Please help me on this....

    Read the article

  • Explaining verity index and document search limits

    - by Ahmad
    As present, we currently have a CF8 standard edition server which have some limitations around verity indexing. According to Adobe Verity Server has the following document search limits (limits are for all collections registered to Verity Server): - 10,000 documents for ColdFusion Developer Edition - 125,000 documents for ColdFusion Standard Edition - 250,000 documents for ColdFusion Enterprise Edition We have now reached a stage where the server wide number of documents indexed exceed 125k. However, the largest verity collection consists of about 25k documents(and this is expected to grow). Only one collection is ever searched at a time. In my understanding, this means that I can still search an entire collection with no restrictions. Is this correct? Or does it mean that only documents that were indexed across all collection prior to reaching the limit are actually searchable? We are considering moving to CF9 standard as a solution to this and to use the Solr solution which has no restrictions. The coldfusionjedi highlights some differences between Verity and Solr. However, before we upgrade I am trying to gain a clearer understanding of this before we commit to an upgrade. Can someone provide me a clear explanation as to what this means and how it actually affects verity searching and indexing?

    Read the article

  • WCF - Network Cost

    - by Mubashar Ahmad
    Dear Devs I have a wcf service deployed on IIS with basicHttpBinding and aspNetCompatibilityEnabled=true I have a test client as well which invokes multiple service functions simultaneously. To check the performance of service call on client and server I calculated the Avg time it takes to complete a service request on client(in proxy code) and on server as well. after a test of 8 hrs (server and client were on the same machine) i came to know that average response time on client is around 34ms where as the Avg execution time on server is around 3ms so the difference is 31ms. I would like to know why every call is taking 31ms is it justified? and how can i reduce this?

    Read the article

  • Write-Through Cache

    - by Mubashar Ahmad
    Dear All I am trying to do an C# implementation of Write-through Cache to minimize the read hits on db i need your suggestions, articles or sample codes to fulfill this assignment. Initially this would be use only on one server but will be updated to work in clustered environment. I only able to get a worth reading article on Oracle Site. Please share your views Regards Mubashar

    Read the article

  • How to Setup Eclipse to Start Writing Web Services using Axis2

    - by Mubashar Ahmad
    Dear Gurus I am a .net Developer but now a days i want to setup Eclipse to write a sample web services to test the capacity of Java/Axis over WCF/BasicHttpBindings. I found a couple of articles regarding the setup procedures but they are too old or their wording is may be for java or eclipse experts. Can anyone please give me detailed instruction on how can I get to work quickly. I tried my best but i can't even setup TomCat properly its not starting and throwing exception when i try to start it from eclipse servers windows. Please some one give me a latest and novice level article. Regards

    Read the article

  • Performance Counters in Server Development

    - by Mubashar Ahmad
    Dear Gurus All you be agree with the value and worth of Performance Counters while developing and maintaining a server kind application I would like to know what is the best way to implement those, Specifically using C#? Usually performance counters have the following attributes They are shared global Writing requires locks to ensure Synchronization Reading Some times requires locks too. Is it better to update them Asynchronously and what is the best way to make them so. (I am planning to use the ThreadPool.QueuWorketItem function, pls tell me you opinion on this too.) If my question seems a bit vague can you just take the example of a HelloWorld Wcf service and i wanted to know following how many times its being hit overall and within a certain period Average/min/max Response Times overall and within a certain period. Moreover if any one knows about the Specialized way provided by DotNet or WCF then please let me know as well.

    Read the article

  • Execute linux AT Command via PHP

    - by ahmad Rabie
    When I run this code via ssh echo wget http://domain.com/send_me_email.php | at 12:54 it run correctly and send me an email at that time. but if I run a php Like this exec("echo wget http://domain.com/send_me_email.php | at 12:54"); exec("atq",$arr); print_r($arr); result of that code is something like this : job 63 at 2011-11-27 12:54 ,As you can see the job created successfully but I don't receive any Email at that time?! I test this line in php exec("wget http://domain.com/send_me_email.php"); and it send me an email, it means that I have permission to run exec and wget via php.but what is problem? I cant understand what is my problem. Please help me. thanks

    Read the article

  • WCF Service Memory Leaks

    - by Mubashar Ahmad
    Dear Devs I have a very small wcf service hosted in a console app. [ServiceContract] public interface IService1 { [OperationContract] void DoService(); } [ServiceBehavior(InstanceContextMode=InstanceContextMode.PerCall)] public class Service1 : IService1 { public void DoService() { } } and its being called as using (ServiceReference1.Service1Client client = new ServiceReference1.Service1Client()) { client.DoService(new DoServiceRequest()); client.Close(); } Please remember that service is published on basicHttpBindings. Problem Now when i performed above client code in a loop of 1000 i found big difference between "All Heap bytes" and "Private Bytes" performance counters (i used .net memory profiler). After investigation i found some of the objects are not properly disposed following are the list of those objects (1000 undisposed instance were found -- equals to the client calls) (namespace for all of them is System.ServiceModel.Channels) HttpOutput.ListenerResponseHttpOutput.ListenerResponseOutputStream BodyWriterMessage BufferedMessage HttpRequestContext.ListenerHttpContext.ListenerContextHttpInput.ListenerContextInputStream HttpRequestContext.ListenerHttpContext Questions Why do we have lot of undisposed objects and how to control them. Please Help

    Read the article

  • Save Jquery Object without losing its binding

    - by Ahmad Satiri
    Hi I have object created using jquery where each object has it's own binding. function closeButton(oAny){ var div = create_div(); $(div).attr("id","btn_"+$(oAny).attr("id")); var my_parent = this; $(div).html("<img src='"+ my_parent._base_url +"/assets/images/close.gif'>"); $(div).click(function(){ alert("do some action here"); }); return div; } var MyObject = WindowObject(); var btn = closeButton(MyObject); $(myobject).append(btn); $("body").append(myobject); //at this point button will work as i expected //save to array for future use ObjectCollections[0] = myobject; //remove $(myobject).remove(); $(body).append(ObjectCollections[0]); // at this point button will not work For the first time i can show my object and close button is working as i expected. But if i save myobject to any variable for future use. It will loose its binding. Anybody ever try to do this ? Is there any work around ? or It is definitely a bad idea ? .And thanks for answering my question.

    Read the article

  • Data Annotations on ViewModels or Domain Objects

    - by Ahmad
    Where would data annotations be more suitable: ViewModels or Domain Objects or Both I am struggling to decide where these will be more suited. I have not as yet fully utilized them but this question came to mind. From most of the examples I have seen, they are generally placed on Models and simply use the required attributes for validation using ModelState.IsValid. I have also seen another question on SO where the use of data annotations alone is not sufficient and advocate. Option 1 - I will still need to validate again in my service layer. ( I think that my service layer should be complete and this include validation, since its planned to be used elsewhere) Option 2 - How will I then get the benefits of the built in validation both client and server side. Option 3 - there will be a repetition of validation logic, however I was wondering if one could use a MetaData class approach that can be used for both ViewModels and Domain Objects. ( This is completely of the top of my head, so it may be nonsensical) I wonder if this question even makes sense. If not, can someone please help in understanding this better. Have I completely misunderstood the use of data annotations?

    Read the article

< Previous Page | 1 2 3 4 5 6  | Next Page >