Search Results

Search found 676 results on 28 pages for 'muhammad ali'.

Page 21/28 | < Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >

  • Can't retrieve more than 2 gmail messages using Zend framework imap access - server dies - doens't r

    - by Ali
    Hi guys I'm working on a google apps application. Basically I've set it up so users can add multiple gmail addresses and check on their inboxes in the application. It works fine with a google apps email address however when I add a gmail address it just dies out. I'm using this code here: $mail = new Zend_Mail_Storage_Imap($mail_options); $all_messages = array(); $page = isset($_GET['page'])?$_GET['page']:1; $limit = isset($_GET['limit'])?$_GET['limit']:20; $offset = (($page-1)*$limit)+1; $end = ($page*$limit)>$c?$c:($page*$limit); for ($i=$offset;$i<=$end;$i++){ $h2t = new html2text(); $h2t->set_allowed_tags('<a>'); if(!$mail[$i]) break; else{ $one_message = $mail->getMessage($i); $one_message->id = $i; $one_message->UID = $mail->getUniqueId($i); $one_message->parts = array(); $one_message->body = ''; $count = 1; foreach (new RecursiveIteratorIterator($mail->getMessage($i)) as $ii=>$part) { try { $tpart = $part; //$tpart->_content = ''; $one_message->parts[$count] = $tpart; $count++; // check for html body if (strtok($part->contentType, ';') == 'text/html') { $b = $part->getContent(); if($part->contentTransferEncoding == 'quoted-printable') $b = quoted_printable_decode($b); $one_message->html_body = $b; $h2t->set_html($b); $one_message->body = $h2t->get_text(); } //check for text body if (strtok($part->contentType, ';') == 'text/plain') { $b = $part->getContent(); if($part->contentTransferEncoding == 'quoted-printable') $b = quoted_printable_decode($b); $one_message->text_body = $b; $one_message->body = $b;//$part->getContent(); } } catch (Zend_Mail_Exception $e) { // ignore } } $all_messages[] = $one_message; } } No matter what the emails it dies out on retrieving just 2 emails... whats going on here?

    Read the article

  • Php script running as scheduled task hangs - help!

    - by Ali
    Hi guys, I've built a php script that runs from the command line. It opens a connection into a pop3 email account and downloads all the emails and writes them to a database, and deletes them once downloaded. I have this script being called from the commandline by a bat file. in turn I have created a scheduled task which invokes the bat file every 5 minutes. The thing is that I have set the time out to zero for the fact that at times there could be emails with large attachments and the script actually downloads the attachments and stores them as raw files offline and the no timeout is so that the script doesnt die out during downloading. I've found that the program hangs sometimes and its a bit annoying at that - it always hangs are one point i.e. when negotiating the connection and getting connected to the mail server. And because the timeout is set to zero it seems to stay stuck up in taht position. And because of that the task is not run as its technically hung up. I want that the program should not timeout when downloading emails - however at the points where it is negotiating a connection or trying to connect to the mailserver there should be a timeout only at that point itself and not the rest of the program execution. How do I do this :(

    Read the article

  • Nhibernate - Getting Exception when run a simple join query

    - by Muhammad Akhtar
    hi, I am getting issue when I run sql Query having inner join, here is what I am doing very simple ISession session = NHibernateHelper.GetCurrentSession(); string query = string.Format("select Documents.TypeId from Documents inner join DocumentTrackingItems on Documents.Id = DocumentTrackingItems.DocumentId WHERE DocumentTrackingItems.ItemStepId = {0} order by Documents.TypeId asc", 13); System.Collections.ArrayList document = (System.Collections.ArrayList)session.CreateSQLQuery(query, "document", typeof(Document)).List(); I am getting this exception Exception Details: System.IndexOutOfRangeException: Id what's wrong in my query? --- thanks

    Read the article

  • Suppressing a function's command window output in Matlab

    - by Ali
    A function I'm using has "display()" in it (or other things that display messages on command window), so it outputs a lot of things (x 1200) on command line when I run my code, which makes things hard to track and observe. Is there a way to suppress the output of this specific function? Ending the statement with semicolon obviously doesn't help.

    Read the article

  • Python timed file upload

    - by Ali
    I have a python script that accepts a file from the user and saves it. Is it possible to not upload the file immediately but to que it up and when the server has less load to upload it then. Can this be done by transferring the file to the browsers storage area or taking the file from the Harddrive and transferring to the User's RAM?

    Read the article

  • How to bind grid in ASP.NET?

    - by Abid Ali
    I cant bind my Grid. I dont know what I am doing wrong, the grid appears empty when I run the program. here is my code :: protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) this.BindGrid(this.GridView1); } private void BindGrid(GridView grid) { SqlCommand cmd = new SqlCommand("Select * from Person", cn); SqlDataAdapter da = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); da.Fill(dt); grid.DataSource = dt; grid.DataBind(); } <body> <form id="form1" runat="server"> <div style="margin-left: 240px"> <asp:GridView ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None" Width="856px" AutoGenerateColumns = "false" ShowFooter = "true" ShowHeader="true" BorderStyle="Groove" CaptionAlign="Top" HorizontalAlign="Center" onrowdatabound="GridView1_RowDataBound" > <RowStyle BackColor="#F7F6F3" ForeColor="#333333" /> <Columns> <asp:BoundField HeaderText="ID" /> <asp:BoundField HeaderText="First Name" /> <asp:BoundField HeaderText="Last Name" /> <asp:BoundField HeaderText="Home Phone #" /> <asp:BoundField HeaderText="Cell #" /> <asp:BoundField HeaderText="Email Address" /> <asp:BoundField HeaderText="NIC #" /> <asp:TemplateField HeaderText="Action"> <ItemTemplate> <asp:Button ID="Button1" runat="server" Text="Button" /> <asp:Button ID="Button2" runat="server" Text="Button" /> </ItemTemplate> </asp:TemplateField> </Columns> <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /> <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" /> <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" /> <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /> <EditRowStyle BackColor="#999999" /> <AlternatingRowStyle BackColor="White" ForeColor="#284775" /> </asp:GridView> </div> </form> </body>

    Read the article

  • Array filteration PHP

    - by Muhammad Sajid
    I have an array with values like: Array ( [0] => Array ( [parent] => Basic [parentId] => 1 [child] => Birthday [childId] => 2 ) [1] => Array ( [parent] => Basic [parentId] => 1 [child] => Gender [childId] => 3 ) [2] => Array ( [parent] => Geo [parentId] => 10 [child] => Current City [childId] => 11 ) [3] => Array ( [parent] => Known me [parentId] => 5 [child] => My personality [childId] => 7 ) [4] => Array ( [parent] => Known me [parentId] => 5 [child] => Best life moment [childId] => 8 ) ) And I want to filter this array such that their filtration based on parent index, and the final result would be like: Array ( [0] => Array ( [parent] => Basic [parentId] => 1 [child] => Array ( [0] => Birthday [1] => Gender ) ) [1] => Array ( [parent] => Geo [parentId] => 10 [child] => Array ( [0] => Current City ) ) [2] => Array ( [parent] => Known me [parentId] => 5 [child] => Array ( [0] => My personality [1] => Best life moment ) ) ) For that I coded : $filter = array(); $f = 0; for ($i=0; $i<count($menuArray); $i++) { $c = 0; for( $b = 0; $b < count($filter); $b++ ){ if( $filter[$b]['parent'] == $menuArray[$i]['parent'] ){ $c++; } } if ($c == 0) { $filter[$f]['parent'] = $menuArray[$i]['parent']; $filter[$f]['parentId'] = $menuArray[$i]['parentId']; $filter[$f]['child'][] = $menuArray[$i]['child']; $f++; } } But it results : Array ( [0] => Array ( [parent] => Basic [parentId] => 1 [child] => Array ( [0] => Birthday ) ) [1] => Array ( [parent] => Geo [parentId] => 10 [child] => Array ( [0] => Current City ) ) [2] => Array ( [parent] => Known me [parentId] => 5 [child] => Array ( [0] => My personality ) ) ) Could anyone point out my missing LOC?

    Read the article

  • How to get <select> options either (value or text) using jQuery

    - by Muhammad Sajid
    Hello, i have a code for <select id='list'> <option value='1'>Option A</option> <option value='2'>Option B</option> <option value='3'>Option C</option> </select> and i want that how ever i select any option, it will show in an alert message. i have try <script type='text/javascript'> //var value = $("#list option[value=2]").text(); //var value = $("#list option:selected").text(); //var value = $('#list').val(); var value = $(this).val(); alert(value); </script> but fail.

    Read the article

  • deactivate ' pin to start ' on Application List page when pinning an app via code using C#?

    - by Ahmed Ali
    i'm creating a windows phone app ,where i've put a button to pin the app to start screen , but when press and hold the app icon on application list screen i find that the pin to start option can be used ShellTile TileToFind = ShellTile.ActiveTiles.FirstOrDefault(x => x.NavigationUri.ToString().Contains("MainPage.xaml")); // Create the Tile if we didn't find that it already exists. if (TileToFind == null) { // Create the Tile object and set some initial properties for the Tile. // The Count value of 12 shows the number 12 on the front of the Tile. Valid values are 1-99. // A Count value of 0 indicates that the Count should not be displayed. StandardTileData NewTileData = new StandardTileData { BackgroundImage = new Uri("300.png", UriKind.Relative), Title = "apptitle", BackTitle = "title", BackContent = "testing ", BackBackgroundImage = null }; // Create the Tile and pin it to Start. This will cause a navigation to Start and a deactivation of our app. ShellTile.Create(new Uri("/MainPage.xaml", UriKind.Relative), NewTileData); } else { MessageBox.Show("Already Pinned"); } how can i disable the user from pinning the application again from application list screen

    Read the article

  • Joomla of ASP.NET

    - by Sakhawat Ali
    Hi all, If i look into PHP they have Joomla, although it was initially build for CMS only but currently it is doing much more then that, like it have Shopping Card module, blogging, forums and many more. In short for PHP guy they have Joomla as opensource, which just need a little customization and the side is ready within 3days. Now what we have in ASP.NET, the most famous opensource here is dotNetNuke but don't support web2.0. My question here is that what do we have in ASP.NET platform or in other word what is Joomla of ASP.NET.

    Read the article

  • Data Access from single table in sql server 2005 is too slow

    - by Muhammad Kashif Nadeem
    Following is the script of table. Accessing data from this table is too slow. SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Emails]( [id] [int] IDENTITY(1,1) NOT NULL, [datecreated] [datetime] NULL CONSTRAINT [DF_Emails_datecreated] DEFAULT (getdate()), [UID] [nvarchar](250) COLLATE Latin1_General_CI_AS NULL, [From] [nvarchar](100) COLLATE Latin1_General_CI_AS NULL, [To] [nvarchar](100) COLLATE Latin1_General_CI_AS NULL, [Subject] [nvarchar](max) COLLATE Latin1_General_CI_AS NULL, [Body] [nvarchar](max) COLLATE Latin1_General_CI_AS NULL, [HTML] [nvarchar](max) COLLATE Latin1_General_CI_AS NULL, [AttachmentCount] [int] NULL, [Dated] [datetime] NULL ) ON [PRIMARY] Following query takes 50 seconds to fetch data. select id, datecreated, UID, [From], [To], Subject, AttachmentCount, Dated from emails If I include Body and Html in select then time is event worse. indexes are on: id unique clustered From Non unique non clustered To Non unique non clustered Tabls has currently 180000+ records. There might be 100,000 records each month so this will become more slow as time will pass. Does splitting data into two table will solve the problem? What other indexes should be there?

    Read the article

  • Pass CSS property dynamically from panelgrid

    - by Bernad Ali
    I have a hidden property which is fetched from ebean. how do i pass that color code property to css function? <h:panelGrid id="testpanel" columns="#{message.no_of_columns}" rows="#{message.no_of_rows}" styleClass="dynamicGrid"> <c:forEach items="#{bLDashBoardAction.listBondLoc}" var="item"> <h:panelGroup> <h:outputText value="#{item.rackTagCode}" /> <h:hiddenInput value="#{item.colorEBean.colorCode};" /> </h:panelGroup> </c:forEach> </h:panelGrid> this is my css property,background need to be assigned from panelgrid colorcode .dynamicGrid td { width: 50px; height: 50px; border: 4px solid gray; background: }

    Read the article

  • gzip compression using varnish cache

    - by Ali Raza
    Im trying to provide gzip compression using varnish cache. But when I set content-encoding as gzip using my below mentioned configuration for varnish (default.vcl). Browser failed to download those content for which i set content-encoding as gzipped. Varnish configuration file: backend default { .host = "127.0.0.1"; .port = "9000"; } backend socketIO { .host = "127.0.0.1"; .port = "8083"; } acl purge { "127.0.0.1"; "192.168.15.0"/24; } sub vcl_fetch { /* If the request is for pictures, javascript, css, etc */ if (req.url ~ "^/public/" || req.url ~ "\.js"){ unset req.http.cookie; set beresp.http.Content-Encoding= "gzip"; set beresp.ttl = 86400s; set beresp.http.Cache-Control = "public, max-age=3600"; /*set the expires time to response header*/ set beresp.http.expires=beresp.ttl; /* marker for vcl_deliver to reset Age: */ set beresp.http.magicmarker = "1"; } if (!beresp.cacheable) { return (pass); } return (deliver); } sub vcl_deliver { if (resp.http.magicmarker) { /* Remove the magic marker */ unset resp.http.magicmarker; /* By definition we have a fresh object */ set resp.http.age = "0"; } if(obj.hits > 0) { set resp.http.X-Varnish-Cache = "HIT"; }else { set resp.http.X-Varnish-Cache = "MISS"; } return (deliver); } sub vcl_recv { if (req.http.x-forwarded-for) { set req.http.X-Forwarded-For = req.http.X-Forwarded-For ", " client.ip; } else { set req.http.X-Forwarded-For = client.ip; } if (req.request != "GET" && req.request != "HEAD" && req.request != "PUT" && req.request != "POST" && req.request != "TRACE" && req.request != "OPTIONS" && req.request != "DELETE") { /* Non-RFC2616 or CONNECT which is weird. */ return (pipe); } # Pass requests that are not GET or HEAD if (req.request != "GET" && req.request != "HEAD") { return(pass); } #pipe websocket connections directly to Node.js if (req.http.Upgrade ~ "(?i)websocket") { set req.backend = socketIO; return (pipe); } # Properly handle different encoding types if (req.http.Accept-Encoding) { if (req.url ~ "\.(jpg|png|gif|gz|tgz|bz2|tbz|mp3|ogg|js|css)$") { # No point in compressing these remove req.http.Accept-Encoding; } elsif (req.http.Accept-Encoding ~ "gzip") { set req.http.Accept-Encoding = "gzip"; } elsif (req.http.Accept-Encoding ~ "deflate") { set req.http.Accept-Encoding = "deflate"; } else { # unkown algorithm remove req.http.Accept-Encoding; } } # allow PURGE from localhost and 192.168.15... if (req.request == "PURGE") { if (!client.ip ~ purge) { error 405 "Not allowed."; } return (lookup); } return (lookup); } sub vcl_hit { if (req.request == "PURGE") { purge_url(req.url); error 200 "Purged."; } } sub vcl_miss { if (req.request == "PURGE") { purge_url(req.url); error 200 "Purged."; } } sub vcl_pipe { if (req.http.upgrade) { set bereq.http.upgrade = req.http.upgrade; } } Response Header: Cache-Control:public, max-age=3600 Connection:keep-alive Content-Encoding:gzip Content-Length:11520 Content-Type:application/javascript Date:Fri, 06 Apr 2012 04:53:41 GMT ETag:"1330493670000--987570445" Last-Modified:Wed, 29 Feb 2012 05:34:30 GMT Server:Play! Framework;1.2.x-localbuild;dev Via:1.1 varnish X-Varnish:118464579 118464571 X-Varnish-Cache:HIT age:0 expires:86400.000 Any suggestion on how to fix it and how to provide gzip compression using varnish.

    Read the article

  • MVC2 Data Annotation Buddy Classes Doesn't seem to work when Classes and EOM Model is in separate Project

    - by Danish Ali
    Dear All Iam new to MVC2 and having a little problem with implementing validation via buddy classes. Iam using Repository pattern with dependency injection. My Entity Object Model is in Data Layer Project and Buddy Classes are in Business Layer project and MVC 2 Project as a separate Presentation Layer Project. Can any one help me out with implementing Buddy Classes in this Architecture. Thanks and Regards Dani

    Read the article

  • Costs and Scope in developing a typical iphone application

    - by ali
    Iam new to iphone development and have been tasked to development a fairly simple iphone application. It would basically show listings of information eg accommodations, restaurants...around 8-9 different types. Drilling on one would show the details of it. These are dynamically sourced from a db (through an xml feed) that powers an existing website. Also users should have ability to save favourites and also an interactive google map showing locations of these places. Just would like to know how long would such an iphone application take to develop and what would it costs. As iam new to iphone dev, i do not know how big the scope is, any complications to anticipate, scope creep issues, and how much to charge. Want to give a reasonable estimate so that i dont overcharge.

    Read the article

  • SQL query to return data from two separate rows in a table joined to a master table

    - by Ali
    I have a TWO tables of data with following fields table1=(ITTAG,ITCODE,ITDESC,SUPcode) table2=(ACCODE,ACNAME,ROUTE,SALMAN) This is my customer master table that contains my customer data such as customer code, customer name and so on... Every Route has a supervisor (table1=supcode) and I need to know the supervisor name in my table which both supervisor name and code exist in one table. table1 has contain all names separated by ITTAG. For example, supervisor's name has ITTAG='K'; also salesman's name has ITTAG='S'. ITTAG ITCODE ITDESC SUPCODE ------ ------ ------ ------- S JT JOHN TOMAS TF K WK VIKI KOO NULL Now this is the result which I want ACCODE ACNAME ROUTE SALEMANNAME SUPERVISORNAME ------- ------ ------ ------------ --------------- IMC1010 ABC HOTEL 01 JOHN TOMAS VIKI KOO I hope this this information is sufficient to get the query..

    Read the article

  • Using jquery Autocomplete on textbox control in c#

    - by Abid Ali
    When I run this code I get alert saying Error. My Code: <script type="text/javascript"> debugger; $(document).ready(function () { SearchText(); }); function SearchText() { $(".auto").autocomplete({ source: function (request, response) { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/GetAutoCompleteData", data: "{'fname':'" + document.getElementById('txtCategory').value + "'}", dataType: "json", success: function (data) { response(data.d); }, error: function (result) { alert("Error"); } }); } }); } </script> [WebMethod] public static List<string> GetAutoCompleteData(string CategoryName) { List<string> result = new List<string>(); using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["DbConnection"].ConnectionString)) { using (SqlCommand cmd = new SqlCommand("select fname from tblreg where fname LIKE '%'+@CategoryText+'%'", con)) { con.Open(); cmd.Parameters.AddWithValue("@CategoryText", CategoryName); SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { result.Add(dr["fname"].ToString()); } return result; } } } I want to debug my function GetAutoCompleteData but breakpoint is not fired at all. What's wrong in this code? Please guide. I have attached screen shot above.

    Read the article

  • monotouch play music when device is locked

    - by Ali Shafai
    I'm trying to make my monotouch app continue playing when the device is locked, I found this snippet in ObjC, was wondering if mt already has bindings for it or not. AudioSessionInitialize (NULL,NULL,interruptionListenerCallback,self); UInt32 sessionCategory = kAudioSessionCategory_MediaPlayback; AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(sessionCategory), &sessionCategory);

    Read the article

  • Show values in TDropDownList in PRADO.

    - by Muhammad Sajid
    I m new to PRADO, I have a file Home.page with code: <%@ Title="Contact List" %> <h1>Contact List</h1> <a href="<%= $this->Service->constructUrl('insert')%>">Create New Contact</a> <br/> <com:TForm> <com:TDropDownList ID="personInfo"> <com:TListItem Value="value 1" Text="item 1" /> <com:TListItem Value="value 2" Text="item 2" Selected="true" /> <com:TListItem Value="value 3" Text="item 3" /> <com:TListItem Value="value 4" Text="item 4" /> </com:TDropDownList> </com:TForm> & Home.php with code <?php class Home extends TPage { /** * Populates the datagrid with user lists. * This method is invoked by the framework when initializing the page * @param mixed event parameter */ public function onInit($param) { parent::onInit($param); // fetches all data account information $rec = ContactRecord::finder()->findAll(); } } ?> the $rec contain array of all values. Now I want to show all name in Dropdown list. I tried my best but fail. Can anyone help me? Thanks

    Read the article

  • CakePHP hasMany relationship with multiple columns

    - by Muhammad Yasir
    Hi, I am using CakePHP framework to build a web application. The simplest form of my problem is this: I have a users table and a messages table with corresponding models. Messages are sent from a user to another user. So messages table has columns from_id and to_id in it, both referencing to id of users. I am able to link Message model to User model by using $belongsTo but I am unable to link User model with Message model (in reverse direction) by using $hasMany in the same manner. var $hasMany = array( 'From' => array( 'className' => 'Message', 'foreignKey' => 'from_id', 'dependent' => false, 'conditions' => '', 'fields' => '', 'order' => '', 'limit' => '', 'offset' => '', 'exclusive' => '', 'finderQuery' => '', 'counterQuery' => '' ), 'To' => array( 'className' => 'Message', 'foreignKey' => 'to_id', 'dependent' => false, 'conditions' => '', 'fields' => '', 'order' => '', 'limit' => '', 'offset' => '', 'exclusive' => '', 'finderQuery' => '', 'counterQuery' => '' ) ); What can do here? Any ideas? Thanks for any help.

    Read the article

  • Replace images in a DIV using javascript.

    - by Muhammad Sajid
    Hi, I want to show different images in a DIV, the turn of an image depend on a random number. The image name is like 1.gif, 2.gif, .. 6.gif to do that I coded var img = document.createElement("IMG"); img.src = "images/1.gif"; document.getElementById('imgDiv').appendChild(img); but it does not replace the old image how ever it add an another image right in the bottom of first image. syntax for DIV is: <div id="imgDiv" style="width:85px; height:100px; margin:0px 10px 10px 375px;"></div> may u halp me ?

    Read the article

< Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >