Search Results

Search found 185 results on 8 pages for 'joao angelo'.

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

  • How can I use nested Async (WCF) calls within foreach loops in Silverlight ?

    - by Peter St Angelo
    The following code contains a few nested async calls within some foreach loops. I know the silverlight/wcf calls are called asyncrously -but how can I ensure that my wcfPhotographers, wcfCategories and wcfCategories objects are ready before the foreach loop start? I'm sure I am going about this all the wrong way -and would appreciate an help you could give. private void PopulateControl() { List<CustomPhotographer> PhotographerList = new List<CustomPhotographer>(); proxy.GetPhotographerNamesCompleted += proxy_GetPhotographerNamesCompleted; proxy.GetPhotographerNamesAsync(); //for each photographer foreach (var eachPhotographer in wcfPhotographers) { CustomPhotographer thisPhotographer = new CustomPhotographer(); thisPhotographer.PhotographerName = eachPhotographer.ContactName; thisPhotographer.PhotographerId = eachPhotographer.PhotographerID; thisPhotographer.Categories = new List<CustomCategory>(); proxy.GetCategoryNamesFilteredByPhotographerCompleted += proxy_GetCategoryNamesFilteredByPhotographerCompleted; proxy.GetCategoryNamesFilteredByPhotographerAsync(thisPhotographer.PhotographerId); // for each category foreach (var eachCatergory in wcfCategories) { CustomCategory thisCategory = new CustomCategory(); thisCategory.CategoryName = eachCatergory.CategoryName; thisCategory.CategoryId = eachCatergory.CategoryID; thisCategory.SubCategories = new List<CustomSubCategory>(); proxy.GetSubCategoryNamesFilteredByCategoryCompleted += proxy_GetSubCategoryNamesFilteredByCategoryCompleted; proxy.GetSubCategoryNamesFilteredByCategoryAsync(thisPhotographer.PhotographerId,thisCategory.CategoryId); // for each subcategory foreach(var eachSubCatergory in wcfSubCategories) { CustomSubCategory thisSubCatergory = new CustomSubCategory(); thisSubCatergory.SubCategoryName = eachSubCatergory.SubCategoryName; thisSubCatergory.SubCategoryId = eachSubCatergory.SubCategoryID; } thisPhotographer.Categories.Add(thisCategory); } PhotographerList.Add(thisPhotographer); } PhotographerNames.ItemsSource = PhotographerList; } void proxy_GetPhotographerNamesCompleted(object sender, GetPhotographerNamesCompletedEventArgs e) { wcfPhotographers = e.Result.ToList(); } void proxy_GetCategoryNamesFilteredByPhotographerCompleted(object sender, GetCategoryNamesFilteredByPhotographerCompletedEventArgs e) { wcfCategories = e.Result.ToList(); } void proxy_GetSubCategoryNamesFilteredByCategoryCompleted(object sender, GetSubCategoryNamesFilteredByCategoryCompletedEventArgs e) { wcfSubCategories = e.Result.ToList(); }

    Read the article

  • Inherit from Type class of .Net

    - by Miguel Angelo
    Is there any point at all on inheriting from Type class in .Net? i.e. What could be the meaning of doing so? I am asking this because of this text in MSDN documentation: Notes to Inheritors When you inherit from Type, you must override the following members... list of members. MSDN doc for Type: http://msdn.microsoft.com/en-us/library/system.type.aspx ok, that is actually saying that anyone can inherit from Type... but they dont say why would you ever want to do that. Thanks!

    Read the article

  • Tomcat Clustering and HTTPS Issue

    - by Angelo
    Hi I have two instances of Tomcat 6 with content accessible via HTTP and HTTPS for other pages. I have configured the instances this way: 1) Instance one to listen on port 8080(Http) and 8443(Https) 2) Instance two to listen on port 7080(Http) and 7443(Https) I have mod_proxy configured with Apache 2.2 to do clustering. The requests are coming in properly and all works well for HTTP traffic but when you are in the app and it becomes HTTPS then i get the page cannot be found when tomcat tries to serve the page. Now if I access the two tomcat instances directly bypassing the load balancer then everything is fine. So http/https is configured properly on tomcat but not on Apache. I have a feeling i must configure Apache to handle this(or mod_proxy). Thanks,

    Read the article

  • Lxml or Xpath content print

    - by Angelo
    function= def parseTitle(self, post): """ Returns title string with spaces replaced by dots "" return post.xpath('h2')[0].text.replace('.', ' ') i would to see the content of post. Tried all . How can i properly debug the content. ir is an webstite of movies where i rip links and tittle. So this one should parse the title.and i am sure H@ is not existing , how to print/debug it?

    Read the article

  • Can this be done in 1 line?

    - by Angelo
    Can this be done in 1 line with PHP? Would be awesome if it could: $out = array("foo","bar"); echo $out[0]; Something such as: echo array("foo","bar")[0]; Unfortunately that's not possible. Would it be possible like this? So I can do this for example in 1 line: echo array(rand(1,100), rand(1000,2000))[rand(0,1)]; So let's say I have this code: switch($r){ case 1: $ext = "com"; break; case 2: $ext = "nl"; break; case 3: $ext = "co.uk"; break; case 4: $ext = "de"; break; case 5: $ext = "fr"; break; } That would be much more simplified to do it like this: $ext = array("com","nl","co.uk","de","fr")[rand(1,5)];

    Read the article

  • iPhone: How do I override the back button in a Navigation Controller?

    - by Angelo Stracquatanio
    Hello, In my app I have a basic Navigation Controller. For all of my views, except one, the controller works as it should. However, for one view in particular, I would like the 'back' button to not go back to the previous view, but to go to one I set. In particular it is going to go back 2 views and skip over one. After doing some research I found that I can intercept the view when it disappears, so I tried to put in code to have it navigate to the page I would like: - (void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; //i set a flag to know that the back button was pressed if (viewPushed) { viewPushed = NO; } else { // Here, you know that back button was pressed mainMenu *mainViewController = [[mainMenu alloc] initWithNibName:@"mainMenu" bundle:nil]; [self.navigationController pushViewController:mainViewController animated:YES]; [mainViewController release]; } } That didn't work, so does anyone have any ideas? Thanks!!

    Read the article

  • Playing craps, asking and printing

    - by Angelo Mejia
    How do I ask the amount of games of craps someone wants to play and print the number of wins as a result of n number of games? Also How do I make a table in the main method using the previous methods I have? A table like this but shows the results: Percent Wins Games Experiment Number 1 2 3 4 5 6 7 8 9 10 100 1000 10000 100000 1000000 public class CrapsAnalysis { public static int rollDie( int n) { return (int)(Math.random()*n) + 1 ; } public static int rollDice( ) { int die1 ; int die2 ; die1 = rollDie(6) ; die2 = rollDie(6) ; return die1 + die2 ; } public static boolean playOneGame( ) { int newDice ; //repeated dice rolls int roll ; //first roll of the dice int playerPoint = 0 ; //player point if no win or loss on first roll newDice = rollDice() ; roll = rollDice() ; if (roll == 7 || roll == 11) return true; else if (roll == 2 || roll == 3 || roll == 12) return false; else { playerPoint = roll; newDice = rollDice(); do { newDice = rollDice(); } while (newDice != playerPoint || newDice != 7) ; if (newDice == 7) return false; else return true; } } public static int playGames ( int n ) { int numWon = 0; for (int i = 1; i <= n; i++) if(playOneGame()) numWon++; return numWon; } public static void main(String[] args) { //Don't know how to ask and print out the results of the number of wins depending on the n number of games played } }

    Read the article

  • Thumbnail image saved with worse quality on Windows Server 2003

    - by Angelo
    Hello, In asp.net 2.0 application I am trying to create thumbnails from uploaded images. However when I test the application on my PC under Windows7 it works fine, but on the real Windows 2003 Server the resized image has worse quality. Where this difference could come from? Different JPEG codec or what, if Yes how it can be updated on Win 2003 Server? Thanks! Here is the code: Resize of the Image: Bitmap newBmp = new Bitmap(imgWidth, imgHeight, PixelFormat.Format24bppRgb); newBmp.SetResolution(inputBmp.HorizontalResolution, inputBmp.VerticalResolution); //Create a graphics object attached to the new bitmap Graphics newBmpGraphics = Graphics.FromImage(newBmp); newBmpGraphics.InterpolationMode = InterpolationMode.HighQualityBicubic; newBmpGraphics.SmoothingMode = SmoothingMode.HighQuality; newBmpGraphics.PixelOffsetMode = PixelOffsetMode.HighQuality; newBmpGraphics.DrawImage(inputBmp, new Rectangle(0, 0, imgWidth, imgHeight), new Rectangle(0, 0, inputBmp.Width, inputBmp.Height), GraphicsUnit.Pixel); Save of the Image: System.IO.Stream imgStream = new System.IO.MemoryStream(); //Get the ImageCodecInfo for the desired target format ImageCodecInfo destCodec = FindCodecForType(ImageMimeTypes.JPEG); if (destCodec == null) { //No codec available for that format throw new ArgumentException("The requested format image/jpeg does not have an available codec installed", "destFormat"); } //Create an EncoderParameters collection to contain the //parameters that control the dest format's encoder EncoderParameters destEncParams = new EncoderParameters(1); EncoderParameter qualityParam = new EncoderParameter(System.Drawing.Imaging.Encoder.Quality,(long)quality); destEncParams.Param[0] = qualityParam; //Save w/ the selected codec and encoder parameters inputBmp.Save(imgStream, destCodec, destEncParams); Bitmap destBitmap = new Bitmap(imgStream);

    Read the article

  • What is the most efficient way of associating information with a Type in .Net?

    - by Miguel Angelo
    I want to associate custom data to a Type, and retrieve that data in run-time, blasingly fast. This is just my imagination, of my perfect world: var myInfo = typeof(MyClass).GetMyInformation(); this would be very fast... of course this does not exist! If it did I would not be asking. hehe ;) This is the way using custom attributes: var myInfo = typeof(MyClass).GetCustomAttribute("MyInformation"); this is slow because it requires a lookup of the string "MyInformation" This is a way using a Dictionary<Type, MyInformation: var myInfo = myInformationDictionary[typeof(MyClass)]; This is also slow because it is still a lookup of 'typeof(MyClass)'. I know that dictionary is very fast, but this is not enough... it is not as fast as calling a method. It is not even the same order of speed. I am not saying I want it to be as fast as a method call. I want to associate information with a type and access it as fast as possible. I am asking whether there is a better way, or event a best way of doing it. Any ideas?? Thanks!

    Read the article

  • Can this be done in 1 line? [PHP]

    - by Angelo
    Can this be done in 1 line with PHP? Would be awesome if it could: $out = array("foo","bar"); echo $out[0]; Something such as: echo array("foo","bar")[0]; Unfortunately that's not possible. Would it be possible like this? So I can do this for example in 1 line: echo array(rand(1,100), rand(1000,2000))[rand(0,1)];

    Read the article

  • How can I get document field with jqCouch?

    - by Angelo
    Has anyone ever used jqCouch - jquery plugin for CouchDB? Know how to retrieve the fields in a document? with futon i created a document ex: _id "ceb5da7e0ac10c619e81b2a9c2ab115e" _rev "2-9ae589297cf186b6899f5762a40324e5" post "great" I try this for example: var dc = $.jqCouch.connection('doc'); var all = dc.all('testapp'); var all_documents = null; if (all.total_rows > 0) { all_documents = all.rows; } var c = all_documents[0].value.post; into value I have only _id and _rev, but not post. thanks!

    Read the article

  • SQL Server 2008 Management Studio Activity Monitor

    - by Angelo
    Hi, I tried to turn on the Activity Monitor using SQL Server 2008 Management Studio (SSMS) through the options window of the application (Tools | Options | Environment | General | At Startup). I restarted SSMS and I am getting the following message: "This operation does not support connections to Microsoft SQL Server Standard Edition version 8.00.2249." I need to be able to monitor the processes and activities inside the database since I am investigating a particular application which takes a lot of time in its database data retrieval access and I am thinking it may be due to some locks or some processes. How do I resolve this? Inputs highly appreciated. Thanks.

    Read the article

  • JavaScript - Multiple signals received after click

    - by Angelo A
    I'm creating a webapp using jQueryMobile. When I'm using the app and I click a button it runs the script multiple times. For example: I have a submit button: <input type="submit" id="login-normal" value="Login" /> And I have this JavaScript for debugging on which this error occurs: $("input#login-normal").live('click',function() { console.log("Test"); }); On the very first click it works (and it goes to another screen for example), but when I go back to that screen and I click again, it outputs multiple console.logs

    Read the article

  • jQuery trigger custom event synchronously?

    - by Miguel Angelo
    I am using the jQuery trigger method to call an event... but it behaves inconsistently. Sometimes it call the event, sometimes it does not. <a href="#" onclick=" $(this).trigger('custom-event'); window.location.href = 'url'; return false; ">text</a> The custom-event has lots of listeners added to it. It is as if the trigger method is not synchronous, allowing the window.location.href be changed before executing the events. And when window.location.href is changed a navigation occurs, interrupting everything. How can I trigger events synchronously? Using jQuery 1.8.1. Thanks! EDIT I have found that the event, when called has a stack trace like this: jQuery.fx.tick (jquery-1.8.1.js:9021) tick (jquery-1.8.1.js:8499) jQuery.Callbacks.self.fireWith (jquery-1.8.1.js:1082) jQuery.Callbacks.fire (jquery-1.8.1.js:974) jQuery.speed.opt.complete (jquery-1.8.1.js:8991) $.customEvent (myfile.js:28) This proves that jQuery trigger method is asynchronous. Oohhh my... =\

    Read the article

  • Create a unique ID by fuzzy matching of names (via agrep using R)

    - by tbrambor
    Using R, I am trying match on people's names in a dataset structured by year and city. Due to some spelling mistakes, exact matching is not possible, so I am trying to use agrep() to fuzzy match names. A sample chunk of the dataset is structured as follows: df <- data.frame(matrix( c("1200013","1200013","1200013","1200013","1200013","1200013","1200013","1200013", "1996","1996","1996","1996","2000","2000","2004","2004","AGUSTINHO FORTUNATO FILHO","ANTONIO PEREIRA NETO","FERNANDO JOSE DA COSTA","PAULO CEZAR FERREIRA DE ARAUJO","PAULO CESAR FERREIRA DE ARAUJO","SEBASTIAO BOCALOM RODRIGUES","JOAO DE ALMEIDA","PAULO CESAR FERREIRA DE ARAUJO"), ncol=3,dimnames=list(seq(1:8),c("citycode","year","candidate")) )) The neat version: citycode year candidate 1 1200013 1996 AGUSTINHO FORTUNATO FILHO 2 1200013 1996 ANTONIO PEREIRA NETO 3 1200013 1996 FERNANDO JOSE DA COSTA 4 1200013 1996 PAULO CEZAR FERREIRA DE ARAUJO 5 1200013 2000 PAULO CESAR FERREIRA DE ARAUJO 6 1200013 2000 SEBASTIAO BOCALOM RODRIGUES 7 1200013 2004 JOAO DE ALMEIDA 8 1200013 2004 PAULO CESAR FERREIRA DE ARAUJO I'd like to check in each city separately, whether there are candidates appearing in several years. E.g. in the example, PAULO CEZAR FERREIRA DE ARAUJO PAULO CESAR FERREIRA DE ARAUJO appears twice (with a spelling mistake). Each candidate across the entire data set should be assigned a unique numeric candidate ID. The dataset is fairly large (5500 cities, approx. 100K entries) so a somewhat efficient coding would be helpful. Any suggestions as to how to implement this?

    Read the article

  • Dynamic IP on NGINX geo module without restart

    - by joaorvmaia
    I want create a task on my Capistrano deploy to put my public IP on geo module configuration of my NGINX server without restart NGINX, is it possible? Example, my /etc/nginx/nginx.conf: geo $geo { default no; include /home/deploy_user/appname/shared/ip_list; } The file /home/deploy_user/appname/shared/ip_list I will provide during deploy. I need this because my public IP can change many times. Regards, João

    Read the article

  • cx_Oracle.DatabaseError: ORA-01036: illegal variable name/number

    - by Joao Figueiredo
    I've a cron scheduled query which is failing with, File "./run_ora_query.py", line 69, in db_lookup cursor.execute(query, dict(time_key=time_key) ) cx_Oracle.DatabaseError: ORA-01036: illegal variable name/number where >>> dict(time_key=time_key) {'time_key': '12/10/2012 19:12:00'} I'm using a .yaml file to update the last time_key after each query runs, where the relevant parameters are, {query: 'select session_mode, inst_id, user_name, schema_name, os_user, process_id, process_mb_use, process_name, to_char(datet,''dd-mm-yyyy hh24:mi'') as DATETIME from os_admin.mem_usage where data > TO_DATE(:time_key,''dd-mm-yyyy hh24:mi:ss'') order by datet, inst_id, os_user', time_key: '12/10/2012 19:12:00'} Where is the culprit for this error?

    Read the article

  • How to Choose Fields While Using ExportToExcel in jqGrid ?

    - by João Guilherme
    Hi ! I have this jqGrid <trirand:JQGrid runat="server" ID="JQGrid1" OnRowEditing="JQGrid1_RowEditing" RenderingMode="Optimized" oncellbinding="JQGrid1_CellBinding" Height="350" EditUrl="/Ferramenta/Transacoes/TransacoesT.aspx"> <AppearanceSettings HighlightRowsOnHover="true"/> <Columns> <trirand:JQGridColumn DataField="IdLancamento" PrimaryKey="True" Visible="false" /> <trirand:JQGridColumn DataField="IdCategoria" Visible="false" /> <trirand:JQGridColumn DataField="DataLancamento" Editable="true" DataFormatString="{0:dd/MM/yy}" HeaderText="Data" Width="65" TextAlign="Center" CssClass="font_data" /> <trirand:JQGridColumn DataField="Descricao" Editable="true" HeaderText="Descrição" Width="330" /> <trirand:JQGridColumn DataField="NomeCategoria" Editable="true" EditType="DropDown" EditorControlID="ddlCategorias" HeaderText="Categoria"> <Formatter> <trirand:CustomFormatter FormatFunction="DefineUrl" /> </Formatter> </trirand:JQGridColumn> <trirand:JQGridColumn DataField="Valor" Editable="false" DataFormatString="{0:C}" HeaderText="Valor" Width="80" TextAlign="Center" /> </Columns> <ClientSideEvents RowSelect="editRow" /> <PagerSettings PageSize="20" /> <ToolBarSettings ShowEditButton="false" ShowRefreshButton="True" ShowAddButton="false" ShowDeleteButton="false" ShowSearchButton="false" /> <SortSettings InitialSortColumn=""></SortSettings> </trirand:JQGrid> <asp:LinkButton ID="lbExportar" runat="server" onclick="lbExportar_Click">Exportar todas as transações</asp:LinkButton> When I use the method ExportToExcel JQGrid1.ExportToExcel("export.xls"); it includes the first column IdLancamento that is not visible and also includes another column that is used on the query. Is it possible to choose the columns that are going to be exported ?

    Read the article

  • Uploadify not working with ASP.NET WebForms

    - by João Guilherme
    Hi ! I'm trying to use Uploadify in a ASP.NET webforms project. The problem is that my script is not calling the generic handler. Here is the script. <input id="fileInput" name="fileInput" type="file" /> <script type="text/javascript"> $(document).ready(function() { $('#fileInput').uploadify({ 'uploader': '/Ferramenta/Comum/Uploadify/uploadify.swf', 'script': 'UploadTest.ashx', 'cancelImg': '/Ferramenta/Comum/Uploadify/cancel.png', 'folder': "/Ferramenta/Geral/", 'auto': true, 'onError': function(event, queueID, fileObj, errorObj) { alert('error'); }, 'onComplete': function(event, queueID, fileObj, response, data) { alert('complete'); }, 'buttonText' : 'Buscar Arquivos' }); }); </script> This is the code of the generic handler (just to test) using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Services; using System.IO; namespace Tree.Ferramenta.Geral { public class UploadTest : IHttpHandler { public void ProcessRequest(HttpContext context) { context.Response.Write("1"); } public bool IsReusable { get { return false; } } } } Any ideas ? Thanks !

    Read the article

  • MVC LOB application

    - by João Passos
    Hi, I'm new to web development and i'm starting with a MVC project. I have a view to create a new Service. In this view, i need to have a button to show a dialog with client names (i also would like to implement filters and paging in this dialog). Once the user selects a client from the dialog, i need to populate some combo boxes in the Service View with info relative to that particular client. How can i accomplish this? If there any demo code or tutorial i can get my hands on to learn this? Thanks in advance for any tip.

    Read the article

  • t-sql i am transforming data

    - by João Pedro Portelinha
    I am transforming data from this legacy table: MovTime (IdMov INT, IdPerson NVARCHAR(20), Date1 datetime, Type1 nvarchar(30) ) IdMov IdPerson Date1 Type ----------- -------------------- ----------------------- ------------------------------ 1 David 2012-06-01 09:00:00.000 Entered 2 David 2012-06-01 12:30:00.000 Exit 3 David 2012-06-01 14:00:00.000 Entered 4 David 2012-06-01 18:30:00.000 Exit 5 Kim 2012-06-02 09:00:00.000 Entered 6 Kim 2012-06-02 12:00:00.000 Exit ... I want the result to be the following: IdPerson Data Total Time ---------- ---------- ---------- David 2012-06-01 08:00:00 Kim 2012-06-02 03:00:00 T-SQL declare @WK_TABLE TABLE (IdMov INT, IdPerson NVARCHAR(20), Date1 datetime, Type1 nvarchar(30)) Insert into @WK_TABLE values(1,'David', '2012-06-01 09:00', 'Entered') Insert into @WK_TABLE values(2,'David', '2012-06-01 12:30', 'Exit') Insert into @WK_TABLE values(3,'David', '2012-06-01 14:00', 'Entered') Insert into @WK_TABLE values(4,'David', '2012-06-01 18:30', 'Exit') Insert into @WK_TABLE values(5,'Kim', '2012-06-02 09:00', 'Entered') Insert into @WK_TABLE values(6,'Kim', '2012-06-02 12:00', 'Exit') select * from @WK_TABLE Can someone help me?

    Read the article

  • Artificial Inteligence library in python

    - by João Portela
    I was wondering if there are any python AI libraries similar to aima-python but for a more recent version of python... and how they are in comparison to aima-python. I was particularly interested in search algorithms such as hill-climbing, simulated annealing, tabu search and genetic algorithms. edit: made the question more clear.

    Read the article

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