Daily Archives

Articles indexed Saturday June 12 2010

Page 13/74 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • When transactionManager is not named "transactionManager" ...

    - by smallufo
    I am trying Spring 3(.0.2.RELEASE) and JPA2 and Hibernate 3.5.1-Final... One thing upsets me is that spring seems only accept a transaction Manager named "transactionManager" If I don't name it "transactionManager" , Spring will throws NoSuchBeanDefinitionException: No bean named 'transactionManager' is defined. Here is my config : <context:component-scan base-package="destiny.data.mining"/> <context:annotation-config/> <bean id="miningEntityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> <property name="persistenceUnitName" value="mining"/> </bean> <bean id="miningTransactionManager" class="org.springframework.orm.jpa.JpaTransactionManager" > <property name="entityManagerFactory" ref="miningEntityManagerFactory"/> </bean> <tx:advice id="txAdviceMining" transaction-manager="miningTransactionManager"> <tx:attributes> <tx:method name="get*" read-only="true"/> <tx:method name="save*" propagation="REQUIRED"/> <tx:method name="update*" propagation="REQUIRED"/> <tx:method name="delete*" propagation="REQUIRED"/> <tx:method name="*" propagation="SUPPORTS" read-only="true"/> </tx:attributes> </tx:advice> <aop:config> <aop:pointcut id="methods" expression="execution(* destiny.utils.AbstractDao+.*(..))"/> <aop:advisor advice-ref="txAdviceMining" pointcut-ref="methods"/> </aop:config> <tx:annotation-driven transaction-manager="miningTransactionManager"/> In this config , an Entity Manager Factory is not necessarily named "entityManagerFactory" , and "txAdvice" is not necessarily named "txAdvice" , either. But I don't know why on earth Spring requires a transaction manager named "transactionManager" ? Is there any way not to name a transaction manager "transactionManager" ? (I'm running multiple spring config files , so I try my best to avoid name-conflicting) test code : @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations={"classpath:mining.xml"}) public class MiningPersonDaoTest { @Inject private EntityManagerFactory miningEntityManagerFactory; @Inject private MiningPersonDao miningPersonDao; @Transactional @Test public void testUpdate() { MiningPerson p = miningPersonDao.get(42L); p.setLocationName("OOXX"); miningPersonDao.update(p); System.out.println(p); } } ii

    Read the article

  • Tomcat Compression Does Not Add a Content-Encoding: gzip in the Header

    - by Julien Chastang
    I am using Tomcat to compress my HTML content like this: <Connector port="8080" maxHttpHeaderSize="8192" maxProcessors="150" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="8443" acceptCount="150" connectionTimeout="20000" disableUploadTimeout="true" compression="on" compressionMinSize="128" noCompressionUserAgents="gozilla, traviata" compressableMimeType="text/html" URIEncoding="UTF-8" /> In the HTTP header (as observed via YSlow), however, I am not seeing Content-Encoding: gzip resulting in a poor YSlow score. All I see is HeadersPost Response Headers Server: Apache-Coyote/1.1 Content-Type: text/html;charset=ISO-8859-1 Content-Language: en-US Content-Length: 5251 Date: Sat, 14 Feb 2009 23:33:51 GMT I am running an apache mod_jk Tomcat configuration. How do I compress HTML content with Tomcat, and also have it add "Content-Encoding: gzip" in the header?

    Read the article

  • Mac OS X, MySQL Preference Pane doesn't work

    - by Steve Kuo
    I downloaded and installed MySQL 5.1.47 for OS X 10.6 using the DMG archive: mysql-5.1.47-osx10.6-x86_64.dmg I also installed MySQL.prefPane and MySQLStartupItem.pkg. MySQL.prefPane is a Preference Pane. The problem is, whenever I attempt to start/stop MySQL from the Preference Pane, System Preferences just hangs. It runs at about 50% CPU forever, eventually I have for force quit System Preferences. The same thing happens if I toggle "Automatically Start MySQL Server on Startup". Basically the MySQL Preference Pane is not functional. Note that I have no problem starting MySQL from the command line: sudo /usr/local/mysql/bin/mysqld_safe I have tried reinstalling MySQL and the Preference Pane. I'm using the standard installation location, nothing out of the ordinary. Every time the MySQL Preference Pane just hangs. I'm doing this on a Macbook Pro (Intel) running OS X 10.6.3. There are no old versions of MySQL on this machine.

    Read the article

  • Reading RSS feeds --> not consistent

    - by DEE
    Hi There, i am trying to read the RSS feed by loading it to xmldocument some thing like xmlTextReader = new XmlTextReader(url); XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(xmlTextReader); some times the loading to xml document succeeds and some times it fails . the url i am using is http://rss.nzherald.co.nz/rss/xml/nzhrsscid%5F000000004.xml what could be the probelm, is it like the RSS is not updated properly..? any suggestions/comments Regards DEE

    Read the article

  • Trouble with LINQ databind to GridView and RowDataBound

    - by Michael
    Greetings all, I am working on redesigning my personal Web site using VS 2008 and have chosen to use LINQ to create by data-access layer. Part of my site will be a little app to help manage my budget better. My first LINQ query does successfully execute and display in a GridView, but when I try to use a RowDataBound event to work with the results and refine them a bit, I get the error: The type or namespace name 'var' could not be found (are you missing a using directive or an assembly reference?) This interesting part is, if I just try to put in a var s = "s"; anywhere else in the same file, I get the same error too. If I go to other files in the web project, var s = "s"; compiles fine. Here is the LINQ Query call: public static IQueryable pubGetRecentTransactions(int param_accountid) { clsDataContext db; db = new clsDataContext(); var query = from d in db.tblMoneyTransactions join p in db.tblMoneyTransactions on d.iParentTransID equals p.iTransID into dp from p in dp.DefaultIfEmpty() where d.iAccountID == param_accountid orderby d.dtTransDate descending, d.iTransID ascending select new { d.iTransID, d.dtTransDate, sTransDesc = p != null ? p.sTransDesc : d.sTransDesc, d.sTransMemo, d.mTransAmt, d.iCheckNum, d.iParentTransID, d.iReconciled, d.bIsTransfer }; return query; } protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { this.prvLoadData(); } } internal void prvLoadData() { prvCtlGridTransactions.DataSource = clsMoneyTransactions.pubGetRecentTransactions(2); prvCtlGridTransactions.DataBind(); } protected void prvCtlGridTransactions_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { var datarow = e.Row.DataItem; var s = "s"; e.Row.Cells[0].Text = datarow.dtTransDate.ToShortDateString(); e.Row.Cells[1].Text = datarow.sTransDesc; e.Row.Cells[2].Text = datarow.mTransAmt.ToString("c"); e.Row.Cells[3].Text = datarow.iReconciled.ToString(); }//end if }//end RowDataBound My googling to date hasn't found a good answer, so I turn it over to this trusted community. I appreciate your time in assisting me.

    Read the article

  • GridView paging inside an UpdatePanel or PlaceHolder components

    - by John
    Hello, I'm new to ASP.NET. Im developing ASP.NET C# web form which creating GridView components dynamically and filling them using the data received from my webservice. I'm creating these GridView components programmatically in server-side (cs file)- it has to be flexible - 1 GridView and sometimes 10 GridView components. The problem occurs when I'm trying to add pagination - whenever the user clicks the "next" page, the whole page is getting refreshed because of a postBack and I'm loosing all my data and the page returns Blank/Empty. I used PlaceHolder to hold the GridView components, while searching for a solution, I found UpdatePanel as a better alternative - as far as I understand the page can be partially refreshed - which means that only the UpdatePanel has to be refreshed...but it doesn't work. The following code sample is my TEST, the UpdatePanel is the only component initiated in the client side (aspx page), the rest initiated programmatically in CS. how can I solve the issue described above? Why does the whole page is getting refreshed and I'm loosing my data? can you recommend another way? can provide me with any code sample? If I'm not rebuilding the GridView, it doesn't work... Here is my Default.aspx.cs: public partial class TestAjaxForm : System.Web.UI.Page { DataTable table; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) bindGridView(); } public void bindGridView() { GridView gridView1 = new GridView(); gridView1.AutoGenerateColumns = true; gridView1.PageSize = 2; gridView1.AllowPaging = true; gridView1.PagerSettings.Mode = PagerButtons.Numeric; gridView1.PagerSettings.Position = PagerPosition.Bottom; gridView1.PagerSettings.PageButtonCount = 10; gridView1.PageIndexChanging += new GridViewPageEventHandler(this.GridView1_PageIndexChanging); table = new DataTable(); table.Columns.Add("FirstName"); table.Columns.Add("LastName"); DataRow row = table.NewRow(); row["FirstName"] = "John"; row["LastName"] = "Johnoson"; table.Rows.Add(row); row = table.NewRow(); row["FirstName"] = "Johnny"; row["LastName"] = "Marley"; table.Rows.Add(row); row = table.NewRow(); row["FirstName"] = "Kate"; row["LastName"] = "Li"; table.Rows.Add(row); panel.ContentTemplateContainer.Controls.Add(gridView1); gridView1.DataSource = table; gridView1.DataBind(); } protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e) { GridView gridView1 = (GridView)sender; gridView1.PageIndex = e.NewPageIndex; gridView1.DataSource = table; gridView1.DataBind(); } } Please help me, Thank you.

    Read the article

  • How to use unset() for this Linear Linked List in PHP

    - by Peter
    I'm writing a simple linear linked list implementation in PHP. This is basically just for practice... part of a Project Euler problem. I'm not sure if I should be using unset() to help in garbage collection in order to avoid memory leaks. Should I include an unset() for head and temp in the destructor of LLL? I understand that I'll use unset() to delete nodes when I want, but is unset() necessary for general clean up at any point? Is the memory map freed once the script terminates even if you don't use unset()? I saw this SO question, but I'm still a little unclear. Is the answer that you simply don't have to use unset() to avoid any sort of memory leaks associated with creating references? I'm using PHP 5.. btw. Unsetting references in PHP PHP references tutorial Here is the code - I'm creating references when I create $temp and $this-head at certain points in the LLL class: class Node { public $data; public $next; } class LLL { // The first node private $head; public function __construct() { $this->head = NULL; } public function insertFirst($data) { if (!$this->head) { // Create the head $this->head = new Node; $temp =& $this->head; $temp->data = $data; $temp->next = NULL; } else { // Add a node, and make it the new head. $temp = new Node; $temp->next = $this->head; $temp->data = $data; $this->head =& $temp; } } public function showAll() { echo "The linear linked list:<br/>&nbsp;&nbsp;"; if ($this->head) { $temp =& $this->head; do { echo $temp->data . " "; } while ($temp =& $temp->next); } else { echo "is empty."; } echo "<br/>"; } } Thanks!

    Read the article

  • How to correctly hook and return GetDlgItemTextA from C++ to C# to C++ from EasyHook

    - by Gbps
    I'm using EasyHook, a C# library for injecting and detouring functions from unmanaged applications. I'm trying to hook onto GetDlgItemTextA, which takes the arguments: UINT WINAPI GetDlgItemText( __in HWND hDlg, __in int nIDDlgItem, __out LPTSTR lpString, __in int nMaxCount );` In my hook, I am casting it as: [DllImport("user32.dll", // CharSet = CharSet.Unicode, SetLastError = true, CallingConvention = CallingConvention.StdCall)] static extern uint GetDlgItemTextA(IntPtr hWin, int nIDDlgItem, StringBuilder text, int MaxCount); And my hook is: static uint DGetDlgItemText_Hooked(IntPtr hWin, int nIDDlgItem, StringBuilder text, int MaxCount) { // call original API... uint ret = GetDlgItemTextA(hWin, nIDDlgItem, text, MaxCount); MessageBox.Show(text.ToString()); return ret; } Unfortunately, the moment this is called, the hooked application crashes. Is there a better cast I can use to successfully hook onto this function? Thanks! I've compiled, editted, and confirmed the working condition of my EasyHook setup. This is just casing and hooking only.

    Read the article

  • Efficient mapping of game entity positions in Java

    - by byte
    In Java (Swing), say I've got a 2D game where I have various types of entities on the screen, such as a player, bad guys, powerups, etc. When the player moves across the screen, in order to do efficient checking of what is in the immediate vicinity of the player, I would think I'd want indexed access to the things that are near the character based on their position. For example, if player 'P' steps onto element 'E' in the following example... | | | | | | | | | |P| | | | |E| | | | | | | | | ... would be to do something like: if(player.getPosition().x == entity.getPosition().x && entity.getPosition.y == thing.getPosition().y) { //do something } And thats fine, but that implies that the entities hold their positions, and therefor if I had MANY entities on the screen I would have to loop through all possible entities available and check each ones position against the player position. This seems really inefficient especially if you start getting tons of entities. So, I would suspect I'd want some sort of map like Map<Point, Entity> map = new HashMap<Point, Entity>(); And store my point information there, so that I could access these entities in constant time. The only problem with that approach is that, if I want to move an entity to a different point on the screen, I'd have to search through the values of the HashMap for the entity I want to move (inefficient since I dont know its Point position ahead of time), and then once I've found it remove it from the HashMap, and re-insert it with the new position information. Any suggestions or advice on what sort of data structure / storage format I ought to be using here in order to have efficient access to Entities based on their position, as well as Position's based on the Entity?

    Read the article

  • Sound Manager Classes for Windows

    - by Yakov
    I need some classes for playing short wav sounds, this classes would load this wav files into memory when an instance created, play sounds in background when needed, release this wav files from memory when an instance disposed. How can I do this on C# for windows (.Net 2.0)? (Win API's sndPlaySound, OpenAL or may be any wrapper) Ideally I would love to find an exist solution that simple and able to solve my task. Do you know any solutions for this issue?

    Read the article

  • Unicode characters and IE

    - by findmeahamper
    I just built a site that relies on certain Unicode characters like &#9398;, but have just realized that IE doesn't show these characters? Is there some meta tag to get the browser to show it or how do you update IE to handle these Unicode characters?

    Read the article

  • Professional WCF 4.0: Windows Communication Foundation with .NET 4.0

    The book in which I been working on since last year finally went to the light this week. It has been the result of hard work between me and three other Connected Systems MVP, my friend Fabio Cozzolino, Kurt Claeys and Johann Grabner. If you are interested in learning the new features in WCF 4.0, but also WCF in general and how to apply in real world scenarios, this book is for you. I dedicated three chapters of this book to one of my favorites topics, Security, from the basics to more complicated...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Having IIS remote management problem with my vista machine managing Server 2008 IIS 7.5

    - by Breadtruck
    I am trying to use IIS 7 Remote Management installed on Vista Ultimate SP1. Connection is to IIS 7.5 on Windows Server 2008 Webserver R2. Tried on both full & core install. When I connect up, the console wants to download and install new features. Microsoft.Web.Management.IisClient 7.5.0.0 Microsoft.Web.Management.AspnetClient 7.5.0.0 I check the boxes and click OK and it downloads them and asks if I want to install them, but after I click run it just quits. I tried just choosing one or the other, same thing. I ran IIS Remote tool as administrator. These features installed correctly on my XP machine. Any ideas? UPDATE : If I had any Rep I would offer like 500 rep to get this fixed!

    Read the article

  • Desktop G4: Wireless?

    - by Yar
    I just inherited a G4 Server (I don't know much about it, except that it runs 10.4 and cannot go beyond that). It does not have an Airport connection. How would I figure out what kind of card or network interface I need for Wifi?

    Read the article

  • How to attach a line to a moving object?

    - by snow-spur
    Hello i have designed a maze and i want to draw a path between the cells as the 'person' moves from one cell to the next. So each time i move the cell a line is drawn I have done this so far but do not want to show my full code However i get an error saying Circle has no attribute center my circle which is my cell center = Point(15, 15) c = Circle(center, 12) c.setFill('blue') c.setOutline('yellow') c.draw(win) p1 = Point(c.center().getx(), c.center().gety()) this bit is in my loop p2 = Point(getx(), gety()) line = graphics.Line(p1, p2)

    Read the article

  • How to access Sharepoint List Items using an ID

    - by GEShafer
    I am currently working on a nice table that displays the items in a list of "Tasks" on a dispForm page. Each Task is created and initially given a ProjectID depending on which project the task is for. The ProjectID is the actual ID given to the "project" when it is added to the list, therefore it is not actually a parameter in the list of projects while it is a parameter in the list of tasks. I would like to know how to use the ProjectID parameter in the task list to link to the Project list and grab the ProjectName parameter so that I can display the Project Name in the table. Currently I can not get it to work. All help is appreciated, Gale

    Read the article

  • Can I have sinatra not read the entire request body into memory?

    - by Chris Markle
    Say I have a sinatra route ala: put '/data' do request.body.read [...] end It appears that the entire request.body is read into memory. Is there a way to consume the body as it comes into the system, rather than having it all buffered in Rack/sinatra beforehand? I see I can do this to read the body in parts, but the entire body still seems to be read into memory beforehand. put '/data' do while request.body.read(1024) != nil [...] end [...] end

    Read the article

  • Browsed Time Problem.

    - by aamir Fayyaz
    I want to display the browsed time of a user, But when i refresh it, it will be again start from 0:0:0. How can it handle? <?php $total_mints=($live_match['match_name']) * (60); ?> <script language="javascript"> display_c(<?=$total_mints?>,'ct'); </script> <script type="text/javascript"> function display_c(start,div){ window.start = parseFloat(start); var end = 0 // change this to stop the counter at a higher value var refresh=1000; // Refresh rate in milli seconds if(window.start >= end ){ mytime=setTimeout("display_ct('"+div+"')",refresh) } else {alert("Time Over ");} </script>

    Read the article

  • Can i pop to Specific ViewController?

    - by Ankit Vyas
    Hello!I am using Navigation Based Application.I push First ViewController to Second ViewController and From Second ViewController to Third ViewController Now I want to Pop From Third ViewController to First ViewController.I am Performing This task using the Below Code but i application get's Terminate.Please any body give me some proper Guidelines.I can't use pop to RootViewController because it's Different ViewController.Thanks in Advance... In Third ViewControler i have Written this: FirstViewCtr *x=[[FirstViewCtr alloc] initWithNibName:@"FirstViewCtr" bundle:nil]; [self.navigationController popToViewController:x animated:NO];

    Read the article

  • How to write mod_security friendly PHP code?

    - by KPL
    Hello people, I made a theme in WordPress which hit the mod_security rule on HostGator and gave 403 error. I contacted people there(at HostGator) and they fixed it for me. But I don't want my theme to work like this. I just wanted to know if there are any guides/blog post/tutorials telling about writing PHP code which is mod_security friendly? I tried Google, but didn't find anything helpful.

    Read the article

  • Creating an additional related model with Devise

    - by Tim Sullivan
    I've started to implement a new project using Devise, which is pretty fantastic for handling users. However, when a user signs up, they're not just creating a User model, but also need to create a related Account model that represents the company. Additional users will also belongs_to this Account model. I can't seem to find a hook for this in Devise, though it seems like a pretty common pattern. What's the best practice for this?

    Read the article

  • Where can I get material for learning EBNF?

    - by yesraaj
    Extended Backus–Naur Form: EBNF I'm very new to parsing concepts. Where can I get sufficiently easy to read and follow material for writing a grammar for the boost::spirit library, which uses a grammar similar to EBNF? Currently I am looking into EBNF from Wikipedia.

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >