Daily Archives

Articles indexed Monday November 19 2012

Page 12/16 | < Previous Page | 8 9 10 11 12 13 14 15 16  | Next Page >

  • IntentService android download and return file to Activity

    - by Andrew G
    I have a fairly tricky situation that I'm trying to determine the best design for. The basics are this: I'm designing a messaging system with a similar interface to email. When a user clicks a message that has an attachment, an activity is spawned that shows the text of that message along with a paper clip signaling that there is an additional attachment. At this point, I begin preloading the attachment so that when the user clicks on it - it loads more quickly. currently, when the user clicks the attachment, it prompts with a loading dialog until the download is complete at which point it loads a separate attachment viewer activity, passing in the bmp byte array. I don't ever want to save attachments to persistent storage. The difficulty I have is in supporting rotation as well as home button presses etc. The download is currently done with a thread and handler setup. Instead of this, I'd like the flow to be the following: User loads message as before, preloading begins of attachment as before (invisible to user). When the user clicks on the attachment link, the attachment viewer activity is spawned right away. If the download was done, the image is displayed. If not, a dialog is shown in THIS activity until it is done and can be displayed. Note that ideally the download never restarts or else I've wasted cycles on the preload. Obviously I need some persistent background process that is able to keep downloading and is able to call back to arbitrarily bonded Activities. It seems like the IntentService almost fits my needs as it does its work in a background thread and has the Service (non UI) lifecycle. However, will it work for my other needs? I notice that common implementations for what I want to do get a Messenger from the caller Activity so that a Message object can be sent back to a Handler in the caller's thread. This is all well and good but what happens in my case when the caller Activity is Stopped or Destroyed and the currently active Activity (the attachment viewer) is showing? Is there some way to dynamically bind a new Activity to a running IntentService so that I can send a Message back to the new Activity? The other question is on the Message object. Can I send arbitrarily large data back in this package? For instance, rather than send back that "The file was downloaded", I need to send back the byte array of the downloaded file itself since I never want to write it to disk (and yes this needs to be the case). Any advice on achieving the behavior I want is greatly appreciated. I've not been working with Android for that long and I often get confused with how to best handle asynchronous processes over the course of the Activity lifecycle especially when it comes to orientation changes and home button presses...

    Read the article

  • Change css when tab has active class

    - by Yunowork
    I'm trying to change the background colour of the <body> depending on what tab specific is active. When a tab is active, a class called 'st_view_active' is added onto the tab content. In the tab content I add a hidden div with the hex code of what my body background colour should be when that tab is active, my jQuery code looks like this: $(document).ready(function() { $(function(){ $('body').css('backgroundColor',$('.st_view_active').find('.background').text()); }); }); And my html code when the tab is active is following: <div class="tab-6 st_view st_view_active" > <div style="display:none" class="background">yellow</div> <div class="st_view_inner"> tab 6 </div> </div> So when tab6 is active the background of the body should be yellow. However, this is not working, the background colour is not changing, what am I doing wrong here? DEMO and JSfiddle Thanks PS: The red and blue square is the next and previous tab handler..

    Read the article

  • How to accurately resize nested elements with ems and font-size percentage?

    - by moonDogDog
    I have a carousel with textboxes for each image, and my client (who knows nothing about HTML) edits the textboxes using a WYSIWYG text editor. The resulting output is akin to your worst nightmares; something like: <div class="carousel-text-container"> <span style="font-size:18pt;"> <span style="font-weight:bold;"> Lorem <span style="font-size:15pt:">Dolor</span> </span> Ipsum <span style="font-size:19pt;"><span>&nbsp;<span>Sit</span>Amet</span> </span> </div> This site has to be displayed at 3 different sizes to accomodate smaller monitors, so I have been using CSS media queries to resize the site. Now I am having trouble resizing the text inside the textbox correctly. I have tried using jQuery.css to get the font size of each element in px, and then convert it to em. Then, by setting a font-size:x% sort of declaration on .carousel-text-container, I hoped that that would resize everything properly. Unfortunately, there seems to be a recursive nature with how font-size is applied in ems. That is, .example is not resized properly in the following because its parent is also influencing it <span style="font-size:2em;"> Something <span class="example" style="font-size:1.5em;">Else</span> </span> How can I resize everything reliably and precisely such I can achieve a true percentage of my original font size, margin, padding, line-height, etc. for all the children of .carousel-text-container?

    Read the article

  • Threading is slow and unpredictable?

    - by Jake
    I've created the basis of a ray tracer, here's my testing function for drawing the scene: public void Trace(int start, int jump, Sphere testSphere) { for (int x = start; x < scene.SceneWidth; x += jump) { for (int y = 0; y < scene.SceneHeight; y++) { Ray fired = Ray.FireThroughPixel(scene, x, y); if (testSphere.Intersects(fired)) sceneRenderer.SetPixel(x, y, Color.Red); else sceneRenderer.SetPixel(x, y, Color.Black); } } } SetPixel simply sets a value in a single dimensional array of colours. If I call the function normally by just directly calling it it runs at a constant 55fps. If I do: Thread t1 = new Thread(() => Trace(0, 1, testSphere)); t1.Start(); t1.Join(); It runs at a constant 50fps which is fine and understandable, but when I do: Thread t1 = new Thread(() => Trace(0, 2, testSphere)); Thread t2 = new Thread(() => Trace(1, 2, testSphere)); t1.Start(); t2.Start(); t1.Join(); t2.Join(); It runs all over the place, rapidly moving between 30-40 fps and sometimes going out of that range up to 50 or down to 20, it's not constant at all. Why is it running slower than it would if I ran the whole thing on a single thread? I'm running on a quad core i5 2500k.

    Read the article

  • Accessing array values in jQuery ajax callback function

    - by gibberish
    Values are received through a jQuery AJAX callback, but I've been unsuccessful getting at the values. Here's the ajax call: $.ajax({ type: "POST", url: "ajax/ax_all_ajax_fns.php", data: 'request=edit_timecard_entry&staff_id='+staff_id+'&tid='+tid, success: function(data){ alert(data); } } Here's the code sent out by ax_all_ajax_fns.php: $staff_id = $_POST['staff_id']; $t_id = $_POST['tid']; $rCard = mysql_query("SELECT `staff_id`, `date`, `project_id`, `project_num`, `task_desc`, `hours` FROM `timecards` WHERE `t_id`='$t_id'"); $aCard = mysql_fetch_assoc($rCard); print_r($aCard); // echo $aCard; Of course, I don't want the information print_r'd, I want it echoed. The print_r was used to demonstrate that the correct data was sent out by the PHP script, and it is echoed successfully in the alert() box in the success function. So the correct data is being returned, and (if correctly formatted) it is viewable. The data returned in this way looks like this in the alert() popup: Array ( [staff_id] => 51 [date] => 2012-10-18 [project_id] => 0 [project_num => 49 [task_desk] => This is a task [hours] => 3.30 ) But when I use echo to output the $aCard array and then try to break it down inside the success function of the ajax call, I can't figure out how to get at the values. My attempts have consistently returned values of "undefined". In the success function, in place of alert(data);, I've tried this: var tce_staff_id = data['staff_id']; alert(tce_staff_id); and this: var tce_staff_id = data.staff_id; alert(tce_staff_id); What am I missing? UPDATE: Thanks to Martin S. for information re json_encode() PHP instruction. I've modified the ajax script as follows: echo json_encode($aCard); I now get THIS result from alert(data); in the success function: {"staff_id":"51","date":"2012-10-18","project_id":"0","project_num":"49","task_desc":"This is a task","hours":"3.30"} However, the following returns "undefined": alert(data.staff_id); alert(data[0].staff_id); var test = data.staff_id; alert(test); Can anyone see what I'm missing? All above code comes immediately after alert(data) inside the success callback of the ajax function. alert(data) DOES work and displays the desired data, as above.

    Read the article

  • Compatibility jquery with IE - click function and fade

    - by Julien Fotnaine
    Here my script : http://jsfiddle.net/3XwZv/153/ HTML <div id="box1" class="choice" style="background:blue;"> <div class="selection ordinateur"> <div class="choix1"><a class="link1" href="#"></a></div> </div> </div> <div id="box2" class="choice" style="display:none;background:red;"> <div class="selection ordinateur"> <div class="choix1"><a class="link2" href="#"></a></div> </div> </div> <div id="box3" class="choice" style="display:none;background:green;"> <div class="selection ordinateur"> <div class="choix1"><a href="#"></a></div> </div> </div> JS $(".link1").click(function() { $('#box1').fadeOut("slow", function(){ $('#box2').css("display","block"); $('#box2').replaceWith(div); $('#box1').fadeIn("slow"); }); $('.link1').fadeOut("slow"); return false; }); $(".link2").click(function() { $('#box2').fadeOut("slow", function(){ $('#box3').css("display","block"); $('#box3').replaceWith(div); $('#box2').fadeIn("slow"); }); $('.link2').fadeOut("slow"); return false; }); The main goal is that when you click on the giant square, I have three differents action. However, in Internet Explorer I block to the second. (the red square does not go to the green square). Please I need your help guys!

    Read the article

  • MATLAB plot moving data points in seperate subplots simutaneously

    - by Nate B.
    I wish to visualize the movement of a data point throughout space across a period of time within MATLAB. However, the way I want my figure to display is such that only a single instant is plotted at any given time. That was easy, I simply created a for loop to update my 3D plot display for every set of coordinates (x,y,z) in my data. However, I wish to display 4 different viewing angles of this plot at all times. I am well aware of how to setup subplots within MATLAB, that is not the issue. My issue is getting all 4 of these subplots to execute simultaneously so that all 4 subplots are always displaying the same point in time. I would appreciate if anyone could suggest how to handle this issue. As requested, my code for a figure with a single plot is shown below: datan = DATA; %data in form of x,y,z,a,b,c by column for row# of time points tib=zeros(size(datan,1),12); tib(:,1:3) = datan(:,1:3); tib_ref=tib(1,1:3); for i=1:size(datan,1) tib(i,1:3)=tib(i,1:3)-tib_ref; end angle_to_dircos close all figure('Name','Directions (Individual Cycles)','NumberTitle','off') for cc=1:2 hold off for bb=1:10:size(tib,1); scatter3(tib(bb,1),tib(bb,2),tib(bb,3),'green','filled'); %z and y axes are flipped in polhemus system hold on p0 = [tib(bb,1),tib(bb,2),tib(bb,3)]; p1 = [tib(bb,1)+10*tib(bb,4),tib(bb,2)+10*tib(bb,5),tib(bb,3)+10*tib(bb,6)]; p2 = [tib(bb,1)+10*tib(bb,7),tib(bb,2)+10*tib(bb,8),tib(bb,3)+10*tib(bb,9)]; p3 = [-(tib(bb,1)+100*tib(bb,10)),-(tib(bb,2)+100*tib(bb,11)),-(tib(bb,3)+100*tib(bb,12))]; vectarrow(p0,p1,1,0,0) hold on vectarrow(p0,p2,0,1,0) hold on vectarrow(p0,p3,0,0,1) hold on az = 90; el = 0; view(az, el); xlim([-50,50]); ylim([-50,50]); zlim([-50,50]); xlabel('distance from center in X'); ylabel('distance from center in Y'); zlabel('distance from center in Z'); title('XYZ Scatter Plots of Tracker Position'); hold on plot3(0,0,0,'sk','markerfacecolor',[0,0,0]); p0 = [0,0,0]; p1 = [10,0,0]; p2 = [0,10,0]; p3 = [0,0,100]; vectarrow(p0,p1,1,0,0) hold on vectarrow(p0,p2,0,1,0) hold on vectarrow(p0,p3,1,0,1) drawnow; end end

    Read the article

  • Gone fishing, because i like it

    - by NewDi
    Integer orci risus, vestibulum et pharetra in, accumsan sit amet diam. Praesent rutrum faucibus tellus, at ullamcorper ligula vestibulum non. Nam felis tortor, tempor nec tincidunt vel, porta a nisi. Cras dictum, orci vitae varius feugiat, lorem nisi euismod nisi, vel sodales ante ipsum ut sapien. Praesent varius, ligula sit amet laoreet mattis, nulla nisi tincidunt urna, at placerat libero leo id mauris. Fusce pretium facilisis quam, nec vulputate nulla faucibus non. Donec sodales iaculis dui in gravida. Sed consequat scelerisque eros, quis pulvinar ipsum auctor ac. Sed odio felis, euismod at tincidunt in, sagittis vel lacus. Praesent vitae nisi non augue fringilla ornare. Phasellus interdum tellus quis elit blandit mattis eu id sapien. Duis at augue libero, quis mattis lorem. Morbi ut mauris ligula, nec dapibus quam. Suspendisse et ipsum enim. Suspendisse vel erat lorem. Sed id velit risus, porttitor pharetra urna. Fusce vestibulum elementum turpis in vehicula. Nullam eu nulla ipsum. Ut viverra diam quis urna congue in ullamcorper massa hendrerit. Curabitur convallis tempor ipsum et condimentum. Suspendisse eget enim tellus. Cras id sapien elit, sit amet rutrum tortor. Quisque ac odio tortor, et vestibulum turpis. Integer et magna in erat placerat placerat. Proin ac dapibus leo. Sed fringilla cursus quam quis ornare. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; In nec diam sapien. Mauris ac enim dolor, a fringilla lorem. Nulla facilisi. Fusce bibendum quam vitae lorem placerat imperdiet. Phasellus molestie quam vehicula dolor auctor a dapibus lorem rhoncus. Fusce non arcu augue. Aliquam mollis placerat molestie. Duis quis diam vel erat porta bibendum vel id lacus. Quisque nec purus id magna imperdiet adipiscing non dictum sem. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec enim metus, tincidunt quis eleifend at, tristique in sem. In elit elit, lobortis cursus lobortis eu, scelerisque vel mi. Fusce at leo ac mi porta feugiat. Etiam nec facilisis sem. Pellentesque bibendum, felis sit amet vehicula convallis, libero dolor venenatis sapien, in pretium nulla odio quis dolor. Praesent mollis porttitor quam, in elementum odio condimentum at. Sed elit odio, aliquam nec molestie in, tempor eget felis. Suspendisse lobortis magna lorem. Suspendisse nisl risus, sollicitudin non imperdiet eu, vestibulum sit amet elit. Praesent vulputate molestie ante, sit amet sagittis enim egestas a. Vestibulum ultrices iaculis dolor eget pharetra. Nam purus velit, sodales eu facilisis at, imperdiet at mauris. Nulla et enim vitae nulla luctus gravida a a dui. Pellentesque sollicitudin, libero nec scelerisque bibendum, ipsum tortor vehicula ipsum, at ultricies massa nisi in nibh. Suspendisse vel pharetra odio. Fusce neque sapien, commodo in interdum nec, scelerisque vitae nunc. Nunc eu sapien ac justo placerat cursus in eu felis. Maecenas ultrices vestibulum iaculis. Proin vel risus erat, nec consectetur turpis. Etiam odio erat, placerat quis porta vel, euismod vel nibh. Nulla tristique molestie lacinia. Pellentesque molestie enim vel enim condimentum eu imperdiet nulla pellentesque. Ut arcu lectus, sodales eget varius ac, pharetra quis mauris. Quisque odio est, posuere vel auctor ut, elementum nec.

    Read the article

  • The remote server returned an error: (400) Bad Request - uploading less 2MB file size?

    - by fiberOptics
    The file succeed to upload when it is 2KB or lower in size. The main reason why I use streaming is to be able to upload file up to at least 1 GB. But when I try to upload file with less 1MB size, I get bad request. It is my first time to deal with downloading and uploading process, so I can't easily find the cause of error. Testing part: private void button24_Click(object sender, EventArgs e) { try { OpenFileDialog openfile = new OpenFileDialog(); if (openfile.ShowDialog() == System.Windows.Forms.DialogResult.OK) { string port = "3445"; byte[] fileStream; using (FileStream fs = new FileStream(openfile.FileName, FileMode.Open, FileAccess.Read, FileShare.Read)) { fileStream = new byte[fs.Length]; fs.Read(fileStream, 0, (int)fs.Length); fs.Close(); fs.Dispose(); } string baseAddress = "http://localhost:" + port + "/File/AddStream?fileID=9"; HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(baseAddress); request.Method = "POST"; request.ContentType = "text/plain"; //request.ContentType = "application/octet-stream"; Stream serverStream = request.GetRequestStream(); serverStream.Write(fileStream, 0, fileStream.Length); serverStream.Close(); using (HttpWebResponse response = request.GetResponse() as HttpWebResponse) { int statusCode = (int)response.StatusCode; StreamReader reader = new StreamReader(response.GetResponseStream()); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } } Service: [WebInvoke(UriTemplate = "AddStream?fileID={fileID}", Method = "POST", BodyStyle = WebMessageBodyStyle.Bare)] public bool AddStream(long fileID, System.IO.Stream fileStream) { ClasslLogic.FileComponent svc = new ClasslLogic.FileComponent(); return svc.AddStream(fileID, fileStream); } Server code for streaming: namespace ClasslLogic { public class StreamObject : IStreamObject { public bool UploadFile(string filename, Stream fileStream) { try { FileStream fileToupload = new FileStream(filename, FileMode.Create); byte[] bytearray = new byte[10000]; int bytesRead, totalBytesRead = 0; do { bytesRead = fileStream.Read(bytearray, 0, bytearray.Length); totalBytesRead += bytesRead; } while (bytesRead > 0); fileToupload.Write(bytearray, 0, bytearray.Length); fileToupload.Close(); fileToupload.Dispose(); } catch (Exception ex) { throw new Exception(ex.Message); } return true; } } } Web config: <system.serviceModel> <bindings> <basicHttpBinding> <binding> <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="2097152" maxBytesPerRead="4096" maxNameTableCharCount="2097152" /> <security mode="None" /> </binding> <binding name="ClassLogicBasicTransfer" closeTimeout="00:05:00" openTimeout="00:05:00" receiveTimeout="00:15:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="67108864" maxReceivedMessageSize="67108864" messageEncoding="Mtom" textEncoding="utf-8" useDefaultWebProxy="true"> <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="67108864" maxBytesPerRead="4096" maxNameTableCharCount="67108864" /> <security mode="None"> <transport clientCredentialType="None" proxyCredentialType="None" realm="" /> <message clientCredentialType="UserName" algorithmSuite="Default" /> </security> </binding> <binding name="BaseLogicWSHTTP"> <security mode="None" /> </binding> <binding name="BaseLogicWSHTTPSec" /> </basicHttpBinding> </bindings> <behaviors> <serviceBehaviors> <behavior> <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> <serviceMetadata httpGetEnabled="true" /> <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --> <serviceDebug includeExceptionDetailInFaults="true" /> </behavior> </serviceBehaviors> </behaviors> <serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="true" /> </system.serviceModel> I'm not sure if this affects the streaming function, because I'm using WCF4.0 rest template which config is dependent in Global.asax. One more thing is this, whether I run the service and passing a stream or not, the created file always contain this thing. How could I remove the "NUL" data? Thanks in advance. Edit public bool UploadFile(string filename, Stream fileStream) { try { FileStream fileToupload = new FileStream(filename, FileMode.Create); byte[] bytearray = new byte[10000]; int bytesRead, totalBytesRead = 0; do { bytesRead = fileStream.Read(bytearray, totalBytesRead, bytearray.Length - totalBytesRead); totalBytesRead += bytesRead; } while (bytesRead > 0); fileToupload.Write(bytearray, 0, totalBytesRead); fileToupload.Close(); fileToupload.Dispose(); } catch (Exception ex) { throw new Exception(ex.Message); } return true; }

    Read the article

  • FormStartPosition.CenterParent does not work

    - by kol
    In the following code, only the second method works for me (.NET 4.0). FormStartPosition.CenterParent does not center the child form over its parent. Why? Source: this SO question using System; using System.Drawing; using System.Windows.Forms; class Program { private static Form f1; public static void Main() { f1 = new Form() { Width = 640, Height = 480 }; f1.MouseClick += f1_MouseClick; Application.Run(f1); } static void f1_MouseClick(object sender, MouseEventArgs e) { Form f2 = new Form() { Width = 400, Height = 300 }; switch (e.Button) { case MouseButtons.Left: { // 1st method f2.StartPosition = FormStartPosition.CenterParent; break; } case MouseButtons.Right: { // 2nd method f2.StartPosition = FormStartPosition.Manual; f2.Location = new Point( f1.Location.X + (f1.Width - f2.Width) / 2, f1.Location.Y + (f1.Height - f2.Height) / 2 ); break; } } f2.Show(f1); } }

    Read the article

  • Google Top Geek E04

    Google Top Geek E04 In Spanish! Google Top Geek is a weekly show from Google Mexico. This week: 1. Esto es Google, el evento más grande e importante de Google en México, en su segunda edición, se llevó a cabo los días 13 y 14 de noviembre de 2012. Fue un gran evento dirigido a todo el ecosistema en México: desarrolladores, usuarios y negocios. Cerca de 3000 asistentes nos honraron con su presencia en Esto es Google a lo largo de dos intensos días, llenos de conferencias, paneles y espacios para conocer y acercarse a tecnología y startups. Mencionamos durante este segmento, ligas para aprender más de la importancia del mercado de móviles en México y el mundo: Go Mobile, para pasar tu sitio actual a una versión para móviles. The Mobile Playbook, con mucha información para tomar las mejores decisiones con respecto a móviles y tecnologías modernas. 2. De concursos de programación, de negocios hasta internships y trabajo de tiempo completo, Google ofrece una amplia gama de oportunidades en todo el mundo. por ejemplo, está por iniciar el concurso Google Code-in 2012, para chavos de preparatoria, con un formato similar al de Google summer of code, con 10 organizaciones de código abierto como mentoras. 3. Lanzamientos de la semana, el primero interesante para Gmail: búsquedas por tamaño, utilizando size:5m, larger: .., fechas flexibles, etc. En Google Drive ya puedes buscar por persona, no sólo los que han compartido contigo; sino los que involucran a una misma persona. Búsquedas de la semana Las <b>...</b> From: GoogleDevelopers Views: 15 2 ratings Time: 15:50 More in Science & Technology

    Read the article

  • Unconventional webapps con GWT/Elemental WebRTC e WebGL (parte 2)

    Unconventional webapps con GWT/Elemental WebRTC e WebGL (parte 2) Seconda parte del'intervento di Alberto Mancini del GDG Firenze: realizzata l'app di base, grazie a GWT e NyARToolkit, sarà possibile aggiungere della realtà aumentata direttamente sullo streaming video utilizzando dei marker. Post con esempi di codice all'indirizzo jooink.blogspot.it From: GoogleDevelopers Views: 28 2 ratings Time: 19:08 More in Science & Technology

    Read the article

  • Win a Free Copy of Windows Presentation Foundation 4.5 Cookbook

    - by Ricardo Peres
    Win A free copy of the 'Windows Presentation Foundation 4.5 Cookbook', just by commenting! For the contest, Packt Publishing has two eBook copies of Windows Presentation Foundation 4.5 Cookbookto be given away to two lucky winners. How you can win: To win your copy of this book, all you need to do is come up with a comment below highlighting the reason "why you would like to win this book”. Duration of the contest & selection of winners: The contest is valid for 7 days (until November 26), and is open to everyone. Winners will be selected on the basis of their comment posted. Windows Presentation Foundation 4.5 Cookbookis written by Pavel Yosifovich, the CTO of CodeValue (http://www.codevalue.net), a software development, consulting, and training company, based in Israel. This book is written in an easy-to-read style, with a strong emphasis on real-world, practical examples. Step-by-step explanations are provided for performing important tasks. This book is the best guide for C# developer who is looking forward to increase understanding and knowledge of WPF. Using this book, readers will learn to build complex and flexible user interfaces using XAML, perform lengthy operations asynchronously while keeping the UI responsive, get well-versed with WPF features such as data binding, layout, resources, templates, and styles and also customize a control’s template to alter appearance but preserve behavior. In the next days I will post my review on this book. In the meantime, here’s the table of contents: Preface Chapter 1: Foundations Chapter 2: Resources Chapter 3: Layout and Panels Chapter 4: Using Standard Controls Chapter 5: Application and Windows Chapter 6: Data Binding Chapter 7: Commands and MVVM Chapter 8: Styles, Triggers, and Control Templates Chapter 9: Graphics and Animation Chapter 10: Custom Elements Chapter 11: Threading Index I’m waiting for your comments!

    Read the article

  • Aplicações do SharePoint e Windows Azure

    - by Leniel Macaferi
    Segunda-feira passada eu tive a oportunidade de me apresentar dando uma palestra na SharePoint Conference (em Inglês). Meu segmento na palestra cobriu o novo modelo de Aplicações para Nuvem do SharePoint (SharePoint Cloud App Model) que estamos introduzindo como parte dos próximos lançamentos do SharePoint 2013 e Office 365. Este novo modelo de aplicações para o SharePoint é aditivo para as soluções de total confiança que os desenvolvedores escrevem atualmente, e é construído em torno de três pilares principais: Simplificar o modelo de desenvolvimento tornando-o consistente entre a versão local do SharePoint e a versão online do SharePoint fornecida com o Office 365. Tornar o modelo de execução flexível - permitindo que os desenvolvedores criem aplicações e escrevam código que pode ser executado fora do núcleo do serviço do SharePoint. Isto torna mais fácil implantar aplicações SharePoint usando a Windows Azure, evitando a preocupação com a quebra do SharePoint e das aplicações que rodam dentro dele quando algo é atualizado. Este novo modelo flexível também permite que os desenvolvedores escrevam aplicações do SharePoint que podem alavancar as capacidades do .NET Framework - incluindo ASP.NET Web Forms 4.5, ASP.NET MVC 4, ASP.NET Web API, Entity Framework 5, Async, e mais. Implementar este modelo flexível utilizando protocolos padrão da web - como OAuth, JSON e APIs REST - que permitem aos desenvolvedores reutilizar habilidades e ferramentas, facilmente integrando o SharePoint com arquiteturas Web e arquiteturas para aplicações móveis. Um vídeo da minha palestra + demos está disponível para assistir on-line (em Inglês): Na palestra eu mostrei como construir uma aplicação a partir do zero - ela mostrou como é fácil construir soluções usando a nova aplicação SharePoint, e destacou um cenário web + workflow + móvel que integra o SharePoint com código hospedado na Windows Azure (totalmente construído usando o Visual Studio 2012 e ASP.NET 4.5 - incluindo MVC e Web API). O novo Modelo de Aplicações para Nuvem do SharePoint é algo que eu acho extremamente emocionante, e que vai tornar muito mais fácil criar aplicações SharePoint usando todo o poder da Windows Azure e do .NET Framework. Usar a Windows Azure para estender facilmente soluções baseadas em SaaS como o Office 365 é também algo muito natural e que vai oferecer um monte de ótimas oportunidades para os desenvolvedores.  Espero que ajude, - Scott P.S. Além do blog, eu também estou utilizando o Twitter para atualizações rápidas e para compartilhar links. Siga-me em: twitter.com/ScottGu Texto traduzido do post original por Leniel Macaferi.

    Read the article

  • Creating a Yes/No MessageBox in a NuGet install/uninstall script

    - by ParadigmShift
    Sometimes getting a little feedback during the install/uninstall process of a NuGet package could be really useful. Instead of accounting for all possible ways to install your NuGet package for every user, you can simplify the installation by clarifying with the user what they want. This example shows how to generate a windows yes/no message box to get input from the user in the PowerShell install or uninstall script. We’ll use the prompt on the uninstall to confirm if the user wants to delete a custom setting that the initial install placed in their configuration.  Obviously you could use the prompt in any way you want. The objects of the message box are generated similar to the controls in the code behind of a WinForm. At the beginning of your script enter this: param($installPath, $toolsPath, $package, $project)   # Set up path variables $solutionDir = Get-SolutionDir $projectName = (Get-Project).ProjectName $projectPath = Join-Path $solutionDir $projectName   ################################################################################################ # WinForm generation for prompt ################################################################################################ function Ask-Delete-Custom-Settings { [void][reflection.assembly]::loadwithpartialname("System.Windows.Forms") [Void][reflection.assembly]::loadwithpartialname("System.Drawing")   $title = "Package Uninstall" $message = "Delete the customized settings?" #Create form and controls $form1 = New-Object System.Windows.Forms.Form $label1 = New-Object System.Windows.Forms.Label $btnYes = New-Object System.Windows.Forms.Button $btnNo = New-Object System.Windows.Forms.Button   #Set properties of controls and form ############ # label1 # ############ $label1.Location = New-Object System.Drawing.Point(12,9) $label1.Name = "label1" $label1.Size = New-Object System.Drawing.Size(254,17) $label1.TabIndex = 0 $label1.Text = $message   ############# # btnYes # ############# $btnYes.Location = New-Object System.Drawing.Point(156,45) $btnYes.Name = "btnYes" $btnYes.Size = New-Object System.Drawing.Size(48,25) $btnYes.TabIndex = 1 $btnYes.Text = "Yes"   ########### # btnNo # ########### $btnNo.Location = New-Object System.Drawing.Point(210,45) $btnNo.Name = "btnNo" $btnNo.Size = New-Object System.Drawing.Size(48,25) $btnNo.TabIndex = 2 $btnNo.Text = "No"   ########### # form1 # ########### $form1.ClientSize = New-Object System.Drawing.Size(281,86) $form1.Controls.Add($label1) $form1.Controls.Add($btnYes) $form1.Controls.Add($btnNo) $form1.Name = "Form1" $form1.Text = $title #Event Handler $btnYes.add_Click({btnYes_Click}) $btnNo.add_Click({btnNo_Click}) return $form1.ShowDialog() } function btnYes_Click { #6 = Yes $form1.DialogResult = 6 } function btnNo_Click { #7 = No $form1.DialogResult = 7 } ################################################################################################ This has also wired up the click events to the form.  This is all it takes to create the message box. Now we have to actually use the message box and get the user’s response or this is all pointless.  We’ll then delete the section of the application/web configuration called <Custom.Settings> [xml] $configXmlContent = Get-Content $configFile   Write-Host "Please respond to the question in the Dialog Box." $dialogResult = Ask-Delete-Custom-Settings #6 = Yes #7 = No Write-Host "dialogResult = $dialogResult" if ($dialogResult.ToString() -eq "Yes") { Write-Host "Deleting customized settings" $customSettingsNode = $configXmlContent.configuration.Item("Custom.Settings") $configXmlContent.configuration.RemoveChild($customSettingsNode) $configXmlContent.Save($configFile) } if ($dialogResult.ToString() -eq "No") { Write-Host "Do not delete customized settings" } The part where I check if ($dialog.Result.ToString() –eq “Yes”) could just as easily check the value for either 6 or 7 (Yes or No).  I just personally decided I liked this way better.   Shahzad Qureshi is a Software Engineer and Consultant in Salt Lake City, Utah, USA His certifications include: Microsoft Certified System Engineer 3CX Certified Partner Global Information Assurance Certification – Secure Software Programmer – .NET He is the owner of Utah VoIP Store at http://www.utahvoipstore.com/ and SWS Development at http://www.swsdev.com/ and publishes windows apps under the name Blue Voice.

    Read the article

  • Simple Little Registry Editor - New Release

    - by Bruce Eitman
    I have posted a new release of the Simple Little Registry Editor found in Windows CE: Simple Little Registry Editor.  This release fixes a problem with writing DWORD values when the most significant bit is set.  The application uses RegistryKey.SetValue.  There seems to be a problem with how the .NET CompactFramework (and the full framework) handle the second argument during the call which causes an exception. So the following does not work: RegistryKey.SetValue( "TestValue", 0xFFFFFFFF, RegistryValueKind.DWord ); But, this does: RegistryKey.SetValue( "TestValue",unchecked((int) 0xFFFFFFFF), RegistryValueKind.DWord ); Copyright © 2012 – Bruce Eitman All Rights Reserved

    Read the article

  • What is the best way to run ClamAV on Windows Server 2008 R2

    - by gabbsmo
    I'm hosting a Wordpress-site on Windows Server 2008 RS and want to scan all files that are uploaded by users for viruses using this plugin http://wordpress.org/extend/plugins/upload-scanner/. I'm on a really tight budget (no profit) so ClamAV seem like a good choice. What is the best way to run ClamAV under these circumstances? I'm concidering the following options: Just running the raw windows build from http://sourceforge.net/projects/clamav/ an setup definition updates with task scheduler. Any way to automate updates of the scanner (binaries)? Using a "distro" like ClamWin or Immunet (advertised on clamav.net). Any suggestions are welcome.

    Read the article

  • How do I send a newsletter to 2000 emails on a shared server?

    - by Bogdan
    Consider this scenario: I'm running Magento 1.4 Community Edition I have a newsletter that I'm sending out 2 times per week My list has 2000 subscribers I'm on a shared hosting plan (linux on apache 2.2 with Cpanel) My hosting provider limits me to 6 emails/minute How can I send 2000 emails x 2 times/week x 4 weeks/month in the above scenario? Is there a server configuration I can ask my hosting company to make? Any software that can temporize the email send?

    Read the article

  • Prioritize One Network Share Over Another And/Or Cap Network Share Traffic? (Windows Server 2008 R2 Enterprise)

    - by FullTimeCoderPartTimeSysAdmin
    One of my fileservers is a hyper v VM running Windows Server 2008 R2 Enterprise. The NIC in the VM maps to a 1 GB NIC on the host that is dedicated just to this VM. I have two shares on the file server. One is very important and used by a few users. The other is less important but used by many users. The issue I'm having: When a ton of users are accessing the unimportant share, it can choke out requests to the important share. What I'd like to do: I'd like to some prioritize requests for for file on the more important share, or even dedicate a portion of the NIC's bandwidth just to requests for files on that share. Is there any way to do that? Alternately, can I add another NIC and specify that all traffic to one share goes over one NIC and traffic to the other share goes over the other?

    Read the article

  • How to bypass Forefront TMG for downloading from Adobe Cloud

    - by user1006272
    I hope that this question has not been asked as I've spent a couple of days googling around trying to find a solution. I have one computer that needs to download from Adobe Cloud to install applications like Photoshop etc... The issue I'm having is that Adobe uses a download manager program (AdobeApplicationManager.exe) that just keeps incrementing the time left on the download of any app like Photoshop. Is there a way to allow just the download manager from that one computer to bypass any filtering settings in Forefront TMG 2010? I have very little knowledge of servers / ISA servers / Forefront TMG and have been thrown into this position by luck I guess. Any help with this would be highly appreciated. Thanks in advance.

    Read the article

  • HTTP through a proxy server is not allowed

    - by jidma
    When I try to connect to my Tomcat server on http://<servername>:8080 it works fine, but from another ISP provided it gives the following error: HTTP through a proxy server is not allowed. Some ISP apparently don't allow http over the port 8080, as they think the client uses a proxy. I also have a httpd running on port 80 for my website. So in order to avoid the proxy error, I would like to make to following routing: If the user connects to http://<servername>, then the website is served via apache. If the user connects to http://<servername>/AppName, then the port is rerouted to 8080, without the client (or his ISP) knowing. Is that possible (using iptables or something else) ? Thank you

    Read the article

  • Sync clock on Windows XP machine to external (non-domain, non-workgroup) Windows Server 2008 R2 machine

    - by Eric
    I have two machines and I'd like their clocks to be in sync for various reasons. Machine 1 is an XP machine located in the office. Machine 2 is a VPS hosted by a third party running Windows Server 2008 R2. These machines are not in any kind of workgroup or on a domain together. They are completely separate machines. Machine 2 is currently syncing once a week to time.windows.com. The clock on Machine 2 does seem to wander a bit within that week interval. What I would like to do is have Machine 1 set its clock based on the clock of Machine 2. I have tried configuring w32tm on the XP machine. This is what I used for configuration: w32tm /config /syncfromflags:manual /manualpeerlist:"<ip address of machine 2>" However, whenever I issue the /resync command I get "The computer did not resync because no time data was available". I have made sure to start the windows time service on machine 2, and I have added firewall exceptions for UDP port 123. Is there something I need to configure on Machine 2 (other than just starting the time service) in order to get it to respond? Edit: I have also run w32tm /config /reliable:YES /update on Machine 2. I am still getting "The computer did not resync because no time data was available". Is there something else I'm missing?

    Read the article

  • nginx: Disallow Acces to a Folder, except some subfolders

    - by user68202
    how it is possible to deny access to a folder, but execept some subfolders in it from "deny"? I tried something like this (in this order): #this subfolder shouldnt be denied and php scripts inside should be executable location ~ /data/public { allow all; } #this folder contains many subfolders that should be denied from public access location ~ /data { deny all; return 404; } ... which doesnt work correctly. Files inside the /data/public folder are accessible (all other in /data are denied as it should be), but PHP files are not executed anymore in the /data/public folder (if i dont add these restrictions, the php files are executable). What is wrong? How can it be correct? I think theres a better way to do it. It would be very nice if anyone can help me with this :).

    Read the article

  • rsync to EC2: Identity file not accessible

    - by Richard
    I'm trying to rsync a file over to my EC2 instance: rsync -Paz --rsh "ssh -i ~/.ssh/myfile.pem" --rsync-path "sudo rsync" file.pdf [email protected]:/home/ubuntu/ This gives the following error message: Warning: Identity file ~/.ssh/myfile.pem not accessible: No such file or directory. [email protected]'s password: The pem file is definitely located at the path ~/.ssh/myfile.pem, though: vi ~/.ssh/myfile.pem shows me the file. If I remove the remote path from the very end of the rsync command: rsync -Paz --rsh "ssh -i ~/.ssh/myfile.pem" --rsync-path "sudo rsync" file.pdf [email protected] Then the command appears to work... building file list ... 1 file to consider file.pdf 41985 100% 8.79MB/s 0:00:00 (xfer#1, to-check=0/1) sent 41795 bytes received 42 bytes 83674.00 bytes/sec total size is 41985 speedup is 1.00 ...but when I go to the remote server, nothing has actually been transferred. What am I doing wrong?

    Read the article

  • Best approach for Synchronization Mysql databases using C# [closed]

    - by nirmal90
    I have a requirement as below. Windows application in c# with MySQL database MySQL database in both local and server One centralized server with many client synchronizing the server database at each time when the new entry or update is happen in local machine The server data also needs to be updated in local at regular intervals in order to avoid conflicts I need to know what is the best approach to follow to make this synchronization without any conflicts.

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16  | Next Page >