w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Can I interact with the current debugging session variables using C# Interactive window or Immediate window?
You could use linq to do anything you can do in a loop because it is evaluated as an expression for example R.Where(item => item != R[0]); Will show you all items not equal to the first item. Here is why you can do anything with a linq expression: Enumerable.Range(1,1).Select(one => { // any function code you want here //return any type of variable. });

Categories : C#

How to call enlarge-window function depends on current window in Emacs
Taking advantage of windmove being part of emacs, this is what you can do: (require 'windmove) (defun move-separator-up (arg) (interactive "p") (if (< (cdr (windmove-other-window-loc 'up)) 0) (shrink-window arg) (enlarge-window arg))) (defun move-separator-down (arg) (interactive "p") (if (< (cdr (windmove-other-window-loc 'up)) 0) (enlarge-window arg) (shrink-window arg))) When you have 3 windows, enlarge-window and shrink-window rules might not do always what you want, so some further customization might be needed.

Categories : Emacs

submit form in new window and reload current window with new url
May be this you want to add target='_blank' And that should look like this <form action="http://www.example.com/submit/" method="get" name="myform" id="myform" target="_blank" > <div> <div>Your Name:</div> <div> <input type="text" name="name" /> </div> <div> <input type="image" src="http://www.example.com/submit_image.png" /> </div> </div> </form> To reload current page, use location.reload(); <script type="text/javascript"> $(document).ready(function(){ $('#myform').submit(function(){ location.reload(); // window.location.href = 'http://www.google.com'; }); }); </script>

Categories : Jquery

How to launch new window below current window using xulrunner
A solution can be achieved using devilspie. This tool allows you to customize many properties of application's windows including their focus, decoration, placement, and geometry. There is a handy frontend for it called gdevilspie, though there are no rpms available so it must be installed from source. You can set devilsiie to match on all mplayer windows and set their action to "below" which will place them below all normal windows. Unfortunately this will apply to all invocations of mplayer, so this solution may be annoying if you use mplayer under other circumstances.

Categories : Linux

window.open sends the current window to 0
You need to put it in an onclick event. You need to also add in return false; to stop the browser from following the link. <a href="#" onclick="window.open('someurl','_blank'); return false;">Link</a> jsFiddle of it working. Here's another, slightly cleaner way to do it: <a id="link" href="#">Link</a> <script type="text/javascript"> var link = document.getElementById("link"); link.onclick = function() { window.open('someurl','_blank'); return false; } </script> I don't know your scenario, but this is probably the ideal way to do it: <a target="_blank" href="someurl">Link</a> Clean and simple, and it does the exact same thing.

Categories : Javascript

c# - Setting current window as the foreground window
Of course, bringing a window to the foreground may be easily achieved using the SetForegroundWindow API. But this involves working with the System.Runtime.InteropServices namespace, and thus including unmanaged code in your application. An easier approach is a trick I found while looking for a way to do this. It is as simple as setting our form's TopMost property to true and then immediately setting it back to false. Setting it to true will determine the operating system to show it on top of any other windows, no matter if it is focused or not. And then, we restore the default behavior, by setting the property back to false: the window will go to the background if another application gets focus, and thus, comes to the foreground. So, insert the following code snippet wherever you need s

Categories : C#

How to let Org-mode open a link like [[file://file.org]] in current window instead of default in other window?
You need to change the value of org-link-frame-setup. Default value contains the cons (file . find-file-other-window). You may replace it by (file . find-file).

Categories : Emacs

selenium - how to change current window location without closing the selenium window?
It can be done, but some magic is required. Use this.browserbot.openLocation in the target. e.g. this.browserbot.openLocation('http://blog.reallysimplethoughts.com/'); Command storeEval Target this.browserbot.openLocation('http://blog.reallysimplethoughts.com/'); Value ignore_me You might want to check out Sel Blocks v1.3.1 and use the if/else around a normal open command.

Categories : Javascript

My inputcommand keybinding to main window does not work when child window is focussed(same wpf window)?
The key bindings will only work if the Form is focused. You could redirect every Command in your new Window to the Main Window Change your Constructor to of the new Window to accept a Main Window and save this window: MainWindow mainWindow; public Window(MainWindow w) { mainWindow = w; } Whenever a Keybinding executes just do something like this: mainWindow.TabPress(); And show the Window with Window childwindow = new Window(this) { Title = "ChildWindow", Width = 200, Height = 300 }; childwindow.Show();

Categories : C#

javascript/jquery : Window.open opens child window but after few seconds child window get automatically closed for some urls(for IE and chrome)
It's because this code is executed on init on https://wpc.gcsip.com/wpc/wpc page // check that this page is not in a subwindow (e.g. after a session time out) if ( window.opener ) { window.opener.location = "wpc"; window.opener.focus(); window.close(); }

Categories : Javascript

JavaScript - How to display the current URL as a link in current window?
You can do something like this.. Maybe you can improvise on this... <a href="#" id="link" target="_blank">Link</a> <script type="text/javascript"> window.onload = function(){ document.getElementById("link").href = window.location.toString(); } </script>

Categories : Javascript

Proper way of destroying window resources
You must be very careful with resources in Win32. Make sure you've looked at the documentation carefully to determine what Windows itself will unload for you and what you have to unload yourself. For examples, HWNDs will get destroyed as parent HWNDs get destroyed. The best trick is to attempt to unload everything you've personally created. If you get an error returned from a particular function on unload, you likely should not unload it as it's been unloaded by Windows or some related resource. It is important not to unload things when it is not necessary, as that could cause a crash. So for example, an icon created with a window that's directly from a resource likely shouldn't be unloaded. But an HBITMAP you create that you draw to other windows, should most definitely be unloaded

Categories : Windows

open the link from the popup window in an external window and then close the original popup window
Try <input name="Apply Online" type="button" id="Apply Online" value="Apply Online" ONCLICK="window.location.href='some_url';$.colorbox.close();"> or <input name="Apply Online" type="button" id="Apply Online" value="Apply Online" ONCLICK="window.location.href='some_url';parent.$.colorbox.close();">

Categories : Javascript

window.close closes the postbacked child window and a copy of child window still appears
The showModalDialog method will freeze JavaScript execution on the parent window until the dialog that it opens has closed, so we can rule out that as the reason why your second window opens. When FileUpload.aspx posts back from the server, it should work the same way as modeless aspx postbacks. I think you should be able to get rid of the window.open() method and you should be fine. Parent window: window.showModalDialog("FileUpload.aspx", "FileUpload", "center:yes;resizeable=yes;dialogHeight:300px;dialogWidth:600px;"); The Child window will call this when it's done. window.close();

Categories : Javascript

Text in label not shown proper in window form
Try using the following code e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; e.Graphics.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality; e.Graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic; It will affect the performance

Categories : C#

When will proper stack traces be provided on window.onError function?
It seems that the error object itself will be the fifth parameter supplied to onerror. http://html5.org/tools/web-apps-tracker?from=8085&to=8086 http://www.whatwg.org/specs/web-apps/current-work/ - section 7.1.6.1

Categories : Javascript

how to get reference to current tab of current window?
Every window that has a tab has one active tab, so if there are multiple windows open, you need to specify which window you want. To get the window that the current script is calling from, use: chrome.tabs.query({ active: true, windowId: chrome.windows.WINDOW_ID_CURRENT }, function (tabs) { // Do something with tabs }); If, however, by "current window", you mean the front-most focused window shown to the user, use: chrome.tabs.query({ active: true, lastFocusedWindow: true }, function (tabs) { // Do something with tabs }); For further info, see chrome.tabs.query and Chrome's definition of current window.

Categories : Google Chrome

Method that relies on nested switch refactoring to Strategy pattern
When I read your problem, the first thing that came into my mind is the Decorator Pattern. You could just decorate a very basic Evaluator with the required functionality for the specific use case. Still, you would have to a decent amount of decorators but if you do it right, you may end up with a pretty flexible solution.

Categories : Java

Current selected option not showing correctly
You can try this for your sort function: var options = [].slice.call($('select.pca31 option'),0), i,len; options.sort(function(a,b){ return (a.text > b.text)? 1 : (a.text < b.text)? -1 : 0; }); for(i = 0,len=options.length;i<len;i++){ $("select.pca31").append(options[i]); }

Categories : Javascript

Showing a hidden WPF window
You shouldn't be using hide in WPF that is winforms shenanigans. Instead do this.visibility = Visibility.Collapsed; ... this.visibility = Visibility.Visible; Also I saw your comment above that this doesn't work. However, I started a new WPF project, did this, built and ran it. It works. Note that there are no errors.

Categories : C#

How to change current window programatically?
Is it about tabs? If it's about windows, then, you may want to take a look at this page. http://developer.chrome.com/extensions/windows.html

Categories : Google Chrome

save current window to use it at resume
When you try to save a value in Ti.App.Properties it will simply be converted to at string of text. I'm not sure setObject will accept anything else but JSON-objects (and a Ti.UI.Window is not a JSON-object). That being said, saving the actual Window-object might not be a good idea, as the different dependencies might have been removed from memory, when you try to reload the window. A better approach would be to save the relevant properties of the Window (and other values that you might need to restore the current state of the Window) and the re-layout the Window once it gains focus.

Categories : Javascript

Get the current Window without native code in GWT?
There is a Window object in GWT. It does exactly what you are proposing by accessing the javascript #wnd object.

Categories : Gwt

EXT JS: How to load selected grid row into window?
you need to add refs to window objects items: [{ fieldLabel:'Name', name: 'name', allowBlank: false, ref : '../name' },{ fieldLabel: 'Age', name: 'age', allowBlank: false, ref : '../age' },{ fieldLabel: 'Phone', name: 'phnumber', allowBlank: 'false', ref : '../phnumber' }], and set data to them when you show window. itemdblclick: function(record){ var win = Ext.create("Ext.Window",{ title: 'Patients Window', height: 160, width: 160, }) win.name = record.get('name'); win.age = record.get('age'); win.prohne = record.get('phone'); win.show(); }

Categories : Javascript

Link to current window within a JavaScript function
(DEMO HERE) Use this on your html onclick: onclick="colorFunc(this)" and then inside your javascript function colorFunc(e) add e.preventDefault; to prevent from submiting the form. You don't need to use a form for this behavour you show here, but maybe you need it for other code. Anyway this should work. HTML <input id="pass" name="Answer" value="614051" placeholder="Your answer"></input> <button type="button" value="Submit" onclick="colorFunc(this)">Send</button> JS function colorFunc(e) { var passwd = document.getElementById("pass").value; if(passwd=="614051"){ window.open ('color1.html','_self')) } else if(passwd=="eggplant" || passwd=="Eggplant" || passwd=="EGGPLANT"){ window.open('color2.html','_self')); } else{ alert('You have got

Categories : Javascript

Get reference to the current instance of Shell window
You are setting up the container wrong. This tells Unity to give you back the specific instance of Shell when an IShell is requested: Container.RegisterInstance<IShell>(new Shell()); And this tells it to resolve an instance of Shell (not IShell) -- which it happily does, returning a different instance than before: return Container.Resolve<Shell>(); As a result, when you later resolve an IShell from the container you get back a shell window that has not been used at all and its window handle has not been created. Do this instead: protected override System.Windows.DependencyObject CreateShell() { var shell = new Shell(); Container.RegisterInstance<IShell>(shell); return shell; }

Categories : C#

How to pass a selected value to a html popup window
Using jQuery, you could do something this. value = $('#itemSelect option:selected').val(); window.open('form3.php?value='+value+', MyWindow You could then look for $_GET['value'] on the PHP page and process it!

Categories : PHP

how to add the selected files from dialog window to a dictionary?
myDict = {} myDict[filenameFromDialog] = len(myDict) That is the syntax for adding to a dictionary. If you have an array of files you want to add to the dictionary, you could loop over the list and add them one at a time: myDict = {} for filename in filez: myDict[filename] = len(myDict)

Categories : Python

Can someone suggest a design pattern or basic architecture for an application that relies on integrating with 3rd party services
I would have(and have had) a layer that constructs the common data structure(maybe retrieving some data from your database to create the structure), a data mapping layer that converts it into a structure with property names that coincide to the third party's structure, and a request layer that composes the request. It sounds like you have some of these figured out already. If you were doing some sort of "configuration" approach which sounds like what you want, then the request layer would be like an output configuration. I.e. if you think about many reporting engines, you can choose HTML, CSV, Excel, Interactive, etc. outputs. If your new 3rd party uses the same conventions as a previous one for XML data, but maybe a slightly different data structure or different data, then you can reu

Categories : C#

Appearing With Effect, When Showing Window A Second Time
Remove your Form2 from the auto-create list. (Project->Options->Forms, click Form2 in the left pane, and click the button labeled > to move it to the right side.) Change your ButtonClick handler: procedure TForm1.Button1Click(Sender: TObject); var TempFrm: TForm2; begin TempFrm := TForm2.Create(nil); TempForm.Show; end; Add a FormClose event to TForm2 (while you're at it, delete the global Form2: TForm2; variable just above the implementation clause, so you don't use it again by mistake):: procedure TForm2.FormClose(Sender: TObject; var Action: TCloseAction); begin Action := caFree; end; As a note: You should go to Tools->Options->VCL Designer, and uncheck Auto create forms and data modules in the Module creation options at the bottom. Auto-creating forms is a

Categories : Delphi

System.NullReferenceException thrown when showing a Window
Remove SelectedTabIndex="2" declaration from the LayoutGroup in Window2. There are not enough Tabs in the LayoutGroup to select, which results in a NullReferenceException. Maybe it is a bug of the LayoutGroup from DevExpress.

Categories : C#

NUnit is not showing Debug messages in its window
When using Console.WriteLine, you'll see the output in the Text Output tab at the bottom of the test runner. I'm not sure if Debug.WriteLine puts it there as well. Have you checked?

Categories : Visual Studio 2010

JQuery dialog not showing up in center of window
If you want to align center the dialog box: $("#dialog").position({ my: "center", at: "center", of: window }); Try if this would work..Refer the docs here

Categories : Jquery

Unable to add window exception while showing a progress bar
class asytask extends AsyncTask<String, Integer, String> { ProgressDialog dialog ; @Override protected void onPreExecute() { // TODO Auto-generated method stub super.onPreExecute(); dialog = new ProgressDialog(getApplicationContext()); dialog.show(); } @Override protected String doInBackground(String... params) { // TODO Auto-generated method stub //use your backgournd process return null; } @Override protected void onPostExecute(String result) { // TODO Auto-generated method stub super.onPostExecute(result); dialog.dismiss(

Categories : Android

Showing Tkinter window larger than desktop
Here's an example: from Tkinter import Tk root = Tk() root.withdraw() root.update_idletasks() root.geometry("+-1000+-1000") root.minsize(2000, 2000) root.deiconify() root.mainloop() withdraw hides the window, deiconify shows it. Hope that helps.

Categories : Python

prevent Just-In-Time debugger window from showing
You need to use the Application.DispatcherUnhandledException We use it like this: System.Windows.Application.Current.DispatcherUnhandledException += OnWpfUnhandledException; And, you have to set the e.Handled = true

Categories : C#

How to check current window location against an array of values
I followed @tushar gupta's advice, also wrapped it in a function checking wether scrolling ended $(window).scroll(function() { clearTimeout($.data(this, 'scrollTimer')); $.data(this, 'scrollTimer', setTimeout(function() { var hFromTop = $(window).scrollTop(); $.each(pageSectionsArr, function(obj) { console.log(this + 'is sparta') if (~~this.pageSectionPos <= hFromTop && ~~this.pageSectionPos + this.pageSection.offsetHeight > hFromTop) { //console.log(this.pageSectionPos) var sectionsId = this.pageSection.id //console.log(sectionsId) window.location.replace('#/'+sectionsId) }; }); }, 250)); });

Categories : Javascript

How to dynamically resize jqgrid to current window size?
function resizeJqGridWidth(grid_id, div_id, width) { $(window).bind('resize', function() { $('#' + grid_id).setGridWidth(width, true); //Back to original width $('#' + grid_id).setGridWidth($('#' + div_id).width(), true); //Resized to new width as per window }).trigger('resize'); } setGridWidth(new_width, shrink): Sets a new width to the grid dynamically. new_width: It will be the new width (pixel). shrink (default true) : true -> It will allow to resize columns with in the grid according to the currently resized jqGrid width. false -> It will append additional blank column at the end of jqGrid, if currently resized width of jqGrid will exceed its setup jqGrid width. Courtesty of mfs.

Categories : Javascript

How do I get Chrome's current URL now that the Chrome_OmniboxView window class has been removed?
I've just written a Chrome extension to resolve this exact problem. I've put it in the chrome webstore (free) here: https://chrome.google.com/webstore/detail/add-url-to-page-title/ghpeimfjbonkimelnkbgekmcboomkgmi All it does is to convert the html title of the page to this format: Original Title |url:[http://www.the-url.com] This is put into the window title by Chrome, which you can read using NativeWIN32.GetWindowText(handle); Thanks, Simon http://www.xibis.com

Categories : Delphi

how to close current browsing window in javascript using firefox
You will need JavaScript to do this. Use window.close(): function close_window() { if (confirm("Close Window?")) { close(); } } HTML: <a href="#" onclick="close_window();return false;">close</a>

Categories : Javascript



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