w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
TCP window scaling on Windows
See WSAIoctl with SIO_SET_COMPATIBILITY_MODE in MSDN; link here: http://msdn.microsoft.com/en-us/library/windows/desktop/cc136103(v=vs.85).aspx This lets you set the WsaBehaviorAutoTuning value which can be used to turn off auto tuning on the socket in question.

Categories : C++

scaling elements to fit browser window
Without actually seeing your website since it's password protected I would suggest something along the lines of the folllowing: You set a wrapper around your elements, in your case the nav and the video. And then set the CSS for the video and nav to have an auto margin. Which should center it both horizontally and verically. You might want to add a wrapper for the 2 components to keep them nicely stacked together and then put an auto margin on that wrapper, but the below should already work. Html: <div id="container"> <div id="nav"><!-- nav here --></div> <div id="video"><!--video here--></div> </div> CSS: #container { width:100%; height:100%; } #video{ margin:auto; } #nav { margin:auto; }

Categories : CSS

Maintain equal column height when scaling window size up or down
How about this: FIDDLE (Relevant) CSS html,body,.col-ctn,.contact-col { height: 100%; } .fluid-map { position: absolute; top:0; left:50%; height: 100%; }

Categories : CSS

Scaling an image with respect to window size and aspect ratio
http://jsfiddle.net/Bpryg/3/ $(function() { var $w = $(window), $h = $('#home'), // CACHE YOUR SELECTORS aspectRatio = 1920 / 1280; function resizeBg() { $h.width($w.width()); // YOUR ERROR ( should be width() ) if( ( $h.width()/aspectRatio ) <= $("> .container", $h).height() ) { $h.width( $(" > .container", $h).height()*aspectRatio ); } $h.height( $h.width()/aspectRatio); } $w.resize(resizeBg); $w.onload=resizeBg(); });

Categories : Javascript

Restoring keyboard settings in Xorg environment after suspending
The problem was resolved by adding a custom script /etc/pm/sleep.d/00-keyboard that executes (not only) on system resume: #!/bin/bash case $1 in hibernate) # Going to suspend to disk ;; suspend) # Going to suspend to RAM ;; thaw) # Resuming after hibernating ;; resume) # Resuming after suspending echo "Restoring keyboard settings..." /opt/scripts/keyboard.sh ;; *) echo "Something went wrong" ;; esac For more information see https://wiki.archlinux.org/index.php/Pm-utils#Creating_your_own_hooks

Categories : Linux

Window resizing and scaling images / Redeclaring back buffer size / C++ / DIRECTX 9.0
Basically, the issue was I was being a complete derp. I was putting into my rectangle the window width and then readjusting that size based on the oldwidth / newwidth.. well the new width was already the screen size... GRRRRRRR.

Categories : C++

Using memcached on a high end web application
first of all, memcached does not persist your data to the disk, so relying on it to keep your data is not a good practice memcached helps to scale your php application by minimizing the load from your db by serving results from queries or even better minimizing the load off the web server by storing the entire html if you can (there are actually many good use cases for memcached) consider the follwing flow: 1. client browsing to your page 2. php application requests the data from memcached by a key (the key can be the sql query, the url ... it depends) 3. if memcached has the data use it 4. if not the php application should query the data from mysql 5. after the data is retrieved save it in memcached so next request it will be available in 2 to handle updates, make sure to define ttl to

Categories : PHP

How to set the dropdown display default to "Medium" and not to be "High"?
You haven't shown how you rendered the DropDown, but if you used the following: @Html.DropDownListFor(x => x.Priority, Model.PriorityValues) all you need to do is set the value of the Priority property in the controller action to the desired result: IEnumerable<SelectListItem> priorityValues = ... model.PriorityValues = priorityValues; model.Priority = (int)PriorityEnum.Medium; return View(model);

Categories : C#

Vertical Scaling of Java real-time application
I am working on a primitive collections library called Banana. Banana addresses those exact issues. It supports LinkedLists, HashMaps and possibly other data structures soon without the overhead of keeping N objects. basically - the entire storage can be inside an int[] array (or many). While I did not yet officially released it, most of it is well tested and I have already ran it successfully on servers with 144GB of RAM, maintaining fast and consistent performance without any GC pauses. Check out this hash-map benchmark to get an idea on how to use Banana to store data and how well it scales vertically. https://github.com/omry/banana/wiki/Long-to-fixed-size-object-benchmark See the wiki for more info.

Categories : Java

Scaling a Node.js application to 10s of 1000s of simultaneous connections
A websocket is a TCP connection, no? And how long do your customers keep your connections open for? A server will have a limit on the number of open TCP connections you can have. Your operating system will also have a limit on the number of open file handles a process may have at any one time. So: what is the TCP open socket limit on your server, and what is the open file handle limit on your server ?

Categories : Javascript

Scaling an Entity Framework Application / Multiple Apps hitting the same database?
... issues ... regards to multiple EF applications hitting the same database server? Rewind a bit to the fact that your application is an ASP .NET MVC based application. Having multiple instances of it is probably going to raise the spectre of state management. MSDN has a pretty good introduction to why this is an issue: HTTP is a stateless protocol. This means that a Web server treats each HTTP request for a page as an independent request. The server retains no knowledge of variable values that were used during previous requests. ASP.NET session state identifies requests from the same browser during a limited time window as a session, and provides a way to persist variable values for the duration of that session. By default, ASP.NET session state is enabled for all ASP.NET appli

Categories : Asp Net Mvc

Excessively high memory usage in .NET MVC/Entity Framework application
We are automatically assuming that the problem is the EF. Can be, can be not. There are a lots of points that we should take care, not only data access infrastructure. With data access issued, as you are using only EF, you can gain fast improvement using simple .AsNoTracking() method. Adopt a ServiceLocator to help you manage your contexts pool. You can also user Dapper, instead of EF, in ReadOnly situations. And for last, but not least, use pure ADO.NET, for the more complex queries and a fastest execution. Refactor your ActionFilters to avoid using some "BaseController" that all controllers inherits is a good practice either. Check if your IDisposable classes are truly being supressed by CG, adopting the .Dispose(bool) pattern. Be sure that you are not persisting cache variables fo

Categories : Asp Net Mvc

Scaling only with AWS EC2 with Elastic Load Balancing and Auto-Scaling
ELB will pass through TCP and HTTP, you just need to set the ports you want. Autoscaling will scale the servers based on a set of parameters. So yes - you can - provided that your server can handle multiple instances of itself.

Categories : Amazon

Detecting current scaling of page, then resizing to same scaling later?
I have a solution that is good enough for now. It is not pretty. It works in WP8 with IE10, but I doubt it works for WP7 with the earlier version of IE. When the user zooms the screen (by pinch guesture) window.outer{Width,Height} are reduced by the zoom factor. If the window was originally 1024 wide and user zoomed X2, then window.outerWidth is now 512. And window.page{X,Y}Offset are likewise reduced by the same factor. However element sizes (such as document.body.clientWidth) are not changed. So the browser appears to have made the window smaller but left the page alone. (Come to think of it, that's kind of the definition of zoom...) But you cannot set window.outer{Width,Height} to cause the browser to zoom. But you can set document.body.style.zoom. When you do CSS scaling, wi

Categories : Windows Phone 8

oracle row contention causing deadlock errors in high throughtput JMS application
A deadlock implies that each thread is trying to update multiple rows in a single transaction and that those updates are being done in a different order across threads. The simplest possible answer, therefore, would be to modify the code so that messages within the same transaction are applied in some defined order (i.e. in order of the primary key). That would ensure that you would never get a deadlock though you'd still get blocking locks while one thread waits for another thread to commit its transaction. Taking a step back, though, it seems unlikely that you would really want many threads updating the same row in a table when you can't predict the order of the updates. It seems highly likely that would lead to lots of lost updates and some rather unpredictable behavior. What, exac

Categories : Multithreading

How can I open a high chart in a modal window when the chart is clicked on?
Take look at click event on chart. chart: { events: { click: function(event) { alert ('x: '+ event.xAxis[0].value +', y: '+ event.yAxis[0].value); } } }, http://jsfiddle.net/vqCMA/ http://api.highcharts.com/highcharts#chart.events.click

Categories : Highcharts

Azure Could Computing high availoability vs NEO4J high availability?
The short answer is probably yes. Windows Azure provide you infrastructure that allow you to build high availability system, it won't make any system high available by magic. As NEO4J is state-full, each node (with only one node Azure don't give you any SLA, you instance will be down) will need to share some state and the way to do it will be dependent on how NEO4J is working. So you will need to rely on NEO4J mechanism to do it. I don't know how NEO4J is working but you won't be able to skip designing an high available architecture around NEO4J using Windows Azure infra. Cloud may be a magic buzz word that can make things append on management level, but when we are on hard real world level Harry magic wand doesn't exist.

Categories : Neo4j

quicksand sorting price values low to high / high to low
val() gives you a string, so > and < comparisons are lexographical (not numeric). Try wrapping the values in parseInt() or parseFloat(). Make sure to add appropriate error handling as well.

Categories : Jquery

To open a little pop up window on a click to display html content on ie8. Not all content is seen in the window
You could try sizeToContent(): abcd.sizeToContent(); but it's not likely to work. Modern browsers allow the user to assert complete authority over: when a new browser window gets opened what controls it will have what size it will be From MDN's FAQ about window.open How do I resize a window to fit its content? You can not reliably because the users can prevent the window from being resized by unchecking the Edit/Preferences/Advanced/Scripts & Plug-ins/Allow Scripts to/ Move or resize existing windows checkbox in Mozilla or Tools/Options.../Content tab/Enable Javascript/Advanced button/Move or resize existing windows checkbox in Firefox or by setting dom.disable_window_move_resize to true in about:config or by editing accordingly their user.js file. There's more to rea

Categories : Javascript

Varnish High DB Connections In High Traffic
Mostly spiking backend connections has little to do with your varnish configuration but alot to do with the cachability of your site. Are there cookies that prevents you from caching efficiently? You can chose to strip them or remove all but chosen ones, there are examples for both on the varnish site. Do a varnishstat and check your hit rates during peaks. Is it a good cache hitratio? Is it the same as during low load? If it's the same or higher in low load it's easy to work on improving it at any time. Do a varnishtop -i txurl to see what requests are the most frequently sent to backend servers. Maybe it's some URLs that are just not cached due to faulty headers? Maybe some pages can be cached longer? Maybe some parts of the pages can be cached with ESI? Make sure your varnish is not

Categories : Mysql

Which of Yesod's Warp and snap-server should I choose for a high-performance application server?
I would highly recommend making the choice between Warp/Yesod and Snap based on which system provides you with the best set of tools for creating your application. Both Warp and Snap are using the same underlying GHC I/O manager, and both are highly optimized. I would be surprised if a well written application for each system, doing anything non-trivial, showed a significance performance gap. Your last paragraph is a bit vague, but I think the basic answer for either Warp or Snap is to just write your code, and the I/O manager will scale as well as possible. If you really find concurrent connections to be the bottleneck, you could consider trying out the prefork technique, using GHC 7.8 (not yet released, but has a much improved I/O manager), or using multiple servers.

Categories : Haskell

.NET application memory usage - high unused .NET and unmanaged memory and fragmentation
As Alex already pointed out a very nice explanation of the problem class large object heap fragmentation is found here: https://www.simple-talk.com/dotnet/.net-framework/the-dangers-of-the-large-object-heap/ The problem is well known in the .NET FX Dev Team and continuously been worked at. There is a good chance that the symptoms fade off using more recent FX releases. Starting with .NET 4.5.1 there will be a GC method call to even compact the LOH: http://blogs.msdn.com/b/mariohewardt/archive/2013/06/26/no-more-memory-fragmentation-on-the-large-object-heap.aspx However, finding the root cause of the LOHF would be way more efficient than just wiping it of the heap wasting tons of ms's Let me know, if you need further details how to isolate such effects. Seb

Categories : Dotnet

When to use low < high or low + 1 < high for loop invariant
If your invariant is that the target must lie in low <= i <= high, then you use while (low < high); if your invariant is that the target must lie in low <= i < high then you use while (low + 1 < high). [Thanks to David Eisenstat for confirming this.]

Categories : Algorithm

Add application window on WPF window .NET
This sort of thing is often called "swallowing a window" and is possible on some window managers like XTerm. However, I don't believe it's possible on Windows without crafting an entirely new window manager, which is a gargantuan task. Of course, some applications expose their GUIs through embedding technologies like ActiveX or OLE -- that's how Excel documents can be embedded in Word documents, for example. However, the application must be specifically designed to support this, and the vast majority do not.

Categories : Dotnet

Getting a second IE Window to open on a different display
After you launch an IE process, it does some funny stuff and that process you have launched can occasionally end right away as another takes over the window. What I would do is, using the methods below, is EnumTheWindows which would step through every visible window running and look for Internet Explorer or my baseURL. Then I would pass that Window Handle to GetURL and get the specific URL that IE window was running. This allowed me to use ConfirmProcessIsOnProperMonitor() and MoveWindowToMonitor() to get the windows on the proper monitor. Important stuff: private static bool ConfirmProcessIsOnProperMonitor(IntPtr windowHandler, int monitor) { //make sure you don't go to an incorrect monitor if (monitor >= Screen.AllScreens.Count()) monitor = Screen.AllScreens.Count() - 1;

Categories : C#

Display table in a Tcl Tk window with R
Is this what you want: library( gWidgets ) x <- data.frame( a = runif( 20 ), b = runif( 20 ) * 100, c = rnorm( 20 ), d = sample( LETTERS, 20 ), e = 1000:1019, f = rep( "Table Test", 20 ) ) win <- gwindow( "Table", visible = FALSE ) table <- gtable( x, cont = win ) visible( win ) <- TRUE

Categories : R

How to display the Devices & Printer window?
You can open the Devices & Printers window by running the command control printers in a Command Prompt. Knowing that, you can run cmd with the /C argument to tell it to run that command: Process.Start("cmd", "/C control printers"); If you'd prefer the Command Prompt not to show, you can use: var Process = new Process(); var ProcessStartInfo = new ProcessStartInfo("cmd", "/C control printers"); ProcessStartInfo.WindowStyle = ProcessWindowStyle.Hidden; Process.StartInfo = ProcessStartInfo; Process.Start();

Categories : C#

Output Window Progress Display
Can you put an "[System.Windows.Forms.Application]::DoEvents()" between the PowerShell commands? Without it you aren't allowing the form event handler to process a repaint between each command. You would need this immediately after the Write-Host line. I see a good write-up here: Powershell Job Event Action With Form Not Executed

Categories : Visual Studio

WPF 15 extra pixels in Window display
You can use a tool like Snoop to diagnose this. It should allow you to inspect the entire visual tree of your application, and determine which UIElement is responsible for the extra pixels.

Categories : Wpf

Pop up window to display some stuff in a fragment
The following should work perfect in accordance with your specification. Call this method from inside onClick(View v) of OnClickListener assigned to the View: public void showPopup(View anchorView) { View popupView = getLayoutInflater().inflate(R.layout.popup_layout, null); PopupWindow popupWindow = new PopupWindow(popupView, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); // Example: If you have a TextView inside `popup_layout.xml` TextView tv = (TextView) popupView.findViewById(R.id.tv); tv.setText(....); // Initialize more widgets from `popup_layout.xml` .... .... // If the PopupWindow should be focusable popupWindow.setFocusable(true); // If you need the PopupWindow to dismiss when when touched o

Categories : Android

How can I duplicate the display of a UIView into another window?
This is not exactly what you are asking for, but have you looked at using Airplay Mirroring with an AppleTV? It seems like that will provide the functionality you are looking for.

Categories : IOS

display image in tcltk window with R... How?
You can use a label for this: w <- tktoplevel() tcl("image","create","photo", "imageID", file="your_image.gif") l <- ttklabel(w, image="imageID", compound="image") tkpack(l) This only supports a limited number of file formats though.

Categories : Image

Xvfb - Browser window does not fit display
Problem was that I was not using a window manager, so installing Fluxbox (a lightweight one) and running it after starting the virtual display did the trick.

Categories : Python

how to display two bitmap image on window in C
You did not show us the code that is not working, so we can't tell you what you did wrong. Do all painting (i.e. the BitBlt call(s)) after BeginPaint and before EndPaint. Those functions must be called one time only, so don't duplicate them.

Categories : C

pop up a html page or window to display a response
If you want a nice looking popup in the middle of your screen (not the standard javascript alert popups), then... For the div you have above, you can 1) position it in the center of your screen (read http://www.jakpsatweb.cz/css/css-vertical-center-solution.html) You may want to style the div with position: fixed;, depending on how your website is set up. Also set z-index: 999; or some other high number. 2) hide it. For example in the CSS set .esv {display: none} 3) using jQuery/javascript, display it when whatever event you want occurs $("#somebutton").click(function(){ $(".esv").show(); // will display the popup window } This is a very simplified model. But something along these lines might be what you want. If you want to have different content each time, then you

Categories : Javascript

Using a try-catch to display an image in a new browser window C#
To open that image in internet explorer: Process.Start("iexplore.exe", @"http://www.companysite.com/img/XL/"); You can have it open in any browser that is installed by changing the first parameter to the name of the executable of browser you want to use, for example, chrome would be "chrome.exe"

Categories : C#

Display Modal Window once every 3 days with cookie
Here is working example that shows a dialog if the "modal_shown" cookie is not present. Once the modal is shown, the cookie is added so that it won't show up again for 3 days. Demo: http://jsfiddle.net/3M9Wq/ You'll need to include these libraries/stylesheets: jQuery, jQuery UI, jQuery Cookie plugin, a jQuery UI theme CSS. HTML: <div id="dialog">The dialog</div> jQuery: $(document).ready(function() { // Initialize the dialog (initially hidden) $('#dialog').dialog({autoOpen: false}); // Check for the "modal_shown" cookie. If not found, show the dialog and add the cookie if ($.cookie('modal_shown') == null) { $.cookie('modal_shown', 'yes', { expires: 3, path: '/' }); $('#dialog').dialog("open"); } }); Alternate jQuery that

Categories : Javascript

Duplicate a pop window display on dual monitors
My guess is the only way to do it is to use JavaScript to generate two popups and then use CSS to push the popups to the correct locations. The problem I would think you are going to run into is knowing whether or not you have two displays to manage or not.

Categories : Javascript

Display message if close window in ASP.NET but not on PostBack
Try this out:- jQuery(function ($) { $(document).on("click", function () { window.onbeforeunload = null; }); }); window.onbeforeunload = function (event) { return "message"; }

Categories : Javascript

How does App.js/node-webkit Display Window/Graphics?
If you are going to be running on embedded linux then chromium or other browser plus nodejs is going to be quite heavy -- I would guess around 64 Meg or so. On top of that you will then need to run an x environment / display server so you get the graphical GUI up and running. If you want to take the easy way out find a ubuntu linux distribution for the board you are developing for. There are many other distributions and you are welcome to try them, but I do find that there are lots of blog posts and help for ubuntu linux. Once you have that working on your device you can then install nodejs and a browser to view it. If you don't need to have a display connected to the device then you can just run nodejs and surf to the machine which can then run your application on port 80. If you want

Categories : Node Js



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