Posts

Showing posts from August, 2010

c# - How to add and show win form of different module at run time menu -

I am developing an application that has several modules, to develop each module. I have to call an integration module, forms of different modules. So I have to decide whether to develop a dynamic menu from the database where the name of the module and form is stroyed. How to get it .plz help Actually it does that where you have a shell Your initial form and the user will load the module according to which the user asks. The module can be loaded from the file system or some other storage. It uses an eventing system, to indicate which module should load, in this way you can create multiple development teams, where each is working on its module, They only need to decide the API. / div>

tex - Latex minipage to align groups of text -

I'm trying to get two minipage sections show next to each other. \ begin {minipage} [b] {1in} Hello World akdjfasljdfkjasjdfjsadkflkjksadflkaskjdfsadlflkjsafdalkjsfd: he was always an example of a show example my .tex Under the other currently down \ end {minipage} \ {minipage} start [b] {1in} Hello world \ end {minipage} akdjfasljdfkjasjdfjsadkflkjksadflkaskjdfsadlflkjsafdalkjsfd I run following through pdflatex when I combine a document, with two vertical columns get next to each other; \ documentclass {article} \ begin {document} \ {minipage} start [b] {1in} Hello world \ end {minipage} akdjfasljdfkjasjdfjsadkflkjksadflkaskjdfsadlflkjsafdalkjsfd \ {minipage} start [b] {1in} Hello World \ end {minipage} akdjfasljdfkjasjdfjsadkflkjksadflkaskjdfsadlflkjsafdalkjsfd \ end {document} in the future, using around your example code tags.

flash - Templates for AS3 (like c++) -

How do I define templates as C ++ in AS3 ?; I have Map Class (2D Array) which I want to use again in all projects but cell data is a different category based on project or implementation; There is a bunch of other reasons for sharing codes on different implementations, but I hope for some things like: map = new MyMap & lt; MyCell & gt; (); No matter if this is only 10 Flash: -P Cheers, Chris Post -text "itemprop =" text "> are not templates, but using dynamic typing and classes can have enough value for your purpose. You can create a class that takes the class and stores it as a frequency variable. class MyMap {var myClass: Class; Function mime map (c: class) {myClass = c; }} and after that you can feed that square ... map = new MyMap (MyCell); And then in ways, you can refer to that class. // anything anywhere within myMyD: object = new myClass (); // or var anything: object = myClass. SomeCachingSchemeStaticMethod (); // Wh

c# - In LinqToSql, is it possible to have a custom Insert method that Auto-Syncs the primary key? -

I can do this if I leave the organization's insertion method as 'Use Runtime' and it is directly I work to get involved, but I have to use a SP. I have just tried to return the @@ identity to the SML server and then assign it to the ID, but due to this a change becomes the reason for the notification and LinqToSql thinks that it has changed, Even if it is the only id. So basically I need a way to enter the primary key without inserting it through an alert without entering any spam. Is it possible, if so? Thank you. A solution works for me SP is a partial method to call your DataContext is called InsertEntity (where unit is the name of your class. In this method you will need to manually call your SP, but then you You can map the value of your unit's properties, and Linux SQL will respect this. For example: Public Partial Category YourDat AContext {partial null your unit (your entity unit) {using (DbCommand cmd = this.Connection.CreateCommand

optimization - Write a compiler for a language that looks ahead and multiple files? -

In my language, I can use a class variable in my method when it appears below the definition method. It can also call methods below my method and etc. There is no 'header' to take this C # example. class A {public zero call methods () {print (); BB; B.notYetSeen (); Public Zero Print () {Console.Write ("v = {0}", v); } Int v = 9; } Class B {public zero not YETSeen () {Console.Write ("notYetSeen () \ n"); }} How should I compile this? What I was thinking: Pass 1: Change everything in one AST Pass 2: Go through all the squares and define sections / variables / etc Please. > Pass 3: Go through the code and check if there are any errors such as undefined variables, incorrect access, etc. and make their output but it seems that it does work For I have to pass 1 and 2 for all the files before passing it, besides doing so seems like a lot of work until I get a syntax error (obviously that pars can be done on time It is like a brace The do or d

c++ - Static Global Fields in a Shared Library - Where do they go? -

I have a CPP file from which I am creating a shared library (autofoo and so on). In the CPP file, I have declared some static fields which I use in full library work. My question is 2-part: 1) Where are they remember? It is not that the system provides the entire library immediately and keeps it in memory ... The library is, in fact, only a bunch of hooks. 2) Is there a better way to do this? The reason for this is that I did it to start that I want to save the user from the need to pass the fields as parameters in every library function call. Thanks Generally (there are minor technical differences in each): < / P> Loads shared loads: div class = "text-mail" itemprop = "text"> Also launches global static members using their constructor. Note: The shared Lib loader does not have to do this at all load points. It can make some of these work lazy (implementation details). But they will be used before use. Any Global Stack POD Varia

sql server - SQL Order By and "Not-So-Much Group" -

Let's say I have a table: ---------------- --- ------------------- | ID | DATE | Group | Results | -------------------------------------- | 1 | 01/06 | Group 1 | 12345 | | 2 | 01/05 | Group 2 | 54321 | | 3 | 01/04 || Group 1 | 11111 | -------------------------------------- I want to order As a result of the most recent date at the top, but the group "group" column together, but still have specific entries. As a result, I want to: 1 | 01/06 | Group 1 | 12345 3 | 01/04 || Group 1 | 11111 2 01/05 | Group 2 | Edit: I am using MSSSQL. I will try to translate the Oracle query into MS SQL and report my results. Edit SQL Server 2000, therefore the over / partitions are not supported [ Table table (ID int null, [DATE] Small data type, [group] varchar (10) not tap, [RESULT] varchar (10) Empty) Insert @table value (1, '2009-01-06', 'Group 1', '12345') @table value (2, '2009-01-05', 'Group 2', '12345' ) Insert @t

google app engine - How to debug Django NoReverseMatch errors? -

Guys, I'm getting NoReverseMatch error for a special URL call. I want to know: Are there any good tools for these debugging in general? For example, there are ways to know which URLs are registered? My special example: Template: & lt; A href = "{% Url django.contrib.auth.views.redirect_to_login blarg%}" & gt; Sign in & lt; / A & gt; Error: NoReverseMatch: 'settings.django.contrib.auth.views.redirect_to_login' for argument with '(' [[[Inappropriate step ]], And the keyword logic '{}' not found I am using Google App Engine with AppNipPatch, so Django itself has been modified. In this special case where the URL uses the full path of the inverted view function, the easy job is just Look at the viewing function. In Django-1.1 it looks: def redirect_to_login (Next, login_url = none, redirect_field_name = REDIRECT_FIELD_NAME): "The user redirects to the login page, given the 'next' page "Logi

php - plugin_action_links not working in WordPress 2.8+ -

I developed a plugin with the settings link which was working fine in WordPress 2.7. Version 2.8 brings some additional security features which causes the setting to display link messages: You do not have sufficient permissions to access this page. This API hook is what I use to create a link: function folksr_plugin_action ($ links, $ file) {if (strstr ($ file, 'folksr) / Folksr.php ')) {$ fl = "& lt; a href = \" option-general.php? Page = folksr /settings.php\">Settings</a&gt, "; Return array_ararge (ar ($ fl), $ link); } $ Return the link; } Add_filter ('plugin_action_links', 'folksr_plugin_action', 10, 2); Available on full source code. There is no additional argument in the settings screen, only some options and HTML are visible on the screen. Amazingly enough, the codex search phrase "plugin_action_links" does not return anything for you, can you provide examples or can point me in the code that wo

communicate with iphone via USB port on mac -

So I'm communicating with the iPhone through a Mac program. I do not want to do complex stuff, I mainly want to send the "screenshot" command, as much as the encoder does in the organizer window, though I want to be able to speak my own with it. check this uses the macfusus although there are some problems with it It's a good start and I was using it a few years ago.

java ee - Architecture of Liferay Project? -

I have to design high level architecture for the Liferay project, whether Liferay / J2EE? Is there a sample document for portal architecture? . Please see the following links though. (This requires you to enter life) < P>

plugins - How to install a custom plug-in in Eclipse Ganymede? -

We have a custom plug-in This is the company I have been working in. It has developed it in the house. I want to install it as an available plug-in in the Eclipse Ganymede. How can I do this? By installing eClipus software, I support installation from Eclipse software update sites. I went to help -> Install new software .. -> Add -> Browse in the local ... plug-in folder though the dialog adds the directory as the update site to me , But it does not work. This directory expects a local eclipse update site (I think) I get an error No repository was found in the file: / g: / tool / ... Next I just copied the plug-in to the copy. Under my eclipse installation the plug-in directory was not working either. I also tried to copy it to the dropin directory. No dice No. Does anyone tell me about installing a plug-in that is not on the "Update" site? Thank you in advance .... Generally an eclipse plug- These are packaged because the zip file is installed

dns - Transferring Everything from One Domain to Another -

I want to move one domain from one to another which is low and (hopefully) easy to remember, but I Also want to be as smooth as possible in transit I am a coder, so I know about 301 redirects and I want to use them, but is it easy to manually add entries to my .htaccess file? The website is stable with the exception of the blog, which is under the / blog / directory and is powered by WordPress. I want this to be redirected to my new domain name. File and folder structures do not vary. Is there any type of wildcard for this? What type of web server is the host on the site? If you are on Apache, you can use the command

javascript - rails rjs modify style in the body to add margin -

How do I use RJS to modify css elements on a page? I "divin-top: 2.8em;" How can I get it with RJS or should I do something like this page & lt; & Lt; ". Document.getElementById ('Super Rap') style.margin top = '2.8em;';" However this does not work. Thanks found this: # Some.html.erb Page. Call "set_style", "super-rap", "some css-class" #css .some_css_class {margin-top: 2.8 them; } # Appliction.js function set_style (element, class_name) {new element. Classname (element) .set (class_name); } Now I need to reduce it ... At the moment it just dumps itself.

javascript - jQuery replace strings in many classes -

I am trying to use jQuery to change all the frequencies of a particular string that would be in a certain class is. There are several sections of this type on the page. So far I have the following code: var el = $ ('div.myclass'); If (L! = Null & amp; el.html ()! = Null) replace {el.html (LLL (HLH)) (/ this / ig, "that")); } This does not work if there is more than one div from class myclass . If there is more than one div then the second one is replaced with the previous material! It looks like jQuery replaces the first device and with its result it changes all sections of myclass . Does anyone know how I should do this? I am thinking of some kind of loop on all the examples of mychass divs - but my JS is a little weak. A little difference in the previous answer: $ ('div Myclass'). Every (function (i, el) {if ($ (el) Html ()! = "") {$ (L). Html ($ (el) .html (). Replace (/ it / ig, "that "));}}); should wo

mvvm - Event aggregator and collections -

I want to use an event aggregator to synchronize my view modal with the view (overshow model model around ), It is very simple to implement in the model, simply inform the settings of the properties. But when the collection of models is made, it becomes more complex where the code should be informed, should it be reported? What will be the collection interface in the model? The IList? I have thought that the only solution is in the form of a base class, which will use the reflection to repeat through all the ILIIST areas, try to INAtifyCollectionChanged them and add an event handler Any thoughts? Thanks in advance, Eric.

java - Fastest way of finding the middle value of a triple? -

Looking at there is an array of three numeric values ​​and I want to know the value between the three. The question is the fastest way to find the middle of all ? My approach is such a pattern - as there are three numbers, there are six permutations: if (array [random index]> gt ; = Array [randomIndexB] & amp; array [randomIndexB]> = array [randomIndexC]) It would be really good if someone sent me more elegant < / I> and fast can help me find a way to do this. / P> If you are looking for the most efficient solution, I think that's something like this: if (array [random index]> array [random index]) {if (array [randomIndexB]> array [randomIndexC]) {return "b is middle value"; } And if (array [random index]> array [random indexx]) {return "C is middle value"; } And {return "is a moderate value"; }} And {if (array [random index]> array [random indexx]) {return "is a middle value"; } And

javascript - What am I doing wrong with this call to document.getElementById -

मेरे पास निम्न जावास्क्रिप्ट कोड है var myDiv = document.getElementById ("myDiv" ); चेतावनी (myDiv); MyDiv.style.display = 'none'; चेतावनी (myDiv) को कॉल सफलतापूर्वक दिखाता है कि मेरीडिव शून्य नहीं है और मुझे लगता है कि ऑब्जेक्ट (div) में सभी आवश्यक गुण सेट हैं आदि। हालांकि, myDiv.style.display = none को कॉल को IE 8 में एक वस्तु आवश्यक जावास्क्रिप्ट त्रुटि में परिणाम मिलता है। मुझे जो जांच करने की आवश्यकता है, उसके बारे में कोई संकेत? धन्यवाद। सुनिश्चित कर लें आपका HTML मार्कअप मान्य है आप w3c द्वारा सत्यापन का उपयोग कर सकते हैं या यदि आप किसी आईडीई की जाँच कर रहे हैं तो इसकी पुष्टि की सुविधा है

.net - Count word occurrences in a text field with LINQ -

How can I get a word event in a database text area with LINQ? Keywords Token Sample: ASP.Net 4 Edit: Database Records: Record 1: [TextField] = " Blow blah blah blah bli bli as asp.NET blu asp.NET yop yop asp.NET asp.NET blah asp.NET blah asp.NET bli asp.NET bli bli ASP.NET Blue ASP.Net yop yop ASP then The event of 4 "ASP.Net" keywords in the record 1 In the record 2 of the keyword "ASP.Net" Two incidents are included Record 3 includes 7 incidents of "ASP.Net" keyword Collection extraction IList & lt; Record 2 Record 2 LinqToSQL is best, but LinqToObject should also be: ) NB: No problem about "." ASP.NET Keywords (if this is the question then this is not the goal) A regex this well Handles you can use the \ b metacharactor to anchor the word boundary, and avoid the keyword to avoid the unexpected use of special reggae characters. It also handles matters of the past, comma, etc.

iphone: rotating flipped view when rotating visible view -

I have a view controller when the view controller rotates, which has two views which I switch between the use of flip animation Are there. The problem appears if I follow these steps: Rotate the device when viewing the table view. Click the info button. Rotate the device (InfoView appears to be spreading). Click the info button (the table view appears to be spread) It looks like the view has not been added in the supervision, because it is part of composite ideas Was not there when the device was rotated. Is this view changed automatically? Below is a code sample - (zero) viewDidoadload {[Super Viewedload]; // Background image background image = [[UIImageView alloc] initWithImage: [UIImage imageNamed: @ "bg-app.png"]]; BackgroundIMAGE Autorsmings = (UIViewAutoresizingFlexibleWidth | UIVuatorisingFluxibilite); [Self.view addSubview: backgroundImageView]; [See background image release]; // infoView aboutImageView = [[UIImageView alloc] initWithImage: [UIIma

data structures - Circular buffer in JavaScript -

Has anyone already implemented a circular buffer in JavaScript? How would you do without the indicator? Strange co-incident, I have already written today! I do not know what your needs are, but it can be used. It presents an interface like an array of unlimited lengths, but forgets old items: // circular buffer storage externally clear 'length 'Indefinitely increases / when indexed objects will be forgotten under length-N (if you try to get them, undefined // will come back, the attempt to set up is an exception). // n represents the initial length of the array, the maximum function is not circular buffer (n) {this._array = new array (n); This.length = 0; } Circular buffer.prototype.tasting = function () {returns '[object circular buffer (' + .hd.a.re.length + ') length' + this.length + ']'; }; CircularBuffer.prototype.get = function (i) {if (i & lt; 0 || i & lt; this.length-this._array.length) Return is undefined; Please return it.

Simple regex negation -

Trying to match only the first letter in the sample below. Sample String: C / C ++ / Objective Objective-C / Objective-C / Objective-C My faulty regex: ( ?! [OO] Bjktiv [| -]?) C (?! \ + \ +) Doh Try it out: (? & Lt ;! ] Negative lookhead ( Use negative attitudes instead of code> (? & Lt;! ... ) bit) Pipe characters removed from the character classes ( [ ... ] bits. Also add Can be worth \ b s has been added from both sides of C , because your current regex coconut , BBC < / Code>, cfml and so on Also it is worth pointing out that inside the character classes, - is special If not the first or last character. Some people also survived in these situations Not like, ie [\ -] , if then after characters added by mistake.

c++ - Find a prime number? -

To know that N is a prime number, we should only assign all numbers or at least sqrt (N) Need to look for Why is it like this? I am trying to understand a reason behind this. If there is a positive integer that is divisible by two positive integers, 1 and n Because a number separator can not be greater than that number, this is a simple systemic examination: If an integer N, more than 1, any integer category [ 2, N-1] , then N is the principal. Otherwise, N is not the principal. However, it may be best to revise this test to speed up. So let us check. Note that N's separators are in pairs. If N is divisible by a number M, then it is also divided by N / M. For example, 12 divisble 6 is also 2. In addition, if M & gt; = Sqrt (N) , then N / M . This means that if a number is less than or equal to the division of sqrt (n), then divide large numbers (excluding n 1 and n itself) from sqrt (n) Otherwise, there is a contradiction. Then we have a better test:

c++ - Most optimal way to find the sum of 2 numbers represented as linked lists -

I was trying to write a program for the problem mentioned above, the number (ie lists) can be of uneven length Reverse list-2 Search for a yoga and list it in a new list of lists- List <3> Invert list. The complexity of this should be o (n + m). Is it anyway to reduce it, or is it better to do it? The best thing I do is store the reverse In order, so 43,712 is stored in this form: 2 -> 1 - & gt; 7 - & gt; 3 - & gt; 4 This arithmetic operation makes very easy. Displaying a number can be either more or more simpler with an repeated algorithm Note: It all assumes list of linked lists alone. Edit: But you later said that you have no choice in storage format. As such, your best bet is to reverse the two lists, make extra and then reverse the results.

.net - Complete XML Schema Validation -

I'm looking for a device that will tell me all of XML schema verification failures. I have seen that all other tools have been added first, and then I have to fix those people before I will tell the next errors I know that some errors may depend on other nodes in different orders, but the data types Is being formatted incorrectly, as can be reported, even if the nodes are in the wrong order I already have other tools for other questions here The Ujaa, and are closed after the first failure. So if one of those tools is what I want to do, then please let me know the steps to complete this. A programming library or technology that lets me do it in NAT or Delphi. I use a lot of XMLNotepad (I do not know that You have already tried it.) It does a great job of reporting its 'free' and many errors together, provided they are not free and terminal! Regarding compiler errors similar to Delphi: Once this all-in-turn walking process has started, which is often nonse

What is a good jQuery plugin (or plain JavaScript library) for skinning HTML Web forms? -

I search for a high-quality plugin or library to create custom cross-browser-compatible skins for HTML form controls I am doing I want to end the inconsistency of visible presence of form controls in different browsers and operating systems. I have done some search, and the most useful page that I stumbled on: However, I did not find any plugins for my needs Looks polished and stable enough (and supports IE 6, which is a requirement). Can you recommend something else? If not, will it be viable to roll your own solution? I do not need anything complex - no custom controls or special visual effects - just a consistent look in standard browsers like Firefox, IE 6 and newer standard controls (S, S, etc.) Thanks in advance for any help! If this was mine, then I can choose a plugin that I verified or performed the functionality After I went after jQueryUI.com, I made the icon and told that I was after that. For fancy user interface polish, if you look at the theater, you

PHP and MySQL hit counter multiple pages count problem? -

The following script will update the database, but it will not display the correct page number on each separate page. This will freeze the number of pages on the page for a reason. Here is the PHP code: If you give a table structure, then it would be better because the way I Understand that the table structure is that you are using the page string as the id , it is clear from your inserted query select the ID as the page ... where the page = ... I do not know your table structure. So I can not say that the problem is with inserting or updating. If the above notion is correct then replace the updated statement in the section where you placed the page in the updated query instead of the id $ dbc = mysqli_query ($ mysqli, "UPDATE mysql_counter_logs SET hits = hit + 1 WHERE id = '$ page'");

Select different field in mysql if a field is set to null? -

I select the displayname as the user name if username = null and if the user name is not null Then select the username as the username. example. id user name name 1 xyz null 2 ​​null aBC Select how I can do this in a single statement ... Thank you Collages (user name, vip name) should help you. Example: The user from selected Coleses (Username, Dzemen) where ...

language agnostic - Is there any self-improving compiler around? -

I do not know about any self-improvement compiler, but then I am not more of a compiler-man. Is there a self-improvement compiler there? Please note that I am talking about a compiler that improves itself - not a compiler that processes the code . Any indication! Side-note : If you're wondering why I'm asking for even if I agree with most of the arguments then I'm not sure about the following : We have programs that can improve their code without any human input - they are called compilers. ... so my question is. Although it is true that compilers can improve the code without human intervention, however, the claim is That "the compilers themselves are improving" is rather suspicious. These "improvements" that make compilers are only based on the rules that are written by humans (Syborg anyone?). So the answer to your question is: NO On one hand, if we had anything to improve ourselves, then we would know ... The first thing

javascript - PrototypeJS observe windows dimensions change? -

I am trying to create my own 'model' window because none of these currently exists for prototype JSS Does not meet my needs. The problem document is viewing the documentation and the changes to the width of the viewport (or document. BA, based on Quirks / Standard Mode). Document Can not you follow this event now? Event. Blogs (window, 'resizing', function) {warning ('resized');});

jquery - Using a dynamic <script> (a <script> appended to the DOM by JavaScript) to load and initialize Clicky Web Analytics -

I'm creating an HTML / JavaScript widget to use on third-party sites. This widget is a & lt; Script & gt; That our customers will put on their page & lt; Script & gt; A & lt; Iframe & gt; Creates a customer's domain, and then uses all the & lt; Iframe & gt; Creates and incorporates content. It is important that it & lt; Iframe & gt; Clicking tracking code is done to monitor clicks on the outbound link Unfortunately, when I want to & lt; Script & gt; Elements & lt; Iframe & gt; Using javascript. I used the Clicky tracking code for the first time & lt; Iframe & gt; After adding some test outbound links, it is expected that Clicky can automatically engage with those people because it does not seem to work like this on a static page, so my next inclination is "advanced_disable" custom Option to use and clicky.log () on the link I want to track. Here is a link to a test page that is with those lines:

CUDA: What is scattered write? -

The various CUDA demos in the CUDA SDK refer to "scattered writing" what is this scattered writing and why it is so good ? What is the opposite? I am going to use the terminology of the CUDA here. Scattered write means that you are writing from one thread to an arbitrary address (i.e. will not write threads of your warp constantly in memory, eg this frame- Conflicting with writing buffers, which are 2D-compatible, can be processed by hardware. They only wrote one unless long before the GPUs were available. They Contrary to the code collected by a , there are jobs which Read the data from the place where it is stored, and collect them all before collecting the thread of the thread executed in a CIDD fashion on the collected data. However, the accumulated assemblies have become available on the GPU for long time through arbitrary texture.

sql - Is it better in MySQL to have 1 large table or 2 smaller tables? -

This is my position: I have around 50 different data that I need to store for 1 record ( No one is equal or repeating) About 15 people in the field, which I usually need to use in questions, while others are used on occasion (~ 40% of the questions). Should I set up 2 tables, and can join other and 1: 1 relationships with less common areas? Or would I just put them in a table? Does any advantage, speed or otherwise, do one or the other? Post-text "itemprop =" text "> Two tables mean that 40% of your questions have been included and 60% are not included. You Your 40% of the questions are slow. 60% of your questions are fast for two reasons 1) None included 2) Low physical data block . Is this performance different "important"? Does it "make things better"? Unless you spend on each question A. Do not explicitly define time - and run benchmark tests to measure the difference - it does not matter. > Before you can decide what &quo

php - Access GET directly from JavaScript? -

I think I can use PHP to access the $ _ GET variable from javascript I:

reflection - Invalid compiler-generated .NET Class Name -

Image
I was going (with) and when I injected PostSharah (this expression was correct ?) An aspect code in the assembly, I saw this strange named category marked with CompilerGeneratedAttribute It has been named & lt; & Gt; AspectsImplementationDetails_1 . As far as I know, the class name can not be started with . Is any kind of unknown / internal operator? [Update] I did some tests and it seems that I was able to generate type with interesting names. The sample code used here is Using the system; Using the system. Using the system. Reflection.imit; Namespace ReflectionDomo {class program {public static zero main (string [] AGR) {var typename = new [] {"<<", "-", "+", "~", "!", " @ "," # "," $ ","% "," ^ "," & Amp; "," * "," (",") "," = "}; Const String assemblyName = "test"; Leading (

.net - How to identify black or dark images in C#? -

How to recognize black / dark image in C #. Is there an API to see the image visibility or the ratio of the darkness? In my application, while copying images, I want to see each image and discard black pictures. How to get any Idea? Image can be an idea to get dark / brightness: Bitmap bitmap = // bitmap var color = new list & lt; Color & gt; (); For (int x = 0; x & lt; bitmap.Size.Width; x ++) {for (int y = 0; y & lt; bitmap.Size.Height; y ++) {colors.Add (bitmap) .GetPixel (x, y)); }} Float Image Brightness = Color Avg (color = & gt; color.getbightness ()); It is possible that dark images should be considered as bright colors at least 0.1 (or relevant to any other value)

windows - How to read out the boot order? -

Is there any way to get the boot order program on Windows? port on Windows 98. If I'm not mistaken, Windows XP does not allow anymore. Motherboard manufacturers typically provide a utility to store BIOS settings in a file. Even with that information, you probably will need the features of the BOOS edition so that you can locate offset of "boot order" byte (assuming it is stored in a byte). Update: I have not tested it and more specifically If I understood correctly, then the above function With this you will be able to get the lowest stored BIOS data stored in 1MB physical memory. However, you should know where the boot order information is stored.

How to set default null value in to a date field in sql server 2000? -

How to set the external zero value in a date field in the table, if the parameter with the date value is zero? Make sure you are actually going through a tap, I think you are going through an empty string Are there. If you pass in an empty string, you get the value 19 00-01-01 00: 00: 00.000 which you will see. The tap will be empty and there will be no change in any date. Try this test code: Announce @x data time selection is zero, set xx @ x = '' is 'empty string', select @ X Output: ------- ---------- -------- ----- Zero is zero (1 row is affected) --------------- ----------- ---------- - Empty String 1900-01-01 00: 00: 00.000 (1 line is affected)

keyword - Is '@' used in C++? -

What's used in '@' C ++? It is listed as a token in it and I am sure that I can not use @ as part of a variable name, what is used in C ++? And how can I use it? No, it has not been used in C ++. It does not appear anywhere in the standard As such, it does not appear in the set of legal C ++ characters [lex.charset].

c# - How Display data in asp.net Like www.visualthesaurus.com display Thesaurus -

I want to visually display my data as a thesaurus display on the asp.net website. When the user clicks on the node, the next hair node is displayed. I want to know that it is possible in ASP.net. Give me some ideas or an API so that we can achieve this functionality in our website. Some source codes are also welcome. They have written it in Java asp.net is a server side language And it can be used to server-side code. But this is the easy part. If you were very good then it would be possible to use pure HTML / javascript like to do front end. I will use JQuery for graphics and animation because it is easy to deal with cross-browser of these difficult areas. You will have to prepare your code to optimize for javascript to achieve any kind of performance. Perhaps the light of silver can do this .. I do not know much about it.

flex - Sharing Logic Between the Browser and the Server -

I am working on an app that will be like most of the app, it will load a full boat of business logic , Almost all of those who need to be executed on both the server and the Flash-based client ... and I am trying to figure out the best (least complex) way to implement the Rule Engine. Here are the parameters of the problem: The Rule Engine should run on a web browser (i.e., in the Flash Player) and on the server. Duplication of logic (for example, by typing "server" version and a "client" version) would be an unacceptable risk. Input / output data is quite complex, hence the serialization is a non-problematic problem. We are currently using AMF for the needs of all our serialization, and using another protocol will add important complexity. .. then it should probably be avoided. This is unable to implement the "rule description language". Experiments have shown that the rules are complicated enough that any such language will need to be comple

python - Google App Engine compatibility layer -

I'm planning to run an app running on Google App Engine. The only concern is that I would have portability. Or an option to run an app on a local, private cluster I hope that an option to run on other systems for Google App Engine applications, a consistency layer, which is spring up. If the ambescription can be from the layer, then I can imagine GAE compatible framework to provide 100% compatibility with Amazon Simplified or CHDB. I like python though Java will be acceptable. However, as far as I know, no such facility is present today. If I am wrong and if so, then where can I get this Googe App Engine Compatibility Layer? If I am not, then why is the question "why"? There are unexpected technical issues or there is no demand from the market (which will probably indicate the low rates of GAE adoption). Regards, Iwan Application Scale Project Is designed to be from.

silverlight 3.0 - DelegateCommand Newbie Question -

I am trying to get pace with PRISM and how does it work with Silverlight / WPF Is it possible to use the delegation command to open popups (Silverlight Window)? If so, how can I go about doing something like this? The samples I have seen have so far been seen using the delegation command to retrieve the figures (or some other similar action). > If anyone has any suggestions, I would appreciate it. I use delegate command to execute essentially a method and / or data Back to ViewModel A popup is a presentation feature, so I do not see anything wrong with adding event handler to a button and loading a popup from codebehind. I would suggest a more basic / reusable approach either to create some type of IDialogService or to view your popup ViewModel / View and highlight the view through visual injection or binding for content control.

c++ - How to receive feedback from a Windows MessageBox? -

It is possible to do something similar to Windows: messagebox (hWnd, "yes How to react, how to react, how to react, how to respond, how to react, will return an integer referenced to the button by pressing. From the previous link: < Pre> select the return value of the IDBoft Ebert button The Iconsial Cancel button was selected, the button was pressed to continue Ignore Ignore button selected IIDO No button was selected. The IDOK OK button was selected. Select the IDRETRY Retry button IDTRYAGAIN Try Again button was selected. The IDYES Yes button was selected. Then something like this: Full results = message Box (hwnd, "save work?", MB_YESNOCANCEL); if (result == IDOK) {// ...} and if (result == IDNO) {// ...} Else // cancel {// ...}

java - What's wrong with my random wandering algorithm? -

I have created a 2-dimensional grid for a game world in Java. I made 'Winders' mode algorithm I Is having a problem with I have seen a problem that objects will appear in the side of the lower right corner of the grid. I changed the algorithm and thought it was fixed. Today, while testing stress, I came to know that the problem was not fixed, and now wandering objects liked the top left corner of the grid, but it takes more time for them to roam in that area. . works by the algorithm: 1. Obtaining the current values ​​of the person's position 2. Applying all sections in a linked list in the 3 block radius 3. Make the list random 3. List Choose a random value from 5. Setting that value indicates the next goal Here is a code snippet: dot personatt = this.getTopLeftPoint (); PersonAt = Game.getGame (). ScreenTog Game (personAt); LinkedList & LT; Point & gt; Isets = new linked list & lt; Point & gt; (); For (int x = personAt.x - 2; x & lt; per

c# - Getting strack trace error and don't understand why -

I am trying to do the PayPal IPN method. So I thought that since I am doing asp.net mvc, I can create a method view in my controller like this: Public Zero IPN () {// ipn code} < / Code> So I tried to do this on all the local hosts and some IPN variables made their own form to post stuff and it worked fine. I uploaded it to my server and used the IPN simulator from PayPal and returned it to server 500 error. So I removed all the code and basically what I saw about just an empty method in my controller So I tried again simulator and it failed again with a server 500 error. So I went and actually typed in my controller method in my URL and I get this stack trace. [NullReferenceException: Object references are not set to an instance of an object.] Site.com.Controllers.MyTestController.IPN () In MyTestController: 2320 lambda_mathation (ExecutionScope, ControllerBase, Object [ ]) +3 system vib.mvc & Lt; & Gt; C__DisplayClass1. & Lt; Rapwid Action & gt; B__

c++ - How can i compile boost::spirit for unsigned char type? -

बढ़ावा :: आत्मा को बढ़ावा देने पर जोर दिया :: आत्मा :: char_class :: ascii :: isalnum () < P> जब एसीसी वर्ण पास हो जाए तो 127. मैंने अपने सभी निजी चर को std :: string से typedef std :: basic_string & lt; अहस्ताक्षरित चार, std: : Char_traits & lt; अहस्ताक्षरित चार & gt ;, std :: आबंटक & lt; अहस्ताक्षरित चार & gt; & Gt; u_string; लेकिन अभी भी बढ़ावा देता है std: .string आंतरिक रूप से उपयोग करता है मुझे क्या करना है? समाधान काफी आसान है: इसके बजाय का नामस्थान बढ़ावा :: भावना :: एएससीआई; अब मैं नामस्थान बढ़ावा :: भावना :: iso8859_1 का उपयोग कर रहा हूं; यह iso8859 वर्ण सेट में सभी वर्णों को पहचानता है।

ruby on rails - Validating length of habtm association without saving -

I have user models with regards to an HABTM group. I do not want a user to be capable of more than 5 groups, In this way, the HAABT wants to validate the length of the relationship. On the Edit User page, I have a list of checkboxes where users can select the groups they want (I am using formattic for the form). I am calling in my User Controller: @ user.update_attributes (Param [: User]) I have the following in my user model: DIF valid if self.groups.length & gt; ; 5 self.errors.add (: groups, "can not be more than 5 groups") Ending This is failing the form due to verification, but the update_attributes call first To display changes in the related groups, the database clicks on the user's save button every time, their group associations are saved even if the record is invalid. What is the best way to resolve this? I think the legalization needs to be done on the group model rather than the user model, will it work? Ideally, I want to update,

svn - Visual Studio Source Control (AnkhSVN) & Bin directory for ASP.Net site -

itemprop = "text"> For one of your ASP.Net sites, I used the AnkhSVN to post a live post to a VisualSVN server. To do with the website. This setup works very well for every directory except the bin directory. When I create my solution, DLL is placed in the site / bin but is not visible in pending changes. If I select DLL, right click--> click Refresh Status, right click -> Commit. It will be committed, but I can not send the DLL with the rest of the site / bin. Am I doing wrong? "post-text" itemprop = "text"> The visual studio does not consider DLL referenced in the project as a source. Thus they will never be checked in, only will be copied to the bin folder, when the site will be created. VS Refresh files are used to refer to the DRL (the contents of the contents of a .ref file for the original DLL), and these fresh files are considered as sources and they will be checked. Do your setup work You will need to build the project befo

Python: How can I know which exceptions might be thrown from a method call -

What is the exception (coding time) a way to expect when executing Python code? I end up getting the exception class 90% at the end, because I do not know how the exception can be thrown (and do not tell me to read the document.) Exceptions can sometimes be propagated deeply. The documents are not updated or correct times). Is there any type of device to check this? (Like reading Python codes and Libs)? I think a solution can only be unhealthy because the lack of stable typing rules. I do not know of some equipment that examines exceptions, but you can come up with your own equipment (with a good chance to play with stable analysis) with your own device . As the first attempt, you can write a function by creating an AST, which finds all the lifting nodes, and then tries to understand similar patterns of increasing exceptions. Let the command be the following program: x = '' '\ if f (as if calling a constructor) X): Extend the IOError (Error compiler Cr

asp.net - controls in code behind -

I was working on a vb.net project and I could not find some control in the code-behind file (*. Vb). I was thinking that this is because I was working in the page_load function, so the controls are not loaded after the page_control event. Although I was able to find them with the findcontrol function of the launch object. Controls inside the template (such as in your form, in verse, or in gridview) Are not eligible. You will have to use FindControl to access those controls.

c++ - Signal and Slot vs Multithreading in Boost Library -

I have gone through similar questions on stackoverflow, but still no good answer can be found: I am amazed at how this signal / slot has been achieved. Question 1: From the following code, the sign is connected to two functions (hello) and the World (), and it seems that the function is called in sequential manner, which also means that , A function (hello) should be completed before going to another function (world)? => Single Thread Program Question 2: What is anyway to enable multi-threaded signal / slots? (=> World () will start immediately, no need to wait to meet Namaskar ().) Or if it is not recommended, will you tell me why? : Stretch Hello {zero operator () () const {std :: cout & lt; & Lt; "Hello";} }; Structure World {zero operator () () const {std :: cout & lt; & Lt; ", world!" & Lt; & Lt; Std :: endl;}}; Promotion: Indication & lt; Void () & gt; signature; Sig.connect (hello ()); Sig.connect (world

Linq to sql multiple data context in same transaction -

I am working on a project where I have multiple reposetories to fetch data from differnt tables. I have all my treasures free They create new datacontacts, add rows to the table and apply the change commands. Now if in my service, there is a situation where I have to put data in several tables, but it should be in a transaction. I can get it using TrnasctionScope stuff, but they require data. As I am using StrucutreMap to create my objects, I can not get the same data reference, so my transaction fails. Here are my objects. Interface Iconation {MyDataContext GetContext (); } Public class connection: Iconation {public MyDataContext GetContext (new {{New MyDataContext back}); }} Interface IRepositryA {int SaveDataA (objectA A); } Public Class Repository A: IRAPOSITIA {Public Ink Service (Object AA) {var context = Object factory.Get instance & lt; Iconization & gt; (). GetContext (); Context.TableA.InsertOnSubmit (a); Context.SubmitChanges (); Back a.ID; }} Interface IRep

.net - Converting long/lat to pixel x/y, given a zoom-level -

I am trying to develop a page in ASP.NET which as a tile server for Google Maps This will pull a collection of latitude / latitude points from the database, then by looking at the zoom-level (default: 15), they must be presented as a small red dot on the transparent background. This will return the result as a GIF-type image. Any algorithms or libraries have been developed which allow me to take this set of latitude / area and convert them to a set of 2D pixels coordinates, given the zoom level? (This is all being server-side, so I can not use the Google Maps API.) Update: A code- whatever the sample in Pearl The problem is: The problem is, I do not know Pearl, and actually there is no time to open a book and to know it. / P> Can someone help me understand what is happening in this function? Sub Google_Coord_to_Pix {my $ value = shift; My $ lat = shift; My $ lng = shift; My @d = (); My $ E = 0; $ D [1] = sprintf ("% 0.0f", $$ value {'BMO'} +

java - ObjectUtils.equal(x,y) null can work -

यदि x == नल करता है ObjectUtils.equal (x, y) काम? देखें। यह शून्य कार्य करता है।

Display System DateTime In Output Window During Visual Studio 2008 Build -

Does anyone know how to set Visual Studio 2008 to produce the current date / time at the end of a build ? I have set it in verbose output, but it only shows date / time on start / plus application time. I found it a while ago and found that to use it and to use it. If you need some more help about Log 4 Net, just ask. (by the infamous terrible cicinals operators) which allows you to debug an external app and log in it, live! From L4NFAP ... The trace system will send the message to an attached debugger by default (where the message will appear in the output window). If no debugger is attached in this process, messages are sent to system debugger. Utility like debug view can be used to capture these messages.

Best/quickest way to learn Java for a seasoned .NET/C# and C++ developer -

The fastest / easiest way to learn Java for an experienced NATT / C # (over 7 years) and C ++ What is 5 years) developer. When I say to learn Java - I mean, using the base classroom library, we should be able to write applications in "Java way", where a popular Java libraries are required (this It is very good that so many people are open sources of them). I know that there is a lot of flavor in the development of Java - Enterprise Aptitude (JavaEE), Mobile Device (Java ME) is one of these) - Although at the moment I am interested in a normal Java development I am taking - with an emphasis on an integration project / enterprise development. So basically - I'm a strong, passionate, proud of being a Senior C # / C + + developer with over a dozen years of experience, which is effective in the Java environment The program wants to dedicate one month's worth of value (maybe more) to learn the program. By saying that I do not mean that I am switching to Java fro

php shorttags - <?php vs <? ...Does it matter? -

संभव डुप्लिकेट: & lt;? Php // कुछ कोड? & Gt; या & lt ;? // कुछ कोड? & Gt; मुझे पता है कि पहला रास्ता उचित है लेकिन PHP कोड मान्य नहीं है तो, इसके अलावा अतिरिक्त टाइपिंग और amp; बाइट्स, क्या यह बात करता है? अपडेट उत्तर के लिए धन्यवाद ... मुझे नहीं पता था कि उन्हें संक्षिप्त टैग (इसलिए मुझे डुप्लिकेट SO प्रश्न नहीं मिला) मुझे नहीं पता था कि लघु टैग को अनुमति देने / अस्वीकार करने के लिए एक विशिष्ट सर्वर कॉन्फ़िगरेशन विकल्प था। धन्यवाद फिर से ऐसा है, अगर कोई भी आपका उपयोग करता है किसी ऐसे कोड पर कोड जहां कम टैग अक्षम हैं मैं कई सर्वरों के साथ काम करता हूं जहां वे हैं। उस के अलावा, कोई नहीं उपर्युक्त कारण के लिए लघु संस्करण का उपयोग करना आपकी स्क्रिप्ट को कम पोर्टेबल बनाता है। यह आपके लिए एक मुद्दा या हो सकता है। यह एक और मुद्दा है, लेकिन संबंधित है। अगर आप PHP से कुछ प्रकार की फाइलें बनाने की कोशिश कर रहे हैं (एक्सएमएल वह उम्मीदवार है जो मेरे लिए सबसे अधिक बार आता है) तो लघु टैग होने से कोई समस्या हो सकती है उदाहरण के लिए, निम्नलि

java - Relative path in JLabel HTML -

I am trying to show JLable an HTML which refers to the picture using a relative path. But I'm unable to locate the JLable image. When I am using the full path then it works fine. I have tried to run programs from the command line or from eclipse and I have to add a dialog to show that where the current working directory is but for the benefit I have come to the conclusion that the image is present Not found in directory - which brings me to the point Where is the image seen? Here is a test code that shows what I'm doing: import javax.swing. *; Public class HTMLLabel extends JFrame {public HTMLLabel () {setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE); Employmentpan Show Message Dialeg (this, System.GetProperty ("User Guide"); String html = "& lt; html> \ n" + "& lt; body & gt; \ n" + "div style = \" text-align: center; \ "& Gt; \ n" + "IMG src = \" file: //s.png \ "& gt; \ n"

Is there any good user interface add-on for WinDbg for not to use command line debugging? -

I want to use WinDbg, but I do not like the Gebug.exe command-line style. Is there a plugin or something that looks like a 21st Century debugger and feels? There is a code for the managed code. There is also a PowerShell integration module called, however, I really like WinDbg on these, so I'm not the right person to ask.

Java servlet deployment error webui-jsf-suntheme -

I get the following run-time error in the web browser (Firefox) when trying to run Java servlet on one Time Linux Server: unterminated string literal dojo.provide ("webui.suntheme.browser"); W ... wGroupsContainer, _41f.row group [i], "last I believe the problem is related to webui-jsf-suntheme. I can confirm that the application Successfully deploys as a production server on Windows and on a Linux virtual machine running the same version of JDK. The server runs Debian, posted servlet on Tommack 6.0 And Java version 1.6.0_12- this application uses VisualJSF (Project Woodstock) It was developed by JSF 1.2 platform, now is not supported by Oracle, the project may have been opened with NetBeans 6.7 (if it is VisualJSF), otherwise you will have to link the libraries directly into the project.

multithreading - How to manage a dictionary of lazily created objects in a multithreaded environment in .NET? -

This question is in continuity. The deal is simple. Gone: Collection of lonely singletones. Multi-specific environment. Wanted: An implementation with a small lock bar as much as possible when using a previously created item goes. Consider the implementation of the good old C ++ style of a singleton, as an example of If-lock-if pattern: < / P> get some type of public static {get (if m_instance == empty) {lock (m_lock) {if (m_instance == zero) {m_instance = new type); }}} Return m_instance; Again, this is just an example of if-lock-if pattern. Obviously, there is no lock fines when reaching the already built object. Is it possible to prepare a collection of shameful items, when a particular object has already been made, in the same sense of keeping the penalty down? Thank you. Edit: I have re-written this question completely, erase the word with eccentricity, because people get a lot of attention And do not have the origin of the question.

event handling - jquery click handler -

I dynamically create a bunch of tags, add them to one and then add a click handler. . code to add. Nav ("# nav a") to .ready (function () {// ... & lt; a & gt; Click the tag (function (event) {alert ('clicked' + event.target.id); return false;});}); If I have 10 tags as a result of this and click on the first one, I get 10 (ten!) Alerts - but all the tags I actually click on to be the ID Show. / P> (If I click on the 5th tag, yes, I get 5 alerts - with the ID of all the 5th tag ...) What's going on here? Is it because I created the tag dynamically? Try it instead: thanks / P> $ (document) .ready (function () {/ * ... add code to AND div & lt; a & gt; tag. * / $ ("# Nav ("function") (function () {$ (this). (Function (e) {warning ('click' + e.target.id); return false;});});}); Anyway, these two are equal! There is no problem with your code. Check the tag generating code for the bug.

Using the Jena RDF library, how do I return the property of a URI resource? -

I have a Jena URI resource ( resource is the reference of an object where isURIResource () returns correct). An example resource URI is: If you open it in a web browser, you might be given HTML rendering of the data: You can change the .html extension with .rdf : This RDF model is formatted as XML. The property I need to retrieve is: & lt; C: symbol & gt; MSFT.OQ & lt; / C: Symbols & gt; In summary, I am looking for a way to use my Jena Yuri resource to return the value of c: symbol , which in my example MSFT.OQ I know that I can take this URI, getting the representation of RDF through some HTTP client, then load the model as a load and inquiry I am already doing what I believe, though, that Jena is doing this recurring task. Provides a more elegant solution. I do not think there is 'streaming' API for Jena like stax api for xml. Can help: Last year I wrote an simple streaming parser for RDF: it does not handle full

installer - InstallShield battery level warning -

Is there a way to display a warning message if the user tries to install my app when the battery level 5 % is less than? I'm using InstallShield. If the installshield supports this directly, but you run the Autorun menu program that runs first, Which checks the battery level, after which it is OK, then the setup runs?

c# - How to implement automatically select item in a html and click submit? -

I have a website, and a username and password, and usually I will login the website with a username and password, And submit them to perform items and actions in some check boxes. But for now I have to write an application to select the checkboxes by some keywords and submit them automatically. Anybody good idea? Before I use IBM Episode, it can automatically log in to my website, how does this apply? If you are interested in.

c# - How to encapsulate the concept of a combination of generics into a new type? -

Is there any way anyone can interpret the dictionary as a new type of data dictionary, so that changes in definition Need be Although many places are used, it can only be changed in some. Or should I wrap it in another class and only highlight aspects of it? dictionary if you want a proper sub-type, turn it off Class DataDictionary & lt; K, V> : Dictionary & lt; K, V> {} And another option is: Class DataDictionary & lt; K, V> {Private Dictionary & lt; K, V> _Information; } Which gives you more freedom to design your own type. And if you mean "how to eliminate type-criteria", use something like this: class datadition: dictionary & lt; String, int & gt; {}

php - How to update a jointable in CakePHP, manually -

I am a newbie with CakePHP. I have two tables: contact and tag, and an HABT table contact_tag adding the user tag. Because people can be able to do it in delicious.com. They get a list of tags like they write. They can just add new tags by typing them. I'll see the tag table to see which tags already exist and which are not. The new ones should be added to the tag table and the insert id has been added to an array. Then I want to use these tag IDs to update contact tags. Bus. These are the two functions I have created: / ** This function checks for existing tags and creates new tags @param string (tags separated by commas) @ Return Array (Of id) ** / function save and cutlet ($ tag) {$ tag = explosion (",", $ tag); // Create an array of tags $ idArray = array (); Forex Currency ($ tag as $ tag) {$ count = $ this-> Find ('calculation', array ('conditions' = & gt; array ('name' = & gt; $ tag); if ($ count === 0) {$ this-> (;); if

Including Javascript with a custom control in an ASP.Net website -

I have a custom date control that is essentially a text box and ajaxToolKit calendar extender. I want to include javascript in control and it has to work properly, even if any page is on control. Control is called DateControl.ascx So I have two JavaScript functions, dateEditor_OnShown and dateEditor_OnHiding. They are bound to load the DateControl.ascx page ... Calendar Extender.OnClientShown = "dateEditor_OnShown"; Calendar accredited .onlineheading = "date editor-onhiding"; A datacontrol device is used on two separate pages. If I put Javascript directly into the HTML of the Continental, it will only work on the default page, but it will crash when I load the next page with control. Error is a JS runtime error 'dateEditor_OnHiding' is undefined. If I try to link the JavaScript file from my DateControl's html ... & lt; Script type = "text / javascript" src = "../ javascript / IE6 calculatorExtenderFix.js" & gt