Search Results

Search found 48 results on 2 pages for 'tripping'.

Page 1/2 | 1 2  | Next Page >

  • html code in anchor tag text in c# razor

    - by Tripping
    I am trying to show the rupee sign: ₹ code: &#8377 ; in my anchor tag. I have tried a few things but nothing works ... please help @{ string _text = String.Format("{0} {1} {2} {3} {4}", @Html.DisplayFor(model => model.NoOfBedrooms), "bedroom flat", @Html.DisplayFor(model => model.TransactionTypeDescription), @Html.Raw(₹), @Html.DisplayFor(model => model.Price)); string _rental = ""; if (Model.TransactionType == 2) { _rental = " per month"; } else { _rental = ""; }; string _linkText = _text + _rental; } @Html.ActionLink(_linkText, "Details", "Property", new { id = Model.PropertyId }, null)

    Read the article

  • Jquery only works the first time

    - by Tripping
    I am trying to teach myself general web development skills. I am trying to create a image upload with preview functionality using HTML5 FileAPI. Till now, I have created a file input which shows the preview of image when selected. Html mark up is below: <div> <!-- Photos --> <fieldset> <legend>PropertyPhotos</legend> <div class="upload-box" id="upload-box-1"> <div class="preview-box"> <img alt="Field for image cutting" id="preview_1" src="@Url.Content("~/Content/empty.png")" /> </div> <div> @Html.FileFor(model => model.File1) @Html.ValidationMessageFor(model => model.File1) </div> </div> <div class="upload-box" id="upload-box-2"> <div class="preview-box"> <img alt="Field for image cutting" id="preview_2" src="@Url.Content("~/Content/empty.png")" /> </div> <div> @Html.FileFor(model => model.File2) @Html.ValidationMessageFor(model => model.File2) </div> </div> <div class="upload-box" id="upload-box-3"> <div class="preview-box"> <img alt="Field for image cutting" id="preview_3" src="@Url.Content("~/Content/empty.png")" /> </div> <div> @Html.FileFor(model => model.File3) @Html.ValidationMessageFor(model => model.File3) </div> </div> </fieldset> </div> The Jquery to show preview and then display the next "upload-box" is as follows: <script type="text/javascript"> $(document).ready(function () { // show first box $("#upload-box-1").fadeIn(); //Get current & next step index var stepNum = $('div.upload-box').attr('id').replace(/[^\d]/g, ''); var nextNum = parseInt(stepNum)+1; //Get the preview image tag var preview = $('#preview_'+stepNum); //Load preview on file tag change and display second upload-box $('#File'+stepNum).change(function (evt) { var f = evt.target.files[0]; var reader = new FileReader(); if (!f.type.match('image.*')) { alert("The selected file does not appear to be an image."); return; } reader.onload = function (e) { preview.attr('src', e.target.result); }; reader.readAsDataURL(f); //Show next upload-box $("#upload-box-" + nextNum).fadeIn(); }); }); </script> However, this code only first for the first time ... i.e. on selecting a file - It shows a preview and then shows the next "upload-box". However, when I browse using the second file it doesn't show any preview. From what I have ready, I need to close the Jquery function so that it can be initialised again but I am not sure how to do that. Any help will be grateful.

    Read the article

  • What folder is this code signifying?

    - by clifgray
    I am trying to install OpenNi on ubuntu and have found some decent looking instructions but I am not sure what I need to do for this one specific case. Here are the instructions and here is the line that is tripping me up: cd OpenNI/Platform/Linux/CreateRedist/ chmod +x RedistMaker ./RedistMaker cd ../Redist/OpenNI-Bin-Dev-Linux-x64-v1.5.2.23/ sudo ./install.sh I don't know what folder the cd ../Redist/OpenNI-Bin-Dev-Linux-x64-v1.5.2.23/ line is talking about and can't find it anywhere. Does anyone know what this is?

    Read the article

  • Best practices in managing character states

    - by TheBroodian
    While in development of a character, I feel like I'm digging myself deeper into a hole every time I add more functionality to him, creating more bugs and it seems like my code is tripping over itself all over the place. What are the best practices when managing character states for a character that has a large selection of abilities and actions that they can perform, without their abilities interrupting each other and creating a mess overall?

    Read the article

  • Using Appendbuffers in unity for terrain generation

    - by Wardy
    Like many others I figured I would try and make the most of the monster processing power of the GPU but I'm having trouble getting the basics in place. CPU code: using UnityEngine; using System.Collections; public class Test : MonoBehaviour { public ComputeShader Generator; public MeshTopology Topology; void OnEnable() { var computedMeshPoints = ComputeMesh(); CreateMeshFrom(computedMeshPoints); } private Vector3[] ComputeMesh() { var size = (32*32) * 4; // 4 points added for each x,z pos var buffer = new ComputeBuffer(size, 12, ComputeBufferType.Append); Generator.SetBuffer(0, "vertexBuffer", buffer); Generator.Dispatch(0, 1, 1, 1); var results = new Vector3[size]; buffer.GetData(results); buffer.Dispose(); return results; } private void CreateMeshFrom(Vector3[] generatedPoints) { var filter = GetComponent<MeshFilter>(); var renderer = GetComponent<MeshRenderer>(); if (generatedPoints.Length > 0) { var mesh = new Mesh { vertices = generatedPoints }; var colors = new Color[generatedPoints.Length]; var indices = new int[generatedPoints.Length]; //TODO: build this different based on topology of the mesh being generated for (int i = 0; i < indices.Length; i++) { indices[i] = i; colors[i] = Color.blue; } mesh.SetIndices(indices, Topology, 0); mesh.colors = colors; mesh.RecalculateNormals(); mesh.Optimize(); mesh.RecalculateBounds(); filter.sharedMesh = mesh; } else { filter.sharedMesh = null; } } } GPU code: #pragma kernel Generate AppendStructuredBuffer<float3> vertexBuffer : register(u0); void genVertsAt(uint2 xzPos) { //TODO: put some height generation code here. // could even run marching cubes / dual contouring code. float3 corner1 = float3( xzPos[0], 0, xzPos[1] ); float3 corner2 = float3( xzPos[0] + 1, 0, xzPos[1] ); float3 corner3 = float3( xzPos[0], 0, xzPos[1] + 1); float3 corner4 = float3( xzPos[0] + 1, 0, xzPos[1] + 1 ); vertexBuffer.Append(corner1); vertexBuffer.Append(corner2); vertexBuffer.Append(corner3); vertexBuffer.Append(corner4); } [numthreads(32, 1, 32)] void Generate (uint3 threadId : SV_GroupThreadID, uint3 groupId : SV_GroupID) { uint2 currentXZ = unint2( groupId.x * 32 + threadId.x, groupId.z * 32 + threadId.z); genVertsAt(currentXZ); } Can anyone explain why when I call "buffer.GetData(results);" on the CPU after the compute dispatch call my buffer is full of Vector3(0,0,0), I'm not expecting any y values yet but I would expect a bunch of thread indexes in the x,z values for the Vector3 array. I'm not getting any errors in any of this code which suggests it's correct syntax-wise but maybe the issue is a logical bug. Also: Yes, I know I'm generating 4,000 Vector3's and then basically round tripping them. However, the purpose of this code is purely to learn how round tripping works between CPU and GPU in Unity.

    Read the article

  • Connection manager detects network but won't connect

    - by Carson Chittom
    I've just installed 12.04 on my home desktop. Because of where it's located, in order not to have my children tripping over cat5 cable, I've got a cheap 802.11n USB device plugged in, which uses a Realtek 8192CU chip. The house wifi is protected with WPA2. Ubuntu's Network Manager detects the network, but connecting to it just times out and asks for the password again. I'm sure I'm using the correct password. No other computers on the house network are having any difficulty. This device previously worked correctly with both Windows 7 and OpenBSD in the same machine. The linux-firmware package is installed (from the disc) at version 1.79, and /lib/firmware/rtlwifi/rtl8192cufw.bin is present. dmesg|grep rtl only shows the "loading firmware" message. I've tried Google, but I apparently can't find the right set of words to plug in, because I haven't found anything related (lots of "doesn't work at all," but nothing matching my circumstances). Any help would be greatly appreciated.

    Read the article

  • How can I prevent Google mistakenly offering to translate a page?

    - by DisgruntledGoat
    Several of my site's pages are appearing in search results with [Translate this page] next to it. When I click that it takes me to Google Translate and translates my page "from Catalan to English". The pages are in English but have a couple of foreign words (actually Japanese romanisations, not Catalan) that appear to be tripping Google up. A few weeks ago I set the html tag to <html lang="en"> which from research appears to be the best method to specify the language of a document. Google has cached the pages with this attribute but it is still offering to translate. More research led me to a "notranslate" attribute which prevents translation entirely: <html lang="en" class="notranslate">. The problem now is users cannot translate from English to their desired language! Are there any other solutions that force Google to parse my site as English only?

    Read the article

  • Case convention- Why the variation between languages?

    - by Jason
    Coming from a Java background, I'm very used to camelCase. When writing C, using the underscore wasn't a big adjustment, since it was only used sparingly when writing simple Unix apps. In the meantime, I stuck with camelCase as my style, as did most of the class. However, now that I'm teaching myself C# in preparation for my upcoming Usability Design class in the fall, the PascalCase convention of the language is really tripping me up and I'm having to rely on intellisense a great deal in order to make sure the correct API method is being used. To be honest, switching to the PascalCase layout hasn't quite sunk in the muscle memory just yet, and that is frustrating from my point of view. Since C# and Java are considered to be brother languages, as both are descended from C++, why the variation in the language conventions? Was it a personal decision by the creators based on their comfort level, or was it just to play mindgames with new introductees to the language?

    Read the article

  • Using \b in C# regular expressions doesn't work?

    - by Nikhil
    I am wondering why the following regex does not match. string query = "\"1 2\" 3"; string pattern = string.Format(@"\b{0}\b", Regex.Escape("\"1 2\"")); string repl = Regex.Replace(query, pattern, "", RegexOptions.CultureInvariant); Note that if I remove the word boundary characters (\b) from pattern, it matches fine. Is there something about '\b' that might be tripping this up?

    Read the article

  • functional test for rails controller private method

    - by mohit
    I have a private method in my controller. which is used for some database update. this method i am calling from another controller method. and it works fine. But when i am trying to write a test case for that method then It is tripping on accessing (session variable and params) in my functional all other methods are working fine the problem is only with private method? In my setup method in functional test, I am setting session also.?

    Read the article

  • functional test for rails controller privaet method

    - by mohit
    I have a private method in my controller. which is used for some database update. this method i am calling from another controller method. and it works fine. But when i am trying to write a test case for that method then It is tripping on accessing (session variable and params) in my functional all other methods are working fine the problem is only with private method? In my setup method in functional test, I am setting session also.?

    Read the article

  • how do I write a command-line interactive php script?

    - by user151841
    I want to write a php script that I can use from the command line. I want it to prompt and accept input for a few items, and then spit out some results. I want to do this in php, because all my classes and libraries are in php, and I just want to make a simple command line interface to a few things. The prompting and accepting repeated command line inputs is the part that's tripping me up. How do I do this?

    Read the article

  • How can I manipulate a VB6 Collection in .NET?

    - by jhominal
    Hello all, I am currently in the process of designing an interface for .NET software that would be consumed by COM objects - specifically, VB6. While I have found a number of pages by Microsoft detailing how to make an COM-interoperable interface, I am currently tripping over the use of Collections in design time: I would like to be able to use a standard VB6 "Collection object" in the .NET program - for example, specify an argument as being a VB6 collection - and thus minimize the time necessary for clients to consume the interface. Thank you in advance.

    Read the article

  • FIX: Visual Studio Post Build Event Returns &ndash;1 when it should not.

    - by ChrisD
    I had written a Console Application that I run as part of my post build for other projects..  The Console application logs a series of messages to the console as it executes.  I use the Environment.ExitCode value to specify an error or success condition.  When the application executes without issue, the ExitCode is 0, when there is a problem its –1. As part of my logging, I log the value of the exit code right before the application terminates.  When I run this executable from the command line, it behaves as it should; error scenarios return –1 and success scenarios return 0.   When I run the same command line as part of the post-build event, Visual Studio reports the exit code as –1, even when the application reports the exit code as 0.   A snippet of the build output follows: Verbose: Exiting with ExitCode=0 C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(3397,13): error MSB3073: The command ""MGC.exe" "-TargetPath=C:\TFS\Solutions\Research\Source\Framework\Services\Identity\STS\_STSBuilder\bin\Debug\_STSBuilder.dll" C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(3397,13): error MSB3073:  C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(3397,13): error MSB3073: " exited with code -1. The Application returns a 0 exit code.  But visual studio is reporting an error.  Why? The answer is in the way I format my log messages.  Apparently Visual Studio watches the messages that get streamed to the the output console.  If those messages match a pattern used by visual studio to communicate errors, Visual Studio assumes an error has occurred in the executable and returns a –1.  This post details the formats used by Visual Studio to determine error conditions. In my case, the presence of the colon was tripping up Visual studio.  I Replaced all occurrences of colon with an equal sign and Visual Studio once again respected the exit code of the application. Verbose= Exiting with ExitCode=0 ========== Build: 3 succeeded or up-to-date, 0 failed, 0 skipped ==========

    Read the article

  • What are benefit/drawbacks of classifying defects during a peer code review

    - by DXM
    About 3 months ago, our engineering group rolled out Review Board to be used for all peer code reviews. Today, I had a discussion with one of the people involved in that process and found out that we are already looking for a replacement (possibly something commercial) because of several missing features. One of the features that is apparently asked by many people is the ability to classify/categorize each code review comment (i.e. is it a style issue, coding convention, resource leak, logic error, crash... whatever). For those teams that regularly practice code review, is this categorization a common practice? Do you do it? have you done it in the past? Is it good/bad? On one hand, it gives the team some more metrics and possibly will indicate more specific areas where developers may potentially need to be trained in (at least that seems to be the argument). Are there other benefits? And on the other hand, and this is my concern, is that it will slow down code review process that much more. As a team lead, I've done a fairly large share of reviews, and I've always liked the ability, to highlight a chunk of code, hammer off a comment and move on as fast as possible. Although I haven't tried it personally, I have a feeling that expanding that combo box every time and scrolling/searching for the right category would feel like something is tripping you. Also if we start keeping metrics on this stuff, my other concern is that valuable code review meeting time will be spent on arguing whether something is a logic error or if it should be classified as a crash.

    Read the article

  • Design pattern for an automated mechanical test bench

    - by JJS
    Background I have a test fixture with a number of communication/data acquisition devices on it that is used as an end of line test for a product. Because of all the various sensors used in the bench and the need to run the test procedure in near real-time, I'm having a hard time structuring the program to be more friendly to modify later on. For example, a National Instruments USB data acquisition device is used to control an analog output (load) and monitor an analog input (current), a digital scale with a serial data interface measures position, an air pressure gauge with a different serial data interface, and the product is interfaced through a proprietary DLL that handles its own serial communication. The hard part The "real-time" aspect of the program is my biggest tripping point. For example, I need to time how long the product needs to go from position 0 to position 10,000 to the tenth of a second. While it's traveling, I need to ramp up an output of the NI DAQ when it reaches position 6,000 and ramp it down when it reaches position 8,000. This sort of control looks easy from browsing NI's LabVIEW docs but I'm stuck with C# for now. All external communication is done by polling which makes for lots of annoying loops. I've slapped together a loose Producer Consumer model where the Producer thread loops through reading the sensors and sets the outputs. The Consumer thread executes functions containing timed loops that poll the Producer for current data and execute movement commands as required. The UI thread polls both threads for updating some gauges indicating current test progress. Unsure where to start Is there a more appropriate pattern for this type of application? Are there any good resources for writing control loops in software (non-LabVIEW) that interface with external sensors and whatnot?

    Read the article

  • Writing Java in Java

    - by Skeith
    I have been using Java for several months at work now and am becoming mildly competent in it. The problem I think I am having is that I program C++ in Java . By that I mean I have always used C++ and am treating Java as a simple syntax change instead of appreciate if for its own language. For instance a static variable in C++ is the same as a normal variable in Java as Java is all classes so they maintain there values between function calls. Little things like this are tripping me up constantly as I am self taught. What I want is to invest the time to become a good java programmer not just a C++ programmer that can write in Java. The problem is I do not know how to do this. I have tried reading the Java doc pages but I find them very clinical and hard to understand. So what I am looking for is recommendations on how I can learn to think in Java. Books that teach Java concepts not Java syntax, online tutorials that I can work through that give it a context, established Java traditions/best practices and any other thing that you could recommend.

    Read the article

  • how to fully unit test functions and their internal validation

    - by Patrick
    I am just now getting into formal unit testing and have come across an issue in testing separate internal parts of functions. I have created a base class of data manipulation (i.e.- moving files, chmodding file, etc) and in moveFile() I have multiple levels of validation to pinpoint when a moveFile() fails (i.e.- source file not readable, destination not writeable). I can't seem to figure out how to force a couple particular validations to fail while not tripping the previous validations. Example: I want the copying of a file to fail, but by the time I've gotten to the actual copying, I've checked for everything that can go wrong before copying. Code Snippit: (Bad code on the fifth line...) // if the change permissions is set, change the file permissions if($chmod !== null) { $mod_result = chmod($destination_directory.DIRECTORY_SEPARATOR.$new_filename, $chmod); if($mod_result === false || $source_directory.DIRECTORY_SEPARATOR.$source_filename == '/home/k...../file_chmod_failed.qif') { DataMan::logRawMessage('File permissions update failed on moveFile [ERR0009] - ['.$destination_directory.DIRECTORY_SEPARATOR.$new_filename.' - '.$chmod.']', sfLogger::ALERT); return array('success' => false, 'type' => 'Internal Server Error [ERR0009]'); } } So how do I simulate the copy failing. My stop-gap measure was to perform a validation on the filename being copied and if it's absolute path matched my testing file, force the failure. I know this is very bad to put testing code into the actual code that will be used to run on the production server but I'm not sure how else to do it. Note: I am on PHP 5.2, symfony, using lime_test(). EDIT I am testing the chmodding and ensuring that the array('success' = false, 'type' = ..) is returned

    Read the article

  • ASP.NET MVC Custom Role Provider/RolePrincipal

    - by Keith K
    My asp.net MVC application is not caching roles instead it round tripping to the database every request. Also when I attempted to view the cookie I noticed it had not been written to the browser. Web.config: <roleManager defaultProvider="CustomRole" enabled="true" cacheRolesInCookie="true" cookiePath="/" cookieName="CustomRole" maxCachedResults="25" cookieSlidingExpiration="true" cookieProtection="All" cookieRequireSSL="false" createPersistentCookie="false"> <providers> <clear/> <add name="CustomRole" type="Membership.CustomRole, Membership" connectionString="MemberDB" applicationName="/"/> </providers> </roleManager>

    Read the article

  • Why does Xcode launch the iPhone simulator when the iPad simulator is selected?

    - by Dr Dork
    When I open an existing iPad project in Xcode and "Build and Run" it, it launches the iPhone simulator when I have the iPad Simulator set as the active executable? Inside the iPhone simulator is a shrunken version of the iPad. What is going on? How do I get it to run the iPad simulator? Note: When the iPhone Simulator is running, I double checked the Hardware-Device setting and it's set to iPad. This is what I want, of course, but I don't want it to run the iPhone simulator. I seem to recall it used to run an iPad simulator. Is there such a thing or am I tripping and there is only an iPhone simulator that can run iPad apps? Thanks in advance for your help!

    Read the article

  • Why does Chrome incorrectly determine page is in a different language and offer to translate?

    - by Sam
    The new Google Chrome auto-translation feature is tripping up on one page within one of our applications. Whenever we navigate to this particular page, Chrome tells us the page is in Danish and offers to translate. The page is in English, just like every other page in our app. This particular page is an internal testing page that has a few dozen form fields with English labels. I have no idea why Chrome thinks this page is Danish. Does anyone have insights into how this language detection feature works and how I can determine what is causing Chrome to think the page is in Danish?

    Read the article

  • Jquery: Calling functions from different documents

    - by Tom
    Hi, I've got some Jquery functions that I keep in a "custom.js" file. On some pages, I need to pass PHP variables to the Jquery so some Jquery bits need to remain in the HTML documents. However, as I'm now trying to refactor things to the minimum, I'm tripping over the following: If I put this in my custom.js: $(document).ready(function() { function sayHello() { alert("hello"); } } And this in a HTML document: <script type="text/javascript"> $(document).ready(function() { sayHello(); }); </script> ... the function doesn't get called. However, if both are placed in the HTML document, the function works fine. Is there some kind of public property I need to declare for the function or how do I get Jquery functions in my HTML to talk to external .js files? They're correctly included and work fine otherwise. Thanks.

    Read the article

  • Good Silverlight 4.0 chart / graph component?

    - by Duncan Bayne
    I've been using the Silverlight Toolkit but I'm finding the quality lacking; in particular this memory leak / phantom point bug renders the Chart component completely unusable. Can anyone recommend a good chart / graph component for Silverlight 4.0? I'm looking for one that provides: multiple simultaneous series, both scatter and line multi-select of points configurable tool-tips automatic axis scaling real-time update of data That last point sounds trivial but is tripping up the Silverlight Toolkit Chart; if you rapidly change the axis range, it sometimes leaves phantom points behind in addition to the points it should be displaying.

    Read the article

1 2  | Next Page >