Search Results

Search found 2390 results on 96 pages for 'morten green hermansen'.

Page 81/96 | < Previous Page | 77 78 79 80 81 82 83 84 85 86 87 88  | Next Page >

  • StructureMap Configuration Per Thread/Request for the Full Dependency Chain

    - by Phil Sandler
    I've been using Structuremap for a few months now, and it has worked great on some smaller (green field) projects. Most of the configurations I have had to set up involve a single implementation per interface. In the cases where I needed to choose a specific implementation at runtime, I created a factory class that used ObjectFactory.GetNamedInstance<(). In the smaller projects, there were few enough of these cases where I was comfortable with the references to ObjectFactory. My understanding is that you want to limit these references as much as possible, and ideally only reference the ObjectFactory once. I am working to refactor a larger codebase to use IOC/StructureMap, and am finding that I may need many of these factory classes with ObjectFactory references to get what I need. Essentially, I am creating a "root service" with the ObjectFactory, so that everything in the dependency chain is managed by the container. The root service is created by name (i.e. "BuildCar", "BuildTruck"), and the services needed deeper in the dependency chain could also be constructed using the same name--so the "IAttachWheels" service could vary based on whether a car or truck is being built. Since the class that depends on IAttachWheels is the same in both configurations, I don't think I can use ConstructedBy in the registry to choose the implementation. Also, to be clear, the IAttachWheels implementations need to be managed by the container as well, because the dependency chain runs fairly deep. I looked briefly at Profiles as an option, but read (here on StackOverflow) that changing profiles essentially changes implementations for all threads. Is there a feature that is similar to profiles that is thread/request specific? Is the factory class that references ObjectFactory approach the right way to go? Any thoughts would be appreciated.

    Read the article

  • C++ union data-structure, easy acccess of bits within a DWORD

    - by TK
    Im running through a set of DirectX tutorials online and I have the following structure: struct CUSTOMVERTEX { FLOAT x, y, z, rhw; // from the D3DFVF_XYZRHW flag DWORD color; // from the D3DFVF_DIFFUSE flag } My basic understanding of directX leads me to thing tha color is made up of 8-bit alpha, red, green and blue channels. I am attempting to get east access to these channels. Rather than write the following code numerous times (within the CUSTOMVERTEX structure): public: int red() { return (color & 0x00FF0000) >> 16; } I could write a more elegant somution with a combination of a union and a structure e.g. struct CUSTOMVERTEX { FLOAT x, y, z, rhw; // from the D3DFVF_XYZRHW flag #pragma pack(2) union { DWORD color; // from the D3DFVF_DIFFUSE flag struct { char a; char r; char g; char b; }; }; } However this does not appear to function as expected, the values in r, g, & b almost appear the reverse of whats in color e.g. if color is 0x12345678 a = 0x78, r = 0x56. Is this an endieness issue? Also what other problems could I be expecting from this solution? e.g. overflow from the color members? I guess what Im asking is ... is there a better way to do this?!

    Read the article

  • Cocoa button won't display image

    - by A Mann
    Just started exploring Cocoa so pretty much a total noob. I've written a very simple game. Set it up in Interface Builder and got it working fine. It contains a number of buttons and I'm now trying to get the buttons to display images. To start with I'm trying to get an image displayed on just one of the buttons which is called tile0 . The image file (it's nothing but a green square at the moment, but I'm just trying to get that working before I attempt anything more exotic) is sitting in the same directory as the class file which controls the game. I have the following code sitting in my wakeFromNib method: NSString *myImageFileName = [[NSString alloc] init]; myImageFileName = @"greenImage.jpg"; NSImage *myImage = [[NSImage alloc] initByReferencingFile:myImageFileName]; [tile0 setImage: myImage]; Trouble is, the game runs fine, but the image isn't appearing on my button. Is there someone who could kindly tell me if I'm doing something obviously wrong? Many Thanks.

    Read the article

  • ActionScript 3.0 Color Output Error?

    - by TheDarkIn1978
    I'm employing color in a current AS3 project, and have come across what appears to be an error in the Flash Player (version 10). it might also be an error with Apple's DigitalColor Meter (version 3.7.2), which is what i'm using to sample the displayed colors on Mac OS X Snow Leopard (version 10.6.3). //Primary, secondary, and tertiary colors of the RGB color wheel var red:Number = 0xFF0000; var orange:Number = 0xFF7D00; var yellow:Number = 0xFFFF00; var chartreuse:Number = 0x7DFF00; var green:Number = 0x00FF00; var spring:Number = 0x00FF7D; var cyan:Number = 0x00FFFF; var azure:Number = 0x007DFF; //reads 0x0077FF var blue:Number = 0x0000FF; var violet:Number = 0x7D00FF; var magenta:Number = 0xFF00FF; //reads 0xFF00F8 var rose:Number = 0xFF007D; //reads 0xFF0077 all of these colors display normally except for 3: Azure, Magenta and Rose. they are coded with the appropriate number, but when i use the color meter to sample the displayed colors, those 3 return inaccurate results. anyone have any insight about this issue? what is causing the error, the Flash runtime or the color sampler? if it's the Flash player, could this problem be much deeper? *sampling this image will return inaccurate results due to .jpg compression. it's simply for illustration

    Read the article

  • What is a modern C++ approach to structures containing symbolic constants?

    - by Ken
    enum bool { FALSE = 0, TRUE = 1 }; I'm wondering how to translate this in a modern C++ approach and if there is a well suited container for that; i know that the enum are not really that appreciated, but i can't think about a real alternative in the C++ world. What if would like to associate the execution of a particular method with a state? Ok, this is the part where i will be more verbose. I would like to stress the fact that i'm asking about structures symbolic constants and not about TRUE and FALSE, i'm not that "needy". Suppose that i have a structure that can represent several states with their own constants enum semaphore { GREEN = 0, ORANGE = 1, RED = 2 }; this is C code, now my question is about how to do the same in C++ if there is a better way. My question continue when i ask about the possibility to do something like an automatic triggering when a change of state will occur, for example: int main{ ... semaphore = 1; ... } and without any extra statements this has to trigger a method() just because the semaphore is now orange. I hope that is more clear now.

    Read the article

  • Alignment for 2nd row data

    - by user1736299
    <table> <tr><td>test</td></tr> <tr> <td> <div style= height:200px;"> <div style="border:1px solid yellow; display: inline-block; width:100px"> <img src="orderedList4.png"> </div> <div align="center" style="border:1px solid green; display: inline-block; width:650px;height:100px;"> <div>center Test Header1</div> <div>center Test Header2</div> </div> <div align="right" style="border:1px solid red;display: inline-block; width:100px">REL 1.0</div> </div> </td> </tr> </table> In the above code, the image size is 75*75 pixels. I want to have all the three cells to have a height of 100 pixels. I want the image to be centered and left aligned. The middle text to centered. Third text to centered and right aligned. I could not make it working.

    Read the article

  • How to get the real, actual duration of an MP3 file (VBR or CBR) server-side

    - by Cummander Checkov
    I used to calculate the duration of MP3 files server-side using ffmpeg - which seemed to work fine. Today i discovered that some of the calculations were wrong. Somehow, for some reason, ffmpeg will miscalculate the duration and it seems to happen with variable bit rate mp3 files only. When testing this locally, i noticed that ffmpeg printed two extra lines in green. Command used: ffmpeg -i song_9747c077aef8.mp3 ffmpeg says: [mp3 @ 0x102052600] max_analyze_duration 5000000 reached at 5015510 [mp3 @ 0x102052600] Estimating duration from bitrate, this may be inaccurate After a nice, warm google session, i found some posts on this, but no solution was found. I then tried to increase the maximum duration: ffmpeg -analyzeduration 999999999 -i song_9747c077aef8.mp3 After this, ffmpeg returned only the second line: [mp3 @ 0x102052600] Estimating duration from bitrate, this may be inaccurate But in either case, the calculated duration was just plain wrong. Comparing it to VLC i noticed that here the duration is correct. After more research i stumbled over mp3info - which i installed and used. mp3info -p "%S" song_9747c077aef8.mp3 mp3info then returned the CORRECT duration, but only as an integer, which i cannot use as i need a more accurate number here. The reason for this was explained in a comment below, by user blahdiblah - mp3info is simply pulling ID3 info from the file and not actually performing any calculations. I also tried using mplayer to retrieve the duration, but just as ffmpeg, mplayer is returning the wrong value. Now i ran out of options. If somebody knows how to get around this, any hints, tips, guides or corrections are welcome! Thank You!

    Read the article

  • How do I use the Enum value from a class in another part of code?

    - by ChiggenWingz
    Coming from a C# background from a night course at a local college, I've sort of started my way in C++. Having a lot pain getting use to the syntax. I'm also still very green when it comes to coding techniques. From my WinMain function, I want to be able to access a variable which is using an enum I declared in another class. (inside core.h) class Core { public: enum GAME_MODE { INIT, MENUS, GAMEPLAY }; GAME_MODE gameMode; Core(); ~Core(); ...OtherFunctions(); }; (inside main.cpp) Core core; int WINAPI WinMain(...) { ... startup code here... core.gameMode = Core.GAME_MODE.INIT; ...etc... } Basically I want to set that gameMode to the enum value of Init or something like that from my WinMain function. I want to also be able to read it from other areas. I get the error... expected primary-expression before '.' token If I try to use core.gameMode = Core::GAME_MODE.INIT;, then I get the same error. I'm not fussed about best practices, as I'm just trying to get the basic understanding of passing around variables in C++ between files. I'll be making sure variables are protected and neatly tucked away later on once I am use to the flexibility of the syntax. If I remember correctly, C# allowed me to use Enums from other classes, and all I had to do was something like Core.ENUMNAME.ENUMVALUE. I hope what I'm wanting to do is clear :\ As I have no idea what a lot of the correct terminology is.

    Read the article

  • How do I fix the alpha value after calling GDI text functions?

    - by Daniel Stutzbach
    I have a application that uses the Aero glass effect, so each pixel has an alpha value in addition to red, green, and blue values. I have one custom-draw control that has a solid white background (alpha = 255). I would like to draw solid text on the control using the GDI text functions. However, these functions set the alpha value to an arbitrary value, causing the text to translucently show whatever window is beneath my application's. After calling rendering the text, I would like to go through all of the pixels in the control and set their alpha value back to 255. What's the best way to do that? I haven't had any luck with the BitBlt, GetPixel, and SetPixel functions. They appear to be oblivious to the alpha value. Here are other solutions that I have considered and rejected: Draw to a bitmap, then copy the bitmap to the device: With this approach, the text rendering does not make use of the characteristics of the monitor (e.g., ClearText). Use GDI+ for text rendering: This application originally used GDI+ for text rendering (before I started working on Aero support). I switched to GDI because of difficulties I encountered trying to accurately measure strings with GDI+. I'd rather not switch back. Set the Aero region to avoid the control in question: My application's window is actually a child window of a different application running in a different process. I don't have direct control over the Aero settings on the top-level window. The application is written in C# using Windows Forms, though I'm not above using Interop to call Win32 API functions.

    Read the article

  • Jquery Double clicking on link removing div content

    - by ram
    I wrote this code to load the content of a DIV ,when some one clicks on a link. Now,if you click on a link twice,it is removing the content. Here is the code $('a').click(function() { var id = $(this).attr('class'); if(id == 'first') { $('.active').removeClass('active'); $('a.first').addClass('active'); } else if(id == 'second') { $('.active').removeClass('active'); $('a.second').addClass('active'); } $('#first').toggle(id == 'first'); $('#second').toggle(id == 'second'); });? <a class="first">one</a> <a class="second">two</a> <div> <li id="first"> <h2>pen</h2> <div> <div>parker</div> </div> </li> <li id="second" style="display: none;"> <h2>car</h2> <div>Bugatti</div> </div> </li> </div>? .active { color: green; }

    Read the article

  • Table cellspacing with CSS

    - by antpaw
    hey, is it possible to add spacing between the cells? <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>test</title> <style> #wrap { display: table-row; /* there is no also cellspacing in CSS afaik :( */ } #wrap div { display: table-cell; /* margin: 40px; doesn't work for table-cell :( */ /* border: 30px solid transparent; works but it's as good as adding padding */ /* border: 30px solid white; works but the page background is invisible */ /* decoration: */ background-color: green; padding: 20px; } </style> </head> <body> <!-- don't touch the markup --> <div id="wrap"> <div>text1</div> <div>text2</div> </div> </body> </html>

    Read the article

  • Fixing Chrome resizing behaviour

    - by bobo
    <div style="background-color:red;width: 300px;"> <div style="float:left;border:1px solid yellow;">AAA AAA AAA</div> <div style="float:left;border:1px solid green;">BBB BBB BBB</div> <div style="clear:both;"></div> </div> Pasting the above HTML here: http://htmledit.squarefree.com/ And then zoom out in Chrome, you will see that <div> B will eventually be forced down to the next row. If you do the same thing in Firefox and IE, both <div> A and B will stay on the same row. Adding a height attribute on the parent <div> may help, but if the height of the content is not known beforehand, this will not be feasible. I would like to know how this problem can be fixed in Chrome. Many thanks to you all. EDIT: uploaded a screenshot here: http://img52.imageshack.us/i/screenshot1xd.jpg/

    Read the article

  • Javascript doesn't change document?

    - by egbokul
    Take a look at this example code, which doesn't work: <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script type="text/javascript"> <!-- function moveMe() { document.getElementById('moveme').top = 200; document.getElementById('moveme').style.backgroundcolor = 'green'; document.getElementById('writeme').innerHtml = 'abc'; alert('called!'); } // --> </script> <style type="text/css"> .moveable { position: absolute; top: 30px; left: 200px; width: 100px; height: 100px; background-color: yellow; } #writeme { background-color: red; color: white; } </style> </head> <body> <div id="moveme" class="moveable" onClick="moveMe()"> <p id="writeme">Hello!</p> </div> </body> </html> When I click on the text the alert is displayed, but nothing is changed in the document. The paragraph text is not overwritten, the div is not moved... tested it in FF and IE, also checked the DOM via Firebug: strange thing is that the new values are written to the nodes, but they are displayed in bold, and the old values are still there. WTF? I guess I'm missing something fundamental here.

    Read the article

  • Creating a OS X Cocoa App Web View in Xcode 5.0.1

    - by user1822824
    I created a HTML5 web app that I’m trying to wrap in a web view and submit to the Mac App Store. I’ve done the following: 1) Opened Xcode 5.0.1 and selected “Create a new Xcode project” 2) Under “OS X” I selected “Application” then I selected “Cocoa Application” then “Next” 3) I entered a “Product Name” and a “Company Identifier” then selected “Next” (I left all the other settings untouched) then “Create” 4) Under “General” “Deployment Info” “Deployment Target” I selected 10.6 — because I want the app to be compatible with all versions of OS X that support the Mac App Store 5) I clicked “MainMenu.xib” and selected “Window - My App” 6) From the “Object library” I drug the “Web View” object into my window and made it fill the window size 7) I saved my project and click the Play button in the upper left corner of Xcode The app tries to open but freezes. I don’t get an error in Xcode but it does open “main.m” and highlight “return NSApplicationMain(argc, argv);” in green and says “Thread 1: signal SIGABRT” I was hoping that someone could clarify why this isn’t working? And provide me with the last step to link the web view object? I searched Google and found tutorials for iOS and a few for OS X but for different versions of Xcode.

    Read the article

  • Child elements changing opacity with parent Image

    - by mitch
    I have a <div> element which has a background image. On top of that I have some text that is hidden but when the user hovers over the <div> element that text will show and the <div> opacity will lower. My problem is when you hover over the div all elements inside that change opacity as well. I have looked through stackoverflow to see if anyone has the same problem but all i found were answers that had RGBA using background colors (not images). Here is my css: .pic{ background-image:url(http://www.granitesportsinstitute.com/wp-content/uploads/2014/06/Green-Sea-Turtle-150x150.jpg); -webkit-transition: all .3s ease-in-out; -moz-transition: all .3s ease-in-out; -o-transition: all .3s ease-in-out; transition: all .3s ease-in-out; } .textstuff{ visibility:hidden; } .pic:hover .textstuff{ visibility:visible; color:black; } .pic:hover{ filter: alpha(opacity=30); -moz-opacity: 0.3; -khtml-opacity: 0.3; opacity: 0.3; } HTML HERE: <div class="pic" style="height:150px;width:150px;"> <div class="textstuff">this is text</div> </div>

    Read the article

  • Removing most inline styles and properties with PHP

    - by bakkelun
    This question is related to a similar case, namely http://stackoverflow.com/questions/2488950/removing-inline-styles-using-php The solution there does not remove i.e: <font face="Tahoma" size="4"> But let's say I have a mixed bag of inline styles and properties, like this: <ul style="padding: 5px; margin: 5px;"> <li style="padding: 2px;"><div style="border:2px solid green;">Some text</div></li> <li style="padding: 2px;"><font face="arial,helvetica,sans-serif" size="2">Some text</font></li> <li style="padding: 2px;"><font face="arial,helvetica,sans-serif" size="2">Some text</font></li> </ul> What regExp is needed to achieve this result? <ul> <li><div>Some text</div></li> <li><font>Some text</font></li> <li><font>Some text</font></li> </ul> Thanks for reading the question, any help is appreciated.

    Read the article

  • Crystal Reports Cross Tab Conditional Formatting

    - by ltran
    I would like to achieve a simplified result similar to the "Color Scale" function in Excel i.e. gradient colouring based on the lowest value (red) to highest value (green), except in my cross tab using Crystal Reports 2008. My cross tab looks a little like this: HOURS L1 L2 L3 L4 Total 1 hours | 5 | 0 | 1 | 16 | 22 | 2 hours | 0 | 1 | 0 | 10 | 11 | 3 hours | 8 | 2 | 6 | 12 | 28 | TOTAL |13 | 3 | 7 | 38 | 61 | The principle of my function is find the maximum value in the cross table then use 20%, 40%, 60%, 80% values to colour the background. Function is as follows (in the format background section): if currentfieldvalue < ((Maximum (MakeArray (CurrentColumnIndex, CurrentRowIndex, 1)))*0.2) then color(255,0,0) else if (currentfieldvalue >= ((Maximum (MakeArray (CurrentColumnIndex, CurrentRowIndex, 1)))*0.2) and currentfieldvalue < ((Maximum (MakeArray (CurrentColumnIndex, CurrentRowIndex, 1)))*0.4)) then color(255,192,0) else if (currentfieldvalue >= ((Maximum (MakeArray (CurrentColumnIndex, CurrentRowIndex, 1)))*0.4) and currentfieldvalue < ((Maximum (MakeArray (CurrentColumnIndex, CurrentRowIndex, 1)))*0.6)) then color(255,255,0) else if (currentfieldvalue >= ((Maximum (MakeArray (CurrentColumnIndex, CurrentRowIndex, 1)))*0.6) and currentfieldvalue < ((Maximum (MakeArray (CurrentColumnIndex, CurrentRowIndex, 1)))*0.8)) then color(146,208,80) else if (currentfieldvalue >= ((Maximum (MakeArray (CurrentColumnIndex, CurrentRowIndex, 1)))*0.8)) then color(0,176,80) It's not elegant, nor does it work properly, any assistance/suggestions would be much appreciated. I wasn't expecting it to be so complicated as originally I was working with the below assuming it would work, except it tells me that "CurrentFieldValue" is not a field. if CurrentFieldValue < ((Maximum (CurrentFieldValue))*0.2) then color(255,0,0) else if ... etc.

    Read the article

  • Coloring Default Buttons - color filter only on unfocused state

    - by rlo
    I want to buttons of different colors, but I want to do so while using the default button background resource in order to preserve the onfocus and onclick states. This is because I want to use the default highlight color of the OS for my app, which is NOT always orange (HTC Sense makes it green). I found that adding a color filter to the button's background drawable works great (in this case, blue): myButton.getBackground().setColorFilter(Color.parseColor(this.getString (R.color.button_blue)), Mode.MULTIPLY); BUT, when the button is focused or clicked, it turns a nasty orange_blue because it mixes the color filter with the orange of the background drawable. I want to ONLY set this color filter for the unfocused/unclicked nine- patch drawable within the default button's statelistdrawable. I'm not sure how else to do this. I see a similar solution here: http://stackoverflow.com/questions/2065430/fixed-android-detecting-fo... but I have some concerns with that solution, mainly what if the OS changes the graphic of the default button? Since the normal unfocused/ unpressed graphic is now hardcoded into the app, it would break the flow. Maybe can someone comment on whether it would be good or bad practice to hardcode the default graphic into the app? What are the chances of the OS completely changing the graphic? Any help please? Thanks very much!!

    Read the article

  • How can i get the flash player working

    - by Selase
    Am only looking to play some flash content on my page. found this code on the web and just copied it into my codes and changed the file name. However the intellisense underlines part of the code in green and says "File 'swfobject.js' was not found" this is the code i copied below. <asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent"> <script type='text/javascript' src='swfobject.js'></script> <script type='text/javascript'> var s1 = new SWFObject('cmsflash.swf','player', '400', '300', '9'); s1.addParam('allowfullscreen', 'false'); s1.addParam('allowscriptaccess', 'always'); s1.addParam('flashvars', 'file=video.flv'); s1.write('preview'); </script> <style type="text/css"> and it underlines only (swfobject.js) saying file not found. the file i wish to display is named cmsflash and is in the root directory probably ~/cmsflash.swf where and what could be going wrong? the block where the flash should display is declared as follows <table class="style2" style="height: 309px; width: 76%"> <tr> <td> <p id='preview'>The player will show in this paragraph</p> </td> </tr> </table> <span class="style6"> <br /> Please Help

    Read the article

  • Top and Left property not working! Why?

    - by MonuMan5
    I recently took up learning some css... and I am getting stuck on some very basic hurdles. I can't get the top and left properties to work on this basic page that I was creating. Below is all the code for that page... all the properties work except the top and left. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <style type="text/css"> #firstdiv {border: 2px solid red; position: absolute; top:15px; left:25px:} #seconddiv {border: 2px solid green; position: absolute; top:65px; left:5px:} </style> </head> <body> <div id="firstdiv">This is my first div </div> <div id="seconddiv">This is my second div</div> </body> </html> Any help on this issue would be greatly appreciated! = D

    Read the article

  • Simulate Golf Game Strategy

    - by Mitchel Sellers
    I am working on what at best could be considered a "primitive" golf game, where after a certain bit of randomness is introduced I need to play out a hole of golf. The hole is static and I am not concerned about the UI aspect as I just have to draw a line on a graphic of the hole after the ball has been hit showing where it traveled. I'm looking for input on thoughts of how to manage the "logic" side of the puzzle, below are some of my thoughts on the matter, input, suggestions, or references are greatly appreciated. Map out the hole into an array with a specific amount of precision, noting the type of surface: out of bounds, fairway, rough, green, sand, water, and most important the hole. Map out "regions" and if the ball is contained inside one of these regions setup parameters for "maximum" angle of departure. (For example the first part of the hole the shot must be between certain angles Using the current placement of the ball, and the region contained in #2, define a routine to randomly select the shooting angle, and power then move the ball, adjust the trajectory and move again. I know this isn't the "most elegant" solution, but in reality, we are looking for a quick and dirty solution, as I just have to do this a few times, set it and forget it afterward. From a languages perspective I'll be using ASP.NET and C# to get this done.

    Read the article

  • What is a good solution to log the deletion of a row in MySQL?

    - by hobodave
    Background I am currently logging deletion of rows from my tickets table at the application level. When a user deletes a ticket the following SQL is executed: INSERT INTO alert_log (user_id, priority, priorityName, timestamp, message) VALUES (9, 4, 'WARN', NOW(), "TICKET: David A. deleted ticket #6 from Foo"); Please do not offer schema suggestions for the alert_log table. Fields: user_id - User id of the logged in user performing the deletion priority - Always 4 priorityName - Always 'WARN' timestamp - Always NOW() message - Format: "[NAMESPACE]: [FullName] deleted ticket #[TicketId] from [CompanyName]" NAMESPACE - Always TICKET FullName - Full name of user identified by user_id above TicketId - Primary key ID of the ticket being deleted CompanyName - Ticket has a Company via tickets.company_id Situation/Questions Obviously this solution does not work if a ticket is deleted manually from the mysql command line client. However, now I need to. The issues I'm having are as follows: Should I use a PROCEDURE, FUNCTION, or TRIGGER? -- Analysis: TRIGGER - I don't think this will work because I can't pass parameters to it, and it would trigger when my application deleted the row too. PROCEDURE or FUNCTION - Not sure. Should I return the number of deleted rows? If so, that would require a FUNCTION right? How should I account for the absence of a logged in user? -- Possibilities: Using either a PROC or FUNC, require the invoker to pass in a valid user_id Require the user to pass in a string with the name Use the CURRENT_USER - meh Hard code the FullName to just be "Database Administrator" Could the name be an optional parameter? I'm rather green when it comes to sprocs. Assuming I went with the PROC/FUNC approach, is it possible to outright restrict regular DELETE calls to this table, yet still allow users to call this PROC/FUNC to do the deletion for them? Ideally the solution is usable by my application as well, so that my code is DRY.

    Read the article

  • DynamicContent.html: Write a JavaScript in an HTML document that can change the content of an HTML e

    - by A sw A
    ShowHide.html: Write a JavaScript in an HTML document that displays an image and allows the user to toggle the image between appearing and not appearing in the document. Place your image in a (division) tag that has a style attribute. “style.visibility” can take two values: “visible” and “hidden”. The document has a button called “Toggle Image”, which calls the toggle function upon the event “onclick”. DynamicColors.html: Write a JavaScript in an HTML document that changes the background and foreground colors of the body of a document according to the user input. The document has two input texts: background color and foreground color. The colors change when the event “onchange” occurs as you type in the text input and the event handler is called. Your event handler takes two parameters: “where”, and “newColor”. To change the document color and background color you need to change the elements document.body.style.color and document.body.style.backgroundColor. Available colors are: black, silver, gray, white, maroon, red, purple, fuchsia, green, lime, olive, yellow, navy, blue, teal, and aqua. DynamicContent.html: Write a JavaScript in an HTML document that can change the content of an HTML element (a help box). The content of an element is accessed through its “value” property. The content of a help box can change depending on the placement of the mouse cursor. When the cursor is placed over a particular input field (“onmouseover” event), the help box can display advice on how the field is to be filled. When the cursor is moved away from the input field (“onmouseout” event), the help box content changes to simply indicate that assistance is available. Your messages are stored in an array of strings.

    Read the article

  • Need help, stuck on "How to send text message using java script to avoid post back"

    - by user287745
    this is what i have implemented, for further code, how to send this text of the text box to the server to store in variable or database without post back. it can be done by using ajax and update plane but i wold like to implement it using javascript script. <div id="CommentID" style=" width:30%; height:30%"> <asp:Button ID="Button1" runat="server" Text="Comment" OnClientClick="visibleDiv('id1'); return false;" /> <div id="id1" runat="server" style="visibility: hidden; background-color:Green; width:100%; height:100%"> <asp:TextBox ID="TextBox1" runat="server" AutoCompleteType="Disabled" Rows="3" TextMode="MultiLine" Width="98%"></asp:TextBox> <asp:Button ID="Button2" runat="server" Text="Post" onclick="Button2_Click" /> <asp:Button ID="Button3" runat="server" Text="Cancel" OnClientClick="visibleDiv('id1'); return false;" /> </div> </div>

    Read the article

  • How to check of which user-defined type a current JSON element is during $.each()?

    - by Bob
    I have the following structure for a JSON file: ({condos:[{Address:'123 Fake St.', Lat:'56.645654', Lng:'23.534546'},{... another condo ...},{...}],houses:[{Address:'1 Main Ave.', Lat:'34.765766', Lng:'27.8786674'},{... another house ...}, {...}]}) So, I have a list of condos and houses in one big JSON array. I want to plot them all on my map, but I want to give condos and houses different marker icons( blue marker for condos, green marker for houses ). Problem I have is - figuring out how to distinguish between types of markers when I $.each() through them. How would I use if to check whether I'm working with a condo or a house at the moment? var markers = null; $('#map').gmap(mapOptions).bind('init', function(){ $.post('getMarkers.php', function(json){ markers = json; $.each(markers, function(type, dataMembers) { $.each(dataMembers, function(i, j){ //if house use house.png to create marker $('#map').gmap('addMarker', { 'position': new google.maps.LatLng(parseFloat(Lat), parseFloat(Lng)), 'bounds':true, 'icon':'house.png' } ); //if condo use condo.png $('#map').gmap('addMarker', { 'position': new google.maps.LatLng(parseFloat(Lat), parseFloat(Lng)), 'bounds':true, 'icon':'condo.png' } ); }); }); }); });

    Read the article

< Previous Page | 77 78 79 80 81 82 83 84 85 86 87 88  | Next Page >