Search Results

Search found 19688 results on 788 pages for 'con current'.

Page 163/788 | < Previous Page | 159 160 161 162 163 164 165 166 167 168 169 170  | Next Page >

  • Is possible to set generic type by another class?

    - by Soul_Master
    I use ASP.NET MVC for serving web application and I want to create something like the following code. <% using(HTML.Form(Model)) { %> <% HTML.CreateTextBox('txt1', x => x.Property1); <% } From the above code, Form extension method will receive object that represent type of current Model object in current View page. Next, CreateTextBox method will receive type from Form method and I can bind textbox to some property of this model. Update 1 The following code is code of CreateTextBox method that will create instance of TextBox class. public static CreateTextBox(string value, Expression<Func<object>> bindedProperty) { // T should be receive from HTML.Form method or class return new TextBox<T>(value); } Is it possible to creating some code that doing something like the above code? Thanks,

    Read the article

  • Big task - problems with page refresh and ajax

    - by user1830414
    I have a navigation which load dynamically content via ajax. But if I refresh the page or visit another url and go back the current content is away and I see the old content under the first menu tab. Now I have to solve this problem. The index.php include the elements header_registrated.inc.php, navigation.inc.php and main_container.inc.php index.php: <?php include("inc/incfiles/header_registrated.inc.php"); ?> <?php if (!isset($_SESSION["userLogin"])) { echo "<meta http-equiv=\"refresh\" content=\"0; url=http://localhost/project\">"; } else { echo ""; } ?> <?php include("inc/incfiles/navigation.inc.php"); ?> <?php include("inc/incfiles/main_container.inc.php"); ?> <?php include("inc/incfiles/footer.inc.php"); ?> header_registrated.inc.php: <?php include ("inc/scripts/mysql_connect.inc.php"); session_start(); $user = $_SESSION["userLogin"]; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>title</title> <link href="css/style.css" rel="stylesheet" type="text/css" /> <script language="JavaScript" src="js/framework/jquery.js"></script> <script language="JavaScript" src="js/dropdown/window.js"></script> <script language="JavaScript" src="js/navigation/navigation.js"></script> </head> <body> </body> navigation.inc.php: <div class="navigation"> <ul> <li id="1"> <div id="menuImage1" class="menuImage"></div> <div class="menuText"><p>Punkt 1</p></div> <div class="navigationDart"></div> </li> <li id="2"> <div id="menuImage2" class="menuImage"></div> <div class="menuText"><p>Punkt 2</p></div> </li> <li id="3"> <div id="menuImage3" class="menuImage"></div> <div class="menuText"><p>Punkt 3</p></div> </li> <li id="4"> <div id="menuImage4" class="menuImage"></div> <div class="menuText"><p>Punkt 4</p></div> </li> <li id="5"> <div id="menuImage5" class="menuImage"></div> <div class="menuText"><p>Punkt 5</p></div> </li> <li id="6"> <div id="menuImage6" class="menuImage"></div> <div class="menuText"><p>Punkt 6</p></div> </li> </ul> </div> main_container.inc.php: <div class="mainContainer"> <div class="containerHeader"> <div class="contentHeader"> </div> </div> <div class="contentContainer"> <div class="content"> </div> <div class="advertisement"> </div> </div> </div> Now the divs content, cnotentHeader and advertisement (in file main_content.inc.php) is filled via ajax. Also the navigation has some jquery effects which also have to be the same after page refresh. navigation.js: $(document).ready(function() { $.get('inc/incfiles/content_container/header/1.php', function(data) { $('.contentHeader').html(data); }); $.get('inc/incfiles/content_container/content/1.php', function(data) { $('.content').html(data); }); $.get('inc/incfiles/content_container/advertisement/1.php', function(data) { $('.advertisement').html(data); }); var current = '1.php'; $(".navigation li").click(function() { var quelle = $(this).attr('id') + ".php"; // the current content doesn't load again if(current === quelle) { return; } current = quelle; // content $(".content").fadeOut(function() { $(this).load("inc/incfiles/content_container/content/" + quelle).fadeIn('normal'); }) // advertisement $(".advertisement").fadeOut(function() { $(this).load("inc/incfiles/content_container/advertisement/" + quelle).fadeIn('normal'); }) // header $(".contentHeader").fadeOut(function() { $(this).load("inc/incfiles/content_container/header/" + quelle).fadeIn('normal'); }) }); $(".navigation li").click(function() { $(".menuImage").removeClass("menuImageActive1"); $(".menuImage").removeClass("menuImageActive2"); $(".menuImage").removeClass("menuImageActive3"); $(".menuImage").removeClass("menuImageActive4"); $(".menuImage").removeClass("menuImageActive5"); $(".menuImage").removeClass("menuImageActive6"); }); $("#1").mousedown(function() { $("#menuImage1").addClass("menuImageClick1"); // new class on mouse button press }); $("#1").mouseup(function() { $("#menuImage1").removeClass("menuImageClick1"); //remove class after mouse button release }); $("#1").click(function() { $("#menuImage1").addClass("menuImageActive1"); }); $("#2").mousedown(function() { $("#menuImage2").addClass("menuImageClick2"); // new class on mouse button press }); $("#2").mouseup(function() { $("#menuImage2").removeClass("menuImageClick2"); //remove class after mouse button release }); $("#2").click(function() { $("#menuImage2").addClass("menuImageActive2"); }); $("#3").mousedown(function() { $("#menuImage3").addClass("menuImageClick3"); // new class on mouse button press }); $("#3").mouseup(function() { $("#menuImage3").removeClass("menuImageClick3"); //remove class after mouse button release }); $("#3").click(function() { $("#menuImage3").addClass("menuImageActive3"); }); $("#4").mousedown(function() { $("#menuImage4").addClass("menuImageClick4"); // new class on mouse button press }); $("#4").mouseup(function() { $("#menuImage4").removeClass("menuImageClick4"); //remove class after mouse button release }); $("#4").click(function() { $("#menuImage4").addClass("menuImageActive4"); }); $("#5").mousedown(function() { $("#menuImage5").addClass("menuImageClick5"); // new class on mouse button press }); $("#5").mouseup(function() { $("#menuImage5").removeClass("menuImageClick5"); //remove class after mouse button release }); $("#5").click(function() { $("#menuImage5").addClass("menuImageActive5"); }); $("#6").mousedown(function() { $("#menuImage6").addClass("menuImageClick6"); // new class on mouse button press }); $("#6").mouseup(function() { $("#menuImage6").removeClass("menuImageClick6"); //remove class after mouse button release }); $("#6").click(function() { $("#menuImage6").addClass("menuImageActive6"); }); $("#1").click(function(){ $(".navigationDart").animate({ top: "16px" }, 500 ); }); $("#2").click(function(){ $(".navigationDart").animate({ top: "88px" }, 500 ); }); $("#3").click(function(){ $(".navigationDart").animate({ top: "160px" }, 500 ); }); $("#4").click(function(){ $(".navigationDart").animate({ top: "232px" }, 500 ); }); $("#5").click(function(){ $(".navigationDart").animate({ top: "304px" }, 500 ); }); $("#6").click(function(){ $(".navigationDart").animate({ top: "376px" }, 500 ); }); }); My idea was it to work with if(isset($_SESSION['ajaxresponse'])) but I don't no how to do this. Please help me. I have the feeling that I've searched the whole web to find an answer.

    Read the article

  • .htaccess cross browser

    - by lordsharp
    Hi, Im trying to load a custom error document for a 404 error using a .htaccess file on a linux server, the page gets the current page URL then redirects to another site (which is retrieved from a db) based on an id it retrieved from the URL. The current error documents are stored here: /error_docs/ - i dont have permission to upload anything other than the HTML files that are already in there /HTTPDocs/301redir.php is the site root where the .htaccess file is. i have used the following to load the 301redir.php page as the error doc, which works in FF but no other browsers. ErrorDocument 404 /310redir.php using .htaccess is my only real option for changing this, is there a way to get around this issue and make it work across all browsers?

    Read the article

  • Selecting previous and next row using sp

    - by davor
    I want to select previous and next row from table based on current id. I send current id to stored procedure and use this query: -- previous select top 1 id from table where id < @currentId order by id desc -- next select top 1 id from table where id < @currentId order by id asc The problem is when I send currentId which is the last id in the table and want to select next row. Then is nothing selected. Same problem for previous row, when I send currentId which is first id in table Is it possible to solve this in sql without additional queries?

    Read the article

  • linux cpu usage

    - by davidbobo
    I am working on unix. I want to knwo the current cpu usage of a process. I understood that ps give the average of cpu used till the process is up - it is not the current usage. Is there a way to print only the cpu from the top command without 10 more parameters and headers? I know how to do it with awk - this is not the way i want to do it. top -p 20705 -bc -n 1 | tail -n 2 | awk '{ print $9}' | head -n 1 If there is another simple way to do it, not reading /proc/stat... If there is a simple way doing it from c++, it is also ok.

    Read the article

  • WP7 - attempt to select and use application static resource in codebehind not working (no resources found).

    - by pearcewg
    With Windows Phone 7, I'm attempting to dynamically add controls to and object in codebehind, and apply a StaticResource to the new control. Xaml file sample: <phone:PhoneApplicationPage.Resources> <ControlTemplate x:Key="PushpinControlTemplateBlue" TargetType="my2:Pushpin"> ... </ControlTemplate> </phone:PhoneApplicationPage.Resources> Codebehind sample: >Pushpin myPush = new Pushpin(); >myPush.Location = new GeoCoordinate(52.569593, -0.9261151403188705); >myPush.Content = ""; >myPush.Template = (ControlTemplate)Application.Current.Resources["PushpinControlTemplateBlue"]; >mapMain.Children.Add(myPush); When I debug, and look at "Application.Current.Resources", there are no items in the collection, so the item is added to the controls list, but doesn't show up because it has no content. Is there something simple I'm doing wrong? How do I correctly access the resource?

    Read the article

  • How can I get the domain name for a user logged into a Mac via Active Directory

    - by Lawrence Johnston
    In my Cocoa app how can I get the current user's domain when they're logged in via Active Directory? I need to determine two things: 1. If the current user is logged on to an Active Directory domain (only need to handle Active Directory). 2. If 1, the domain of the user. I've found references to Directory Services and the Open Directory Programming Guide but the latter is 10.6 only (I must support 10.5+) and I could not find any examples for the former that gave me an idea of what I needed to do.

    Read the article

  • Virtual String Tree - Display subnode when parent node is hidden

    - by daemon_x
    Is there a way to show subnode if the parent node is hidden in the Virtual String Tree ? I have some tasks in the tree structure and I wish to display only tasks which belongs to the current user as the list, but from all levels. What I've done is the function to display a list, which hides tree buttons, tree lines, sets the fixed indent and enable toShowHiddenNodes option. Then in this function I iterate through the whole tree (all levels) and hide nodes which doesn't belong to the current user IsVisible[Node] := False and show those which belongs him IsVisible[Node] := True, but the subnodes which should be displayed are invisible when their parent is hidden. VT.TreeOptions.PaintOptions - toShowButtons - toShowTreeLines + toFixedIndent + toShowHiddenNodes

    Read the article

  • asp.net impersonation identity: Where does it come from?

    - by Rising Star
    Here's a simple question I've been stuck on for a while. When I set < identity impersonate=true > in my web.config so that asp.net impersonates the logged on user automatically (or the anonymous account if not using Windows Authentication), where does the identity that asp.net impersonates come from? This document: http://msdn.microsoft.com/en-us/library/ff649264.aspx shows three places you can retrieve information about the logged on user: Httpcontext.Current.user System.Threading.Thread.Current System.Security.Principal.WindowsIdentity.GetCurrent It seems that none of these locations consistently match the identity that gets impersonated when I set < identity impersonate=true > in web.config. I would like to know where the impersonated identity comes from.

    Read the article

  • why isn't the input text file being read into the ArrayList<String>, diary?

    - by hmg
    Here's my code: public void readFile() throws IOException { System.out.println("Input file name: "); Scanner in = new Scanner(System.in); String readName = in.nextLine(); Scanner reader = new Scanner(new File(readName)); System.out.println("Reading file..."); while (reader.hasNextLine()) { System.out.println(reader.nextLine()); } System.out.println("File read."); Scanner inAgain = new Scanner(System.in); System.out.println("Would you like to read this into the current Diary?"); System.out.println("Warning: This will overwrite your current Diary!"); String readFileConfirm = inAgain.nextLine(); ArrayList<String> readData = new ArrayList<String>(); if (readFileConfirm.equalsIgnoreCase("yes")) { for (int i = 0; i < readData.size(); i++) { readData.add(reader.nextLine()); } System.out.println("Data added to extra array..."); System.out.println("Here are the contents."); for (int i = 0; i < readData.size(); i++) { System.out.println(readData.get(i)); } System.out.println("Contents read."); System.out.println("Now overwriting current Diary with read file..."); diary.clear(); for (int i = 0; i < diary.size(); i++) { diary.add(readData.get(i)); } System.out.println("New Diary created!"); System.out.println("Use 'recall' to see your new Diary!"); } else { System.out.println("Very well, returning to first command entry."); } } Thanks in advance! -h

    Read the article

  • SQL SELECT INSERTed data from Table

    - by Noam Smadja
    its in ASP Classic. MS-Access DB. i do: INSERT INTO Orders (userId) VALUES (123)" what i want to retrieve is orderNumber from that row. its an auto-increment number. so i did: SELECT orderNumber FROM Orders WHERE userId=123 but since it is on the same page, the SELECT returns: Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record. i've seen somewhere RETURNING orderNumber as variable but it was for oracle and i dont know how to implement it into my asp :( set addOrder = Server.CreateObject("ADODB.Command") addOrder.ActiveConnection = MM_KerenDB_STRING addOrder.CommandText = "INSERT INTO Orders (userId) VALUES ("&userId&")" addOrder.CommandType = 1 addOrder.CommandTimeout = 0 addOrder.Prepared = true addOrder.Execute() Dim getOrderNumber Set getOrderNumber = Server.CreateObject("ADODB.Recordset") getOrderNumber.ActiveConnection = MM_KerenDB_STRING getOrderNumber.Source = "SELECT orderNumber FROM Orders WHERE userId=" & userId getOrderNumber.CursorType = 0 getOrderNumber.CursorLocation = 2 getOrderNumber.LockType = 1 getOrderNumber.Open() session("orderNumber") = getOrderNumber.Fields.Item("orderNumber").value

    Read the article

  • Iterating Through a jQuery Object Array

    - by DeltaFox
    I know this has been asked and answered a couple times already, but I'm still confused about how to reference the current object when iterating over a jQuery array. For example, the following code gives me the error "TypeError: genH3Array[i].next is not a function". What is the right way to reference the current array object? var genH3Array = $('#Generation_II').parent(); genH3Array.push($('#Generation_III').parent());; genH3Array.push($('#Generation_IV').parent()) $.each(genH3Array, function(i, value) { if(genH3Array[i].next().attr("align") == "center") { genH3Array[i].next().next().next().insertBefore(heading.next()) } genH3Array[i].next().next().insertBefore(heading.next()) genH3Array[i].next().insertBefore(heading.next()) })

    Read the article

  • Where should we manage session objects in an ASP.NET application?

    - by Kumar
    I am developing a 3-tired ASP.NET C# web application and was wondering where should the sessions be managed. I have a SessionManager class as follows: public sealed class SessionManager { private const string USER = "User"; private SessionManager() { } public static SessionManager Instance { get { return _instance; } } public User User { get { return HttpContext.Current.Session[USER] as User; } set { HttpContext.Current.Session[USER] = value; } } } Now should the session information be managed in the Business Logic Layer or should it be managed in the Presentation Layer?

    Read the article

  • Converting a Matrix to a grid of colors

    - by Zach
    I'm currently making a console application in C# (will be going to a Windows Form application in the future. Sooner if needed). My current objective is to have a matrix (current size 52x42) be exported as an image (bitmap, jpeg, png, I'm flexible) where each value in the matrix (0, 1, 2, 3) is portrayed as a white, black, blue, or red square of size 20px x 20px with a grid 1px wide seperating each 'cell'. Can this even be done in a console application, and if so how? If not, what would I need to get it working in a Windows Form application?

    Read the article

  • Manipulating Directory Paths in Python

    - by G Ullman
    Basically I've got this current url and this other key that I want to merge into a new url, but there are three different cases. Suppose the current url is localhost:32401/A/B/foo if key is bar then I want to return localhost:32401/A/B/bar if key starts with a slash and is /A/bar then I want to return localhost:32401/A/bar finally if key is its own independent url then I just want to return that key = htt p://foo.com/bar - http://foo.com/bar I assume there is a way to do at least the first two cases without manipulating the strings manually, but nothing jumped out at me immediately in the os.path module.

    Read the article

  • Sharepoint as a replacement for N-Tiers Applications and OLTP Databases

    - by user264892
    All, At my current company, we are looking to replace all ASP.NET Applications and OLTP databases with Sharepoint 2007. Our applications and databases deal with 10,000+ rows, and we have 5,000 + clients actively using the system. Our Implementation of sharepoint would replace all n-tier applications. Does anyone have an experience in implementing this? My current viewpoint is that Sharepoint is not built for or adequate enough to handle this type of application. Can it really replace application with hundreds of pages, and hundreds of tables? Support Data warehousing operations? Support high performance OLTP operations? Provide a robust development environment? Any and all input is greatly appreciated. Thanks S.O. Community.

    Read the article

  • Advice needed: stay with Java team or move to C++ team?

    - by user68759
    Some background - I have been programming in Java as a professional for the last few years. This is mainly using Java SE. I have also touched bits and pieces of other various Java technologies and have some basic knowledge about them. I consider my self as an intermediate Java programmer. I like Java very much. I think it is only going to get bigger. Recently, my manager asked my opinion on whether I would like to be transferred to another team within the company that is developing a product in C++. This is mainly because my current Java team simply didn't make enough money due to poor sales and the economic downturn. Now, I have never had any experience with C++ nor have I ever coded a single line of code in C++. I have always wanted to learn it and now is my chance. But I really want to make sure I get benefit out of it in the future, in the sense that I will have the skills that will still be on-demand in the future. So, what do you experts think? Is C++ still the language to learn these days to secure yourself for the future? What will I learn more in C++ but not in Java? And are they worthy to learn considering the current and possible future demands in IT industry? (Apart from the obvious more control over memory management and something along that line.) What is a good excuse to refuse the offer in order to stay with the Java team? I don't want to blatantly refuse it because you can never predict the future and I could possibly come back to my manager in the future and ask him to transfer me to the C++ team. How do I say it nicely that I am taking the offer but I would like to still be involved with Java one way or another, such as when there is a new Java project I would like to be considered. I have to admit that I am kind of 50-50 at the moment. I want to learn C++ for the sake of improving my skills and also helping my company to reduce the fund required for the Java team. But it is also hard for me to leave Java because I know Java is going to get bigger, so I am afraid of getting behind when I start concentrating on C++. I could, of course, decide to just join the C++ team, and then spend my free time reading about Java to keep in touch with it, but I thought I would ask anyway in case some people can point out the strong points of either over the other given the current and possibly future circumstances.

    Read the article

  • Unset array element inside a foreach loop

    - by Richard Knop
    So here is my code: <?php $arr = array(array(2 => 5), array(3 => 4), array(7 => 10)); foreach ($arr as $v) { $k = key($v); if ($k > 5) { // unset this element from $arr array } } print_r($arr); // now I would like to get the array without array(7 => 10) member As you can see, I start with an array of sinwgle key = value arrays, I loop thorugh this array and get a key of the current element (which is a single item array). I need to unset elements of the array with key higher than 5, how could I do that? I might also need to remove elements with value less than 50 or any other condition. Basically I need to be able to get a key of the current array item which is itself an array with a single item.

    Read the article

  • Can anyone help me with a complex sum, 3 table join mysql query?

    - by Scarface
    Hey guys I have a query and it works fine, but I want to add another table to the mix. The invite table I want to add has two fields: username and user_invite. Much like this site, I am using a point system to encourage diligent users. The current query which is displayed below adds the up votes and down votes based on the user in question: $creator. I want to count the number of entries for that same user from the invite table, and add 50 for each row it finds to the current output/sum of my query. Is this possible with one query, or do I need two? "SELECT *, SUM(IF(points_id = \"1\", 1,0))-SUM(IF(points_id = \"2\", 1,0)) AS 'total' FROM points LEFT JOIN post ON post.post_id=points.points_id WHERE post.creator='$creator'"

    Read the article

  • PHP - MySQL how to delete an image when a user submits a new image problem.

    - by pc-wiki
    I'm trying to delete the current image that is already set on the server when a user submits a new image to the server, but I don't know how to do add this to my current code can some one please help me? Here is my PHP & MySQL code. if(isset($_FILES["thumb"]["name"])) { if (file_exists("/images/" . $_FILES["thumb"]["name"])) { $thumb != $_FILES["thumb"]["name"]; } else if($_FILES["thumb"]["name"] == TRUE) { move_uploaded_file($_FILES["thumb"]["tmp_name"], "/images/" . mysqli_real_escape_string($mysqli, htmlentities(strip_tags(basename($_FILES["thumb"]["name"]))))); $thumb = mysqli_real_escape_string($mysqli, htmlentities(strip_tags(basename($_FILES["thumb"]["name"])))); } if($thumb == TRUE) { //create thumb code here... } }

    Read the article

  • Jquery to slide on load

    - by Pexsol
    I have a simple slider that works on click. How can I automate it so it runs automatically yet keeping the click function as it is? $(document).ready(function() { var currentPosition = 0; var slideHeight = 360; var slides = $('.main-item'); var numberOfSlides = slides.length; var tracker = 0; $('.slider-height').css('height', slideHeight * numberOfSlides); $('.slide-option li a').click(function() { tracker = $('.slide-option li a').index($(this)); $('.slide-option li a').removeClass('current-item'); $(this).addClass('current-item'); //alert(tracker); $('.slider-height').animate({ 'top': slideHeight * (-tracker) }); return false; //alert(tracker); }); });

    Read the article

  • Is it possible to obtain ASP.NET membership user name after FormsAuth.SignIn ?

    - by Simon_Weaver
    I have some code that is accessing Membership.GetUser() to get the current logged in user. This works fine until I try to access it immediately after logging in with FormsAuth.SignIn(userName, false); However I noticed that neither Membership.GetUser() nor User.Identity.Name is updated with the newly logged in user until a new request (I assume its reading directly from the Request cookies). This however kind of screws up my logic that accesses Membership.GetUser() becasue it introduces a special case. Question: is there a way to read the current logged in user with ASP.NET membership immediately after logging in. Or will I have to introduce my own abstraction layer to allow me to 'set' a user as being logged in ? (This is in an AJAX request - so i'd rather not do a redirect).

    Read the article

  • Use jQuery to match variable text?

    - by VUELA
    Hello! I have a sidebar navigation that lists blog entry titles down the side of the page. I am trying to write some jquery that will check the text in the title of the current full blog entry page and match it with the corresponding title in the sidebar navigation so that I can apply a class to style for an active state link ... but I'm not quite getting it! Here is the link to an example page: http://ncw-commercial.com/property-listings/eastpoint-plaza-lot.html, and below is my current code. I have also tried using :contains but could not figure out how to get that to work with a variable rather than direct text. $('.single-journal-entry-wrapper .journal-entry .title').each(function(){ var activeTitle = $(this).text(); $(".feedburnerFeedBlock .headline a").filter(function(index) { return $(this).text() == "activeTitle"; }).parent().addClass("activeTitle"); });

    Read the article

< Previous Page | 159 160 161 162 163 164 165 166 167 168 169 170  | Next Page >