Daily Archives

Articles indexed Monday May 17 2010

Page 18/112 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • How do web browser games access temporary files

    - by Phenom
    There is a web game that I play and I used fiddler to see what temporary files it downloaded. While I was playing I deleted all those temporary files including the sounds and flash files. But it didn't affect the game at all. Why is that? I checked in fiddler and it doesn't look like the files were redownloaded.

    Read the article

  • Creating a QMainWindow from Java using JNI

    - by ebasconp
    Hi everybody: I'm trying to create a Qt main windows from Java using JNI directly and I got a threading error. My code looks like this: Test class: public class Test { public static void main(String... args) { System.out.println(System.getProperty("java.library.path")); TestWindow f = new TestWindow(); f.show(); } } TestWindow class: public class TestWindow { static { System.loadLibrary("mylib"); } public native void show(); } C++ impl: void JNICALL Java_testpackage_TestWindow_show (JNIEnv *, jobject) { int c = 0; char** a = NULL; QApplication* app = new QApplication(c, a); QMainWindow* mw = new QMainWindow(); mw->setWindowTitle("Hello"); mw->setGeometry(150, 150, 400, 300); mw->show(); QApplication::exec(); } and I get my window painted but frozen (it does not receive any event) and the following error message when instantiating the QMainWindow object: QCoreApplication::sendPostedEvents: Cannot send posted events for objects in another thread I know all the UI operations must done in the UI thread but in my example I created the QApplication in the only thread I have running, so, everything should work properly. I did some tests executing the code of my "show" method from a QMetaObject::invokeMethod stuff using Qt::QueuedConnection but nothing works properly. I know I could use Jambi... but I know that it could be done natively too and that is what I want to do :) Any ideas on this? Thanks in advance! Ernesto

    Read the article

  • Attachment_fu: can't disable :partition option

    - by Nathan Long
    I'm trying to use the Attachment_Fu plugin in a Rails project, and want to customize the paths where uploaded files are saved. The documentation shows this option: :partition # Whether to partiton files in directories like /0000/0001/image.jpg. Default is true. (The 0001 part is an ID from a table.) I don't want that, so I set the partition option to false, like so: class Photo < ActiveRecord::Base has_attachment :content_type => :image, :storage => :file_system, :max_size => 500.kilobytes, :resize_to => '320x200', :thumbnails => {:thumb => '100x100>' }, :partition => false validates_as_attachment end ...but the :partition => false option has no effect. Has anybody else encountered this problem? How did you fix it?

    Read the article

  • Android custom widget styles: how to put them into a namespace?

    - by Matthias
    In the ApiDemos, there is a view example called Gallery1 which declares a custom style in attrs.xml, as such: <declare-styleable name="Gallery1"> <attr name="android:galleryItemBackground" /> </declare-styleable> now, I want to do the same thing for my widgets, but using a different namespace. However, as soon as I replace the android: namespace with something else, I get this error: ERROR: In Gallery1, unable to find attribute myns:galleryItemBackground Unable to find attribute? Why does it look for an attribute I am about to declare? Isn't the point of this file to be able to name your own custom attributes? It's interesting to note that it works if you do not supply a custom namespace, but just an attribute name.

    Read the article

  • Zend_Router requirements mismatch

    - by elbicho
    Hello you all: I have two routes that match a url with the same apparent pattern, the difference lies in the $actionRoute, this should only be matched if the variable :action on it equals 'myaction'. If I go to /en/mypage/whatever/myaction it goes as expected through $actionRoute. If I go to /en/mypage/whatever/blahblah it gets rejected by $actionRoute and matched by $genRoute. If I go to /en/mypage/whatever it should be matched by $genRoute but it gets matched by $actionRoute instead throwing and exception because the action noactionAction() does not exist. Don't know what I'm doing wrong, I'd appreciate your help. $genRoute = new Zend_Controller_Router_Route( ':lang/mypage/:var1/:var2', array( 'lang' => '', 'module' => 'mymodule', 'controller' => 'index', 'action' => 'index', 'var1' => 'noone', 'var2' => 'no' ), array( 'var1' => '[a-z\-]+?', 'lang' => '(es|en|fr|de){1}' ) ); $actionRoute = new Zend_Controller_Router_Route( ':lang/mypage/:var1/:action', array( 'lang' => '', 'module' => 'mymodule', 'controller' => 'index', 'action' => 'noaction', 'var1' => 'noone', ), array( 'action' => '(myaction)+?', 'var' => '[a-z\-]+?', 'lang' => '(es|en|fr|de){1}', ) ); $router->addRoute('genroute',$genRoute); $router->addRoute('actionroute',$actionRoute);

    Read the article

  • What's the deal with rubygems on Debian? It's different and strange.

    - by JSW
    I've noticed at least the following oddities around rubygems on Debian (5.0 lenny in my case): Packages go into a different installation location: /var/lib/gems vs /usr/lib/ruby/gems The debian package is rubygems 1.3.6, and updating rubygems to the latest version (1.3.7) doesn't work: $ sudo gem update --system ERROR: While executing gem ... (RuntimeError) gem update --system is disabled on Debian. RubyGems can be updated using the official Debian repositories by aptitude or apt-get. Not all gems appear to work like they do on other systems. For instance, when installing Phusion Passenger, it did not detect the "rack" gem even though it was definitely installed. Manually installing rubygems using the source tarball and reinstalling all my gems (to /usr/lib/ruby/gems) made my problems go away. What's the deal? Why is debian's package different?

    Read the article

  • file cretaed using exec could not be accessed immediately after creation?

    - by Holicreature
    HI I'm using exec in php to execute a command and it will create a .png file in a temp folder.. After creating that i'm trying to open that file and read contents and process them,, but i end up file could not read error.. I think the time taken by the exec to execute and create a file is the cause for the issue.. but i dont know how to fix it? i tried sleep() but it makes my script to run slow <?php error_reporting(E_ALL); extension_loaded('ffmpeg') or die('Error in loading ffmpeg'); //db connection codes $max_width = 120; $max_height = 72; $path ="/path/"; $qry="select id, input_file, output_file from videos where thumbnail='' or thumbnail is null;"; $res=mysql_query($qry); $cnt = 1; while($row = mysql_fetch_array($res,MYSQL_ASSOC)) { $outfile = $row[output_file]; $imgname = $cnt.".png"; $srcfile = "/path/".$outfile; echo "####$srcfile####"; exec("ffmpeg -i ".$srcfile." -r 1 -ss 00:00:05 -f image2 -s 120x72 ".$path.$imgname); $nname = "./temp/".$imgname; echo "nname===== $nname"; $fileo = fopen($nname,"rb"); if($fileo) { $imgData = addslashes(file_get_contents($nname)); .. ... .... } else echo "Could not open<br><br>"; $cnt = $cnt + 1: } ?>

    Read the article

  • select for update problem in jdbc

    - by kartiku
    I'm having a problem with select for update in jdbc. The table i'm trying to update is the smalldb table, i'm having problems-- i'm using select for update which does a lock on the selected row the update statement is -- String updateQ = "UPDATE libra.smalldb SET hIx = ? WHERE name = ?"; the select statement is -- rs = stmt1.executeQuery("SELECT hIx FROM libra.smalldb for update"); rs0 = stmt2.executeQuery("SELECT name,aff FROM libra.smalldb"); the second statement is because i need those fields as well. Here is the complete code -- import java.sql.*; import java.util.ArrayList; import java.util.Collections; public class Jdbcexample1 { /** * @param args */ public static void main(String[] args) { Connection con = null; try { Class.forName("com.mysql.jdbc.Driver").newInstance(); con = DriverManager.getConnection("jdbc:mysql:///test", "root", "*****"); //String url = "jdbc:msql://200.210.220.1:1114/Demo"; //Connection conn = DriverManager.getConnection(url,"",""); Statement stmt1 = con.createStatement(); Statement stmt2 = con.createStatement(); Statement stmt3 = con.createStatement(); Statement stmt4 = con.createStatement(); ResultSet rs0; ResultSet rs; ResultSet rs1; ResultSet rs2; String name; String hIx; int hIxInt; StringBuffer sb = new StringBuffer(); String affiliationSmall; ArrayList<String> affiliation = new ArrayList<String>(); ArrayList<Float> matchValues = new ArrayList<Float>(); ArrayList<Integer> hixValues = new ArrayList<Integer>(); ArrayList<Integer> idValues = new ArrayList<Integer>(); boolean moreFlag = false; String queryString; int tmpIdx; String name1; //get the hix at that index where the similarity is maximum int tmpHidx = 0; int tmpHix = 0; int id = 0; int count; int tmpidIdx = 0; //rs = stmt.executeQuery("SELECT id FROM libra.researchint WHERE id = 910887"); // Get name, affiliation , hIx from smalldb //rs = stmt1.executeQuery("SELECT name,aff,hIx FROM libra.smalldb"); // String cursorName = "OUR_CURSOR"; // stmt1.setCursorName(cursorName); //rs = stmt1.executeQuery("SELECT name,aff,hIx FROM libra.smalldb for update"); rs = stmt1.executeQuery("SELECT hIx FROM libra.smalldb for update"); rs0 = stmt2.executeQuery("SELECT name,aff FROM libra.smalldb"); while ( rs.next() && rs0.next() ) { //String lastName = rs.getString("id"); hIx = rs.getString("hIx"); hIxInt = Integer.parseInt(hIx); //if hIx if (hIxInt==-1) continue; //name = rs.getString("name"); name = rs0.getString("name"); name1 = new String(name); System.out.println(name); //affiliationSmall = rs.getString("aff"); affiliationSmall = rs0.getString("aff"); //name = "\"" +name+ "\""; // Get matching names from large faculty table //String queryString = "SELECT id,name,hIx FROM libra.faculty WHERE name = " +name; //name = does not work names are similar but not same (in faculty and // smalldb) String query = "SELECT id,name,hIx FROM libra.faculty WHERE name like ?"; //String query = "SELECT id,name,hIx FROM libra.faculty for update of hIx WHERE name like ?"; PreparedStatement prepStmt = con.prepareStatement(query); String[] nameArr = name.split(" "); StringBuffer tmpSb = new StringBuffer(); for(int idx = 0;idx<nameArr.length;idx++) { tmpSb.append(nameArr[idx] + "%"); } name = tmpSb.toString(); prepStmt.setString(1, name); rs1 = prepStmt.executeQuery(); //Try to get matching names from faculty big db //Execute the query on faculty table //rs1 = stmt2.executeQuery(queryString); if(rs1.isClosed()) continue; count = 0; matchValues.clear(); affiliation.clear(); while(rs1.next()) { //name = rs1.getString("name"); id = Integer.parseInt(rs1.getString("id")); //idValues.add(id); tmpHix = Integer.parseInt(rs1.getString("hIx")); queryString = "SELECT aff FROM libra.affiliation WHERE id = "+id; rs2 = stmt3.executeQuery(queryString); //affiliation = rs1.getString("aff"); sb.delete(0, sb.length()); while (rs2.next()) { //Concatenate it to the same string using a stringbuffer sb.append(rs2.getString("aff")); //affiliation.add(rs2.getString("aff")); } affiliation.add(sb.toString()); count++; // if(count1) // { // moreFlag = true; // //Call fuzzy match function, store the distance values and select the // //affiliation that has the minimum distance from affiliationSmall // // //problem is here, affiliation.get Index: 2, Size: 2 // // matchValues.add(fuzzyMatch(affiliationSmall,affiliation.get(count))); // hixValues.add(tmpHix); // idValues.add(id); // } }//end of while rs1 -> faculty rs1.close(); int idx = 0; if(count>1) { moreFlag = true; //Call fuzzy match function, store the distance values and select the //affiliation that has the minimum distance from affiliationSmall //problem is here, affiliation.get Index: 2, Size: 2 matchValues.add(fuzzyMatch(affiliationSmall,affiliation.get(idx))); hixValues.add(tmpHix); idValues.add(id); idx++; } if(moreFlag) { Object obj = Collections.max(matchValues); float maxVal = Float.parseFloat(obj.toString()); //int tmpIdx = matchValues.indexOf(new Float(maxVal)); //get the index at which similarity between affiliation strings is maximum, //as returned by fuzzyMatch //int tmpIdx = matchValues.indexOf(maxVal); tmpIdx = matchValues.indexOf(maxVal); //get the hix at that index where the similarity is maximum //int tmpHidx = hixValues.get(tmpIdx); tmpHidx = hixValues.get(tmpIdx); tmpidIdx = idValues.get(tmpIdx); //update the smalldb table String updateQ = "UPDATE libra.smalldb SET hIx = ? WHERE name = ?"; //String updateQ = "UPDATE libra.smalldb SET hIx = ? WHERE current of "+cursorName; //PreparedStatement prepStmt1 = con.prepareStatement("UPDATE libra.smalldb SET hIx = ? WHERE current of "+cursorName); PreparedStatement prepStmt1 = con.prepareStatement(updateQ); //PreparedStatement prepStmt1 = con.prepareStatement(updateQ); prepStmt1.setString(2, name1); prepStmt1.setString(1, Integer.toString(tmpHidx)); prepStmt1.executeUpdate(updateQ); //prepStmt1.execute(); //stmt4.executeUpdate(updateQ); }//end of if //For matching names get the affiliation based on id from affiliation table //con.close(); //System.out.println(lastName); System.out.println(name); }//end of while rs -> smalldb rs.close(); // String updateQ = "UPDATE libra.smalldb1 SET hIx = "+Integer.toString(tmpHidx)+ "WHERE id = "+Integer.toString(tmpidIdx); // stmt4.executeUpdate(updateQ); con.close(); } catch (Exception e) { System.err.println("Got an exception! "); System.err.println(e.getMessage()); e.printStackTrace(); } } public static float fuzzyMatch(String affiliationSmall, String affiliation) { //float distance = 0; String[] temp = null; temp = affiliationSmall.split(" "); int index; //int index1 = affiliation.indexOf(affiliationSmall); int matchCount = 0; for (int idx = 0;idx<temp.length; idx++) { index = affiliation.indexOf(temp[idx]); if (index!=-1) { matchCount++; } } float tmpFloat = matchCount/temp.length; //int[] aff1= new int[affiliation1.length()]; //int[] aff2 = new int[affiliation2.length()]; return tmpFloat; } } i think it is because of the second select statement (rs0) Here is the error- Got an exception! You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 1 com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 1 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at com.mysql.jdbc.Util.handleNewInstance(Util.java:409) at com.mysql.jdbc.Util.getInstance(Util.java:384) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3562) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3494) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1960) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2114) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2690) at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1648) at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1567) at Jdbcexample1.main(Jdbcexample1.java:184)

    Read the article

  • Synchronize locale yml files tool in Rails

    - by Konstantinos
    I was wondering, is it possible to synchronize with any tool or gem or w/e 2 or more yml files? eg. i have the Greek yml file called el.yml el: layout: home: "??????" and the english one called en.yml en: layout: home: "Home" category: "Category" Is there any tool that based on a single yml file ie en.yml ( root ) that goes to the rest of the ymls and creates the missing translations with the default (en.yml) values? After running such a tool i would expect to have the el.yml become likes this: el: layout: home: "??????" category: "Category" I am using a similar tool in .NET RESX Synchronizer and it does exactly that, but for resx files.

    Read the article

  • Problem with JSTL and weblogic

    - by Jeune
    I get the following error when I run my java ee app on weblogic, javax.servlet.jsp.el.ELException: Cannot find PropertyDescriptor for 'name' for bean 'class java.lang.String' I want to print a list of artists with the following class, public class Artist { private int id; private String name; private String genre; public Artist() { } public Artist(String name){ this.name=name; } public void setId(int id) { this.id = id; } public int getId() { return id; } public void setName(String name) { this.name = name; } public String getName() { return name; } public String getGenre() { return genre; } public void setGenre(String genre) { this.genre = genre; } } The following lines of code seem to be causing the problem because when I remove it I don't get the error anymore. <c:forEach items="artists" var="artist"> <c:out value="${artist.name}"></c:out><br/> </c:forEach> When I use PrintWriter to print, it works: for (Artist artist:artists){ resp.getWriter().println(artist.getName()); } I am using java ee 2.4 and weblogic 9.2

    Read the article

  • mouse wheel scrolling work with f5 in app but don't work on web

    - by lina
    Good day! I have a web application on Silverlight 3. on ManePage I have a <ScrollViewer x:Name="sV" MouseWheel="sV_MouseWheel" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto"> with such code: private void sV_MouseWheel(object sender, MouseWheelEventArgs e) { var offset = sV.VerticalOffset; sV.ScrollToVerticalOffset(offset + (e.Delta * -0.5)); } When I press F5 button to debug my application, mouse wheel scrolling works well, but when I press F6 and then choose Web.Project prperty Debug-Start New Instance or publish my project on site, mouse wheel scrolling doesn't work :( what can I do?

    Read the article

  • Event on Item Marked as Read in Outlook - Delphi COM Add-in

    - by Tao
    I have a Delphi COM Add-in for Outlook (2000-2007) and am trying to find a way to register an event when an MailItem in Outlook is marked as read. I want to add an additional property to the item as/just after it is marked as read. Does anyone have any idea how to do this using the Outlook Object Model? I am also using Add-In-Express components to help get to additional properties events.

    Read the article

  • the MVCC effect on migration from oracle to db2

    - by Ryan Fernandes
    I have a simple (actually simplified :) ) scenario that is possibly the cause for the headache I've been having for the last few days... My current application (that serves 100's of users) currently uses Oracle as the database. I have no stored procs (I wish actually). Now, I've been asked if the product will work if I migrate to IBM DB2 as the database. So, after taking Oracle for granted all this while.... and having re-read Tom's article on MVCC (Multiversion Concurrency Control) and going through this post stating that DB2 is not 'on the list' or 'just tip-toeing in the area' as it were... I know I can't be sure that the product will work with DB2 as is. Is there no hope.. or is there a nice disclaimer I could use.. ?

    Read the article

  • How to Delete a Row with DataTables Plugin?

    - by chobo2
    Hi I am trying to delete a row using the DataTables plugin. First I don't get the example at all. What I have this is a user checks the row they want to delete. I do this then var row = $('#id :checked').parents('tr'); So I get the row of the checked checkbox. Lets assume they only check one box( if multiple where choose it might be different - might need a jquery each loop). I then try to do this var position = GlobalVariable.fnGetPosition(row); GlobalVariable.fnDeleteRow(position); position is always null and So I have no clue how to do this. http://datatables.net/api

    Read the article

  • What is the easiest way to get the property value from a passed lambda expression in an extension me

    - by Andrew Siemer
    I am writing a dirty little extension method for HtmlHelper so that I can say something like HtmlHelper.WysiwygFor(lambda) and display the CKEditor. I have this working currently but it seems a bit more cumbersome than I would prefer. I am hoping that there is a more straight forward way of doing this. Here is what I have so far. public static MvcHtmlString WysiwygFor<TModel, TProperty>(this HtmlHelper<TModel> helper, Expression<Func<TModel, TProperty>> expression) { return MvcHtmlString.Create(string.Concat("<textarea class=\"ckeditor\" cols=\"80\" id=\"", expression.MemberName(), "\" name=\"editor1\" rows=\"10\">", GetValue(helper, expression), "</textarea>")); } private static string GetValue<TModel, TProperty>(HtmlHelper<TModel> helper, Expression<Func<TModel, TProperty>> expression) { MemberExpression body = (MemberExpression)expression.Body; string propertyName = body.Member.Name; TModel model = helper.ViewData.Model; string value = typeof(TModel).GetProperty(propertyName).GetValue(model, null).ToString(); return value; } private static string MemberName<T, V>(this Expression<Func<T, V>> expression) { var memberExpression = expression.Body as MemberExpression; if (memberExpression == null) throw new InvalidOperationException("Expression must be a member expression"); return memberExpression.Member.Name; } Thanks!

    Read the article

  • delete file issue for Mac

    - by George2
    I am using a MacBook Pro running Mac OS X 10.5. I am new to this development environment, and previously worked on Windows. I have tried when select a file (e.g. a ppt file on desktop), then I press Delete key on keyboard. The file is not deleted (seems no effect). How to delete a file from keyboard? Thanks in advance.

    Read the article

  • Where can I find this HP modular keyboard or similar?

    - by Chaos Whistler
    I'm looking for an HP USB 104-Key Modular Keyboard with Detachable Number Pad (model number is DT530A, I believe), shown at this online store, where it's quite cheap but is sadly sold out. I've searched for hours on Google, and I've found several - the problem is they're Spanish or Greek keyboards but I need one in English (US keys preferred)! I would also be happy with a keyboard which is not exactly this but is similar, either with a detachable keypad or with no keypad at all, as long as the keyboard key layout and positioning is the same as on a standard keyboard. Can you help me find such a keyboard?

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >