Daily Archives

Articles indexed Friday May 7 2010

Page 32/110 | < Previous Page | 28 29 30 31 32 33 34 35 36 37 38 39  | Next Page >

  • Kohana3 ORM save problem

    - by Bob0101
    Hi, Can anyone help me with Kohana ORM. I can take out name and value. I can give them new values and I try to save them back to base, but in phpmyadmin i can see still old values for these option attributes. What is wrong with this code (it works and echos right value but i can't see it in db): $option = ORM::factory('draft') ->where('user_id', '=', $user_id) ->find() ->draft_options ->where('name', '=', $_POST['name']) ->find(); $option->name = $_POST['name']; $option->value = $_POST['value']; $option->save(); if ($option->saved()) echo Kohana::debug($option->value);

    Read the article

  • How to demonstrate java multithreading visibility problems?

    - by Joe23
    If variables in Java are accessed from multiple threads, one must ensure that they are safely published. This usually means using synchronizedor volatile. I have got the impression, that some of my colleagues do not take this issue seriously, since they "never heard of volatile before and their programs have worked for years". So my question is: Can someone provide an example Java program/snippet, that reliably shows data visibility problems. I think running a program and seeing the unexpected NPE or stale variable value would help more, than just theoretic explanations, that cannot be demonstrated. Thanks a lot for your help!

    Read the article

  • How to get SQL Server Date in its native format?

    - by RoguePlanetoid
    I need to get a Date from an SQL Server Database (SQL Server 2000), the date is stored as such: 2009-09-30 00:00:00.000 I want to pass this date into a Classic ASP function to use this date in the Database somewhere else, however when I get the date, it converts in my ASP code to a locale-dependant version, such as: 30/09/2009 I just want the date as-is as formatting the date so it is correct again seems unnecessary, although if this the only way then fine - is there any way to treat it as string data so it stays like that, so it can be inserted back into the database as the same date, without needing conversion?

    Read the article

  • UIScrollView issue with autorotation and content scaling

    - by boliva
    Hi, I'm building a new (autorotating) iPad app that consists mainly of a screen sized UIScrollView that contains an UIImageView for an image which is 5 times the iPad screen resolution while in portrait mode (3840x1024). What I haven't been able to accomplish is that whenever the device rotates (to whichever orientation) the imageView bounds and the scrollView contentSize asjusts the image for the new height (maintaining its aspect ratio), making the height of the image to always fit the device height for the given orientation (so in the particular case of this image, it would get shown as 2880x768). I tried different combinations of autoresizingMask and contentMode for the imageView but the closer I've been able to get is to effectively display the image at the desired size but with a white padding around it and into the scrollView content (to make up for the original orientation contentSize). I also tried recalculating the scrollView contentSize in the didRotate.../viewWillAnimate... rotation-related methods in my viewController class, with no avail. Best regards and thanks for your time

    Read the article

  • Why does the Maven goal "package" include the resources in the jar, but the goal "jar:jar" doesnt?

    - by Bernhard V
    Hi, when I package my project with the Maven goal "package", the resources are included as well. They are originally located in the directory "src/main/resources". Because I want to create an executable jar and add the classpath to the manifest, I'm using maven-jar-plugin. I've configured it as the following likes: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>2.2</version> <configuration> <archive> <manifest> <addClasspath>true</addClasspath> <mainClass>at.sozvers.stp.zpv.ekvkumsetzer.Main</mainClass> </manifest> </archive> </configuration> </plugin> Why won't the jar file created with "jar:jar" include my resources as well. As far as I'm concerned it should use the same directories as the "package" goal (which are in my case inherited from the Maven Super POM).

    Read the article

  • Silverlight: DataContractSerializer cannot handle read only collection properties

    - by moonground.de
    Hey Stackoverflowers :) For our Silverlight Project (SL4) I'm using a Model which might contain Lists (IList<AnotherModel>). According to good practice and rule CA2227:CollectionPropertiesShouldBeReadOnly the IList properties don't have a public setter. We serialize the Model using the DataContractSerializer which is working. But when I try to deserialize, a SecurityException is thrown by DataContractSerializer's ReadObject(Stream) Method, complaining that the target property (pointing to the IList property) cannot be set due to a missing public setter. Since the DataContractSerializer is sealed and neither extendable nor flexible so I currently see no chance to add some kind of additional rules which allow to deserialize the ILists using a foreach-loop on Add() method or some other method of transferring the collection items. I've also tried to dig into DataContractSerializer source (using Reflector) to create a little fork but it looks like i'd have to dig very deep and replicating whole serialization classes doesn't seem to be a viable solution. Do you see another chance to serialize a List with no public setter using the DataContractSerializer? Thank you very much in advance for your ideas! Thomas

    Read the article

  • Authentication Failed exception - In the middle of bulk mail sending code.

    - by Ezhil
    We have a thread program that sends bulk mail. The information like 1. To 2. Subject Etc., are fetched from database, mail is composed and pushed to SMTP server. One of our customer sent a bulk mail with 2390 email. After sending 40 emails, suddenly the following exception occurred EXCEPTION javax.mail.AuthenticationFailedException STACKTRACE javax.mail.Service.connect(Service.java:306) javax.mail.Service.connect(Service.java:156) javax.mail.Service.connect(Service.java:105) ............... java.lang.Thread.run(Thread.java:619) and the rest 2350 emails failed. Why does this occur? Thanks for the Suggestions and Help Ezhil

    Read the article

  • route a word document

    - by Ravisha
    I heard about the routing feature available in micro soft products (word ,doc) .through which we can route a document in MS outlook.I have no idea how to initiate it.Can some one please tell me the procedure for the same

    Read the article

  • Recommended boot partition size for Windows 7

    - by dwj
    I started using One Big Partition for everything and separating data out with folders when I got my current computer years ago. I'm preparing to upgrade my system from Windows XP to Windows 7 and I thought I might go back to putting my data on a separate partition. Most likely I'll just use the default OS install. My current Program Files tree has ~16 GB of stuff. Thinking ahead though, I've had XP installed for years. Who knows what apps I'm going to install down the line? This, of course, begs the question: How big do I make my Windows 7 install partition?

    Read the article

  • Strange problem with SEAM stateful session bean

    - by John
    Hi, I've got a staeful session bean. @Scope(ScopeType.SESSION) @Name("chuckNorrisBean") public class ChuckNorrisBean implements Serializable, ChuckNorris with some function public void roundHouseKick() { ... } interface @Local public interface ChuckNorris { public void roundHouseKick() { ... } } and calling them on a jsf .xhtml page using #{chuckNorrisBean.roundHouseKick} which works perfectly fine. However if I add the @Stateful annotation to the bean so it becomes @Stateful @Scope(ScopeType.SESSION) @Name("chuckNorrisBean") public class ChuckNorrisBean implements Serializable, ChuckNorris and the page will load with exceptions complainig about Exception during request processing:Caused by javax.servlet.ServletException with message: "#{chuckNorrisBean.roundHouseKick}: javax.el.MethodNotFoundException: //localhost/universe/earth.xhtml @41,65 action= "#{chuckNorrisBean.roundHouseKick}": Method not found: ChuckNorrisBean:a6gkg-w6das4-g8wmgh0y-1-g8woy0wo-4b.roundHouseKick()" Any advice on what might've went wrong with my chuckNorrisBean? The system is built on SEAM/richfaces. Thanks!

    Read the article

  • How do you separate the template of a blog block in Drupal?

    - by Ralph
    Hi, In Drupal, I created a block using views. This block contains the latest blog entries. I've placed this on a specific page to display it as an archive. Now, as for the blog itself (for example when one of them is clicked), A blog template for it depends on node-blog.tpl.php. My problem is, when I style node-blog.tpl.php, the block I created for the archives (as it displays on the page) gets affected. For example if I add TEST on node-blog.tpl.php, I will also get that on the block for every entry. I think it's because it is associated to a blog entry? What I want is to have node-blog styled "alone" when blog entries are viewed individually and not get the other entries on the blocks on the archive page be affected. How should I do this?

    Read the article

  • Is there kind of runtime C++ assembler library around?

    - by Anton
    Hi guys! For my small hobby project I need to emit machine code from C++ program in runtime. I have base address 0xDEADBEEF and want to write something like this: Assembler a((void*)0xDEADBEEF); a.Emit() << Push(Reg::Eax) << Push(Reg::Ebx) << Jmp(0xFEFEFEFE); Inline assembler isn't my choice because generated machine code is dependent of the program state. Does anybody know any existing library for doing this? If no, would it be a good idea to develop one from scratch and make it open source? (I mean, will anybody ever use this library if it existed?)

    Read the article

  • Transpose a Collection

    - by Joseph Melettukunnel
    Hello, I've a list of different sizes of a T-Shirt, e.g. S, M, L. Since this might change for T-Shirts (sometimes we just have e.g. M, L), we load this into a List sizes. Since most DataGrids (xamDataGrid, WPF Toolkit DataGrid) need Properties for binding to the Columns, I'd like to transpose somehow my data. Does anyone have an idea how to do this? E.g. Instead of having List where Size { string sizeName, int available, int defect, int ordered} Avail. Defect Ordered [S] 1 2 3 [M] 1 2 3 [L] 1 2 3 I want an Object which has the Properties S, M, L containing the Values like this: [S] [M] [L] Avail. 1 2 3 Defect 1 2 3 Ordered 1 2 3 The problem here is that I don't know how many sizes will be available for the tshirt, it might be 3, 4, or 10. Thanks for any help Cheers PS: Here is a mockup of how the final grid should look like http://img39.imageshack.us/img39/9161/multirowspangridfixedel.png

    Read the article

  • Handling Special char such as ^ÛY, ^ÛR in java

    - by RJ
    Hi, Has anybody encountered special char such as ^ÛY, ^ÛR ? Q1. How do I do an ftp of the files containing these chars? The chars are not seen once I do a ftp on AIX (bi or ascii) and hence I am unable to see my program to replace these, working. Q2. My java program doesn't seem to recognise these or replace these if I search for these explicitly (^ÛY, ^ÛR ) in the file however a replace using regular expression seems to work (I could only see the difference in the length of the string). My program is executed on AIX. Any insights why java cannot recognise these? Q3. Does the Oracle database recognise these chars? An update is failing where my program indicates the string to be of lesser length and without these characters but the db complains "value too large for column" as the string to be updated contains these chars and hence longer. thanks in advance, RJ

    Read the article

  • Android number input with plus and minus sign.

    - by alaak
    Hi, I am developing in android and I would like an input field for numbers, where the user can select the correct number using the plus sign at the top and the minus sign at the bottom of the input field. I know this works for date picker. Is there some property or something similar to make this available for any integer number input field? Thanks

    Read the article

  • Converting raw bytes into audio sound

    - by Afro Genius
    In my application I inherit a javastreamingaudio class from the freeTTS package then bypass the write method which sends an array of bytes to the SourceDataLine for audio processing. Instead of writing to the data line, I write this and subsequent byte arrays into a buffer which I then bring into my class and try to process into sound. My application processes sound as arrays of floats so I convert to float and try to process but always get static sound back. I am sure this is the way to go but am missing something along the way. I know that sound is processed as frames and each frame is a group of bytes so in my application I have to process the bytes into frames somehow. Am I looking at this the right way? Thanx in advance for any help.

    Read the article

  • std::map operator[] and automatically created new objects

    - by thomas-gies
    I'm a little bit scared about something like this: std::map<DWORD, DWORD> tmap; tmap[0]+=1; tmap[0]+=1; tmap[0]+=1; Since DWORD's are not automatically initialized, I'm always afraid of tmap[0] being a random number that is incremented. How does the map know hot to initialize a DWORD if the runtime does not know how to do it? Is it guaranteed, that the result is always tmap[0] == 3?

    Read the article

  • Parsing SQL in .NET

    - by Eli
    I'm trying to build a .NET Managed data provider and I need to be able to parse SQL commands. What are good, free (as in beer) objects to do this? - I haven't seen any standard .NET assemblies for this yet. Thanks, Eli.

    Read the article

  • django powering multiple shops from one code base on a single domain

    - by imanc
    Hey, I am new to django and python and am trying to figure out how to modify an existing app to run multiple shops through a single domain. Django's sites middleware seems inappropriate in this particular case because it manages different domains, not sites run through the same domain, e.g. : domain.com/uk domain.com/us domain.com/es etc. Each site will need translated content - and minor template changes. The solution needs to be flexible enough to allow for easy modification of templates. The forms will also need to vary a bit, e.g minor variances in fields and validation for each country specific shop. I am thinking along the lines of the following as a solution and would love some feedback from experienced django-ers: In short: same codebase, but separate country specific urls files, separate templates and separate database Create a middleware class that does IP localisation, determines the country based on the URL and creates a database connection, e.g. /au/ will point to the au specific database and so on. in root urls.py have routes that point to a separate country specific routing file, e..g (r'^au/',include('urls_au')), (r'^es/',include('urls_es')), use a single template directory but in that directory have a localised directory structure, e.g. /base.html and /uk/base.html and write a custom template loader that looks for local templates first. (or have a separate directory for each shop and set the template directory path in middleware) use the django internationalisation to manage translation strings throughout slight variances in forms and models (e.g. ZA has an ID field, France has 'door code' and 'floor' etc.) I am unsure how to handle these variations but I suspect the tables will contain all fields but allowing nulls and the model will have all fields but allowing nulls. The forms will to be modified slightly for each shop. Anyway, I am keen to get feedback on the best way to go about achieving this multi site solution. It seems like it would work, but feels a bit "hackish" and I wonder if there's a more elegant way of getting this solution to work. Thanks, imanc

    Read the article

  • SQL Server becomes slow after restart

    - by Tobi DM
    We use SQL Server 2005 on an Windwos Server 2008. Ther Server has 48 GB RAM. SQL Server is configured to use 40 GB RAM. There is only one database hosted (About 70 GB). The only app beside SQL Server is our App-Server which connects the clients to the database. Now we encounter the following problem: After a restart of the server our the performance is great. The server grabs the 40 GB RAM wich it is allowed to and then runs fast as hell. But after about 4 weeks the system becomes slower and slower. The execution of statements (seen in the profiler) is raising slowly. But I cannot see that there is something going wrong on the server. CPU usage is at about 20% I/O also seems to be no Problem The process monitor does also not show that there are strange apps or something like that. Eventlog does also have no interessting messages No open transactions or blockings to see We tried already the following things without effect: Droped the cache by using the statements DBCC FreeProcCache DBCC FREESYSTEMCACHE('ALL') DBCC DropCleanbuffers Restarted the Appserver we are using. Restart the sql server service But nothing did help exept restarting the whole server. Any ideas?

    Read the article

  • How to change the number of columns in a table dynamically but still keep the table layout intact?

    - by gurupriyan.e
    I have a 'n' column table , the first column is a drop down box , on selecting the options from the drop down, the other columns change. For eg: first drop down might need to display a text box and a button , the second drop down 3 text boxes and a button and so on. There is only one row in the table. What is the best solution to achieve this. with Sincere thanks,

    Read the article

< Previous Page | 28 29 30 31 32 33 34 35 36 37 38 39  | Next Page >