Saturday, 15 May 2010

winforms - C# WaitCursor while form loads -


I am getting a form that takes seconds to display at the end. This form is called:

 using  (result frm = new result ()) {this.Visible = false; Frm.ShowDialog (); This.Visible = True; }  

It's useful to let me see the default cursor as cursor. VAT Kaiser is available, while waiting for the form to display at the end. Currently I am able to successfully do this using the stable 'current' property:

 using  (result frm = new ResultsForm ()) {//this.visible = false; Cursor Current = cursor Wait cursor; Frm.ShowDialog (); //this.Visible = true; }  

But it has two problems:

  • This forces me to disable the mainstream hide-ins feature which I would like to maintain.
  • This increases the coupling after the cursor. Current = cursor Default; is to be called within the event shown as a result.

How can I change the cursor during the form before replacing the code snippet and avoiding coupling while loading without loading?

Update: The question was answered now, the video presentation was removed so I do not go to my ISP bandwidth limits

Why you have to remove it. View = false? You should still be able to do this while determining the cursor.

What would be an acceptable solution to set the cursor instead of the parents? Get it to set the cursor before starting the code which takes all the time, then set it back to the end.


.net - JSON.Net serialization and custom objects -


So I was working toward serializing some of my objects to a fairly lightweight approach, and the use of NewtonSoft's JasonNet Was hoping to do.

The challenge is that I am trying to use a simple interface for serializing an IDictionary. T will be one of the many institutions in my domain in this case that everyone has a Gid ID (which creates its key in the dictionary).

The problem I have is JSON.Net is successfully sorted by the dictionary key value and the ID property of the stored objects, but none of HT's other properties (which, at this point, are all simple types) . My serialization code is much more accurate than the JSON.net website:

  string json = JsonConvert.SerializeObject (data, formatting indent); As "Data" I have said that there is an IDictionary, and T (for this test) is a "property" type which is just a Guid ID and a string name property. The output looks like this:  
  {"d1cb1764-66cd-4cfb-8f51-c0b8457ce00e": {"Id": "d1cb1764-66cd-4cfb-8f51-c0b8457ce00e"}}  

Thank you.


Is there a way to push a MATLAB workspace onto a stack? -


Does anyone know that there can be a heap of workspaces in MATLAB? It would be very convenient, to say the least.

I need this for research. We have several scripts that interact interestingly. Functions are local variables, but there is no script ...

The regular metallab function call stack is a stack, the easiest way to use one's workspace function, and copy-on-written of Matlab makes it appropriately efficient but perhaps it Not what you are asking for.

There is a natural correspondence between workspace and strokes because the same identifiers are valid for variable names and structures fields. They are essentially both identifier => Mxarray mapping.

You can use whos and evalin to capture a workspace position for a structure. Use a cell vector to apply one of those stacks. (A straight array will not work because it requires homogeneous field names.) Stacks can be stored in the appadata to prevent it from appearing in a workspace.

Here are push and pop functions for this technique

function push_workspace () c = getappdata (0, 'WORKSPACE_STACK'); If Hamperity (C) C = {}; The end% hold the workspace w = evalin ('collar', 'whos'); Name = {w.name}; S = struct; I for = 1: numel (w) s (Names {i}) = evalin ('caller', names {i}); Push it to end% stack C {And + 1} = S; Setappdata (0, 'WORKSPACE_STACK', c); Function pop_workspace ()% off previous workstation stack C = getappdata (0, 'WORKSPACE_STACK') pop; If direct (C) warning ('nothing on the workstation stack'); Return; End s = c {end}; C (end) = []; Setappdata (0, 'WORKSPACE_STACK', c); % If you want a blank slate for your workspace evalin ('collar', 'clear'), do it; Caller's workspace names =% stick wars in field names; I for = 1: number (name) assignine ('caller', name {i}, s (name {i}); End

copying a texture in xna into another texture -


I am loading a texture2D that contains several phantom textures. I initialize to store in different texture2D objects I would like to draw different textures while loading texture, but there is no such way where I have to do this. SpriteBatch Draw, I believe that only one beginning, the end block should be called right from within?

Thank you.

I am loading a texture2D that contains many phantom textures. To store texture in 2D object, I would like to draw different textures while loading the initial texture.

You do not have to do this, nor should you want to reach a single texture faster than many settings. In addition, textured GPU textures are stored in memory to split it does not make sense.

You should instead focus on the written code that can reach individual sprites within your phantom sheet. I suggest how you can see how a play based game works

Here's a great tutorial video series that you should help:


What does the jQuery() function do? -


In answer to the question

I have a follow-up question. What does the jQuery () function do? (There are four answers on this; the subject should describe at least selector and element-set mode)

I tried with googling but could not get a clear answer.

Thanks for any help in advance.

jQuery function input:

  • $ ("") , $ (zero) , or $ (undefined) < Li> $ (DOMElement)
  • $ (html) -> $ (array)
  • $ ("# id")
  • $ ("TAG")
  • $ (expr, $ (...))
  • $ (expr, context)
  • $ (function)

To see how this is controlled, see, respectively.


java - 2nd level hibernate cache understanding -


** 1 ** For second-level caches, can only set the timeout period but can not clear the refresh / unit cache? Or is auto-refresh / cache saving / updating / mergeupdate every time as the tipping annotation @Cache (use = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) ? Is hibernated template. Flush () related to this?


2. Is it good for all institutions to enable second level cache?

= "text">

1) If you have to do then you can manually remove the bodies from the second level cache. There are several ways for this purpose; Some ejected a single instance of a unit (or collection); Others ejected all bodies of the given class (or name of the given entity).

He said, you should not do this like Normally - Hibernate will keep the cache updated for you (as long as you are not updating something like that SQL Update - in which case your question is clear).

2) Generally - no, it is not good for cash All Organizations This is usually a good idea to cache an inevitable institution, as well as Are often loaded / rarely updated; Suppose you do not have tons of them. But again, it really depends on you what you are doing.

There is a timeout (or, if you make a safe), your cache size / good caching strategy should not be trusted.


asp.net - RedirectUrl info lost after doing postback in client-side code -


My login page works like this: when you enter it, javascript reads some of your information, Writes in the input and submits so that the read data can be read and processed on the server.

  & lt; Script language = "javascript" type = "text / javascript" & gt; Function getUserInfo () {var userInfo = xyz.GetSecureBox (); Form1.info.value = userInfo; Form1.read.value = "true"; Form1.submit (); } & Lt; / Script & gt;  

Depending on the data provided, the server code authenticates the user or not

The problem is that when you try to enter a different page , Then make it the default .aspx, you are redirected to the page login with the redirect URL parameter so that you can be certified. But after postback I have lost the javascript redirectUrl information. How can I protect it?

OK, I can definitely read that string string parameter in JS and write it in some input. How do I use query string parameters in JS? And maybe there is a different way?

The only way I can think about session and / or cookie.

If using the query string and parsing in JS, then you have to code yourself. There are so many code out there that are doing this eg.