Daily Archives

Articles indexed Friday May 7 2010

Page 25/110 | < Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >

  • My iPod never finishes syncing and only syncs audio, not pictures or video - any ideas as to how I c

    - by Sam Meldrum
    My iPod classic 160GB worked well for a couple of years. I used to sync a lot of photos at full resolution to it, but this recently stopped working after I moved to Windows 7. iTunes is on latest version - 9.1.1.12 iPod software is up to date - 1.1.2 Windows 7 is fully up to date and patched The symptoms are that the iPod will start to sync, all audio (music and podcasts will sync successfully) but the syncing will then just appear to continue - itunes message: Syncing iPod. Do not Disconnect. This sync never completes - I have left it trying for days. I have tried resetting the iPod using the Restore button, whereupon it restarts sync from default options and again will sync audio, but nothing else. I suspect that something has gone wrong on the hard-drive - either a bad sector or some corrupt data. Is there a process I can go through to fix this? E.g. SpinRite or a format? If so how do I go about formatting an iPod and will it be recognised as an iPod after format and work as normal? Any advice on what to try next much appreciated?

    Read the article

  • Java Best Practice for type resolution at runtime.

    - by Brian
    I'm trying to define a class (or set of classes which implement the same interface) that will behave as a loosely typed object (like JavaScript). They can hold any sort of data and operations on them depend on the underlying type. I have it working in three different ways but none seem ideal. These test versions only allow strings and integers and the only operation is add. Adding integers results in the sum of the integer values, adding strings concatenates the strings and adding an integer to a string converts the integer to a string and concatenates it with the string. The final version will have more types (Doubles, Arrays, JavaScript-like objects where new properties can be added dynamically) and more operations. Way 1: public interface DynObject1 { @Override public String toString(); public DynObject1 add(DynObject1 d); public DynObject1 addTo(DynInteger1 d); public DynObject1 addTo(DynString1 d); } public class DynInteger1 implements DynObject1 { private int value; public DynInteger1(int v) { value = v; } @Override public String toString() { return Integer.toString(value); } public DynObject1 add(DynObject1 d) { return d.addTo(this); } public DynObject1 addTo(DynInteger1 d) { return new DynInteger1(d.value + value); } public DynObject1 addTo(DynString1 d) { return new DynString1(d.toString()+Integer.toString(value)); } } ...and similar for DynString1 Way 2: public interface DynObject2 { @Override public String toString(); public DynObject2 add(DynObject2 d); } public class DynInteger2 implements DynObject2 { private int value; public DynInteger2(int v) { value = v; } @Override public String toString() { return Integer.toString(value); } public DynObject2 add(DynObject2 d) { Class c = d.getClass(); if(c==DynInteger2.class) { return new DynInteger2(value + ((DynInteger2)d).value); } else { return new DynString2(toString() + d.toString()); } } } ...and similar for DynString2 Way 3: public class DynObject3 { private enum ObjectType { Integer, String }; Object value; ObjectType type; public DynObject3(Integer v) { value = v; type = ObjectType.Integer; } public DynObject3(String v) { value = v; type = ObjectType.String; } @Override public String toString() { return value.toString(); } public DynObject3 add(DynObject3 d) { if(type==ObjectType.Integer && d.type==ObjectType.Integer) { return new DynObject3(Integer.valueOf(((Integer)value).intValue()+((Integer)value).intValue())); } else { return new DynObject3(value.toString()+d.value.toString()); } } } With the if-else logic I could use value.getClass()==Integer.class instead of storing the type but with more types I'd change this to use a switch statement and Java doesn't allow switch to use Classes. Anyway... My question is what is the best way to go about something thike this?

    Read the article

  • Retrieve value from form

    - by vetri
    My form is like <form action="javascript:;" method="post" id="reportForm"> <input type="text" name="as" maxlength="3" /> --CODE-- <html:hidden property="reportid" value="${Scope.reportId}" /> --code-- </form> I can retrieve values from the form in javascript like this.form = dojo.byId('reportForm'); this.as1 = this.form.as; How can i retrieve the value of the html:hidden tag property.

    Read the article

  • How to create a backup from SqlAlchemy?

    - by swilliams
    I'm writing a Pylons app, and am trying to create a simple backup system where every table is serialized and tarred up into a single file for an administrator to download, and use to restore the app should something bad happen. I can serialize my table data just fine using the SqlAlchemy serializer, and I can deserialize it fine as well, but I can't figure out how to commit those changes back to the database. In order to serialize my data I am doing this: from myproject.model.meta import Session from sqlalchemy.ext.serializer import loads, dumps q = Session.query(MyTable) serialized_data = dumps(q.all()) In order to test things out, I go ahead and truncation MyTable, and then attempt to restore using serialized_data: from myproject.model import meta restore_q = loads(serialized_data, meta.metadata, Session) This doesn't seem to do anything... I've tried calling a Session.commit after the fact, individually walking through all the objects in restore_q and adding them, but nothing seems to work. What am I missing? Or is there a better way to do what I'm aiming for? I don't want to shell out and directly touch the database, since SqlAlchemy supports different database engines.

    Read the article

  • STL map - insert or update

    - by CodeJunkie
    I have a map of objects and I want to update the object mapped to a key, or create a new object and insert into the map. The update is done by a different function that takes a pointer to the object (void update(MyClass *obj)) What is the best way to "insert or update" an element in a map?

    Read the article

  • Calling javascript function on the Mousehoever and mouseout using jQuery

    - by Wazdesign
    I want to call the javascript function using mousehover jQuery event. Here is the one function. // On mouse hover function function ShowHighlighter(d, highlight_elid) { //alert ("ShowHighlighter\n"+d); if (d == "addHighlight") { var txt = getSelText(); if (txt.length < 1) { return; } ShowContent(d); } else if (d == "deleteHighlight") { var elid = "#"+d; jQuery(elid).stop(); ShowContent(d); delete_highlight_id = "#"+highlight_elid; } } // on Mouse out function function HideContent(d) { if(d.length < 1) { return; } document.getElementById(d).style.display = "none"; } I am trying to use this function ... but it not seems to be working. jQuery('a[href="HIGHLIGHT_CREATELINK"]').mouseover(ShowHighlighter("deleteHighlight","highlight"+ randomCount + ");) ; jQuery('a[href="HIGHLIGHT_CREATELINK"]').mouseout('javascript:HideContentFade(\"deleteHighlight\");') please help me out in this. thanks.

    Read the article

  • Test if file exists

    - by klaus-vlad
    Hi, I'm trying to open a file in android like this : try { FileInputStream fIn = context.openFileInput(FILE); DataInputStream in = new DataInputStream(fIn); BufferedReader br = new BufferedReader(new InputStreamReader(in)); if(in!=null) in.close(); } catch(Exception e) { } , but in case the file does not exists a file not found exception is thrown . I'd like to know how could I test if the file exists before attempting to open it.

    Read the article

  • How to resolve "Could not convert JavaScript argument arg 0 [nsIDOMHTMLDivElement.appendChild]" erro

    - by Holicreature
    i have a json object returned from ajax and when i alert it, it is displayed correctly and i try to add those into a unordered list and add that to a place holder div, but throws the above error.. function handleResponse() { if(httpa.readyState == 4){ var response = httpa.responseText; //alert(response); if(response!='empty') { //alert(response); eval("prod="+response); var len = prod.length; var st = "<ul>"; for(var cnt=0;cnt<len;cnt++) { st = st + "<li onclick='set("+prod[cnt].id+")'>"+prod[cnt].name+"</li>"; } st = st + "</ul>"; } var tt = document.getElementById('holder1'); tt.appendChild(st); // i even tried **tt.appendChild(eval(st));** tt.style.display = 'block'; } }

    Read the article

  • Writing to a java socket channel which should be closed does not generate an exception

    - by Dan Serfaty
    Hi all, We have a java server that keeps a socket channel open with an Android client in order to provide push capabilities to our client application. However, after putting the Android in airplane mode, which I expected would sever the connection, the server can still write to the SocketChannel object associated with that Android client and no error is thrown. Calling SocketChannel.isConnected() before writing to it returns true. What are we missing? Is the handling of sockets different with mobile devices? Thanks in advance for your help.

    Read the article

  • find the all the stored procedures and jobs in sql server 2000

    - by kumar
    Hi, In SQL SERVER 2005 This query works fine : Select * from sys.procedures where object_definition(object_id) like '%J%' SELECT * FROM MSDB.DBO.SYSJOBS WHERE NAME LIKE '%J%' but in sql server 2000 it is not working. Here i need to find the all the stored procedures and jobs which matches my string ? how to find in sql server 2000 ? regards, kumar

    Read the article

  • How do I browse a Websphere MQ message without removing it?

    - by jmgant
    I'm writing a .NET Windows Forms application that will post a message to a Websphere MQ queue and then poll a different queue for a response. If a response is returned, the application will partially process the response in real time. But the response needs to stay in the queue so that a daily batch job, which also reads from the response queue, can do the rest of the processing. I've gotten as far as reading the message. What I haven't been able to figure out is how to read it without removing it. Here's what I've got so far. I'm an MQ newbie, so any suggestions will be appreciated. And feel free to respond in C#. Public Function GetMessage(ByVal msgID As String) As MQMessage Dim q = ConnectToResponseQueue() Dim msg As New MQMessage() Dim getOpts As New MQGetMessageOptions() Dim runThru = Now.AddMilliseconds(CInt(ConfigurationManager.AppSettings("responseTimeoutMS"))) System.Threading.Thread.Sleep(1000) 'Wait for one second before checking for the first response' While True Try q.Get(msg, getOpts) Return msg Catch ex As MQException When ex.Reason = MQC.MQRC_NO_MSG_AVAILABLE If Now > runThru Then Throw ex System.Threading.Thread.Sleep(3000) Finally q.Close() End Try End While Return Nothing 'Should never reach here' End Function NOTE: I haven't verified that my code actually removes the message. But that's how I understand MQ to work, and that appears to be what's happening. Please correct me if that's not the default behavior.

    Read the article

  • Preventing dictionary attacks on a web application

    - by Kevin Pang
    What's the best way to prevent a dictionary attack? I've thought up several implementations but they all seem to have some flaw in them: Lock out a user after X failed login attempts. Problem: easy to turn into a denial of service attack, locking out many users in a short amount of time. Incrementally increase response time per failed login attempt on a username. Problem: dictionary attacks might use the same password but different usernames. Incrementally increase response time per failed login attempt from an IP address. Problem: easy to get around by spoofing IP address. Incrementally increase response time per failed login attempt within a session. Problem: easy to get around by creating a dictionary attack that fires up a new session on each attempt.

    Read the article

  • How should I handle pages that move to a new url with regards to search engines?

    - by Anders Juul
    Hi all, I have done some refactoring on a asp.net mvc application already deployed to a live web site. Among the refactoring was moving functionality to a new controller, causing some urls to change. Shortly after the various search engine robots start hammering the old urls. What is the right way to handle this in general? Ignore it? In time the SEs should find out that they get nothing but 400 from the old urls. Block old urls with robots.txt? Continue to catch the old urls, then redirect to new ones? Users navigating the site would never get the redirection as the urls are updated through-out the new version of the site. I see it as garbage code - unless it could be handled by some fancy routing? Other? As always, all comments welcome... Thanks, Anders, Denmark

    Read the article

  • Is it possible to change an "Unidentified Network" into a "Home" or "Work" network on Windows 7

    - by Rhys
    I have a problem with Windows 7 RC (7100). I frequently use a crossover network cable on WinXP with static IP addresses to connect to various industrial devices (e.g. robots, pumps, valves or even other Windows PCs) that have Ethernet network ports. When I do this on Windows 7, the network connection is classed as an "Unidentified Network" in Networks and Sharing Center and the public firewall profile is enforced by Windows. I do not want to change the public profile and would prefer to use the Home or Work profile instead. For other networks like Home and Work I'm able to click on them and change the classification. This is not available for unidentified networks. My questions are these:- Is there a way to manual override the "Unidentified Network" classification? What tests are performed on the network that fail, therefore classifying it as an "Unidentified Network" By googling (hitting mainly vista issues) it seems that you need to ensure that the default gateway is not 0.0.0.0. I've done this. I've also tried to remove IPv6 but this does not seem possible on Windows 7.

    Read the article

  • loading data into rails applicaton

    - by ash34
    Hi, I have a list of rows in an excel sheet which I need to load as historical transactions into a table in my rails applications. I saved the excel file as a csv file. I tried using csv from the standard library but keep getting the following exception CSV::IllegalFormatError. Not sure how to even figure out where the problem lies. Any suggestions on how to do this. thanks, ash

    Read the article

  • How can I ignore properties of a component using Fluent Nhibernate's AutoPersistenceModel?

    - by Jason
    I am using Fluent NHibernate AutoMappings to map my entities, including a few component objects. One of the component objects includes a property like the following: public string Value { set _value = value; } This causes an NHibernate.PropertyNotFoundException: "Could not find a getter for property 'Value'..." I want to ignore this property. I tried creating an IAutoMappingOverride for the component class but I couldn't use AutoMapping<.IgnoreProperty(x = x.Value) for the same reason. "The property or indexer 'MyComponent.Value' cannot be used in this context because it lacks the get accessor" I've also looked at IComponentConvention but can't see anyway of altering the mappings with this convention. Any help would be appreciated... Thanks

    Read the article

  • ListView Final Column Autosize creates scrollbar

    - by Courtney de Lautour
    Hi There, I am implementing a custom control which derives from ListView. I would like for the final column to fill the remaining space (Quite a common task), I have gone about this via overriding the OnResize method: protected override void OnResize(EventArgs e) { base.OnResize(e); if (Columns.Count == 0) return; Columns[Columns.Count - 1].Width = -2; // -2 = Fill remaining space } or via another method: protected override void OnResize(EventArgs e) { base.OnResize(e); if (!_autoFillLastColumn) return; if (Columns.Count == 0) return; int TotalWidth = 0; int i = 0; for (; i < Columns.Count - 1; i++) { TotalWidth += Columns[i].Width; } Columns[i].Width = this.DisplayRectangle.Width - TotalWidth; } Edit: This works fine until I dock the ListView into a parent container and resize via that control. Every second time the control size shrinks (IE, drag the the border one pixel), I get a scroll bar on the bottom which can't move at all (not even one pixel). The result of which is when I drag the size of the parent I am left with a flickering scroll bar in the ListView, and a 50% chance it will be there when the dragging stops.

    Read the article

  • memory problem with metapost

    - by yCalleecharan
    Hi, I'm using gnuplot to plot a graph to the mp format and then I'm converting it to eps via the command: mpost --sprologues=3 -soutputtemplate=\"%j-%c.eps\" myfigu.mp But I don't get the eps output; instead I get this message: This is MetaPost, version 1.208 (kpathsea version 3.5.7dev) (mem=mpost 2009.12.12) 6 MAY 2010 23:16 **myfigu.mp (./myfigu.mp ! MetaPost capacity exceeded, sorry [main memory size=3000000]. _wc-withpen .currentpen.withcolor.currentcolor gpdraw-...ptpath[(EXPR0)]_sms((EXPR1),(EXPR2))_wc .else:_ac.contour.ptpath[(... l.48052 gpdraw(0,517.1a,166.4b) ; If you really absolutely need more capacity, you can ask a wizard to enlarge me. How do I tweak in order to get more memory. The file from which I'm plotting has two columns of 189,200 values each. These values are of type long double (output from a C program). The text file containing these two column values is about 6 MB. Thanks a lot...

    Read the article

  • How to get the Output value of SP using C#

    - by karthik
    I am using the following Code to execute the SP of MySql and get the output value. I need to get the output value to my c# after SP is executed. How ? Thanks. Code : public static string GetInsertStatement(string DBName, string TblName, string ColName, string ColValue) { string strData = ""; MySqlConnection conn = new MySqlConnection(ConfigurationSettings.AppSettings["Con_Admin"]); MySqlCommand cmd = conn.CreateCommand(); try { cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.CommandText = "InsGen"; cmd.Parameters.Clear(); cmd.Parameters.Add("in_db", MySqlDbType.VarChar, 20); cmd.Parameters["in_db"].Value = DBName; cmd.Parameters.Add("in_table", MySqlDbType.VarChar, 20); cmd.Parameters["in_table"].Value = TblName; cmd.Parameters.Add("in_ColumnName", MySqlDbType.VarChar, 20); cmd.Parameters["in_ColumnName"].Value = ColName; cmd.Parameters.Add("in_ColumnValue", MySqlDbType.VarChar, 20); cmd.Parameters["in_ColumnValue"].Value = ColValue; conn.Open(); cmd.ExecuteNonQuery(); conn.Close(); } catch (System.Exception e) { Console.WriteLine(e.Message); } return strData; } SP : DELIMITER $$ DROP PROCEDURE IF EXISTS `InsGen` $$ CREATE DEFINER=`root`@`localhost` PROCEDURE `InsGen` ( in_db varchar(20), in_table varchar(20), in_ColumnName varchar(20), in_ColumnValue varchar(20) ) BEGIN declare Whrs varchar(500); declare Sels varchar(500); declare Inserts varchar(2000); declare tablename varchar(20); declare ColName varchar(20); set tablename=in_table; # Comma separated column names - used for Select select group_concat(concat('concat(\'"\',','ifnull(',column_name,','''')',',\'"\')')) INTO @Sels from information_schema.columns where table_schema=in_db and table_name=tablename; # Comma separated column names - used for Group By select group_concat('`',column_name,'`') INTO @Whrs from information_schema.columns where table_schema=in_db and table_name=tablename; #Main Select Statement for fetching comma separated table values set @Inserts=concat("select concat('insert into ", in_db,".",tablename," values(',concat_ws(',',",@Sels,"),');') from ", in_db,".",tablename, " where ", in_ColumnName, " = " , in_ColumnValue, " group by ",@Whrs, ";"); PREPARE Inserts FROM @Inserts; select Inserts; EXECUTE Inserts; END $$ DELIMITER ;

    Read the article

  • How to tell the database type checking the file

    - by Click Ok
    My friend have a system to manage customers. The program per si is terrible, and my friend lost contact with the developers. The case is, now my friend lost the access to program (something that the developers say "locked to machine" so when moved to another pc, he lost the access to program and data. I get mission of to try to recover the database, migrating to another database, and create a cool program to my friend. Now I need to discover wich database was used by the developers. I know that the program was made using Visual Basic, because the MSVBVM60.DLL is required. There is some program to read the metadata in the .dat files and discover wich database was used?

    Read the article

  • How to configure XMPP to allow all logged in user to see each other and chat with each other?

    - by Nachiket
    Hello guys, I am new to XMPP. I am using Openfire server, and created a console client using Smack library. My usecase: All users anonymous, logged in (In future, website visitors) will be able to see other anonymous, logged-in users. And they can initiate a private chat (one-to-one) with any of them. So, I am able to logged in as Anonymous user, but I am not able to see other Anon / Logged in users (using Roster), because they are not in anon user's roster. So, What should be configuration OR custom=component/code to to achieve this usecase? Do I need to create server component? Any hint? OR It can be done using proper configuration? Cheers

    Read the article

< Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >