w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
While Sending Html Mails from my web application Recieved Mails contains Symbols like &ldquo,&rdquo, ‘
Check with another constructor for htmlView: ContentType mimeType = new System.Net.Mime.ContentType("text/html"); var htmlView = AlternateView.CreateAlternateViewFromString(bodyMessage, mimeType);

Categories : Asp Net Mvc

Memory leak in C++ function using std::swap
The way I see it there are three possibilities: 1: (the most likely) the CNet destructor does not properly de-allocate memory that is reserved by its constructor. To check that, use a global CNet newNet variable, and do not re-create temporary variables every time you go into this routine (rather just set the values of the global newNet variable), so you do not keep calling the constructor/destructor. 2: The std::swap(newNet, netVector[destination]); call, which I think creates a temporary variable as explained here: http://www.cplusplus.com/reference/algorithm/swap/ Try to comment the std::swap call and see what happens. 3: Something inside the for loop is fishy, but you do not provide details there. Good luck.

Categories : C++

memory swap to disk in Java JVM
No, that's not necessarily true. Physical memory is shared by all processes, as well as by a bunch of other kernel things (e.g. the disk cache). So the amount of virtual memory used by your application is not the only consideration.

Categories : Java

std::vector swap causing memory fragmentation?
This technique seems to guarantee fragmentation if in-between calls to Check_MemBlock_Size() you do some more dynamic allocation. This is because you release your 50K allocation after allocating your smaller chunk, creating a 50K object hole in memory, which can now be partially filled by some more memory, which your next rebuild of your MemoryBlock cannot use. You could create a global vector instead of a temporary one to hold this 50K object allocation. Then, when you next rebuild a new MemoryBlock, instead of resizing a new 50K object vector, just swap in the global one. When you want to shrink it, swap out with the global one again. Reusing the 50K reserved memory this way will remove any fragmentation to which this allocation may have contributed. However, there may be other sources

Categories : C++

Swap out DOM elements with JavaScript, for memory intensive application
Actually, the most interesting and also dangarous part of your code is the start method. Without it, it looks good, except the kill function - it is like shooting in a dark room) You overwrite your this.screen property anyway, so the old reference should be then deleted, in case you have no memory leaks in your start method. So all your interactivity is risky. This could be some jQuery widgets or some other things, that hold references to the nodes, and so they wont be removed from the memory by the garbage collector. This could be even raw event listeners, or some enclosed closures with the DOM node references. But you have a good weapon in your arsenal - Memory Timeline, Heap Profiler. The process is simple: open your first screen → collect stats of the memory allocation → go

Categories : Javascript

Best practice to swap a string for another & swap back
Consider using Tuple: List<Tuple<string,string>> data = new ... //Populate the data here foreach(Tuple t in data) { t.Item1="acura"; //Read and write t.Item2="Acura"; //Read and write }

Categories : C#

What does ".swap" in "swap!" source code do?
A lot of things in Clojure are actually implemented in Java, like reference types (atom, ref, var, agent), data structures (map, vector, list, set), namespaces (the actual Namespace class) and other stuff. When reading the source code for Clojure functions in clojure.core it's not rare to find an interop call to a Java method. It is my understanding that there's a long term objective to implement these things in Clojure itself (search here for Clojure-in-Clojure), but for now these things are implemented in Java, which is really not so bad since the whole language is open source and you can check any implementation detail online in the github repo (already linked in a comment): Clojure (note that there's a jvm and a clj folder indicating in what language the code inside is implemented).

Categories : Clojure

How do I keep my app from going inactive?
Run your code when it needs to run, you don't need a background page running constantly to do so. E.g. use chrome.runtime.onInstalled, chrome.runtime.onStartup, chrome.app.runtime.onRestarted, etc to trigger code on those events. The Alarms API to wake up occasionally, Push Messaging to be woken up by your sever, or launch a window if there is interface a user should interact with. The application can be restarted at any time - so always keep your state saved.

Categories : Google Chrome

How to release correctly memory in iOS: Memory is never released; potential leak of memory pointed to by
You need to free the bytes, because NSData does not take ownership of it: it cannot know if the array is a temporary or a dynamic, so it makes a copy of it. To fix this problem, replace return [NSData dataWithBytes:bytes length:c]; with NSData *res = [NSData dataWithBytes:bytes length:c]; free(bytes); return res;

Categories : IOS

Active and Inactive div
You have several options to do this: JQuery: There are many tab samples created with JQuery. One of the best is JQueryUI. You can view the source of the example to see how it's done. CSS: Setting display to none to hide the element, and block to show it. Here is a collection of tabs implemented using different solutions.

Categories : Javascript

FTP does not work after being 5 minutes inactive
If you really have to keep the connection alive, run NOOP commands against the server, so that the control connection remains alive. Either do it manually: client.sendNoOp(); Or set the client to do it at fixed interval rates: client.setControlKeepAliveTimeout(300); // set timeout to 5 minutes But if you can avoid wasting resources, logout and disconect after the initial download phase, do your local processing and connect / login again for uploading afterwards.

Categories : Java

Inactive commands in wpf Toolbar
WPF should be calling your CanRemoveRow method every once in a while to check if it is ok to remove a row. You should put a Boolean condition in this method that will answer that question. If you want similar functionality for your AddRowCommand, add a CanAddRow method where you bind the AddRowCommand. You may want to read the Commanding Overview at MSDN. UPDATE >>> Oh... do you want to know what code to use for these disabled conditions? I'll assume so: when application is running I'm guessing you mean 'when application is busy'... add a Boolean property named IsBusy, set it to true when the application performs any long running processes, then add !IsBusy into your method condition. when I click on gray field of DataGrid when DataGrid is empty Both of these conditions can be judg

Categories : C#

ParticleSystem initially inactive
Send stopSystem to stop the particle emitter from emitting more particles. This will let existing particles continue until their lifetimes expire. Send resetSystem to start the particle emitter. This will kill all existing particles but make the system start emitting new particles. If you want to prevent the system from emitting any particles in the first place, set its emissionRate to 0 before adding it to its parent. Then set emissionRate to a positive number when you want it to emit particles. Take a look at the implementation of -[CCParticleSystem update:] method for details. Also, as far as I can tell, the parent doesn't start the particle system. Instead, the particle system is simply created in the active state. Did you try sending stopSystem to the system before adding it

Categories : IOS

WSO2 API Manager - Tokens become inactive
AccessTokenDefaultValidityPeriod defines for how longer the server keeps the AccessToken alive. By default this is 1 hour (3600s), which means you need to generate a new access token when trying after 1 hours. Therefore setting this value to 0 second is wrong and to make the token doesn't expire you need to set this to -1 as, <!-- Default validity period for Access Token in seconds --> <AccessTokenDefaultValidityPeriod>-1</AccessTokenDefaultValidityPeriod> You can refer to WSO2 API Manager documentation in here.

Categories : Amazon

PDFreactor interactive PDF
It is hard to say why the combo boxes are non-interactive in your case without knowing the source document. You actually only have to make sure to set the style "-ro-pdf-format: pdf" to all form elements that should be interactive, like in this minimal sample: <html> <head> <style> select { -ro-pdf-format: pdf; } </style> </head> <body> <form> <select> <option>blue</option> <option>green</option> <option>red</option> </select> </form> </body> </html> If converted with PDFreactor, the resulting PDF should consist of one interactive combo box. There is also a more complex "Styled Forms" sample included in the PDFrea

Categories : C#

Accessing inactive union members
It's probably compiler specific due to how it arranges the underlying data in the union. Essentially accessing by an 'inactive' member is just interpreting the data differently. Interpreting a large int as a smaller one should work. [FF|01] < a uint16 A uint8 just reads the first byte of that data: [FF|01] ^ read ^ ignored Interpreting a float as an int, or an int as a float is unlikely to work, since the underlying bits won't make sense: [0x1|0xF|0x7FFFFF] ^ 23-bit mantissa ^ 8-bit exponenent ^ sign bit

Categories : Misc

How do you empty out data from inactive tabs?
My guess is that you don't want hide(), but html(''). (Note the quotes, indicating an empty value.) This will remove all of an element's contents. http://api.jquery.com/html/#html2 See this question for more on removing nodes from memory: Remove HTML element (DOM Node) from memory

Categories : Javascript

commandButton inactive after ajax rendering
It seems that you're not entirely familiar with HTML/JavaScript. You know, JSF is basically a HTML/JavaScript(/CSS) code generator. Ajax updating works basically like this in JavaScript: After sending the ajax request to JSF via XMLHttpRequest, retrieve a XML response which contains all elements which needs to be updated along with their client IDs. For every to-be-updated element, use document.getElementById(clientId) to find it in the current HTML DOM tree. Replace that element by new element as specified in ajax XML response. However, if a JSF component has not generated its HTML representation because of rendered="false", then there's nothing in the HTML DOM tree which can be found and replaced. That totally explains the symptoms you're "seeing". You basically need to wrap conditi

Categories : JSF

Add text to an inactive viewcontroller's textfield
When you create an object for AthleteDetail AthleteDetail *athleteDetail= [self.storyboard instantiateViewControllerWithIdentifier:@"showAthlete"]; it does not initialise the controls subviewed. The best way to get the desired the behaviour is to create a property named "athleteName" in AthleteDetail class @property(nonatomic, strong) NSString * athleteName now instead of athleteDetail.firstDetailTextField.text = athlete.first; write the following code athleteDetail.athleteName = athlete.first; now in viewDidLoad of AthleteDetail class, assign athleteName to your textfield firstDetailTextField.text = _athleteName; I hope this works for you.. :)

Categories : IOS

How to hide the inactive products from in app billing?
AFAIK, you can remove the sku from the query list //moreSkus.add("premium"); //don't query this item This depends on your code but kinda makes sense, since you cannot query all available products with an empty "moreSku" list, you have to choose what you really want; it depends on your code anyway. Hope it can help.

Categories : Java

Session Inactive pop-up warning using Spring 3.0
Sounds like a job for Javascript on the client, rather than something Spring would do. If you know (or set) the session timeout on the server, you can set a corresponding timer on the client, to go off 2mins prior to the actual session expiry. If required you can always force the session to end by redirecting the page to the logout URL from Javascript. If your logout destination is set to the home page, then that's where the user would end up.

Categories : Java

Java Timeout for an inactive user
Take a look at this -> http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ScheduledThreadPoolExecutor.html The shutdownNow() makes no guarantees to cancel execution. As for a solution, I recommend you use ScheduledFuture or Future objects rather than Runnable. [EDIT] A scheduled future, on which you can call a .cancel() function instead of .shutdownNow() is returned by the .schedule() call, which you call, but don't seem to use (or indeed save) the handle to the Future anywhere. And yes, you do still need a Runnable but only insofar as it will give you the Future handle. Try something like this: private ScheduledFuture<?> future; public void start() { future = scheduledThreadPool.schedule(logicalWorker, delay, TimeUnit.SECONDS); } public void stop() { if(futur

Categories : Java

Change inactive page Title
The most 'angular' way would be to create a directive on some element which listens for the events and changes a scope variable. I would create an API like this: <html ng-app="myApp" window-active-model="appIsActive"> <title>{{appIsActive ? 'My Super App' : 'Come back to me!'}}</title> </html>

Categories : Javascript

Handle active/inactive tabs, better way other than this?
For example: <input type="button" data-route="route1" value="Activos" class="tab active"> <input type="button" data-route="route2" value="Inactivos" class="tab"> $( ".tab" ).click(function() { var this$ = $( this ); if ( !this$.hasClass( 'active' ) ) { $( '.tab.active' ).removeClass( 'active' ); this$.addClass( 'active' ); $( "#layout-center" ).load( Routing.generate( this$.data( 'route' ) ) ); } } ); In case of 2 tabs only even toggleClass( 'active' ) can be used.

Categories : Jquery

How to make setInterval to work even when a tab is inactive in chrome?
So I solved it... Seems chrome supports setInterval even it is inactive, but it extends the interval. So solution is to use onblur and onfocus events to determine, if tab is inactive or not. So final js code's here: http://warhome.eu/play/player_final.js

Categories : Javascript

Dark Transparent Layer on Inactive Form
The Form has an opacity property though: Form.Opacity Just set this to 0.25 On the Deactivate Event and 1 on the Activate Event

Categories : Vb.Net

Inactive customers mysql query optimization
Try select name,t.id from customer t where not exists ( select 1 from orders where custID=t.id and datediff(curdate(),orders.orderDate) <= 30 )

Categories : Mysql

Jquery accordion tweak for inactive state
this jquery plugin i threw together should do it: (function ( $ ) { var backgroundColorToggleStatus = null; $.fn.backgroundColorToggle = function(one,two) { return this.each(function(){ if (backgroundColorToggleStatus == one) backgroundColorToggleStatus = two; else if (backgroundColorToggleStatus == two) backgroundColorToggleStatus = one; else{ backgroundColorToggleStatus = one; } $(this).css("backgroundColor",backgroundColorToggleStatus); }); }; }( jQuery )); simply call .backgroundColorToggle("#fff","#000"); like this.

Categories : Jquery

how to make scroll bar(even inactive) disappear using jquery
Your code only runs once, when your site loads. If your div changes content after loading then you need make a function to check the height and modify it if needed immediately after changing the content of the div, or use something like attrchange to listen to the height changes of the div, and hide the scrollbar if necessary.

Categories : Jquery

jquery ui tabs wrong position value of inactive tab
The inactive tabs are set to display:none. You can get coordinates of visibility:hidden elements, but display:none elements are excluded from rendering tree. So their position is undefined. You can get the css styles inline data, if they are helpful. Alternatively you can set the element visible, get its position and then hide it again, but can cause rendering issues. Demo: http://jsfiddle.net/IrvinDominin/xnmHj/1/

Categories : Jquery

Inactive session in multiple tabs open
create a common timer for all the pages.A single function would do.Place this function in a separate js file start your timer on window.onload.Pause your timer on window.blur.Restart your timer on window.focus -include this on every page of your application. You can get much more help if you show your code.

Categories : PHP

End a session after a period of time if the page has been inactive - PHP
Where did you define $_SESSION['start' ]? I test this: $session_life = time() - $_SESSION['start']; echo $session_life ,' - ', $_SESSION['timeout']; die(); And both $session_life and $_SESSION['timeout'] has the same values so the question is, which value takes $_SESSION['start']?

Categories : PHP

ASP.NET user can still log in if account is inactive or deleted from database
As you've noticed, IsAuthenticated will return true for a user even after they've been removed. This is because the call only checks the contents of the authentication cookie, which still resides on their system. One solution to this is to enable role-based security for the site. Using roles means that you can protect sections of your site from certain categories of users, e.g. making the administration pages visible only to a subset of accounts. This role information is saved in the backing store, not the cookie, so it has to be properly checked every time. It's also deleted when the user is deleted, so your protected pages will be inaccessible to the user as soon as they're removed. You should still be able to manage all this through the web-based tools, too. More here: http://msdn.

Categories : Asp Net

Keeping Some MATLAB Function Input Arguments Inactive
There are a number of ways of doing this. A simple alternative to varargin is to pass a logical vector with 0/1 values. In your case, the vector would contain 11 entries. The value of each entry would signal to the function whether to expect that variable pair in a separate array. Within the function you could have a series of if statements to check whether an entry in v is 1 or 0, for instance: function [myoutputs] = myfunction(array_1,array_2,...., v); default_1 = some_values1; % change some_values1 to whatever should be defaults for variable 2 default_2 = some_values2; % change some_values2 to whatever should be defaults for variable 2 % ... additional default initializations if v(1) pair_1 = array_1; else pair_1 = default_1; end % ... if statements for remaining pairs...

Categories : Matlab

To make query if Suppliers has status Inactive from his Users
It's hard coding without real objects, I hope this is correct: public ActionResult Grid(int? status, Pager pager, Guid? supplierId) { var sActive = Context.Suppliers.AsNoTracking() .WhereIf(o=> o.Id == supplierId) .Select(o=> o.Active).FirstOrDefault(); var page = Context.Users.AsNoTracking() .Where(e => e.SupplierId == supplierId) .WhereIf(status != null, e => (e.Status == status)) .Select(e => new UserRow { Id = e.Id, FullName = e.FullName, Email = e.Email, Name = e.Name, Status = e.Status, Role = e.Role, SupplierIsInactive = !sActive }) .GetPage(pager, Sorter.Asc<UserRow, string>(e => e.FullName)); retur

Categories : Asp Net Mvc

Appengine Modules: dispatch.yaml inactive on dev server
Have you specified the dispatch.yaml when you start the SDK? dev_appserver.py dispatch.yaml app.yaml my_module_a.yaml my_module_b.yaml You will see them start an instance on different ports, just like a backend. You should see in the console, Starting dispatcher running at: http://localhost:8080 (or whatever port you specified) This can be found at the bottom of this page, although isn't obvious how you get dev_appserver to run with a dispatch.yaml UPDATE As Zachary points out in the comments you don't need to mention dispatch.yaml any longer. Just specifying separate .yaml files for each module is enough. Make sure that if the paths to each yaml is correct in relation to the directory you are running dev_appserver.py in. Update docs are here

Categories : Google App Engine

Pause or run in real time setInterval function while in inactive tab
Even when the page isn't inactive, those timings will slowly drift. The value you give to setTimeout isn't absolutely precise. Because of that, and because I think it will address your actual question as well, I'd recommend using a single 125ms timer instead, and remembering what child to fade (and in which way). That way, if that one timer is suspended, it picks up where it left off (and you don't have the issue of drift). Something like this: Updated Fiddle $('.child0,.child1,.child2,.child3,.child4').hide(); fadeItIn(); function fadeItIn() { var child; child = 4; setTimeout(fadeIn, 3000); function fadeIn() { $("#child" + child).fadeIn(175); --child; if (child >= 0) { // Continue fading in setTimeout(fadeIn, 175);

Categories : Jquery

Zurb Foundation Accordion - Don't collapse inactive segments
Comment out the lines within the click listener that remove the active class from the li element. If you change your mind and want to allow the section to be closed by clicking again, only comment out the second one. See below: $(document).on('click.fndtn', '.accordion li .title', function () { var li = $(this).closest('li'), p = li.parent(); if(!hasHover(p)) { var flyout = li.children('.content').first(); if (li.hasClass('active')) { //p.find('li').removeClass('active').end().find('.content').hide(); } else { //$('.content', p).not(flyout).hide().parent('li').removeClass('active'); flyout.show(0, function () { flyout.parent('li').addClass('active'); }); } } } );

Categories : Jquery

How to return a button to its inactive state in mobile browsers
jsFiddle Demo Perhaps you should attempt this by segregating your class names for active/hover a little bit button.largeButton:hover, button.largeButton:active {...} could become button.activeButton:hover, button.activeButton:active {...} and then once the button had been clicked, this class would be removed. sample html <button class="activeButton largeButton"> jquery to remove class $(".activeButton").click(function(){$(this).removeClass("activeButton");}); There is no pure css way to do this unfortunately. The best way would be to use :visited however, that is not possible because Note: For privacy reasons, browsers strictly limit the styles you can apply using an element selected by this pseudo-class: only color, background-color, border-color, border-bottom-col

Categories : Javascript

cocoa: detect inactive states of all the running application
See the Accessibility framework. This lets you access application instances and their properties such as "active" state. Try notifications and see if that gets you around having to poll app state.

Categories : Objective C



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.