Search Results

Search found 447 results on 18 pages for 'ali'.

Page 15/18 | < Previous Page | 11 12 13 14 15 16 17 18  | Next Page >

  • New/strange Java "try()" syntax?

    - by Ali
    While messing around with the custom formatting options in Eclipse, in one of the sample pieces of code, I say code as follows: /** * 'try-with-resources' */ class Example { void foo() { try (FileReader reader1 = new FileReader("file1"); FileReader reader2 = new FileReader("file2")) { } } } I've never seen try used like this and I've been coding in Java for 9 years! Does any one know why you would do this? What is a possible use-case / benefit of doing this? An other pieces of code I saw, I thought was a very useful shorthand so I'm sharing it here as well, it's pretty obvious what it does: /** * 'multi-catch' */ class Example { void foo() { try { } catch (IllegalArgumentException | NullPointerException | ClassCastException e) { e.printStackTrace(); } } }

    Read the article

  • Exporting data to an accounting system for billing and invoicing - is there any generic standard pra

    - by Ali
    Hi guys, I've built a web application which basically logs work that has been done upon projects plus maintain resources used etc. What I need now is to set it up so that projects can be billed. Billed such that - each task that has been undertaken in a project is regarded as a billable service. Instead of building my own invoicing system and accounts management system I was wondering if there was any standard data format i.e in xml DTD or so to which I could set up the information so it could be imported by a third party accounting system for billing - or if not then what is the best way to accomplish this. I need to integrate invoicing capabilities somehow - better if its third party as I don't wish to have to go through building an entire accounting system.

    Read the article

  • Node & Redis: Crucial Design Issues in Production Mode

    - by Ali
    This question is a hybrid one, being both technical and system design related. I'm developing the backend of an application that will handle approx. 4K request per second. We are using Node.js being super fast and in terms of our database struction we are using MongoDB, with Redis being a layer between Node and MongoDB handling volatile operations. I'm quite stressed because we are expecting concurrent requests that we need to handle carefully and we are quite close to launch. However I do not believe I've applied the correct approach on redis. I have a class Student, and they constantly change stages(such as 'active', 'doing homework','in lesson' etc. Thus I created a Redis DB for each state. (1 for being 'active', 2 for being 'doing homework'). Above I have the structure of the 'active' students table; xa5p - JSON stringified object #1 pQrW - JSON stringified object #2 active_student_table - {{studentId:'xa5p'}, {studentId:'pQrW'}} Since there is no 'select all keys method' in Redis, I've been suggested to use a set such that when I run command 'smembers' I receive the keys and later on do 'get' for each id in order to find a specific user (lets say that age older than 15). I've been also suggested that in fact I used never use keys in production mode. My question is, no matter how 'conceptual' it is, what specific things I should avoid doing in Node & Redis in production stage?. Are they any issues related to my design? Students must be objects and I sure can list them in a list but I haven't done yet. Is it that crucial in production stage?

    Read the article

  • Help needed to convert code from C# to Python.

    - by Ali
    Can you please convert this code from C# to Python to be run on IronPython? I don’t have any experience with Python. using System; using Baz; namespace ConsoleApplication { class Program { static void Main() { Portal foo = new Portal("Foo"); Agent bar = new Agent("Bar"); foo.Connect("127.0.0.1", 1234); foo.Add(bar); bar.Ready += new Agent.ReadyHandler(bar_Ready); } static void bar_Ready(object sender, string msg) { Console.WriteLine(msg.body); } } }

    Read the article

  • Php file outputting javascript for include as a JS file - need to restrict so its not opened in a browser window

    - by Ali
    Hi guys, I'm storing configuration details in a database which I need to use in javascript. I'm accessing all this using php and instead of outputting all the details into inline javascript code on the main page I've instead created a php file that outputs content type javascript and refernce it in my main page as an external javascript file. I want to set it up so that it can't be viewed in a browser window i.e : <script type="text/javascript" src="phpFileThatDoesJS.php" ></script> should work but typing www.mysite.com/phpFileThatDoesJS.php in the browser shouldn't EDIT ========== The thing is that I have to edit a script that for some oddball reason stores the username and password of a user in a javascript Object and outputs it within script tags. I have to set it up so that this is not viewable by a simple view source action. Thats why I thought of referencing it as an external javascript. Isnt there any htaccess tricks that I could use?

    Read the article

  • window form: Adding Emoticons

    - by Emaad Ali
    Hi, i am trying to develop a window form using c# with asp.net 3.5 framework. in that form i want to insert emoticons as we found in yahoo, hotmail etc messenger. can anyone tell me how i can implement that thing as it is done in messenger. please help me.

    Read the article

  • How can I search for an email using the zend framework?

    - by Ali
    Hi guys I need to build a functionality that involves searching through emails in an inbox for emails whose subjects match a certain user inputted keyword. SInce I'm using the zend framework I would like a solution that uses the zend framework libraries. Aside this I have noticed that the zend libraries are a bit limited with respect to my requirements for email handling. Is there any open library available in php which can be used for handling emails - when I mean handling emails I mean like: Ease to mark and flag emails Moving of emails from folder to folder. Parsing emails searching through emails SOrting emails etc - the stuff you would require if you wished to build a web client. EDIT ========= I'm looking for a generic solution here. The emails are in a regular email inbox on an IMAP server. I need a way to be able to read through and search for emails in the inbox using any specialized library to make it easier.

    Read the article

  • update table in gtk

    - by ali
    I have window that contains a table on screen, now I want to attach a widget to that table I use gtk_table_attach(GTK_TABLE(table), label, ...) the function is correct and it runs without any error but table does not respond to that line I mean there is no change on my table, I think I need something to tell that table update it self but how? note= that line is inside a callback of a signal and I am sure that signal runs note2= I do not want to destroy window for that note3= I use gtk+ and pygtk note4= I am sure I attach that widget to a correct position ( it is free)

    Read the article

  • IP address of domain on shared host

    - by Ali
    I have domain on a shared hosting provider. How do I find the direct IP address of my domain using Python? Is it possible to post to a script on my domain using the IP address and not the website itself? Thanks.

    Read the article

  • send mouse movement via client-server application

    - by Ali
    I wana let the mouse appeared and move in client side as it moved in the server.For more explination my application is sending the server screen to the client side which appeared as a seperated window in the client .However, the screen is appeared but the mouse has not been seen the window as i wish .

    Read the article

  • PHP Export to CSV

    - by Ali Hamra
    I'm not really familiar with PHP exporting to excel or csv, but I'm using PHP MySQL for a local point of sale. According to the code below, this actually works..But not in the way it should be ! All records are placed as 1 row inside the csv file, how can i fix that ? Also, How would I stop overwriting the same file...I mean When I click on a Button to export the csv, it should check if there is an existing csv file, If there is--Create new one ! Thank You require_once('connect_db.php'); $items_array = array(); $result = mysql_query("SELECT * FROM sold_items"); while($row = mysql_fetch_array($result)) { $items_array[] = $row['item_no']; $items_array[] = $row['qty']; } $f = fopen('C:/mycsv.csv', 'w'); fputcsv($f, $items_array); fclose($f);

    Read the article

  • how to start stop tomcat server using CMD?

    - by ali
    i set the path for the tomcat and set all variables like 1.JAVA_HOME=C:\Program Files (x86)\Java\jdk1.6.0_22 2.CATALINA_HOME=G:\springwork\server\apache-tomcat-6.0.29 3.CLASSPATH=G:\springwork\server\apache-tomcat-6.0.29\lib\servlet-api.jar;G:\springwork\server\apache-tomcat-6.0.29\lib\jsp-api.jar;.; when i go to bin folder and double click on startup.bat then my tomcat start and when i double click on shutdown.bat tomcat is stop. But I want using CMD start and stop the tomcat. And in any folder i write command startup.bat the server will start and when i write the server will stop...... Thanks in advace..........

    Read the article

  • .htaccess subdomain redirect problem

    - by Ali
    Hi, I have a website let's say www.example.com and I have a subdomain something.example.com Both main domain and sub domain are pointing to directory "public_html" I have .htaccess on root which redirects any URL without www to www. For e.g. if user enters example.com then he will be redirected to www.example.com If user enters example.com/mypage.html then he will be redirected to www.example.com/mypage.html Now the problem is this is also affecting my subdomain. Because if someone enters something.example.com/visit.html then he is redirect to www.example.com/visit.html I don't want this! If user enters subdomain then I don't want to redirected to www domain. This is what I have in my .htacces file RewriteCond %{HTTP_HOST} !^www.stackoverflow.com$ [NC] RewriteRule ^(.*)$ http://www.stackoverflow.com/$1 [R=301,L] Can you please tell me what should I do to solve above problem? Thanks.

    Read the article

  • Reason for monolithic data files

    - by Ali Lown
    Primarily this seems to be a technique used by games, where they have all the sounds in one file, textures in another etc. With these files commonly reaching the GB size. What is the reason behind doing this over maintaining it all in subdirectories as small files - one per texture which many small games use this, with the monolithic system being favoured by larger companies? Is there some file system overhead with lots of small files? Are they trying to protect their property - although most just seem to be a compressed file with a new extension?

    Read the article

  • Zend Framework - Not Connecting to IMAP mail server - instead dumps empty php file

    - by Ali
    Hi guys I'm trying to connect to an imap mail server using zend frameworks Zend_Mail_Storage_Imap function. Its working with some accounts but with most accounts it just dies out. I'm connecting using: $mail = new Zend_Mail_Storage_Imap(array('host' =>$current_dept->incoming_server, 'ssl' =>$current_dept->ssl, 'port'=>$current_dept->incoming_port, 'folder'=>$mbox_name, 'user' =>$current_dept->email, 'password' =>$current_dept->email_psd)); WIth some email accounts teh code doesn't go past this statement - and instead I'm prompted to 'download' the php file being run. Whats happening here - the mail server details are correct.

    Read the article

  • Grails unit testing domain classes with Set properties - is this safe?

    - by Ali G
    I've created a domain class in Grails like this: class MyObject { static hasMany = [tags: String] // Have to declare this here, as nullable constraint does not seem to be honoured Set tags = new HashSet() static constraints = { tags(nullable: false) } } Writing unit tests to check the size and content of the MyObject.tags property, I found I had to do the following: assertLength(x, myObject.tags as Object[]) assertEquals(new HashSet([...]), myObject.tags) To make the syntax nicer for writing the tests, I implemented the following methods: void assertEquals(List expected, Set actual) { assertEquals(new HashSet(expected), actual) } void assertLength(int expected, Set set) { assertLength(expected, set as Object[]) } I can now call the assertLength() and assertEquals() methods directly on an instance of Set, e.g. assertLength(x, myObject.tags) assertEquals([...], myObject.tags) I'm new to Groovy and Grails, so unaware how dangerous method overloading like this is. Is it safe? If so, I'm slightly* surprised that these methods (or similar) aren't already available - please let me know if they are. * I can see how these methods could also introduce ambiguity if people weren't expecting them. E.g. assertLength(1, set) always passes, no matter what the content of set

    Read the article

  • Error occurs when I convert NSMutableArray to NSArray

    - by Ali
    Hi All, I want to convert NSMutableArray to NSArray to it gives error following is code ABAddressBookRef addressBook = ABAddressBookCreate(); CFArrayRef allPeople = ABAddressBookCopyArrayOfAllPeople(addressBook); CFIndex nPeople = ABAddressBookGetPersonCount(addressBook); tempPeoples=[[NSMutableArray alloc]init]; for(int i=0;i<nPeople;i++){ ABRecordRef i1=CFArrayGetValueAtIndex(allPeople, i); [tempPeoples addObject:i1]; // [peoples addObject:i1]; }// end of the for loop // Peoples is NSArray // peoples=[[NSArray alloc] initWithArray: tempPeoples]; peoples=[NSArray arrayWithArray:tempPeoples]; Please help

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18  | Next Page >