Daily Archives

Articles indexed Thursday April 22 2010

Page 3/123 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Can't Convert NSNamedColorSpace to NSDeviceRGBColorSpace?

    - by Bret
    Can anyone tell me why this colorUsingColorSpaceName is returning nil? For example, the following code block will print "deviceColor is nill": NSColor *color = [NSColor windowBackgroundColor]; NSColor *deviceColor = [color colorUsingColorSpaceName: NSDeviceRGBColorSpace]; if(deviceColor == nil) NSLog(@"deviceColor is nill"); How can I convert an NSColor in the NSNamedColorSpace? I need to be able to get the color components so i can convert an NSColor to a CGColorRef

    Read the article

  • How to get a result from output parameter(SYS_REFCURSOR) of Oracle stored procedure in iBATIS 3(by u

    - by yjacket
    I got an example how to call oracle SP in iBATIS 3 without a map file. And now I understand how to call it. But I got another problem that how to get a result from output parameter(Oracle cursor). A part of exception messages is "There is no setter for property named 'rs' in 'class java.lang.Class". Below is my code. Does anyone can help me? Oracle Stored Procedure: CREATE OR REPLACE PROCEDURE getProducts ( rs OUT SYS_REFCURSOR ) IS BEGIN OPEN rs FOR SELECT * FROM Products; END getProducts; Interface: public interface ProductMapper { @Select("call getProducts(#{rs,mode=OUT,jdbcType=CURSOR})") @Options(statementType = StatementType.CALLABLE) List<Product> getProducts(); } DAO: public class ProductDAO { public List<Product> getProducts() { return mapper.getProducts(); // mapper is ProductMapper } } Full Error Message: Exception in thread "main" org.apache.ibatis.exceptions.IbatisException: ### Error querying database. Cause: org.apache.ibatis.reflection.ReflectionException: Could not set property 'rs' of 'class org.apache.ibatis.reflection.MetaObject$NullObject' with value 'oracle.jdbc.driver.OracleResultSetImpl@1a001ff' Cause: org.apache.ibatis.reflection.ReflectionException: There is no setter for property named 'rs' in 'class java.lang.Class' ### The error may involve defaultParameterMap ### The error occurred while setting parameters ### Cause: org.apache.ibatis.reflection.ReflectionException: Could not set property 'rs' of 'class org.apache.ibatis.reflection.MetaObject$NullObject' with value 'oracle.jdbc.driver.OracleResultSetImpl@1a001ff' Cause: org.apache.ibatis.reflection.ReflectionException: There is no setter for property named 'rs' in 'class java.lang.Class' at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:8) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:61) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:53) at org.apache.ibatis.binding.MapperMethod.executeForList(MapperMethod.java:82) at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:63) at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:35) at $Proxy8.getList(Unknown Source) at com.dao.ProductDAO.getList(ProductDAO.java:42) at com.Ibatis3Test.main(Ibatis3Test.java:30) Caused by: org.apache.ibatis.reflection.ReflectionException: Could not set property 'rs' of 'class org.apache.ibatis.reflection.MetaObject$NullObject' with value 'oracle.jdbc.driver.OracleResultSetImpl@1a001ff' Cause: org.apache.ibatis.reflection.ReflectionException: There is no setter for property named 'rs' in 'class java.lang.Class' at org.apache.ibatis.reflection.wrapper.BeanWrapper.setBeanProperty(BeanWrapper.java:154) at org.apache.ibatis.reflection.wrapper.BeanWrapper.set(BeanWrapper.java:36) at org.apache.ibatis.reflection.MetaObject.setValue(MetaObject.java:120) at org.apache.ibatis.executor.resultset.FastResultSetHandler.handleOutputParameters(FastResultSetHandler.java:69) at org.apache.ibatis.executor.statement.CallableStatementHandler.query(CallableStatementHandler.java:44) at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:55) at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:41) at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:94) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:72) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:59) ... 7 more Caused by: org.apache.ibatis.reflection.ReflectionException: There is no setter for property named 'rs' in 'class java.lang.Class' at org.apache.ibatis.reflection.Reflector.getSetInvoker(Reflector.java:300) at org.apache.ibatis.reflection.MetaClass.getSetInvoker(MetaClass.java:97) at org.apache.ibatis.reflection.wrapper.BeanWrapper.setBeanProperty(BeanWrapper.java:146) ... 16 more

    Read the article

  • How to upload a file with watir and IE?

    - by karlthorwald
    I am writing a watir script to test an upload form. But the script does not automatically choose the file that is to be uploaded from my harddrive. Instead IE stops with the file chooser dialog open. As soon as I manually select the to be uploaded file in the dialog and click ok, watir continues as desired. I wonder why it stops. This is from my watir script: ie.file_field(:name, 'upload').set("s:\\localwatir\\Test_Pdf.pdf") ie.button(:name, 'submit').click I got the code from this page: http://wiki.openqa.org/display/WTR/File+Uploads This is the form: <form name="form1" enctype="multipart/form-data" method="post" action="uploadlegacy.php"> <input type="file" name="upload" size="30"> <input type="submit" name="submit" value="upload"> </form> I have found this manual http://svn.openqa.org/svn/watir/trunk/watir/unittests/filefield_test.rb also, but as I do not know what $htmlRoot stands for, I cannot really follow it. Does that mean, I have to put some "file///" into the parameter for set()? If so, how exactly? I am using IE 6 for the testing.

    Read the article

  • Is it possible to inject a bean into a spring form bean

    - by Mike
    I tried to do it 2 different ways, but neither way worked. @Component public class EmailForm{ ... private QuestionDAO questionDAO; ... @Autowired public void setQuestionDAO(QuestionDAO questionDAO) { this.questionDAO = questionDAO; } ... Another way: @Component public class EmailForm implements ApplicationContextAware { ... public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { this.questionDAO = (QuestionDAO)applicationContext.getBean("questionDAO"); } ... Neither way results in questionDAO being injected Form bean is populated by spring: @RequestMapping(method = RequestMethod.POST) public String submit(@Valid final EmailForm emailForm, BindingResult result, final Model model) {

    Read the article

  • A problem regarding dll inheritance

    - by Adam
    Hello all I have created a dll that will be used by multiple applications, and have created an installer package that installs it to the program files, as well as adds it to the Global Assembly Cache. The dll itself uses log4net, and requires a xml file for the logging definitions. Therefore when the installer is run, the following files get copied to the install directory within program files: The main dll that I developed - The Log4Net.dll - the Log4Net.xml file I am now experiencing a problem. I have created a test console application for experimentation. I have added my dll as a reference, and set the 'local copy' flag to false. When I compile the test console exe however, I noticed that it has copied the log4net.dll and log4net.xml files to the bin directory. And when running the test console, it appears that it will only work if the log4net.dll is in the same directory as the exe. This is dispite the fact that the test console application does not use log4net, only the dll that was added as a reference does. Is there some way to have it so that the log4net.dll & xml files used will be the ones that were installed to the program files, rather than any application needed to copy over local copies? The applications that will be using my dll will not be using log4net, only the dll that they are referencing uses it. Many thanks

    Read the article

  • Constructing colours for maximum contrast

    - by Martin
    I want to draw some items on screen, each item is in one of N sets. The number of sets changes all the time, so I need to calculate N different colours which are as different as possible (to make it easy to identify what is in which set). So, for example with N = 2 my results would be black and white. With three I guess I would get all red, all green, all blue. For all four, it's less obvious what the correct answer is, and this is where I'm having trouble.

    Read the article

  • Samba Configuration with Webmin

    <b>Linux.com:</b> "The Webmin administration tool is a very powerful suite of web-based admin tools (for the Linux operating system) that have been around for some time. Webmin includes numerous modules covering nearly every aspect of Linux administration."

    Read the article

  • Apache and linux file permissions

    - by morpheous
    I recently moved a Symfony 1.3.2 website (a PHP web framework), from a windows machine to Linux (Ubuntu 9.10). Ever since then, I have had all kinds of problems involving file permission (even though the app run without any of these problems on windows). I run symfony fix-perms which applied a 777 mask to the web directory (presumably, including its sub folders) - (as an aside) I think that is a potential security hole ... I have been meaning to come in here to ask how to correctly set permissions. Currently, when attempting to save a file from my website, I am getting the following error: PHP Warning: imagejpeg() [0function.imagejpeg0]: Unable to open '/home/morpheous/work/webdev/frameworks/symfony/sites/project1/web/uploads/../images/thumbnail/959cd604cf6115014a3703bef5a50486a5520642.jpg' for writing: Permission denied in /home/morpheous/work/webdev/frameworks/symfony/sites/project1/apps/frontend/lib Here are the permissions on the folders: web drwxr-xr-x 16 morpheous morpheous 4096 2010-02-24 21:01 web web/uploads/../images drwxr-xr-x 13 morpheous morpheous 12288 2010-04-09 15:25 images web/uploads/../images/thumbnail drwxr-xr-x 3 morpheous morpheous 4096 2010-02-24 20:44 thumbnail Can someone kindly tell me how to set the permissions so that my website (presumably running as the Apache daemon) can write the files to the directory required above?

    Read the article

  • Does Java 6 open a default port for JMX remote connections?

    - by Bob Cross
    My specific question has to do with JMX as used in JDK 1.6: if I am running a Java process using JRE 1.6 with com.sun.management.jmxremote in the command line, does Java pick a default port for remote JMX connections? Backstory: I am currently trying to develop a procedure to give to a customer that will enable them to connect to one of our processes via JMX from a remote machine. The goal is to facillitate their remote debugging of a situation occurring on a real-time display console. Because of their service level agreement, they are strongly motivated to capture as much data as possible and, if the situation looks too complicated to fix quickly, to restart the display console and allow it to reconnect to the server-side. I am aware the I could run jconsole on JDK 1.6 processes and jvisualvm on post-JDK 1.6.7 processes given physical access to the console. However, because of the operational requirements and people problems involved, we are strongly motivated to grab the data that we need remotely and get them up and running again. EDIT: I am aware of the command line port property com.sun.management.jmxremote.port=portNum The question that I am trying to answer is, if you do not set that property at the command line, does Java pick another port for remote monitoring? If so, how could you determine what it might be?

    Read the article

  • InstallShield setup and Click-Once

    - by QQQ
    Hi InstallShield 10 apparently can create an installer and integrate with click once, but this feature is not active in trial version. Anyway I tried to create a click once deployment by hand (using mage) and succeed with a sample wpf application, what I want to do is click once with an installShield setup.exe file, buy it seems that it's not a .net application and I can't use it for click once. Does anyone know how installShield manages this with it's click once feature? or how can I create click once with the regular setup.exe file. Thanks.

    Read the article

  • Why does Gnumake from parent directory behave differently?

    - by WilliamKF
    I am stumped as to why when I do a gnumake from the parent directory it behaves incorrectly, whereas, if I cd to the subdirectory and do gnumake it works correctly. In the parent makefile, I have a rule like this: .PHONY: zlib-1.2.5 zlib-1.2.5: @ echo Issuing $(MAKE) in $@ ... pushd zlib-1.2.5; make; popd Which gives different result than doing the same from the toplevel pushd zlib-1.2.5; make; popd There is a something from the parent makefile that is making its way into the subdirectory makefile and causing it to behave incorrectly, but I don't know how to find it. The symptom I see is that the subdirectory config generated makefile rule for zlib misses the dependencies and I get this result going straight to the ar without generating the .o(s) first: cd ~/src; make zlib-1.2.5 CPPFLAGS_AUTO = < > Issuing make in zlib-1.2.5 ... pushd zlib-1.2.5; make; popd ~/src/zlib-1.2.5 ~/src make[1]: Entering directory `/disk2/user/src/zlib-1.2.5' ar rc libz.a adler32.o compress.o crc32.o deflate.o gzclose.o gzlib.o gzread.o gzwrite.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o ar: adler32.o: No such file or directory make[1]: *** [libz.a] Error 1 gcc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -o libz.so.1.2.5 adler32.lo compress.lo crc32.lo deflate.lo gzclose.lo gzlib.lo gzread.lo gzwrite.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo uncompr.lo zutil.lo -lc -L. libz.a gcc: adler32.lo: No such file or directory gcc: compress.lo: No such file or directory gcc: crc32.lo: No such file or directory gcc: deflate.lo: No such file or directory [...] make[1]: *** [libz.so.1.2.5] Error 1 make[1]: Target `all' not remade because of errors. make[1]: Leaving directory `/disk2/user/src/zlib-1.2.5' ~/src Versus from the zlib directory where it works correctly: cd ~/src/zlib-1.2.5; make gcc -O3 -D_LARGEFILE64_SOURCE=1 -c -o example.o example.c gcc -O3 -D_LARGEFILE64_SOURCE=1 -c -o adler32.o adler32.c gcc -O3 -D_LARGEFILE64_SOURCE=1 -c -o compress.o compress.c gcc -O3 -D_LARGEFILE64_SOURCE=1 -c -o crc32.o crc32.c [...] gcc -O3 -D_LARGEFILE64_SOURCE=1 -c -o zutil.o zutil.c ar rc libz.a adler32.o compress.o crc32.o deflate.o gzclose.o gzlib.o gzread.o gzwrite.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o (ranlib libz.a || true) >/dev/null 2>&1 gcc -O3 -D_LARGEFILE64_SOURCE=1 -o example example.o -L. libz.a gcc -O3 -D_LARGEFILE64_SOURCE=1 -c -o minigzip.o minigzip.c gcc -O3 -D_LARGEFILE64_SOURCE=1 -o minigzip minigzip.o -L. libz.a mkdir objs 2>/dev/null || test -d objs gcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DPIC -c -o objs/adler32.o adler32.c mv objs/adler32.o adler32.lo mkdir objs 2>/dev/null || test -d objs gcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DPIC -c -o objs/compress.o compress.c mv objs/compress.o compress.lo [...] mkdir objs 2>/dev/null || test -d objs gcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DPIC -c -o objs/zutil.o zutil.c mv objs/zutil.o zutil.lo gcc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -o libz.so.1.2.5 adler32.lo compress.lo crc32.lo deflate.lo gzclose.lo gzlib.lo gzread.lo gzwrite.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo uncompr.lo zutil.lo -lc -L. libz.a rm -f libz.so libz.so.1 ln -s libz.so.1.2.5 libz.so ln -s libz.so.1.2.5 libz.so.1 rmdir objs gcc -O3 -D_LARGEFILE64_SOURCE=1 -o examplesh example.o -L. libz.so.1.2.5 gcc -O3 -D_LARGEFILE64_SOURCE=1 -o minigzipsh minigzip.o -L. libz.so.1.2.5 gcc -O3 -D_LARGEFILE64_SOURCE=1 -o example64 example64.o -L. libz.a gcc -O3 -D_LARGEFILE64_SOURCE=1 -o minigzip64 minigzip64.o -L. libz.a

    Read the article

  • Refresh tables in Visual Studio?

    - by Curtis White
    How can I refresh the tab in Visual Studio for a database table? Currently I re-open the table but I would think there is a way to refresh the table. I am referring to tables opened via the Server Explorer/SQL Express. The clear results does not seem to refresh.

    Read the article

  • In Ruby, how can I initialize instance variables in new objects of core classes created from literal

    - by Ollie Saunders
    class Object attr_reader :foo def initialize @foo = 'bar' end end Object.new.foo # => 'bar' ''.foo # => nil //.foo # => nil [].foo # => nil I want them all to return 'bar' Am aware that you can do this already: class Object def foo 'bar' end end But I specifically want to initialize a state variable. Also note that this doesn't work. class String alias_method :old_init, :initialize def initialize(*args) super old_init(*args) end end class Object attr_reader :foo def initialize @foo = 'bar' super end end ''.foo # => nil Nor does this: class String attr_reader :foo def initialize @foo = 'bar' end end ''.instance_variables # => [] I'm beginning to think that this isn't actually possible.

    Read the article

  • Lua task scheduling

    - by Martin
    I've been writing some scripts for a game, the scripts are written in Lua. One of the requirements the game has is that the Update method in your lua script (which is called every frame) may take no longer than about 2-3 milliseconds to run, if it does the game just hangs. I solved this problem with coroutines, all I have to do is call Multitasking.RunTask(SomeFunction) and then the task runs as a coroutine, I then have to scatter Multitasking.Yield() throughout my code, which checks how long the task has been running for, and if it's over 2 ms it pauses the task and resumes it next frame. This is ok, except that I have to scatter Multitasking.Yield() everywhere throughout my code, and it's a real mess. Ideally, my code would automatically yield when it's been running too long. So, Is it possible to take a Lua function as an argument, and then execute it line by line (maybe interpreting Lua inside Lua, which I know is possible, but I doubt it's possible if all you have is a function pointer)? In this way I could automatically check the runtime and yield if necessary between every single line.

    Read the article

  • Problem with using APACHE-POI to convert PPT to Image

    - by SpawnCxy
    Hi all, I got a problem when I try to use Apache POI project to convert my PPT to Images.My code as follows: FileInputStream is = new FileInputStream("test.ppt"); SlideShow ppt = new SlideShow(is); is.close(); Dimension pgsize = ppt.getPageSize(); Slide[] slide = ppt.getSlides(); for (int i = 0; i < slide.length; i++) { BufferedImage img = new BufferedImage(pgsize.width, pgsize.height, BufferedImage.TYPE_INT_RGB); Graphics2D graphics = img.createGraphics(); //clear the drawing area graphics.setPaint(Color.white); graphics.fill(new Rectangle2D.Float(0, 0, pgsize.width, pgsize.height)); //render slide[i].draw(graphics); //save the output FileOutputStream out = new FileOutputStream("slide-" + (i+1) + ".png"); javax.imageio.ImageIO.write(img, "png", out); out.close(); It works fine except that all Chinese words are converted to some squares.The png image I got is like following image: Then how can I fix this?Thanks in advance!

    Read the article

  • Web Security Threats on the Rise, Report Finds

    It may not be Tony Soprano on the Web, but a new security report finds that wise-guy hackers have become increasingly organized....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

  • VS 2010 Debugger Improvements (BreakPoints, DataTips, Import/Export)

    This is the twenty-first in a series of blog posts Im doing on the VS 2010 and .NET 4 release.  Todays blog post covers a few of the nice usability improvements coming with the VS 2010 debugger.  The VS 2010 debugger has a ton of great new capabilities.  Features like Intellitrace (aka historical debugging), the new parallel/multithreaded debugging capabilities, and dump debuging support typically get a ton of (well deserved) buzz and attention when people talk about the debugging...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

  • Home Energy Management & Automation with Windows Phone 7

    A number of people at Clarity are personally interested in home energy conservation and home automation. We feel that a mobile device is a great fit for bringing this idea to fruition. While this project is merely a concept and not directly associated with Microsofts Hohm web service, it provides a great model for communicating the concept. I wanted to take the idea a step further and combine saving energy in your home with the ability to track water usage and control your home devices. I designed an application that focuses on total home control and not just energy usage. Application Overview By monitoring home consumption in real time and with yearly projections users can pinpoint vampire devices, times of high or low consumption, and wasteful patterns of energy use. Energy usage meters indicate total current consumption as well as individual device consumption. Users can then use the information to take action, make adjustments, and change their consumption behaviors. The app can be used to automate certain systems like lighting, temperature, or alarms. Other features can be turned on an off at the touch of a toggle switch on your phone, away from home. Forget to turn off the TV or shut the garage door? No problem, you can do it from your phone. Through settings you can enable and disable features of the phone that apply to your home making it a completely customized and convenient experience. To be clear, this equates to more security, big environmental impact, and even bigger savings.   Design and User Interface  Since this panorama application is designed for win phone 7 devices, it complies with the UI Design and Interaction Guide for wp7. I developed the frame and page hierarchy from existing examples. The interface takes advantage of the interactive nature of touch screens with slider controls, pivot control views, and toggle switches to turn on and off devices (not shown in mockup). I followed recommendations for text based elements and adapted the tile notifications to display the most recent user activity. For example, the mockup indicates upon launching the app that the last thing you did was program the thermostat. This model is great for quick launching common user actions. One last design feature to point out is the technical reasons for supplying both light and dark themes for the app. Since this application is targeting energy consumption it only makes sense to consider the effect of the apps background color or image on the phones energy use. When displaying darker colors like black the OLED display may use less power, extending battery life. Other Considerations For now I left out options of wind and solar powered energy options because they are not available to everyone. Renewable energy sources and new technologies associated with them are definitely ideas to keep in mind for a next iteration. Another idea to explore for such an application would be to include a savings model similar to mint.com. In addition to general energy-saving recommendations the application could recommend customized ways to save based on your current utility providers and available options in your area. If your television or refrigerator is guilty of sucking a lot of energy then you may see recommendations for energy star products that could save you even more money! 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

  • Get a Silverlight XAP signing certificate for cheap thanks to GoDaddy

    One of the new features in Silverlight 4 is the ability to sign your XAP applications so that your out-of-browser trusted applications look more friendly (trusted) to your users, they come from a verified publisher, and they can take advantage of the auto-update APIs in Silverlight. If you dont know what Im talking about, heres some resources for some background: XAP Signing in Silverlight 4 HOWTO Video: Sign Silverlight 4 Applications Basically if you are writing a Silverlight 4 trusted...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

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >