Search Results

Search found 18677 results on 748 pages for 'current'.

Page 127/748 | < Previous Page | 123 124 125 126 127 128 129 130 131 132 133 134  | Next Page >

  • How to read log4j output to a web page?

    - by Ran
    I have a web page, used for admin purposes, which runs a task (image fetching from a remote site). In order to be able to debug the task using the browser only, no ssh etc, I'd like to be able to read all log output from the executing thread and spit it out to the web page. The task boils down to: Changing log level for current thread at the beginning of the call and restore when the call is done. Reading all log output by current thread and storing it in a string. So in pseudocode my execute() method would look like this: (I'm using struts2) public String execute() throws Exception { turnLoggingLevelToDebugOnlyForThisThread() ... do stuff... restoreLoggingLevelForThisThread() String logs = readAllLogsByThisThread(); } Can this be done with log4j? I'm using tomcat, struts2, log4j and slf4j.

    Read the article

  • Return to AvAudioPlayer

    - by robmontesinos
    I can use some help with an AVAudioPlayer issue. My App is basically an interactive audio book. The RootViewController is a UITableView using a drill-down approach sitting on top of a Navigation Controller. The first level are the Chapters and the second level are the Topics. Each Topic goes to an audio file which plays in a SoundPlayerViewController utilizing AVAudioPlayer - standard stuff. If the user leaves the SoundPlayer to browse Chapters and Topics with the Back button(s), the audio continues playing - this is good. If the user selects a new Topic, the current audio file stops and the new audio file begins playing - this is good. What I have not been able to figure out is how to allow the user to go back to the current SoundPlayer so they can rewind, pause or whatever. This is not so good. Any help with an approach or pointing to some help would be greatly appreciated. Thanks so much in advance.

    Read the article

  • cakePHP: Filter selected list by variable

    - by gonzela2006
    I'm on cakePHP 2. I have a problem and I need your help. Here is some code of my controller(StudentsController.php) specifically "edit" function: $students = $this -> Student -> find('list', array( 'order' => 'Student.name ASC' )); $this -> set('students', $students); How can I filter the list by the current student's class?? so the list will contain all students that has the same student's class I need some code like this $students = $this -> Student -> find('list', array( 'conditions' => array('Student.class_id' => CURRENT-STUDENT'S-CLASS), 'order' => 'Student.name ASC' )); $this -> set('students', $students); Please Advise Thanks, gonzela2006

    Read the article

  • Outlook 2007 VSTO Add-in deployed by click-once doesn't detect published updates

    - by Matt
    I have created an outlook 2007 add-in project in vs2008, targeting .net 3.5, then migrated the project to vs2010. I have then published the project from vs2010 to a web site, and installed the add-in using click-once to a virtual machine running xp, .net 3.5 sp1, and outlook 2007. This all works great and I can see my add-in within outlook. Publish update settings are set to update the add-in at startup rather than every 7 days. However when I then make a simple change to the add-in, update the AssemblyVersion and AssemblyFileVersion of the add-in project, and then publish the updates, when I run outlook it doesn't detect that there is a new version, and just runs the current one that is installed. I can see that the publish has generated a new setup.exe and added a new folder to the 'Application Files' folder with the current (autogenerated) publish version. Can anyone suggest anything how I can get the update to be deployed to the client?

    Read the article

  • Relative Dates with Datejs

    - by Prasanna
    I have a requirement where in, I have to parse the dates relative to a date object returned from the server side. But the datejs library always considers only the browsers date object. The situation is something like this: The server gives back the date in PST and the browser is in IST. And all the inputs are getting parsed with respect to the current date in IST instead of current date in PST. Is there any way I could resolve this. Or could you suggest any workarounds. Thanks in advance.

    Read the article

  • jQuery: resizing element cuts off parent's background

    - by Justine
    Hi, I've been trying to recreate an effect from this tutorial: http://jqueryfordesigners.com/jquery-look-tim-van-damme/ Unfortunately, I want a background image underneath and because of the resize going on in JavaScript, it gets resized and cut off as well, like so: http://dev.gentlecode.net/dotme/index-sample.html - you can view source there to check the HTML, but basic structure looks like this: <div class="page"> <div class="container"> div.header ul.nav div.main </div> </div> Here is my jQuery code: $('ul.nav').each(function() { var $links = $(this).find('a'), panelIds = $links.map(function() { return this.hash; }).get().join(","), $panels = $(panelIds), $panelWrapper = $panels.filter(':first').parent(), delay = 500; $panels.hide(); $links.click(function() { var $link = $(this), link = (this); if ($link.is('.current')) { return; } $links.removeClass('current'); $link.addClass('current'); $panels.animate({ opacity : 0 }, delay); $panelWrapper.animate({ height: 0 }, delay, function() { var height = $panels.hide().filter(link.hash).show().css('opacity', 1).outerHeight(); $panelWrapper.animate({ height: height }, delay); }); }); var showtab = window.location.hash ? '[hash=' + window.location.hash + ']' : ':first'; $links.filter(showtab).click(); }); In this example, panelWrapper is a div.main and it gets resized to fit the content of tabs. The background is applied to the div.page but because its child is getting resized, it resizes as well, cutting off the background image. It's hard to explain so please look at the link above to see what I mean. I guess what I'm trying to ask is: is there a way to resize an element without resizing its parent? I tried setting height and min-height of .page to 100% and 101% but that didn't work. I tried making the background image fixed, but nada. It also happens if I add the background to the body or even html. Help?

    Read the article

  • Querying Active Directory in ruby app on Windows box

    - by Ben
    I have a small ruby app in which I'm trying to query some information from Active Directory. The app will be run by a Windows user who is already logged in. It looks like the ruby-net-ldap gem wants me to connect to an LDAP server using an IP address, port and then pass my username and password. Is there a way to achieve this (with a different gem, say) so that I don't have to pass this information (I don't have the current user's password for example, so that's not going to work)? I'm also hosting a Trac website on our intranet (which is written in Python if I remember correctly and that seems to know the current Windows username and domain. If it can do it, surely my little ruby app can access this information too?

    Read the article

  • jquery scrollpane and scrollTo at same time

    - by steve
    Current demo here: http://www.studioimbrue.com/sites/eliotdudik I have the tabs system working wonderfully. I'm trying to get it so that if you're down a ways on the gallery and then click "foreword" or any menu item, it scrolls you back to 0,0. The current sliding code is as follows: $('#wrapper ul li').click(function() { $(window).scrollTo($(this).next('li'), 500, {offset: {top:0, left:-50}}, {easing:'easeOutExpo'} ); }); And I'm trying to add something like this under it: $('#menu li').click(function() { $(window).scrollTo(0,0, 500, {offset: {top:0, left:-50}}, {easing:'easeOutExpo'} ); }); It continues switching tabs, but it won't scroll back to the beginning!

    Read the article

  • Checking if parsed date is within a date range

    - by Brett Powell
    So I am using a scripting language with c++-like syntax, and I am trying to think of the best way to check if a date is within range. The problem I am running into is that if the current day is in a new month, the check is failing. Here is what my code looks like: if(iMonth >= iStartMonth && iMonth <= iEndMonth) { if(iDay >= iStartDay && iDay <= iEndDay) { if(iYear >= iStartYear && iYear <= iEndYear) { bEnabled = true; return; When I have something like this: Start date: 3 27 2010 End Date: 4 15 2010 Current Date: 3 31 2010 The day check fails because if (iDay <= iEndDay) does not pass. The scripting language doesn't have a lot of time related functions, and I can't compare timestamps because I'm allowing users to put like "03:27:2010" and "04:15:2010" as start/end dates in a config file. I'm assuming I am just not thinking straight and missing an easy fix.

    Read the article

  • Working effectively unit tests / Anyone tried the in-assembly approach?

    - by CodingCrapper
    I'm trying to re-introduce unit testing into my team as our current coverage is very poor. Our system is quite large 40+ projects/assemblies. We current use a project named [SystemName].Test.csproj were all the test code is dumped and organised to represent the namespaces using folders. This approach is not very scalable and makes it difficult to find tests. I've been thinking about added a Tests folder to each project, this would put the unit tests "in the developers face" and make them easy to find. The downside is the Production release code would contain references to nunit, nmocks as well as the test code and test data.... Has anyone tried this approach? How is everyone else working with unit tests on large projects? Having a Tests project per "real" project/assembly would introduce too many new projs. Thanks in advance

    Read the article

  • Can I create a new project based on an abandoned one licenced under GNU GPL v2?

    - by Jared Pearson
    I've found a SourceForge project with a solid core that I would like to improve. The project hasn't been updated since 2007 so I assume it is "dead". I sent an e-mail asking to become a contributor to the listed project manager last week but still haven't received a response. The project is licensed under the GNU GPL v2. I would like to contribute to the current project but that doesn't appear to be possible. Can I modify the current source version of the project and release this modified project? I would keep the same license on the modified project.

    Read the article

  • Joining remote paths in Java

    - by Mickael Marrache
    I'm using the FTP library provided by Apache (commons-net). I want to check if a file exists on the FTP server so I use the listFiles method of FTPClient: ftpClient.listFiles(remoteFileDir + "\\" + fileName); The current directory is the FTP server root directory. So, the value of remoteFileDir is a path relative to this root directory. My question concerns the merge between the remote directory path and the file name. What is the right way to do it? For a local file, I would do: File file = new File(remoteFileDir,fileName); but here it doesn't work since when I call file.getAbsolutePath(), I get an absolute path for the file in the local current directory which is not what I want. Also, I guess the merging has been done according to my local environment. PS: I looked at How are paths determined on a remote machines? but it doesn't help me. Thanks

    Read the article

  • What data is actually stored in a B-tree database in CouchDB?

    - by Andrey Vlasovskikh
    I'm wondering what is actually stored in a CouchDB database B-tree? The CouchDB: The Definitive Guide tells that a database B-tree is used for append-only operations and that a database is stored in a single B-tree (besides per-view B-trees). So I guess the data items that are appended to the database file are revisions of documents, not the whole documents: +---------|### ... | | +------|###|------+ ... ---+ | | | | +------+ +------+ +------+ +------+ | doc1 | | doc2 | | doc1 | ... | doc1 | | rev1 | | rev1 | | rev2 | | rev7 | +------+ +------+ +------+ +------+ Is it true? If it is true, then how the current revision of a document is determined based on such a B-tree? Doesn't it mean, that CouchDB needs a separate "view" database for indexing current revisions of documents to preserve O(log n) access? Wouldn't it lead to race conditions while building such an index? (as far as I know, CouchDB uses no write locks).

    Read the article

  • Flickering when repainting a JPanel inside a JScrollPAne

    - by pR0Ps
    I'm having a problem with repainting a JPanel inside a JScrollPane. Basically, I'm just trying to 'wrap' my existing EditPanel (it originally extended JPanel) into a JScrollPane. It seems that the JPanel updates too often (mass flickering). How would I stop this from happening? I tried using the setIgnoreRepaint() but it didn't seem to do anything. Will this current implementation work or would I need to create another inner class to fine-tune the JPanel I'm using to display graphics? Skeleton code: public class MyProgram extends JFrame{ public MyProgram(){ super(); add(new EditPanel()); pack(); } private class EditPanel extends JScrollPane{ private JPanel graphicsPanel; public EditPanel(){ graphicsPanel = new JPanel(); } public void paintComponent(Graphics g){ graphicsPanel.revalidate(); //update the scrollpane to current panel size repaint(); Graphics g2 = graphicsPanel.getGraphics(); g2.drawImage(imageToDraw, 0, 0, null); } } }

    Read the article

  • SQL select all items of an owner from an item-to-owner table

    - by kdobrev
    I have a table bike_to_owner. I would like to select current items owned by a specific user. Table structure is CREATE TABLE IF NOT EXISTS `bike_to_owner` ( `bike_id` int(10) unsigned NOT NULL, `user_id` int(10) unsigned NOT NULL, `last_change_date` date NOT NULL, PRIMARY KEY (`bike_id`,`user_id`,`last_change_date`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; In the profile page of the user I would like to display all his/her current possessions. I wrote this statement: SELECT `bike_id`,`user_id`,max(last_change_date) FROM `bike_to_owner` WHERE `user_id` = 3 group by `last_change_date` but i'm not quite sure it works correctly in all cases. Can you please verify this is correct and if not suggest me something better. Using php/mysql. Thanks in advance!

    Read the article

  • Session is null when inherit from System.Web.UI.Page

    - by Andreas K.
    I want to extend the System.Web.UI.Page-class with some extra stuff. In the ctor I need the value of a session-variable. The problem is that the Session-object is null... public class ExtendedPage : System.Web.UI.Page { protected foo; public ExtendedPage() { this.foo = (int)HttpContext.Current.Session["foo"]; // NullReferenceException } } If I move the part with the session-object into the Load-Event everything works fine... public class ExtendedPage : System.Web.UI.Page { protected foo; public ExtendedPage() { this.Load += new EventHandler(ExtendedPage_Load); } void ExtendedPage_Load(object sender, EventArgs e) { this.foo = (int)HttpContext.Current.Session["foo"]; } } Why is the Session-object null in the first case??

    Read the article

  • Available options for hosting FTP server in .NET application

    - by duane
    I need to implement an FTP service inside my .NET application (running as a Windows Service) and have not had much luck finding good/current source code or vendors. Ideally it needs to be able to respond to the basic FTP Protocol and accept the data stream from an upload via a stream, enabling me to process the data as it is being received (think on the fly hashing). I need to be able to integrate it into my service because it will stack on top of our current code base with an existing custom TCP/IP communication protocol. I don't want to write (and then spend time debugging and performance testing) my own protocol, or implementation. I have already found plenty of ftp client implementations, I just need an acceptable server solution.

    Read the article

  • convert from physical path to virtual path

    - by user710502
    I have this function that gets the fileData as a byte array and a file path. The error I am getting is when it tries to set the fileInfo in the code bewlo. It says 'Physical Path given, Virtual Path expected' public override void WriteBinaryStorage(byte[] fileData, string filePath) { try { // Create directory if not exists. System.IO.FileInfo fileInfo = new System.IO.FileInfo(System.Web.HttpContext.Current.Server.MapPath(filePath)); //when it gets to this line the error is caught if (!fileInfo.Directory.Exists) { fileInfo.Directory.Create(); } // Write the binary content. System.IO.File.WriteAllBytes(System.Web.HttpContext.Current.Server.MapPath(filePath), fileData); } catch (Exception) { throw; } } When debugging it, is providing the filePath as "E:\\WEBS\\webapp\\default\\images\\mains\\myimage.jpg" . And the error message is 'E:/WEBS/webapp/default/images/mains/myimage.jpg' is a physical path, but a virtual path was expected. Also, what it is triggering this to happen is the following call properties.ResizeImage(imageName, Configurations.ConfigSettings.MaxImageSize, Server.MapPath(Configurations.EnvironmentConfig.LargeImagePath));

    Read the article

  • Handling Incoming Data from Multiple Sockets in Python

    - by user859434
    Background: I have a current implementation that receives data from about 120 different socket connections in python. In my current implementation, I handle each of these separate socket connections with a dedicated thread for each. Each of these threads parse the data and eventually store it within a shared locked dictionary. These sockets DO NOT have uniform data rates, some sockets get more data than others. Question: Is this the best way to handle incoming data in python, or does python have a better way on handling multiple sockets per thread?

    Read the article

  • How do I find the root path of a website from a dll?

    - by Biff MaGriff
    I have a C# website. It references several compiled dlls. My dlls need to access folders on the website. How do I find the root path of the website from the dlls? I've tried System.Environment.CurrentDirectory - "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE" Assembly.GetExecutingAssembly().Location - C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files...... I was going to use System.Web.HttpContext.Current.Server.MapPath() but System.Web.HttpContext.Current is null. Thanks!

    Read the article

  • Optimize slow ranking query

    - by Juan Pablo Califano
    I need to optimize a query for a ranking that is taking forever (the query itself works, but I know it's awful and I've just tried it with a good number of records and it gives a timeout). I'll briefly explain the model. I have 3 tables: player, team and player_team. I have players, that can belong to a team. Obvious as it sounds, players are stored in the player table and teams in team. In my app, each player can switch teams at any time, and a log has to be mantained. However, a player is considered to belong to only one team at a given time. The current team of a player is the last one he's joined. The structure of player and team is not relevant, I think. I have an id column PK in each. In player_team I have: id (PK) player_id (FK -> player.id) team_id (FK -> team.id) Now, each team is assigned a point for each player that has joined. So, now, I want to get a ranking of the first N teams with the biggest number of players. My first idea was to get first the current players from player_team (that is one record top for each player; this record must be the player's current team). I failed to find a simple way to do it (tried GROUP BY player_team.player_id HAVING player_team.id = MAX(player_team.id), but that didn't cut it. I tried a number of querys that didn't work, but managed to get this working. SELECT COUNT(*) AS total, pt.team_id, p.facebook_uid AS owner_uid, t.color FROM player_team pt JOIN player p ON (p.id = pt.player_id) JOIN team t ON (t.id = pt.team_id) WHERE pt.id IN ( SELECT max(J.id) FROM player_team J GROUP BY J.player_id ) GROUP BY pt.team_id ORDER BY total DESC LIMIT 50 As I said, it works but looks very bad and performs worse, so I'm sure there must be a better way to go. Anyone has any ideas for optimizing this? I'm using mysql, by the way. Thanks in advance Adding the explain. (Sorry, not sure how to format it properly) id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t ALL PRIMARY NULL NULL NULL 5000 Using temporary; Using filesort 1 PRIMARY pt ref FKplayer_pt77082,FKplayer_pt265938,new_index FKplayer_pt77082 4 t.id 30 Using where 1 PRIMARY p eq_ref PRIMARY PRIMARY 4 pt.player_id 1 2 DEPENDENT SUBQUERY J index NULL new_index 8 NULL 150000 Using index

    Read the article

  • jquery :not selector not working in next() method

    - by Richard
    what is the next best thing to use when you want to select the next li item, but not the one that has someClassName. The not selector returns an empty array! or is this a case off using filter? <li class="first">pickle</> <li class="someClassName">tomato</li> <li>chicken</> <li>cocosnut</> var current = $('ul.items li.first'); var next = current.next(':not(li.someClassName)'); thanks, Richard

    Read the article

< Previous Page | 123 124 125 126 127 128 129 130 131 132 133 134  | Next Page >