Posts

Showing posts from June, 2015

Grab-to-pan in Silverlight app -

I have canvas inside a scrollViewer. I want the user to be able to capture and move the canvas, scrollbars But with a thumbs up properly on updating My initial implementation calculates the offset on each mouse move, and updates the scrollbar: // calculate new drag distance newOffsetPos = e.GetPosition (MapCanvas); System.Diagnostics.Debug.WriteLine ("New Offset Grade:" + newOffsetPos.X + "" + newOffsetPos.Y); Double delta x = newoffset.pos.x - _offset.position.x; Double Delta Y = newOffsetPos.Y - _offsetPosition.Y; System.Diagnostics.Debug.WriteLine ("Delta X / Y:" + DeltaX + "" + Delta) "; System.Diagnostics.Debug.WriteLine ("SV offset X / Y:" + _scrollViewer.HorizontalOffset + "" + _scrollViewer.VerticalOffset); _scrollViewer.ScrollToHorizontalOffset (_scrollViewer.HorizontalOffset - Deltax); _scrollViewer.ScrollToVerticalOffset (_scrollViewer.VerticalOffset - Delta); _offsetPosition = newOffsetPos; Although...

When implementing an interpreter, is it a good or bad to piggyback off the host language's garbage collector? -

Assume that you are implementing an interpreter for a GCED language for GCed language, which looks like a GCD That you will receive garbage collection for free, as long as you are very careful about your design. Is this usually done? Are there good reasons to do this? There are two different things in language and sequence: they are not really related to IMHO. Therefore, if your current runtime already provides GC, then there should be a good reason to increase the runtime with other GCs. In the good old days when the memory allocation in the OS was slow and expensive, the app brought its heap managers, where the smaller part of the data is more efficient in handling. This was a reading to add another memory management to the current runtime (or OS). But if you are talking about Java, .NET - then they should be sufficient and efficient to work most. However, you may want to create a proper interface / API for memory and object management. Work (and others), so that your ...

Using Html.ActionLink() with ASP.NET MVC & Spark - Syntax? -

Everything, normal / ASPX view works well with Spark and MVC within NerdDinner, and I have not touched any controller code so I am pretty sure that it is not so. & lt; ViewData Model = "System Colections. Generic.InMemable [[NerdDinner.Models.Dinner]]" /> & Lt; Set Title = "'Upcoming Day' '' & gt; & lt; Content: Main & gt; & lt; li Each =" P in Model "& gt;! {Html.ActionLink (P. Title, 'Description', 'Dinner')} Content: Main> In view of the above code, ActionLink is considered as good as that which is good When I try to provide an ID to my action method, then I start killing a wall, as far as I can tell from Spark sample docs, do something like this Should be enabled in: ! {Html.ActionLink (p.Title, 'Details', 'Dinners', new {id = p.DinnerID}}} However, it throws an exception: "unexpected token '{'" I hope this is something silly. I'm missi...

git - in zsh, how do I do a conditional on the exit status of a program? -

मुझे कुछ ऐसा करने के लिए wnat: अगर [[git स्थिति & amp; & gt; / Dev / null]]; फिर "एक जीआईटी रेपो" गूंज; Else गूंज "एक git repo नहीं है"; फाई को छोड़कर मुझे पता नहीं है कि कैसे बाहर की स्थिति पर जाँच करने के लिए। मैं इसे कैसे ठीक करूं? धन्यवाद का प्रयोग करें $? , इसमें अंतिम कमांड रिटर्न कोड होता है संपादित करें: सटीक उदाहरण: git स्थिति & gt; & amp; / Dev / null अगर [$? -ई 0 0]; फिर "जीआईटी स्थिति सफलतापूर्वक समाप्त हो गई" एको गूंजती "गिट स्थिति त्रुटि कोड से बाहर निकली" फ़िक्स

nested linq queries -

मैं इस तरह एक XML फ़ाइल के साथ काम कर रहा हूं। & lt; लिफाफा xmlns = "http://schemas.xmlsoap.org/soap/envelope/"> & LT; body & gt; & LT; Element1 & gt; & Lt; एलिमेंट 2 दिन = "2009-10-18" & gt; & Lt; Element3 नाम = "जो" & gt; & Lt; एलिमेंट 4 समय = "1" & gt; & Lt; एलिमेंट 5 राशि = "0" मूल्य = "16.58" / & gt; & Lt; एलिमेंट 5 राशि = "1" मूल्य = "18.58" / & gt; & Lt; एलिमेंट 5 राशि = "2" मूल्य = "20.58" / & gt; & Lt; / Element4 & gt; & Lt; / Element3 & gt; & Lt; Element3 name = "Fred" & gt; & Lt; एलिमेंट 4 समय = "5" & gt; & Lt; एलिमेंट 5 राशि = "1" मूल्य = "15.41" / & gt; & Lt; एलिमेंट 5 राशि = "2" मूल्य = "16.41" / & gt; & Lt; एलिमेंट 5 राशि = "3" मूल्य = "17.41" / & gt; & Lt; ए...

iphone - Publish UIWebview via Facebook connect -

I am using fbConnect in my coke touch application. I have UIWebview on my code, and I want to publish the context of UIWebview (its only text) to Facebook. How do I change FBStream to publish my UIWebview? FBStreamDialog * dialog2 = [[[FBstream dialog] alloc] init] autoresphere]; Dialog2.delegate = self; Dialog2.userMessagePrompt = @ "Share Gazals On Your Wall"; Dialog2.attachment = @ "{\" name \ ": \" Huffes app for iPhone \ "," "\" href \ ": \" http://itunes.apple.com/us/app/divan-of - Hefez / ID 340865571? MT = 8? Tab = iPhone \ "," "\" media \ ": [{\" type \ ": \" image \ "," "\" src \ ": \" http: // photos-h.ak.fbcdn. Net / photos-ak-sf2p / v43 / 67/279420942343 / app_5_279420942343_8373.gif \ "," "\" href \ ": \" http://developers.facebook.com/connect. Php? Tab = iphone / \ "}]," \ "attribute ...

.net - Is there a UnicodeCategory Enumeration diagram? -

I'm looking for a good diagram that shows an example for each. This will define a character's Unicode range. A surrogate pair is a coded character representation for a single abstract character, the sequence of two code units, where the first unit of the pair is a high-surrogate and the other is a low-surrogate. Through U-D-FFF, there is a unicode code point in the range of U + D800 and low-surrogate is a unicode code point through U + DfF via U + DFFF. This calculation is based on Unicode standard, version 3.1 This calculation is used to support four methods, such as iSiper Is an open source software that receives one character and returns the character category. In this category, the Unicode character database (Annex # 44) provides complete information about each of the variables described on this database, in which the character range (and open source software, using this DB will allow you to leave the class ) Windows Charmapp will also show you the ch...

language agnostic - How do you create your Factories? -

So, coming to the subject of factories, I am thinking how they have been established. From where I stand, I can see 3 types of units: all in one A factory that originally All the sections used in an application are included. It seems that this is just a factory to be a factory, and does not really feel structured. Example (Where classes, class B, and classes have nothing in common with : class factory {public static function buildClassA () Public static function buildClassB () public static function buildClassC ()} The given code samples are in PHP However, this question is language-agnostic. Built-in Factory Next is mixing in fixed works with regular functions like Wish (See) Example: class ClassA {public static function buildClass () public function __construct ()} Factory on-the-side The last one I can think is a factory for individual sections of individual sections, or sections. The variable used in the manner seems. Example (where class,...

java - searching an unorder list without converting it to an array -

Is there a way to search the object in a linked list of objects in a way? I thought that you just have a sort of sorting and a binary search? Thanks This is not a good way, IMO if you type Collections.sort (list) , where a list is a linkededlist , it templates a temporary array that copies it to list , And then copy it to the O (NlogN) plus 2 * O (N) copies, but when you type a binary search (like Collections.binarySearch (list) , try copying Every search is done by O (N) list traversal operation. Well sorting list is not bothered! Another way to convert an array into an array or an ArrayList , And then search the sort and array / ArrayList. It gives a copy to set up in a way, and o (login) for every search. But none of these is the best way. It depends on how often you search Connection can. If you just want to do a search on the list, then list.contains (...) to O (N) Calling. ..and that's better than sorting and binary search. If you want ...

asp.net - How do I deal with the quantity column of a junction table using sql to entities -

I have 3 tables There are many links to blogs and tags There is a junction table with blog tag volume columns. ** Blog ** Blog ID Title ** Tag ** TagInd Name ** BlogTag ** Blog ID TagIntinity I'm not sure that I How do I handle columns? Thanks OK, you will need to calculate the amount : var q = (In context B to select blogs where B. Blog tag. Ani (t = & gt; gt; tigid == some id) Select b) .count () ; Then you: add 1 blog 2. SaveChanges 3. For each tag on the new blog: 1. Calculate the quantity, as above 2. Update BlogTag.Quantity 4. SaveChanges

MySQL SUM in different ways -

मेरे पास दो टेबल हैं user_raters: | आईडी (इंट) | To_id (int) | मान (इंट) | बनाया_एट (तारीख समय) | 1 | 2 | 1 | 2009-03-01 00:00:00 संपादित करें: मैंने user_rater_id बदल दिया history_user_raters.user_rater_id history_user_raters user_raters.id से संबंधित है: | आईडी (इंट) | User_rater_id (int) | मान (इंट) | बनाया_एट (दिन-समय) | 1 | 1 | 1 | 2009-03-02 00:00:00 | 2 | 1 | 1 | 2009-03-02 00:00:00 | 3 | 1 | -1 | 2009-03-02 00:00:00 | 4 | 1 | 1 | 2009-03-03 00:00:00 | 5 | 1 | -1 | 2009-03-03 00:00:00 | 6 | 1 | -1 | 2009-03-03 00:00:00 | 7 | 1 | -1 | 2009-03-03 00:00:00 मैं history_user_raters से मानों का योग गिनना चाहता हूं क्योंकि यह user_raters से to_id से संबंधित है। क्वेरी से परिणाम होना चाहिए: | वर्ष | महीने | दिन | कुल | नीचे | ऊपर | 2009 | 3 | 2 | 1 | 1 | 2 | 2009 | 3 | 3 | -2 | 3 | 1 मेरे पास एक क्वेरी है जो करीब है, लेकिन यह ऊपर और नीचे सही तरीके से नहीं गिना जा रहा है कुल सही है कुछ एक मदद कर सकते हैं मुझे क्वेरी या नई क्वेरी अप में सुधार करें और नीचे गणना ...

css - Is there any benefit to use Progressive image display for JPG, Gif and PNG? -

Is there any advantage of using progressive image display for JPG, GIF and PNG? Do not let us go to & lt; Img & gt; and background in the CSS Support for progressive display We do? Is not there much speed in mobile? So this is actually useful for mobile phones Progressive display is useful where there is a slow data link Allows the person to see the picture which is broadcasted with some of them. They can choose to terminate the transmission if it is not of interest. I do not know any important browsers that do not support progressive display.

.net - procedure for calling an exe only one time -

I am using process.info, start the process (); Clicking on the button to make an XE call on C # .net, but every time I click on the button, it says an exe and opens a duplicate file on the taskbar. I just want to maximize the exchange which was already on the taskbar. I am facing the problem that it is repeatedly opening the same file on the button click. Is there any way that he can open the exchanges once and click on the button, if he is already opened instead of creating duplicate entries then can maximize the xi file? itemprop = "text"> process. Start () a process gives a class what you can do a class Is variable (for example, the process has been initiated; ) that is initiated when the button is clicked. If that variable is null, it means that the process has not started yet , And that application should be launched, else it is already running, and we should ignore it. Yes is a basic example: Process start process = faucet; Public Zero Button 1_Clicke...

JSP compilation fails on Weblogic 10.3 but works on Weblogic 10 -

मेरे पास जेएसपी & lt;% @ पेज भाषा में कोड का एक टुकड़ा है = "Java" import = "import com.ecc.SiteAdmin.servlets। *"% & Gt; यह फ़ाइल संकलन और वेबलॉग 10 पर ठीक काम करती है, जिसमें सूर्य जेडीके 5 है, लेकिन जेलोकित 6 के साथ वेबलॉगिक 10.3 पर निम्न संदेश में विफल रहता है SiteAdminLogin.jsp: 1:36: इस नाम के साथ कोई भी नाम इस स्थान पर नहीं मिल सकता है। & lt;% @ page language = "java" import = "import com.ecc.SiteAdmin सर्वलेट्स। * "% & Gt; SiteAdminLogin.jsp: 1: 36: आयात एक कीवर्ड है और इसे पहचानकर्ता के रूप में प्रयोग नहीं किया जा सकता। & lt; % @ पेज भाषा = "java" import = "import com.ecc.SiteAdmin.servlets। *"% & Gt; मुझे लगता है कि यह मुझसे कोड आयात शब्द को निकालने के लिए कह रहा है, लेकिन यह JDK5 पर क्यों काम करता है और JDK6 नहीं? क्या इसके लिए कुछ और है? संपादित करें: यह मेरे सहयोगी मशीन पर ठीक काम करता है जो आईई 7 का प्रयोग कर रहा है, मैंने कुछ समय पहले आईई 8 में अपग्रेड कर ल...

how to extract the exact data from an array in php -

I found this array from a database ... how to get the right value attribute ...... how Make PP print $ myArray [0] - & gt; column [ 'A21ha: link_0 '] -> Value; from You will get first. To get all, you want to loop from E through the content. foreach ($ myArray [0] - & gt; column as column column) {Print $ column-> Value;}

pdf generation - Anyway to automatically convert DWF to PDF? -

हमारे ई-ट्रांसफर समाधान, www.monaqasat.com, वर्तमान में विभिन्न कारणों से पीडीएफ दस्तावेजों के साथ काम करता है, उनमें से कुछ सुरक्षा हो रहे हैं हमें पूछा जा रहा है कि क्या हम डीडब्ल्यूएफ दस्तावेजों का समर्थन कर सकते हैं। ऐसा होने के लिए, हमें डीडब्लूएफ दस्तावेजों को स्वचालित रूप से पीडीएफ में कनवर्ट करने की ज़रूरत होगी, कुछ यूनिक्स एप्लिकेशन का इस्तेमाल करना। क्या किसी को ऐसे रेलवे या जावा का उपयोग करने के लिए कोई ऐसा आवेदन पता है? धन्यवाद, । करिम आवश्यकतानुसार सुरक्षा।

Set Nullable property to null via Windsor configuration file? -

How to set a class null property to null through the Windsor configuration file? Let's say I have a class like this: public class MyComponent {public int? MyProperty {Get; Set; }} and there is a configuration file like this: element id = "MyComponent" ... & gt; & Lt; Parameters & gt; & Lt; MyProperty & gt; !!! What do i do here !!! & Lt; / MyProperty & gt; & Lt; / Standards & gt; & Lt; / Component & gt; What to put in the inner text above to clear the property? (Yes, in this example I know it will actually be zero by default, but imagine that it is set in the constructor for something else) Empty text does not work - I have checked. This is not possible, but I do not consider it a missing feature. If you do not need it - tell it clearly - create a constructor without this parameter, and Windsor will handle it properly.

.net - Reason why MethodBuilder.DefineParameter could not set parameter name? -

I'm making interface based on an existing interface for WCF concerns, but I do not set "DefineParameter" parameter name (The type of method of made type is not a name). Are you a reason to do that? public static type MakeWcfInterface (type iService) {AssemblyName AssemblyName = new AssemblyName (see the string. Format ( "{0} _DynamicWcf", iService.FullName)); String modulation name = string.format ("{0} .dll", assemblyName.Name); String ns = iService.Namespace; If (! String.IsNullOrEmpty (ns)) ns + = "."; // Create assembly assembly assembly = AppDomain.CurrentDomain.DefineDynamicAssembly (assembly name, AssemblyBuilderAccess.RunAndSave); // modules create var modules = assembly. Defined dynamic module (module name, incorrect); // asynchronous interface type Create TypeBuilder iWcfService = module.DefineType (| TypeAttributes.Interface | String.Format ( "{0} DynamicWcf", iService.FullName), TypeAttributes.Public TypeAttribut...

SQL Server - Rewrite trigger to avoid cursor based approach -

If I have the table test with two columns num1 and Num2 and the following trigger that increases the number 2 on the sum of num1: DECLARE @ PROC_NEWNUM1 VARCHAR (10) DECLARE @ NEWNUM2 Numerical (20) for selection Select my_Cursor cursor INSERTED from num1; Next to MY_Cursor FETCH @ PROC_NEWNUM1 WHILE @@ FETCH_STATUS = 0 Select SELECT @ NEWNUM2 = MAX (num2) if the @ NEWNUM2 is empty, then start @ NEWNUM2 = 0 set @ NEWNUM2 = @ NEWNUM2 + 1 update test set Number 2 = @ NEWNUM2 WHERE number1 = @ PROC_NEWNUM1 FETCH Close my PROGRAM_NEWNUM1 next to my matrices my_Cursor DEALLOCATE my_Cursor Do any of the above write using a set based approach The way? (If anyone wants to know why I am doing so, here's the background): Row_Number (only Squilie 2005 only) Solution without the temporary table using: SELECT @ MAXNUM2 = MAX (num2) test if the @ MAXNUM2 is started SELECT @ MAXNUM2 = 0 END UPDATE TEST SET num2 = MAXNUM2 + SubQuery Select (number 1, ROW_NUMBER (), from R....

Get value from constructor to a function in php class -

मेरे पास एक वर्ग है: class List_PendingVerify Rs_List विस्तारित {सार्वजनिक फ़ंक्शन __construct ($ आईडी) {} सुरक्षित फ़ंक्शन loadData () {}} अब मैं कैसे लोड आईडी समारोह में $ आईडी का मूल्य प्राप्त कर सकता हूं? ताकि मैं सक्षम हो सकूं $ Id को प्रतिध्वनित करने के लिए। धन्यवाद वर्ग List_PendingVerify Rs_List विस्तार {सार्वजनिक फ़ंक्शन __ रूपांतरण ($ आईडी) {$ this- & gt; id = $ id; } सुरक्षित फ़ंक्शन loadData () {echo $ this- & gt; id; }} मैं दस्तावेज़ीकरण को पढ़ने की अनुशंसा करता हूं। (विशेष रूप से, यह अनुभाग यहां प्रासंगिक है।)

complexity theory - When do you favor the use of state machines over linear workflows -

State machines can reduce the complexity of workflows when there are more than one loop and branches or arguments given to workflow This will be an event driven workflow by the "Give Feedback" for replies In what situation did you choose to use a state machine and what kind of pain did it reduce in terms of time and complexity? State machines are really good for event-driven code. If you see the reaction of some events If your code is being applied in, you can not use loops and branches. You have to use the state machine instead, feed the events to change the state, and give event handler feedback according to the current state of the machine.

c# - Are there any performance drawbacks to using 'do nothing' default event handlers? -

Assume that I have a collection of thousands of objects, all of which apply the following: Public Event EventHeader Status Based = (S, E) = & gt; {}; Private Zero ChangeStatus () {StatusChanged (This, New EventArgs ()); } If any handler is not subscribed to that event for each object, does an option use event handlers which provides any performance loopholes? Or is CLR smart enough to ignore it? Or am I checking a StatusChanged handler before firing events? Yes, CLR is not really very clever, but can be done to ignore it, but In most cases, this difference should be negligible. A method call is not a big deal and there is no possibility of a meaningful effect on the performance of your application.

str replace - How to highlight multiple keywords in a mouthful in PHP? -

Suppose there are 3 keywords, I do not want to place this type of place 3 times: / P> a => & Lt; P & gt; & Lt; / P & gt; Is it possible to do one run? ' You can use PHP (or mb_strtr) function in PHP "screamed"); Echo statter ("Hi all, I say hello", $ trans); // print out "hi all, i shout hi"

objective c - Creating a error-handling UIView Overlay -

I have tab bar controller inside a navigation controller with a 320x411 image (except the status bar, and tab bar) I want to make a scene. The picture is shown for network connection error. Currently I have a tab bar in the view of the personal view of the item: if (appDelegate.hasInternetAtStart == NO) {CGRect myImageRect = CGRectMake (0.0f, 0.0) F, 320.0f, 480.0) f); UIImageView * myImage = [[UIImageView alloc] initWithFrame: myImageRect]; [MyImage Set Image: [UIImage imageNamed: @ "NetworkError.png"]]; MyImage.opaque = Yes; [Self.view pushViewController: myImage animated: no]; [MyImage release]; } However, it is permitting to touch and access the elements below. Is there a correct way to show an error, or should I choose another option method? I would like a single view, which will override all the other scenes in tab bar item, and if possible it can be set in app delegate ... Did you try to launch your UIImageView from within the App Rep? By doing...

range - Even numbers in Python -

Does anybody know that in Python is an in-built function to work for printing values, for example Like the category () Thank you 0, 10, 2) . can write

What's wrong with this NHibernate mapping file? -

I can not load unit error due to incorrect syntax near "file". "} Here is my mapping file. I am assuming that I am not running properly, but I do not know what it is. I do not think it's my Prepay.file is the name of the table. Thanks in advance! class name =" file "table =" preapplication.file "> gt; property name =" date-uploaded "column =" date-uploaded "type =" date-time "no-null = "True" /> gt; Property Name = "filename" column = "` filename` "type =" string "no-null =" true "/> & gt; Properties name =" basic filename "column = "Basic filename" type = "string" no-null = "true" /> Property name = "content type" column = "content type" type = "string" not-null = "true" /> Edit: Using the provided suggestions, I've found that my table has a pr...

flash - Application compiled by Flex Builder 3 does not trace -

I have created a simple application in Flex Builder 3 with some trace () calls. This is an "Action Script Project", it does not include any MXML or AIR. I do not run the app from Eclipse, I just open the HTML file generated with Firefox. I am using Flash Player 10 debug version. After the official instructions, I have set up mm.cnf properly to log the trace output. A flashlog.txt file is generated in the appropriate location. Despite this, the trace output is not shown in the log file. What am i doing wrong (I suspect that this is a compiler option, but I can not find any option in the project options in FlexBuilder) (If I run the app from Eclipse, by pressing F11 , I can see the trace output, but not just in the log file, inside the Eclipse) -debug Try setting the compiler argument to the right. What's the Flash Log? Is there anything in TTT, or is it completely empty?

python - entropy in txt file -

I have a text file that has the following numbers: 1231313123123123 1432423432535345 3532523452345345 1231423432453455 3434535345345345 3452353453253453 All lines are the same length, I want to calculate entropy on each line and get output like this: 2.64234234 2.65464564 2.35355435 etc. / code> Now with this code of this code I have been given an entropy, what am I doing? Thank you. #! / Usr / bin / env python Import Mathematics DHH H (Data): If there is no data: Extra in Extra = 0 x (256): p_x = float (data.count (chr (x))) / Len (data) ) If p_x & gt; 0: entropy + = - p_x * math. Return Entry Failure = Open ('text.txt', 'r') for the line in the log (P_X, 2) failure: Print H ('Failure') failed = open ('text.txt', 'r') for the row in failure: print h (line)

javascript - force browsers to get latest js and css files in asp.net application -

Some browsers cache JS and CSS files, until they force them to refresh, until you force them. What is the easiest way. I have implemented this solution which seems to work. Announce a version variable on your page public string version {get; Set; } Get the version number from the web. Config key version = configuration manager. App settings ["version number"]; To make calls such as JavaScript and stylesheets in your ASPX page & lt; Script src = "scripts / myjavascript.js? V = & lt;% = version%> & gt; type =" text / javascript "& gt; & Lt; / Script & gt; & Lt; Link href = "Styles / Mastile css? V = & lt;% = version%> & gt; Rel = "stylesheet" type = "text / css" /> So if you set 1.0 to 1.0 version in your web.config, then your browser will download the latest files, which is expected to save you and your users from some frustration. Does any other solution work bette...

perl - gsh - Global Shell: Where do you put the shared keys, password? -

I'm trying to use the gsh command on Ubuntu to do some embarrassing parallel stuff I am I have created a / etc / ghosts file containing all the IP addresses for the host, and each host has an account that I have created for "cluster" purposes. However, when I try the command, then $ gsh -l cluster fixes 'echo $ host' I get two errors in return, hostn: host key validation failed. Hostn + 1: Permission denied (publisher, password, keyboard-interactive) I have already done SSH to these computers and have exchanged keys I have a key file Nothing can be found in the gsh man page. In addition, where the password should be kept. This is the version I am using: If you can not reply, you might suggest some options. It looks like gsh uses ssh . Therefore, you have to set up your authorized_keys file as explained.

visual studio - how to match function code block with regex -

What I like to do, all tasks are removed, for example a specific word, if the word 'apple' Is: void eatapple () {// blah // blah} I have all the code from ' zero I tried to delete ' } ' which I have tried: ^ Nil. * Apple (| | \ n) *} But it will take a lot of time that I think there is something wrong here. I'm using Visual Studio Thank you. To clarify the final solution of Jeong, which I think is very clever: this work Does, but it depends on the code which is formatted in a special way. But that's fine, because most IDEs can implement a particular formatting standard. If I can give a related example - The problem that brings me here - I was looking for Java to find the form (expressions) If (DEBUG) probably arbitrary statement or block} Which, of course, is not technically routine, but I have run the eclipse code format on the files so that it can be ensured that they all look like this (our company Desired code style): if...

First Android Test Project does not start -

I'm making my first Android application but it does not start at all. In my src> Android. SamanNeP has created a Java file with the name of the menu. Public class main extended activity {// will be associated with buttons via XML MyoidHandler (View View) {Switch .getId ()) {Case RID.BTN1: ((EditText) SearchWBIID (RTT Contents) Settext ("button 1 click"); break; Case R.id.btn2: ((EditText) findViewById (R.id.txtContent) setText ("button 2 clicked"); break; }}} My res> layout> main.xml: & Lt; Android: layout_width = "wrap-content" Android: layout_height = "wrap_content" Android: text = "button one" Android: ID = "@ + ID / BTN1" & gt; & Lt; / Button & gt; & Lt; Button Android: layout_width = "wrap_content" android: layout_height = "wrap_content" android: text = "button two" Android: id = "@ + ID / BTN 2" & gt; & Lt; / Button & gt;...

c# - Is it possible to package WPF window as COM Object -

I am trying to use a WPF window from a legacy c ++ unmanaged gtk GUI application. Is it possible to package this WPF window (including the xaml file) and use it as a regular com object in the C ++ GUI application? Do you predict any problems or problems with this approach? If possible, any suggestions on any link or tutorial or how to do it would be very helpful thanks. I do not know about any tutorials online for doing this; But this should not be a big problem. I have tried to apply this kind of problem and it worked fine for me, the sequence of steps given below is if I did: 1. "wpf user control" or " Wpf custom control "your solution to the library 2. Add a new WPF window class (add-> window -> ...) to the new project. Then add the ever wpf you like your new window, it works in order to check it after 3. WordPress add new classes and interfaces in the project and put it down as an example define: [Comvejibl (true)] [Gid ( "694 C 18...

iPhone private API usage -

I need to get some general information on personal API usage (like Apple 80211 ...): So far I have feedback , That I need a jailbroken iPhone for the play application using these APIs I'm feeling a little piled now, because it looks like I ran the app using it on my iPhone Can i Is it just a distribution issue with XCode that makes jailbreaking phones necessary, because I can not distribute applications using the Private API on the App Store? That's right. Apple will be able to tell that when you submit your app you are using a private API (they use an automated mechanism for it) and will definitely reject your app. You can however do the app on jailbroken devices.

sql - what's order when select data from database? -

मान लीजिए मेरे पास एक टेबल है: बनाओ टेबल [टैब] ([name] varchar , [Order_by] int) तालिका में 10 पंक्तियाँ हैं, और सभी पंक्तियों के क्रम के लिए समान मूल्य हैं (मान लें कि यह 0 है) एसक्यूएल के बाद: [order_by] [tab] से [tab] आदेश से चुनें * चुनें * पंक्तियों का क्रम क्या है? क्या इस मामले में पंक्ति आदेश का निर्धारण किया जाता है? यह परिभाषित नहीं है डेटाबेस उनको किसी भी क्रम में थूक सकता है, और यह प्रश्नों के बीच क्रम को भी बदल सकता है यदि ऐसा लगता है (यह संभवतः ऐसा नहीं करेगा, लेकिन आपको ऑर्डर के अनुरूप होने पर भरोसा नहीं करना चाहिए)।

asp.net - Problem placing ContentPlaceHolder within <script> tags -

मेरे पास यह एक asp.net मास्टर पेज है: & lt; script language = "जावास्क्रिप्ट" प्रकार = "टेक्स्ट / जावास्क्रिप्ट" & gt; & Lt; asp: ContentPlaceHolder ID = "scriptContentHolder" runat = "सर्वर" & gt; & lt; / asp: ContentPlaceHolder & gt; & Lt; / स्क्रिप्ट & gt; लेकिन जब मैं डिज़ाइन मोड में सामग्री पृष्ठ को देखने की कोशिश करता हूं तो यह बताता है कि संबंधित मास्टर पृष्ठ में एक त्रुटि है क्योंकि "scriptContentHolder" मौजूद नहीं है। & lt; asp: Content ID = "scriptContent" ContentPlaceHolderID = "scriptContentHolder" runat = "server" & gt; G_page = "mnuServveys"; & Lt; / एएसपी: सामग्री & gt; यदि मैं मास्टर पेज को इस पर बदलता हूं: & asp: ContentPlaceHolder ID = "scriptContentHolder" runat = "server" & gt; & lt; / एएसपी: ContentPlaceHolder & gt; और इसके लिए सामग्री पृष्ठ: & lt; asp: Content ID =...

sql server 2005 - SQL Query, SELECT Top 2 by Foreign Key Order By Date -

I need a SQL query that gives the top 2 plans PlanDate per client ID Is on a table where Planetida is the primary ID, ClientID is a foreign id this is what I have yet -> SELECT * FROM [dbo]. [TblPlan] where [PlanID] IN (SELECT TOP (2) PlanID FROM [DBO]. [TblPlan] Order [PlanDate] DESC), of course, only two records are sent. Where I actually have 2 records per ClientID . This can be done using ROW_NUMBER: SELECT PlanId, ClientId, PlanData (Select ROW_NUMBER () (Particular by Client Id Order by Planner DESC) RN, * FOR [DBO]. [TBPLAN]) AS T1 WHERE RN & LT; = 2 You will have to select any other column to get them.

jquery - Understanding XML in Web Development -

I'm new to web programming, right now, I'm working on a web based survey application that I want To use XML. My questions are as follows: Using ASP.NET MVC, How do I return the XML file from the database to the client? Usually, where is a XML file located on the directory of the client and how do I view it using Java or Javascript? Thanks A Google search would take me in this article After this happens, Javascript will not have access to the file. In my PHP experience, when you want to work with Javascript data, you can output it in a variable declaration somewhere in the script space. That you know where to get it and manipulate it, whatever you are trying to accomplish, it can be more useful, but it rarely involves XML. The best question is what are you trying to do? It seems that you need to reconsider your view just because you have a hammer does not mean that everything is a nail.

Programming in C# question -

After creating this code: console. WrightLine ("Hello, and welcome to the Shell bomber \ n"); Console.light line ("You will calculate distance in this game \ n"); Console.light line ("a shell rises and travels on land ^ _ ^ \ n"); Console.light line ("theta =?"); // Initial angle that you ask the user to double theta = Double.Parse (Console.ReadLine ()); Console.witline ("v_o =?"); // Initial velocity which you will ask the user double v_o = Double.Parse (Console.ReadLine ()); Console.light line ("calculation of v_ox"); // vox = v_ocos (theta double v_ox = v_o * monastery.ca); // Math. Cos (theta) method theta = theta * monastery. Pi / 180.0; // degree to radian console. ReadLine ( ); Whether the program is going to automatically convert the values ​​of double v_ox = v_o * Math.CESS (theta) from an input of an angle to the user's input and The initial value? Because when I run it, the program is not calculating t...

asp.net mvc - What are the best practices when using jQuery Ajax calls? -

I am reviewing some code for a collaborator and when there is nothing wrong with jQuery Ajax call, I would like to be more precise about what else should not be seen in the normal Ajax call for the action of ASP.NET MVC controller. For example, in the following code: $ (function () {$ .ajax ({url: "/ admin / action", type: "post" , Data: ({myObjectOrParameters}), success: function (data) {warning (data);}})}}; Is this pattern just fine, or is there other things that should be here also? Is contentType justified? What about datafilter ? Is it unnecessary because we are not using Microsoft Ajax and ".d" are not concerned about returns, should I be worried too? What about the type ? Is it appropriate to use it Is it worthwhile to use it? Is it "$ .ajaxSetup in every case, or can we clearly define our arguments every time? Call me a man in a nutshell ... Let me put this code in this $ .post () method I like to see i do n...

wix - How to remove a COM+ application using WIX3.0? -

I have slipped the Internet, and nothing has been found about doing so. Essentially, we are turning an old VB6 COM + application with a .NET one. We are using WIX to install our new .NET application. As part of this installation, we need to remove the old COM + components. I can see a lot of information about how to install COM + applications using WIX, but how do I remove only one? I have downloaded the source for gold and have seen it in the complex library but nothing can see clearly. Any help much appreciated! Thanks in advance .... I do not think WiX tools will be set in today Nothing is available which will remove the COM + application during install.

SEO issue red characters in source code? &gt; Why? Syntax highlighting? browser source code? -

SEO issue red letter Hi all I'm creating webstas Am Dreamweaver, but when I look at the source code, it's & amp; Quot; Red for Characters , I'm called anything from Google's SEO in red, does anyone know why it looks in red? For example, when I see the code source on the site, I will see the gt; Red & lt; A href = "miss-sell-mortgages.html" class = "darkblue" & gt; Find more & amp; ;;; & Lt; / A & gt; & Lt; / Span & gt; & Lt; / Div & gt; I'm called anything that looks in red from Google's SEO No. Not just Google's SEO works on a text-based basis, it ignores any color or formatting within the page. The color of the text in the source code is simply based on DreamWorker's Syntax highlighting - if you play and see your page in the browser, then it should not be of this color ( Assuming that you are not really setting it in red).

Import huge 550000+ row CSV file into Access -

I have a CSV file with 550000+ rows, I have to import this data in access, but when I try I'm sorry that this file is too big (1.7 GB), can you suggest getting this file in Access? Thanks, Derrill Trying to access the ODBC connector or otherwise importing it into a less limited database (MySQL, SQL Server) and importing it It seems that in some versions of access hard on MDB files There is a limit of 2 GB, so you can also have trouble in it. Good luck.

android - Changing ImageView content causes OutOfMemoryError -

I have a very simple application with an image view and a button loaded by my ImageView The first drawable resource made is specified in the XML layout with the tag "Android: src", although at the runtime I want to change the image it displays . To do this, I start an activity for the result of taking an image from the SD card (intention sent to MediaStore, Picture Media, EXTERNAL_CONTENT_URI). But when the picture is selected, I try to update ImageView with the URI of the selected image, but the message " java.lang.OutOfMemoryError: bitmap size over VM budget " Is received I'am trying to load the pictures taken with my HTC-Hero camera (picture size is approximately 1.1 m) but no success, only pictures of less than 500KB Seems to work together Still I need to load the photos taken with the camera. How can I solve it? What I'm doing wrong I think the code is very simple and should work. Click on Public Zero (see V) {intent selectImageIntent = n...

Javascript pause problem in a loop, ajax, jquery -

I am trying to create a simple animation. Short story short, I've got a list of 20 small divisions and one out-of-the-box. I want to display five small devices within a bigger div at that time. Ideally, I will get a 5 second set of 5 divisions. I am using jquery ajax function to create small divs, here is the code: $ (document) .ready (function () {var amount = 0; $ Ajax ({Type: "GET", url: "SampleServiceIncidentList.xml", Datatype: "XML", Success: Function (xml) {// Creates divs inside GadgetMain div, works fine.}); Zodiac = $ ("# GadgetMain") (children's volume: "+ zodiac"); // This displays in a test area divideFeed ();} // close success}}; // Close $ .jx (function divide () divides the set of small divisions in {// groups} var limit = 5; var pagesNo = Math.ceil ((zodiac / boundary)) var min = 0; var max; var I = 0; while (i & lt; pagesNo) {minimum = i * limit; maximum = minimum + range; // // problem here // popu...

python - Is there any function that returns the out edges of a node? -

I am using Python with Network X package. I have to find the nodes associated with the edges of the given node. I know that there is a function network. DIGROUGH_A_AUGES but it returns the edges to the entire graph. I'm not a network x expert, but have you tried, have specified the source node ? DiGraph.out_edges (nbunch = None, data = false) Return a list of edges. The edges are returned in the form of tuples with alternate data (node, neighboring, data) in sequence. If you want external edges for just one node, pass that node inside the node: graph.out_edges ([my_node] )

c++ - Differences between structs and classes? -

What structures support heritage? I think this is a stupid question, but I do not have much information about it. What does this type of writing code mean: struct A {void f () Cout & lt; & Lt; "Class A" & lt; & Lt; Endl; }}; Struct B: A {Zero F (cout & lt; & Lt; "Class B" & lt; & Lt; Endl; }}; Structures will also come in private sections, will they not give the encapsulation? What is the main difference between structures and orbits? Yes structures support all features that classes do. Members with structure are public by default Members of the structure are public by default

.net - Garbagecollection of eventhandlers -

I have a windows app app with a list of populated people with Windows objects. When a user chooses an account from an account, I keep the EventHindler responsible for updating the selected account transaction in that event, when the user is watching that there is a new user. Private zero listBoxie 1 sealed integrated index (Object Sender, EventArggs E) {var selected = ListBox 1. As the selected account; If (selected! = Null) {Update Transaction (selected); Select.OnNewTransaction + = (S, A) => UpdateTransactions (selected); }} Then my question is as follows; Does this phenomenon be settled automatically as soon as the user selects another account from the list and the selected account goes out of the scope? Or does it continue to work continuously, and then if the user selects the same account, then it is handed over to another handler so that one can make a memory leak? It remains, so every time the user selects the same account, then it Is assigned. EventHandler...

jquery - Does anyone know where I can find a javascript tag cloud generator? -

Ideally, I'm looking for something that I can give back to JSON data retrieved using jquery, and it Data will be based on a cloud (name, link, size, color, etc ...) in that query. Have a look at this:

Why isn't there a do while flow control statement in python? -

Is there any good reason why it is not done while making flow control statements in Python? Why do people have to write while and break clearly? It has been proposed but it has not been implemented because no syntax has come with composition Which is clear from while true an internal if-break .

sql - Round date to 10 minutes interval -

I have a DATE column that I want to round at the next 10 minute intervals Am a query (see example below). I managed to do it by deducting the last digit of minutes by reducing it in seconds. Test_data AS (SELECT TO_DATE (SELECT TO_DATE '2010-01-01 10:00:00', 'YYYY-MM-DD HH24: MI: SS') d with double team selected TO_DATE From ('2010-01-01 10:05:00', 'YYYY-MM-DD HH 24: MI: SS') d Dual union selection from TO_DATE ('2010-01-01 10:09:59', ' Dual union selective TO_DATE ('2010-01-01 10:10:00', 'YYYY-MM-DD HH24: MI: SS') d from DY-YY-MM-DD HH 24: MI: SS ') d Association selected from TO_DATE ('2099-01-01 10:00:33', 'YYYY-MM-DD HH 24: MI: SS') d) Double-select test-data #end D, TRUN ( D, 'MI') - TO_CHA R (D, 'MI'), 10) / (24 * 60) from Test_data And here's the result: 01.01.2010 10 : 00:00 & nbsp; & Nbsp; 01.01.2010 10: 00:00 01.01.2010 10: 05:00 & nbsp; ...

How to display the current date & time in the Freemarker template section of smooks? -

I am able to use smooks in the contents of my incoming XML file in the freemarker template, but I add the current date Want to & amp; My local system time to identify the execution of my program & lt; Ftl: freemarker applied OnElement = "CreditCard" & gt; & Lt; Ftl: templates & gt; & Lt ;! - & lt; Balance Inquiry & gt; & Lt; TransactionId & gt; $ {BalanceInquiryRequest.TransactionId} & lt; / & LT; TransactionId & gt; & Lt; ConfigurationId & gt; $ {BalanceInquiryRequest.ConfigurationId} & lt; / ConfigurationId> & Lt; CardNumberr & gt; $ {. Wars ["Gift Card"] CardNumber.} & Lt; / CardNumberr & gt; & Lt; ExpirationDate & gt; $ {. Wars ["Gift Card"] ExpirationDate.} & Lt; / ExpirationDate & gt; & Lt; SecurityCode & gt; $ {. Wars ["Gift Card"] SecurityCode.} & Lt; / SecurityCode & gt; ***********************************************...

SQL Server 2008 Import Data Wizard doesnt recognize Integer data for a column -

There is an Excel sheet with 10 columns in my head; for a column of "FF5" or other 620 Can be data. The sheet name is IODE. I am trying to import this data from the SSIS import data wizard in the table IODE's database. When selecting the source and destination in the wizard, when I click on the preview data in the selection source tables and the view window, I see the tap as 620. After importing this data, the table will have tap instead of 620. The data type for this column is nvarchar (50), I have many data types like varchar (100), text /. Accepting only alpha numerical data I did not write any code for it. I am trying to import data from Excel sheet to a table. Please help me to resolve it P> thanks ramm Do you mean that you have FF 5 or 620 which is the value for the column meaning you do not have one or the other else or is there any empty field in that column?

sql server 2008 - How to import data with SSIS for sequential guids? -

Is there no way to import data into SSIS, where I hope PK sequential grids are? The method I am able to reach so far is to create a temporary table which remains the column default to load the data in newsequentialid () And then copying it into the correct table, it is not very elegant and adjusting it takes some time to add a bunch of extra layers in your package. "post-text" itemprop = "text"> I am not using GUIDs as a PUS, but you can not set a new look in the form of a new value, then any of your databases It will also be used by putting it.

xslt - Using grouping to pull together text and then test it -

In this great extruded typesetting product, I sometimes see links and email addresses that are different Example: & lt; P & gt; Here is some random text with an email address & lt; Link & gt; Example & lt; / Link> & Lt; Link & gt; @ Example.com & lt; / Link> And here's a more random text with a URL & lt; Link & gt; Http: //www.< / Link> & Lt; Link & gt; Example.com & lt; / Link> Near the end of the sentence & Lt; / P & gt; desired output: & lt; P & gt; Here is some random text with an email address & lt; Email & gt; Example@example.com< / Email & gt; And here's a more random text with url & lt; Ext-link ext-link-type = "uri" xlink: href = "http://www.example.com/" & gt; Http://www.example.com/</ext-link> Near the end of the sentence & Lt; / P & gt; The whispace between the elements does not appear, which is a blessing. I c...

php - Zend MVC - get rid of public folder -

Application - Design-Public - Index.fp -. HTX-Library-Zend Whenever the app loads, it goes to index.php in the public folder and it is transferred from there again .. I want to make sure I have to use it instead of going to the system instead of reaching the system. Is it a Zend conference to keep the public folder? Or can I get rid of it and transfer files to the root directory? I tried to do this, but my application failed miserably because it is unable to find the Z library and it is unable to load the classes. Some of my index.php code is as follows: // Define the path to the application directory ('APPLICATION_PATH') || Define ('APPLICATION_PATH', actual path (dynamic name (__ file__). '/../application')); // Make sure the library contains / include_path set_include_path (implode (PATH_SEPARATOR, array (actual path (APPLICATION_PATH. '/../library'), get_include_path (),))); // Make sure / include include_path set_include_path (impl...

design patterns - ORM to abstract a traditional database plus a WCF service -

Suppose that Microsoft is using an entity framework as an ORM for abstract / work with the database There is a requirement after this, which requires the application to work with the WCF service and a traditional database. There is no ORM tool available for my knowledge, which can serve a WCF in a similar way to the unit framework. Is there anything in the market that can help in this work? The goal is to make WCF and traditional database in such a way that the domain programmers feel like they are working with a database --- edit Take a look at the new WCF data services when 4.4 is available , You will be able to use EF with plain old CLR objects (POCOs).

html - Problems with equal height columns -

यह मेरा सीएसएस है: #contents {स्पष्ट: दोनों; चौड़ाई: 900 पिक्सेल; पृष्ठभूमि: #fff url (../ img / contents_bg.jpg) पुनरावृत्ति- y; } #contents.left {float: left; चौड़ाई: 615 पीएक्स; पैडिंग: 10px 0 0 20px; } #contents .right {float: right; चौड़ाई: 225px; पैडिंग: 10px 20px 0 0; } और HTML: & lt; div id = "सामग्री" & gt; & Lt; div class = "left" & gt; & Lt; p & gt; परीक्षण & lt; / p & gt; & Lt; / div & gt; & Lt; div वर्ग = "सही" & gt; & Lt; p & gt; परीक्षा 2 & lt; / p & gt; & Lt; / div & gt; & Lt; / div & gt; कुछ कारणों से contents_bg.jpg पृष्ठभूमि छवि तब तक प्रदर्शित नहीं होगी जब तक कि मैं # कंटेंट पर ऊँचाई नहीं डालता जो मैं नहीं कर सकता, कोई भी विचार? आपकी div # सामग्री फ्लोटिंग नहीं है और इसलिए इसकी फ़्लोटिंग सामग्री को शामिल करने के लिए नहीं फैलता है उस पर एक अच्छी पढ़ी है उस परिदृश्य के लिए उपलब्ध अन्य उपाय हैं, लेकिन अधिकांश में कुछ अनावश्यक मार्कअप को शाम...

functional programming - From the F# interactive, why would it not accept this? -

I am using F # CTP 1.9.7.8 and running samples based on Thomas Petris's article on page 12 Type MyCell (n: int) = mutual data = n + 1 print "MyCell (create% d)" N member x.get () = Data and set with data (v) = Data & lt; - v member x Print () = printf "data% d" n override x.ToString () = sprintf "(data% d)" data static member FromInt (n) = MyCell (n) # Type in interactive: I got an error message as shown in Figure 1 below. Why a = next to member x.print () , x.ToString () but member X.Data not in Li> Where did x come? And why this happens when type MyCell is being defined, how can you reference 'object' in such a way, like x.print () , X.ToString () and x.Data ? Type myCell (n: int) = - Temporary data = n + 1 type myCell (n: int) = ----- ^^^^^^^ stdin ( 6,6): Error FS0547: One type of definition is required for one or more members or other announcements. If you intend to define an empty square, structure o...

java - Fastest 'update' on jdbc with PreparedStatement and executeBatch -

I have a Java program that, in some circumstances, a large number of records must be updated in a database (for example 100,000 ). The way it does this, it does the snippet by creating a created state and using the addBatch technique here: connection.setAutoCommit (wrong); Created place PS = connection.prepareStatement ("myTable SET colName =? Id = where?"); For (...) {// This loop can be 100000 long colValue = ... id = ... ps.setString (1, colValue); Ps.setString (2, id); Ps.addBatch (); } Ps.executeBatch (); Connection.commit (); Is the best (fastest) way to update 100,000 records in JDBC? Can someone recommend a better way? Try this as a benchmark: Built-in SQL tool to create a bulk extracts in the entire table. All rows all columns. Drop the table (or rename). To use / write a simple flat file, a new file has been applied with the update. Use the bulk load utility that comes with your database to rebuild the entire table from the ext...

.NET Base Validator and reflection -

I'm creating dynamic authenticators and a method that invests the property and the supply to the property I am implementing and Value passing value. This is working for most properties but when I try to open the type method of comparing the operator method or the valuer, I get an error saying that the property can not be found. The code I am using is below, I know that it needs to deal with the error, but I am still in the initial development and want to see where it flies from through the debugger, I can see That supplied as Parmatus Obj is actually a CompareValidator and the properties can not be found. I thought it could only be looking for a base property, (I grieve the base verifier in the caller), but it works on ControlToCompare which is not a member of the BaseValidator. Any help would be appreciated. '' '& lt; Summary & gt; '' 'Invites a property on the item of supply' '' & lt; / Summary & gt; & Lt; / Param ...

java - Spring security 2.0.5 LDAP authentication setup w/Active Directory -

I am trying to work with LDAP authentication with this application (apache roller) It seems that it will just "fill the right areas and go", but I'm still trying to authenticate against the database (default authentication method). I do not understand whether spring- the safety of using any authentication manager, so that it is probably the first thing to change. After spending two days reading the document, it is not close to finding it. & lt; Beans: Bean id = "ldapUser search" category = "org.springframework.security.ldap.search.FilterBasedLdapUser search" & gt; & Lt; Beans: Constructor-Arg Index = "0" value = "CN = Accessories, DC = Domain" /> & Lt; Bean: Constructor-Arg indicator = "1" value = "uid = {0}" /> & lt; Beans: Constructor-Rx Index = "2" Ref = "Initial Dyententax Fatteri" /> & Lt; Beans: Properties name = "searchShoot" value =...

iphone - Starting Three20 sample project in landscape mode renders half the screen unresponsive to touch events -

I'm interested in developing a one-based application for the iPhone OS, which is predominantly landscape oriented. I downloaded all three, loaded them in Xcode, and fixed the Sample Project app on the device using Simulator and using 3.0, 3.1, 3.1.2 SDK. When I changed from initial interface orientation to landscape (right home button) , then start the project in the project's info.plist file Expected that orientation was done, but answered only to touch the event on the left hand of the screen. It appears as if he is still responding to touch events such as he is still in portrait mode only changes in the sample project i info.plist Changing the file. Is that something very easy to me? Starting in landscape orientation is a very basic use case - but I can not find any other person who has filed an issue report or blog post after going around for a few days. Note: This is a problem that originally came up in a more advanced project when I started the Landscap...

math - C# XNA: Looking for a function like MathHelper.Clamp -

I have a function that many would assume, which needs to be normal to [1, 1] of the range. MathHelper.Clamp () takes only those values ​​that are out of range and sets them whatever is bound. Is there anything in XNA or C # that I see? (I see through the documentation, but I can not get it.) This is the movement of the mouse, the value is different between the mouse coordinates between a tick and the next I'm not sure the maximum value for it What is this. This function will take values ​​at a time - so there is no repeated at all prices to scale them all or to see what is the minimum and maximum. I currently have it: // max - not minutes == 0 can personalize the private floatReorange (float value, float min, float max) { Returns (2.0 F * (Price - Minimum) / (Max - Minimum)) -1.0 F; } apply formula 2 * (x-min) / (max-min) (x-min) / (max-min) gives you the value between 0 and 1 Multiplying by 2 gives you between 0 and 2 Value decreases by 1 gives you the v...