Daily Archives

Articles indexed Tuesday June 8 2010

Page 22/122 | < Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >

  • program for calculating metrics in java

    - by senzacionale
    i need to calculate few metrics (CBO, NOC, DAC, LCOM, WMC, RFC and DIT metric). Program is written in jdeveloper and i do not know how to calculate this metrics. Migration to eclipse is not possible becouse code is not compiled. Does anyone know any good program for calculating metrics?

    Read the article

  • XCode Syntax Coloring Broken

    - by sw12345
    XCode frequently seems to lose it's mind, and doesn't color code system classes or provide correct "code sense" suggestions. This is endlessly frustrating. The question has been asked on at least three other occasions: http://stackoverflow.com/questions/2263994/problems-with-xcode-syntax-highlighting http://stackoverflow.com/questions/1627033/xcode-code-sense-color-completion-not-working http://stackoverflow.com/questions/2138047/xcode-code-loses-syntax-coloring I have switched by project version to/from 3.1-compatiable and 3.2-compatiable, completely restarting XCode before and after each change with no effect. I have rebuilt the code sense indexes and completely restarted XCode with no change. I have built my project to make sure there are no errors and restarted. I have copied my files (sans .svn files) to a different location - same problem. I've already completely disabled the argument "placeholders" because they screw up my documents when i type too fast... all I'm asking for is for the "esc" key to display the correct list of properties and methods.

    Read the article

  • thread reaches end but isn't removed

    - by pstanton
    I create a bunch of threads to do some processing: new Thread("upd-" + id){ @Override public void run(){ try{ doSomething(); } catch (Throwable e){ LOG.error("error", e); } finally{ LOG.debug("thread death"); } } }.start(); I know i should be using a threadPool but i need to understand the following problem before i change it: I'm using eclipse's debugger and looking at the threads in the debug pane which lists active threads. Many of them complete as you would expect, and are removed from the debug pane, however some seem to stay in the list of active threads even though the log shows the "thread death" entry for these. When i attempt to debug these threads, they either do not pause for debugging or show an error dialog: "A timeout occurred while retrieving stack frames for thread: upd-...". there is some synchronization going on within the doSomething() call but i'm fairly sure it's ok and since the "thread death" log is being called i'm assuming these threads aren't deadlocked in that method. i don't do any Thread.join()s, however i do call a third party API but doubt they do either. Can anyone think of another reason these threads are lingering? Thanks. EDIT: I created this test to check the Garbage Collection theory: Thread thread = new Thread("!!!!!!!!!!!!!!!!") { @Override public void run() { System.out.println("running"); ThreadUs.sleepQuiet(5000); System.out.println("finished"); // <-- thread removed from list here } }; thread.start(); ThreadUs.sleepQuiet(10000); System.out.println(thread.isAlive()); // <-- thread already removed from list but hasn't been GC'd ThreadUs.sleepQuiet(10000); this proves that it is nothing to do with garbage collection as eclipse removes the thread from the thread list as soon as it completes and isn't waiting for the object to be de-referenced/GC'd.

    Read the article

  • T-SQL: How Do I Create A "Private" Function Inside A Stored Procedure

    - by RPM1984
    Okay so im writing a SQL Server 2008 Stored Procedure (maintenance script). In doing so, being a good boy i've done plenty of error handling, checking rowcounts, printing output messages, etc But in doing this, ive found myself writing over and over again something like this: SELECT @RowsAffected = @@ROWCOUNT IF @RowsAffected > 0 BEGIN PRINT CAST(@RowsAffected, NVARCHAR(2)) + 'rows updated.' END Or debug messages like this: PRINT 'User ' + CAST(@UserId AS NVARCHAR(5)) + ' modified successfully' Is there a way i can create a kind of 'subroutine' inside the stored procedure (like a private method) that can accept something as a parameter (doesnt have to though) and do some logic? I want to be able to do something like this: CheckRowCounts Or this: PrintUserUpatedMessage(@UserId) Which would then perform the above logic (check rowcount, print message, etc) And yes obviously i can create a UDF, but then i would need to create/drop it etc as this logic is only required for the life of the execution of this stored procedure. Getting sick and tired of writing the same code over and over again, and changing all the different areas ive used it when i get an error =) Can anyone help?

    Read the article

  • template function error..

    - by sil3nt
    Hi there, I have function which takes in an parameter of a class called "Triple", and am returning the averge of 3 values of type float. template <typename ElemT> float average(Triple ElemT<float> &arg){ float pos1 = arg.getElem(1); float pos2 = arg.getElem(2); float pos3 = arg.getElem(3); return ( (pos1+pos2+po3) /3 ); } when i try compiling this i get q2b.cpp:32: error: template declaration of `float average' q2b.cpp:32: error: missing template arguments before "ElemT" not quite sure what this means.

    Read the article

  • writing large excel spreadsheets

    - by pstanton
    has anybody found a library that works well with large spreadsheets? I've tried apache's POI but it fails miserably working with large files - both reading and writing. It uses massive amounts of memory leaving you needing a supercomputer to parse or create a 20+mb spreadsheet. Surely there is a more memory efficient way and someone has written it?!

    Read the article

  • Aggregating a list of dates to start and end date

    - by Joe Mako
    I have a list of dates and IDs, and I would like to roll them up into periods of consucitutive dates, within each ID. For a table with the columns "testid" and "pulldate" in a table called "data": | A79 | 2010-06-02 | | A79 | 2010-06-03 | | A79 | 2010-06-04 | | B72 | 2010-04-22 | | B72 | 2010-06-03 | | B72 | 2010-06-04 | | C94 | 2010-04-09 | | C94 | 2010-04-10 | | C94 | 2010-04-11 | | C94 | 2010-04-12 | | C94 | 2010-04-13 | | C94 | 2010-04-14 | | C94 | 2010-06-02 | | C94 | 2010-06-03 | | C94 | 2010-06-04 | I want to generate a table with the columns "testid", "group", "start_date", "end_date": | A79 | 1 | 2010-06-02 | 2010-06-04 | | B72 | 2 | 2010-04-22 | 2010-04-22 | | B72 | 3 | 2010-06-03 | 2010-06-04 | | C94 | 4 | 2010-04-09 | 2010-04-14 | | C94 | 5 | 2010-06-02 | 2010-06-04 | This is the the code I came up with: SELECT t2.testid, t2.group, MIN(t2.pulldate) AS start_date, MAX(t2.pulldate) AS end_date FROM(SELECT t1.pulldate, t1.testid, SUM(t1.check) OVER (ORDER BY t1.testid,t1.pulldate) AS group FROM(SELECT data.pulldate, data.testid, CASE WHEN data.testid=LAG(data.testid,1) OVER (ORDER BY data.testid,data.pulldate) AND data.pulldate=date (LAG(data.pulldate,1) OVER (PARTITION BY data.testid ORDER BY data.pulldate)) + integer '1' THEN 0 ELSE 1 END AS check FROM data ORDER BY data.testid, data.pulldate) AS t1) AS t2 GROUP BY t2.testid,t2.group ORDER BY t2.group; I use the use the LAG windowing function to compare each row to the previous, putting a 1 if I need to increment to start a new group, I then do a running sum of that column, and then aggregate to the combinations of "group" and "testid". Is there a better way to accomplish my goal, or does this operation have a name? I am using PostgreSQL 8.4

    Read the article

  • Upgrade to iPhone 3.0 sdk and now simulator shows blank screen.

    - by NoShitMcGee
    I have an iPhone app that uses an UITabBarController, which contains two UINavigationControllers, each of which in turn contains one or more TableViewControllers (actually, customized UIViewControllers implementing UITableViewDelegate and UITableViewDataSource. ) On launch, it displays the UITabBarController with one of the tableviews displayed. Everything is coded; Interface Builder was NOT used to make any of the UI stuff. It was written in SDK 2. It worked fine in sdk 2. I recently updated to SDK 3.0. In Info, I set the Base SDK setting to iPhone Simulator 3.0. Now, when I launch the application in Simulator, I see only a blank white screen with the status bar at the top. No signs of my app. However, when I exit the app, the missing tableview displays briefly as the exiting animation is playing. Also, on the blank white screen I can still click where the navigation buttons should be and find that, when I exit the app and the missing screen briefly displays, that navigation has taken me to another screen. So the buttons work, and presumably the tableviewcells are there, they just cannot be seen. Has anyone seen anything like this? Does anyone have any idea what is causing it and how I can fix it? I noticed that sample apps, such as SQLiteBooks, seem to work fine when updating to SDK 3.0. My app isn't very much different from SQLiteBooks in terms of technologies used, except that, as I said above, I do not use Interface Builder. Thanks

    Read the article

  • Unload image of UIImageView thats offscreen

    - by ludo
    Hi, I'm coding an application on Ipad, in a certain point of my application I present a ViewController with the presentModalViewController. My ViewController is a UISScrollView who take the larger of the modalView and inside it I display some images, I allow pagingEnabled so I can see all my images inside the scrollView. Sometimes I have to display more than 10 images inside the scrollView, so I have this error RECEIVE MEMORY WARNING LEVEL=1 after this one RECEIVE MEMORY WARNING LEVEL=2 and finnaly the debugger exited due to signal 10 (Sigbus). What can I do? is there a way to unload the image thats offscreen? or others things to do? Thanks,

    Read the article

  • Design ideas for

    - by ZeroVector
    I need to design and I'm looking in to using WCF to accomplish this. Basically here is how I have it: Server process: Generate list of files to transfer across multiple FTP/SFTP sites in to a queue. Client(s): Talk to server to get files to transfer. Transfer the files acquired. All the data necessary to transfer the files will be present. Once transferred successfully, notify the server to remove it from the queue. Also, make sure no other client is trying to perform the transfer. Are there are any good articles/design patterns to use? I think it sounds like a good candidate for WCF since ideally it would be load balanced against a few machines. Development will be in C#/.NET 3.5.

    Read the article

  • Loading package html + resources into webview

    - by mobileopen
    I would like to know how I can display a HTML page in webview with references to relative/local images. The goal is to have the html page and all linked images contained in the android application package itself. Where would I need to place the assets (assets directory?) and how do I reference these so they load into the webview? Thanx! Sven

    Read the article

  • SQL Server connection help...

    - by Gopal
    Using SQL Server 2005 I have the server connection name as (server1) in windows authentication mode, I want to change windows authentication mode to sql server authentication mode... when i try to change sql server authentication mode with username = sa & password = sa, it showing error... How to change the authentication mode or how to create a new sql connection?

    Read the article

  • Android: How can we change the view in the tabs?

    - by achie
    I want to provide a clickthrough on the list in a tab which opens another view. I need to open the new view within the same tab. I then need to provide a back button on the changed layout to change the view to original view. I have tried this. Intent intentA = new Intent(this, AView.class); Now I am trying to access the tabSpec from main activity class[MainTabView] and set the intent as follows. MainTabView.tabSpec1.setContent(intentA); MainTabView.mTabHost.setCurrentTab(0); MainTabView.mTabHost.invalidate(); But this does not change the view immediately but changes it when I go to another tab and come to the starting tab. How can I make it to refresh it as soon as the content has been changed to another intent?

    Read the article

  • C++ rvalue temporaries in template

    - by aaa
    hello. Can you please explain me the difference between mechanism of the following: int function(); template<class T> void function2(T&); void main() { function2(function()); // compiler error, instantiated as int & const int& v = function(); function2(v); // okay, instantiated as const int& } is my reasoning correct with respect to instantiation? why is not first instantiated as const T&? Thank you

    Read the article

  • Problem Using POI To Set CellStyleProperty With HSSFCellUtil

    - by Alvin Sim
    I have a Java class which uses Apache POI to generate reports in Excel. When I run the Java class from my IDE or command prompt, I only see warning messages from LOG4J as below: log4j:WARN No appenders could be found for logger (org.apache.commons.beanutils.converters.BooleanConverter). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. Despite the warning messages, the report was generated successfully. But when I run it from my web app, which uses JSP and submits the form to a Servlet which calls the Java class, the Java class seems to have problems setting the style properties to the cell. Below are the Java code and also the stack trace. I'm testing this on a Standalone OC4J and the IDE which I'm using is Oracle's JDeveloper. And the Java JDK is 1.4.2. I've been looking high and low the whole day yesterday but can't seem to find out why. Code: region = new Region(1, (short) 1, 5, (short)2); sheet.addMergedRegion(region); HSSFRegionUtil.setBorderBottom( (short) 1, region, sheet, workBook ); Stack trace: 10/06/07 16:03:17 SvltRptProcessor ACTION=print_to_file RPT_CLASSNAME=com.reports.BP.DailySalesBudgetExcelRpt DES_TYPE=file DES_FORMAT=xls 10/06/07 16:03:17 rptFilename=/oracle/reports//20100607_160317_BP_DailySalesBudgetByPmgrp_OPR.xls 10/06/07 16:03:17 ReportRunner printToFile execute -> com.reports.BP.DailySalesBudgetExcelRpt 10/06/07 16:03:17 enter daily sales budget excel rpt -----> print() 10/06/07 16:03:18 Tutalii: C:\oc4j10gmy\j2ee\home\applib\poi-2.5.1.jar archive 10/06/07 16:03:19 org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor 10/06/07 16:03:19 at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:509) 10/06/07 16:03:19 at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:285) 10/06/07 16:03:19 at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:255) 10/06/07 16:03:19 at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:381) 10/06/07 16:03:19 at org.apache.commons.beanutils.ConvertUtilsBean.<init>(ConvertUtilsBean.java:157) 10/06/07 16:03:19 at org.apache.commons.beanutils.BeanUtilsBean.<init>(BeanUtilsBean.java:117) 10/06/07 16:03:19 at org.apache.commons.beanutils.BeanUtilsBean$1.initialValue(BeanUtilsBean.java:68) 10/06/07 16:03:19 at org.apache.commons.beanutils.ContextClassLoaderLocal.get(ContextClassLoaderLocal.java:153) 10/06/07 16:03:19 at org.apache.commons.beanutils.BeanUtilsBean.getInstance(BeanUtilsBean.java:80) 10/06/07 16:03:19 at org.apache.commons.beanutils.PropertyUtilsBean.getInstance(PropertyUtilsBean.java:114) 10/06/07 16:03:19 at org.apache.commons.beanutils.PropertyUtils.describe(PropertyUtils.java:209) 10/06/07 16:03:19 at org.apache.poi.hssf.usermodel.contrib.HSSFCellUtil.setCellStyleProperty(HSSFCellUtil.java:174) 10/06/07 16:03:19 at org.apache.poi.hssf.usermodel.contrib.HSSFRegionUtil. setBorderBottom(HSSFRegionUtil.java:153) 10/06/07 16:03:19 at com.reports.BP.DailySalesBudgetExcelRpt.setRegion(DailySalesBudgetExcelRpt.java:773) 10/06/07 16:03:19 at com.reports.BP.DailySalesBudgetExcelRpt.createHdr(DailySalesBudgetExcelRpt.java:308) 10/06/07 16:03:19 at com.reports.BP.DailySalesBudgetExcelRpt.start(DailySalesBudgetExcelRpt.java:272) 10/06/07 16:03:19 at com.reports.BP.DailySalesBudgetExcelRpt.print(DailySalesBudgetExcelRpt.java:222) 10/06/07 16:03:19 at com.servlet.RPT.ReportRunner.printToFile(ReportRunner.java:601) 10/06/07 16:03:19 at com.servlet.RPT.ReportRunner.doPrint(ReportRunner.java:302) 10/06/07 16:03:19 at com.servlet.RPT.ReportRunner.run(ReportRunner.java:270) 10/06/07 16:03:19 at java.lang.Thread.run(Thread.java:619) 10/06/07 16:03:19 Caused by: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor 10/06/07 16:03:19 at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:420) 10/06/07 16:03:19 at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:502) 10/06/07 16:03:19 ... 20 more 10/06/07 16:03:19 Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Category 10/06/07 16:03:19 at java.lang.Class.getDeclaredConstructors0(Native Method) 10/06/07 16:03:19 at java.lang.Class.privateGetDeclaredConstructors(Class. java:2389) 10/06/07 16:03:19 at java.lang.Class.getConstructor0(Class.java:2699) 10/06/07 16:03:19 at java.lang.Class.getConstructor(Class.java:1657) 10/06/07 16:03:19 at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:417) 10/06/07 16:03:19 ... 21 more 10/06/07 16:03:19 Caused by: java.lang.ClassNotFoundException: org.apache.log4j. Category 10/06/07 16:03:19 at java.net.URLClassLoader$1.run(URLClassLoader.java:202 ) 10/06/07 16:03:19 at java.security.AccessController.doPrivileged(Native Method) 10/06/07 16:03:19 at java.net.URLClassLoader.findClass(URLClassLoader.java :190) 10/06/07 16:03:19 at java.lang.ClassLoader.loadClass(ClassLoader.java:307) 10/06/07 16:03:19 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) 10/06/07 16:03:19 at java.lang.ClassLoader.loadClass(ClassLoader.java:248) 10/06/07 16:03:19 ... 26 more org.apache.commons.lang.exception.NestableException: Couldn't setCellStyleProperty. at org.apache.poi.hssf.usermodel.contrib.HSSFCellUtil.setCellStyleProperty(HSSFCellUtil.java:209) at org.apache.poi.hssf.usermodel.contrib.HSSFRegionUtil.setBorderBottom(HSSFRegionUtil.java:153) at com.reports.BP.DailySalesBudgetExcelRpt.setRegion(DailySalesBudgetExcelRpt.java:773) at com.reports.BP.DailySalesBudgetExcelRpt.createHdr(DailySalesBudgetExcelRpt.java:308) at com.reports.BP.DailySalesBudgetExcelRpt.start(DailySalesBudgetExcelRpt.java:272) at com.reports.BP.DailySalesBudgetExcelRpt.print(DailySalesBudgetExcelRpt.java:222) at com.servlet.RPT.ReportRunner.printToFile(ReportRunner.java:601) at com.servlet.RPT.ReportRunner.doPrint(ReportRunner.java:302) at com.servlet.RPT.ReportRunner.run(ReportRunner.java:270) at java.lang.Thread.run(Thread.java:619) Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:509) at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:285) at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:255) at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:381) at org.apache.commons.beanutils.ConvertUtilsBean.<init>(ConvertUtilsBean.java:157) at org.apache.commons.beanutils.BeanUtilsBean.<init>(BeanUtilsBean.java:117) at org.apache.commons.beanutils.BeanUtilsBean$1.initialValue(BeanUtilsBean.java:68) at org.apache.commons.beanutils.ContextClassLoaderLocal.get(ContextClassLoaderLocal.java:153) at org.apache.commons.beanutils.BeanUtilsBean.getInstance(BeanUtilsBean.java:80) at org.apache.commons.beanutils.PropertyUtilsBean.getInstance(PropertyUtilsBean.java:114) at org.apache.commons.beanutils.PropertyUtils.describe(PropertyUtils.java:209) at org.apache.poi.hssf.usermodel.contrib.HSSFCellUtil.setCellStyleProperty(HSSFCellUtil.java:174) ... 9 more Caused by: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:420) at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactory Impl.java:502) ... 20 more Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Category at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389) at java.lang.Class.getConstructor0(Class.java:2699) at java.lang.Class.getConstructor(Class.java:1657) at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:417) ... 21 more Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Category at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) ... 26 more

    Read the article

  • Why is the exception thrown on memcpy using during copying LPBYTE to LPTSTR (clipboard)?

    - by user46503
    Hello, I have a LPBYTE array (taken from file) and I need to copy it into LPTSRT (actually into the clipboard). The trouble is copying work but unstable, sometime an exception was thrown (not always) and I don't understand why. The code is: FILE *fConnect = _wfopen(connectFilePath, _T("rb")); if (!fConnect) return; fseek(fConnect, 0, SEEK_END); lSize = ftell(fConnect); rewind(fConnect); LPBYTE lpByte = (LPBYTE) malloc(lSize); fread(lpByte, 1, lSize, fConnect); lpByte[lSize] = 0; fclose(fConnect); //Copy into clipboard BOOL openRes = OpenClipboard(NULL); if (!openRes) return; DWORD err = GetLastError(); EmptyClipboard(); HGLOBAL hText; hText = GlobalAlloc(GMEM_MOVEABLE, (lSize+ sizeof(TCHAR))); LPTSTR sMem = (TCHAR*)GlobalLock(hText); memcpy(sMem, lpByte, (lSize + sizeof(TCHAR))); The last string is the place where the exception is thrown. Thanks a lot

    Read the article

  • Events doesn't fire when using UpdatePanel

    - by nitinkhanna
    Hi, What I did is, I have made 2 user controls. One control is inside the other. NoW one control has a buttton and a data grid and datalist in it. When pressing button I am filling datagrid while datalist visiblity false. This is working fine. But now when I press some link button in datalist data, it should call item_command event but it is not calling. I have also used a Updatepanel as a wrapper(all controls are inside it). Please suggest what may be the reason for that. Thanks

    Read the article

< Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >