Daily Archives

Articles indexed Sunday January 2 2011

Page 12/27 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • autoloading folder ZendX_JQuery and others

    - by explorex
    Hi, I am trying to use ZendX_Jquery and i don't how know to autoload this file in bootstrap. I am doing require_once("ZendX/JQuery.php"); on my file Bootstrap.php i also tried $autoLoader = Zend_Loader_Autoloader::getInstance(); $autoLoader->registerNamespace('ZendX_'); but it did not work is there any elegant way of autoloading files in diretories? EDIT: Changed ZendX_jQuery to ZendX_JQuery (case sensitivity) on my bootstrap.php file

    Read the article

  • What's the best way to read a UDT from a database with Java?

    - by Lukas Eder
    I thought I knew everything about UDTs and JDBC until someone on SO pointed out some details of the Javadoc of java.sql.SQLInput and java.sql.SQLData JavaDoc to me. The essence of that hint was (from SQLInput): An input stream that contains a stream of values representing an instance of an SQL structured type or an SQL distinct type. This interface, used only for custom mapping, is used by the driver behind the scenes, and a programmer never directly invokes SQLInput methods. This is quite the opposite of what I am used to do (which is also used and stable in productive systems, when used with the Oracle JDBC driver): Implement SQLData and provide this implementation in a custom mapping to ResultSet.getObject(int index, Map mapping) The JDBC driver will then call-back on my custom type using the SQLData.readSQL(SQLInput stream, String typeName) method. I implement this method and read each field from the SQLInput stream. In the end, getObject() will return a correctly initialised instance of my SQLData implementation holding all data from the UDT. To me, this seems like the perfect way to implement such a custom mapping. Good reasons for going this way: I can use the standard API, instead of using vendor-specific classes such as oracle.sql.STRUCT, etc. I can generate source code from my UDTs, with appropriate getters/setters and other properties My questions: What do you think about my approach, implementing SQLData? Is it viable, even if the Javadoc states otherwise? What other ways of reading UDT's in Java do you know of? E.g. what does Spring do? what does Hibernate do? What does JPA do? What do you do? Addendum: UDT support and integration with stored procedures is one of the major features of jOOQ. jOOQ aims at hiding the more complex "JDBC facts" from client code, without hiding the underlying database architecture. If you have similar questions like the above, jOOQ might provide an answer to you.

    Read the article

  • WebGL transparent black.

    - by Catalin Dumitru
    I have a strange problem that I can't figure out when trying to do blending in WebGL. Black is rendered fully transparent , and everything with shades of grey in it is rendered also semi transparent. I have set it to use the alpha channel as the source for transparency, and in some respect it works, every thing that isn't black/grey is rendered differently when changing the alpha value. but even when I set the alpha to 1, black is still displayed transparent. This is how I enable transparency: this.gl.blendFunc(this.gl.SRC_ALPHA, this.gl.ONE); this.gl.enable(this.gl.BLEND); this.gl.disable(this.gl.DEPTH_TEST); And the part of the shader that does transparency: gl_FragColor = vec4(texColor.rgb * vLightWeight, texColor.a * uAlpha); where texColor is the texture color that is being sampled, vLightWeight is the shadowing that is being calculated in the vertex shader, and uAlpha the uniform which I use for transparency.

    Read the article

  • Xml output on HTML

    - by umitunal
    Hi, My xml data = &lt;Item "/api/items/4000000002011"&gt;&lt;ItemID&gt;4000000002011&lt;/ItemID&gt;&lt;Name&gt;Sample Item1&lt;/Name&gt;&lt;Description&gt;Sample Description&lt;/Description&gt;&lt;Rate&gt;34.00&lt;/Rate&gt;&lt;Tax1Name&gt;PST&lt;/Tax1Name&gt;&lt;Tax1Percentage&gt;8&lt;/Tax1Percentage&gt;&lt;Tax2Name/&gt;&lt;Tax2Percentage/&gt;&lt;/Item&gt; Html output=<Item uri="/api/items/4000000002011"> <ItemID>4000000002011</ItemID><Name>Sample Item1</Name><Description>Sample Description</Description><Rate>34.00</Rate><Tax1Name>PST</Tax1Name><Tax1Percentage>8</Tax1Percentage><Tax2Name/><Tax2Percentage/></Item> I want to html output.How do I? <Item "/api/items/4000000002011"> <ItemID>4000000002011</ItemID> <Name>Sample Item1</Name> <Description>Sample Description</Description> <Rate>34.00</Rate> <Tax1Name>PST</Tax1Name> <Tax1Percentage>8</Tax1Percentage> <Tax2Name/> <Tax2Percentage/> </Item>

    Read the article

  • Mac OS X Server mobile account VS Time Machine Network Backup

    - by elhombre
    I am installing a Server @home to manage the mac client's of my family. First I wanted to make time machine Backups over the internal network to an external Hard-drive which is connected to my Mac OS X Server (10.6) but when I read about the mobile accounts and it's synchronization features I got a little bit irritated what the differences between the two Services are. So where are the differences between a mobile account and a Time Machine Backup which is made over the network? Can the synchronized mobile Account be backup to an external Harddisk, if yes, how?

    Read the article

  • What is Slotted and pure aloha?

    - by caspert
    So I am having a really hard time understanding slotted and pure aloha. I have understood CSMA/CD fairly well, but that is it. I have the book: Computer networking - a top down approach, but I find the explanation very cryptic and hard to understand. Wikipedia did not help me. Does anyone have a brief "aloha for dummies" explanation? or perhaps a video tutorial? I think I need something visual. I don't need to be able to create the protocol, I just need a general understanding of it.

    Read the article

  • Why is my HP TouchSmart tx2 1025dx shutting down?

    - by Kristy
    I'm having an issue with my HP tx2 1025dx laptop. Sometimes it will spontaneously shut itself off. First, the screen will go out. Next, the computer itself will shut down. This usually occurs when I am doing something that requires a lot of resources, but lately can happen when I am doing something as simple as using an Office app. I think it may be heat related, if I try to boot the laptop after it shuts itself down, it will shut itself down again before startup is complete. If I let it cool down for a while and then come back to it, the computer will boot properly. These shutdowns are always accompanied by high temperatures on the bottom right side, as well as the right side of the keyboard. I am using a laptop cooler with two fans, and it is not making a bit of difference. This is the second TouchSmart we have owned, the first one had the same issues, we sent it in to HP after it finally refused to reboot. They “fixed” it, and it worked fine for about a month before doing the exact same thing. Unfortunately we had bought the second one before the issues began with the original, if I had known this would be a problem, I would not have purchased another TouchSmart. This particular laptop we have had for more than a year and it didn’t start these issues until a couple of months ago. Any suggestions as to how to fix this problem?

    Read the article

  • Is it normal for an AC adapter to drop voltage if it's not used by a laptop?

    - by leladax
    I'm currently investigating the livelihood of a laptop adaptor and I noticed, unlike another adaptor it drops voltage to almost zero after I also attempt to measure its current [while it did show voltage at first, before measuring current]. The other adaptor normally shows voltage and then normally shows some current and then if it turns to measure voltage, it shows it normally again. I assume the adaptor is faulty, however, I want to make sure if laptop adaptors turn off themselves if they aren't used normally by a laptop.

    Read the article

  • Computer won't start unless power is removed for ~5 minutes

    - by Paul Tarjan
    I have a fairly standard 2-year old desktop computer (quad-core intel, single hard drive, decent video card, 300W power supply) which recently started acting up. I'm not sure what the cause is, so hopefully you can help. Sometimes (once a week-ish) I press the power button and nothing happens. No blinking, no sounds, no nothing. If I remove the power cord (or flip the switch on the power supply) I hear a capacitor discharge. If I leave it in the "no power at all" state for about 5 minutes then I can put the plug back in and the computer works perfectly. What is the issue? What do you think I have to replace?

    Read the article

  • TimeStamp and mini-ETL (extract, transform, load)

    - by Tomaz.tsql
    Short example how to use Timestamp for a mini ETL process of your data. example below is following: Table_1 is production table on server1 Table_2 is datawarehouse table on server2 where datawarehouse is located Every day data are extracted, transformed and loaded to dataware house for further off-line usage and data analysis and business decision support. 1. Creating the environment if object_id ('table_1') is not null drop table table_1; go if object_id ('table_2') is not null drop...(read more)

    Read the article

  • Welcome to EMACS! - the Enterprise Manager Blog from Advanced Customer Services

    - by Rajat Nigam
    Advanced Customer Services(ACS) is the specialist group within Oracle which has helped countless customers become successful with Enterprise Manager as a System Management Product of their choice. ACS has a dedicated "Center of Excellence for Enterprise Manager" with a charter to make customers successful with Enterprise Manager. ACS helps customers right from setting up Enterprise Manager Grid Control to manage enterprise class highly available application deployments, to on-going housekeeping, to evaluation and adoption of new features and solutions, migration and upgrades,  to customizations and extensions of Enterprise Manager and more. 'Emacs' is possibly the best title for this yet another blog on Enterprise Manager. Emacs is going to talk about the real life experiences that Oracle ACS and Oracle Pre-sales team has with Oracle Enterprise Manager in real customer environments from different industry verticals like Banking, Telecom, Defence, Manufacturing, Public Utlities, etc. It discusses best practices, common blue-prints, links to interesting collateral, ACS authored tools and utlitlies. Feel free to ask questions influencing business/architectural decisions to something which is very technical in nature and very specific to the tool. We absolutely welcome any comments and feedback that you can provide. Thanks for visiting our blog!    

    Read the article

  • How to deal with WYSIWYG editors?

    - by Pino
    There are now lots of WYSIWYG editors, however whenever we use one on a cms based website we consitently have issues. The biggest being users pasting conent from word, other online sources and all the various formatting rules being added in "behind the scenes" How do you deal with these editors on a live production website? I love markdown, however its target market is most definatly the tech industry.

    Read the article

  • Is Haskell's type system an obstacle to understanding functional programming?

    - by FarmBoy
    I'm studying Haskell for the purpose of understanding functional programming, with the expectation that I'll apply the insight that I gain in other languages (Groovy, Python, JavaScript mainly.) I choose Haskell because I had the impression that it is very purely functional, and wouldn't allow for any reliance on state. I did not choose to learn Haskell because I was interested in navigating an extremely rigid type system. My question is this: Is a strong type system a necessary by-product of an extremely pure functional language, or is this an unrelated design choice particular to Haskell? If it is the latter, I'm curious what would be the most purely functional language that is dynamically typed. I'm not particularly opposed to strong typing, it has its place, but I'm having a hard time seeing how it benefits me in this educational endeavor.

    Read the article

  • Setting up ubuntu as a wireless accesspoint

    - by nixnotwin
    I have an android phone which doesn't connect to ad-hoc networks. I use ad-hoc network to share internet among my pcs. I want to setup my ubuntu laptop as a wireless access point. But I don't want my ubuntu laptop to be a router as described here as I'll be using suid3 as a http proxy. It should be just a wireless accesspoint which broadcasts it's SSID like a home wireless router. The ubuntu laptop has athros wireless card which requires athk9 driver.

    Read the article

  • copy and Search Web services

    - by user171523
    We are in the process of integrating ASP.NET Business App with Sharepoint. I have some Design questions. Requirement - From ASP.NET buz application we upload document to Sharepoint Doc Lib 2010 using Web Services. And perform a Search using Serach web service. I would like to know from group are there any disadvantages doing this? Performance etc .. What kind of seacurity consideration i need to be thinking of.

    Read the article

  • Expand and collapse a div

    - by user494118
    I have a list of itens and they are holding images, each image is 800w x 600 H. The original div height is 800 W x 300 H, I figured out how to expand the div when it is clicked, but i want to know how to collapse it when you click it while it is already expanded. right now it just expands the div even farther $('.expand').bind('click', function() { var currHeight = $(this).css('height').replace(/px/,''); currHeight = currHeight * 1; var newHeight = currHeight + 500; $(this).animate({ height: newHeight },1000); }); any idea on how to create an if else statement that would say, IF the div is already expanded then collapse on click, or if the div is not expanded, expand to # of px.

    Read the article

  • Why does my Doctrine DBAL query return no results when quoted?

    - by braveterry
    I'm using the Doctrine DataBase Abstraction Layer (DBAL) to perform some queries. For some reason, when I quote a parameter before passing it to the query, I get back no rows. When I pass it unquoted, it works fine. Here's the relevant snippet of code I'm using: public function get($game) { load::helper('doctrinehelper'); $conn = doctrinehelper::getconnection(); $statement = $conn->prepare('SELECT games.id as id, games.name as name, games.link_url, games.link_text, services.name as service_name, image_url FROM games, services WHERE games.name = ? AND services.key = games.service_key'); $quotedGame = $conn->quote($game); load::helper('loghelper'); $logger = loghelper::getLogger(); $logger->debug("Quoted Game: $quotedGame"); $logger->debug("Unquoted Game: $game"); $statement->execute(array($quotedGame)); $resultsArray = $statement->fetchAll(); $logger->debug("Number of rows returned: " . count($resultsArray)); return $resultsArray; } Here's what the log shows: 01/01/11 17:00:13,269 [2112] DEBUG root - Quoted Game: 'Diablo II Lord of Destruction' 01/01/11 17:00:13,269 [2112] DEBUG root - Unquoted Game: Diablo II Lord of Destruction 01/01/11 17:00:13,270 [2112] DEBUG root - Number of rows returned: 0 If I change this line: $statement->execute(array($quotedGame)); to this: $statement->execute(array($game)); I get this in the log: 01/01/11 16:51:42,934 [2112] DEBUG root - Quoted Game: 'Diablo II Lord of Destruction' 01/01/11 16:51:42,935 [2112] DEBUG root - Unquoted Game: Diablo II Lord of Destruction 01/01/11 16:51:42,936 [2112] DEBUG root - Number of rows returned: 1 Have I fat-fingered something?

    Read the article

  • How to: Avoid Inserting Related Entities?

    - by niaher
    I have this schema: I want to insert an Order with OrderItems into database, so I wrote this method: public void SaveOrder(Order order) { using (var repository = new StoreEntities()) { // Add order. repository.Orders.AddObject(order); // Add order items. foreach (OrderItem orderItem in order.OrderItems) { repository.OrderItems.AddObject(orderItem); } repository.SaveChanges(); } } Everything is inserted just fine, except that new Product records are inserted too, which is not what I want. What I want is to insert Order and its OrderItems, without going any further down the object graph. How can that be achieved? Any help is really appreciated, thank you.

    Read the article

  • How to hash and salt passwords

    - by Henrik Skogmo
    I realize that this topic have been brought up sometimes, but I find myself not entirely sure on the topic just yet. What I am wondering about how do you salt a hash and work with the salted hash? If the password is encrypted with a random generated salt, how can the we verify it when the user tries to authenticate? Do we need to store the generated hash in our database as well? Is there any specific way the salt preferably should be generated? Which encryption method is favored to be used? From what I hear sha256 is quite alright. And lastly, would it be an idea to have the hash "re-salted" when the user authenticates? Thank you!

    Read the article

  • CSS3 background-origin property does work in firefox?

    - by hh54188
    I want use CSS3 property to make a complicated background image which with corner shadow and so on.Including background image,left border image,right border image.So,for the <div class="outer"></div>I write the CSS below: .outer { background:url("title_main.png"); background-repeat:repeat-x; background-clip: content; background-origin:content; -moz-background-clip: content; -moz-background-origin: content; -webkit-background-clip: content; -webkit-background-origin:content; -webkit-border-image:url("title_border.png") 0 15 0 15 stretch; -moz-border-image: url("title_border.png") 0 15 0 15 stretch; border-image:url("fancy_title.png") 0 15 0 15 stretch; border-width:0 15px ; width:80px; height:32px; } In chrome browser it work well like: But the firefox doesn't like this: Why would this happened?How can I fix this?Make the firefox effect like the chrome?

    Read the article

  • Side by side madness - running binaries on different computer (with a twist)

    - by sbk
    Here's my configuration: Computer A - Windows 7, MS Visual Studio 2005 patched for Win7 compatibility (8.0.50727.867) Computer B - Windows XP SP2, MS Visual Studio 2005 installed (8.0.50727.42) My project has some external dependencies (prebuilt DLLs - either build on A or downloaded from the Internet), a couple of DLLs built from sources and one executable. I am mostly developing on A and all is fine there. At some point I try to build my project on computer B, copying the prebuilt DLLs to the output folder. Everything builds fine, but trying to start my application I get The application failed to initialize properly (0xc0150002).... The event log contains two of those: Dependent Assembly Microsoft.VC80.CRT could not be found and Last Error was The referenced assembly is not installed on your system. plus the slightly more amusing Generate Activation Context failed for some.dll. Reference error message: The operation completed successfully. At this point I'm trying my Google-Fu, but in vain - virtually all hits are about running binaries on machines without Visual Studio installed. In my case, however, the executables fail to run on the computer they are built. Next step was to try dependency walker and it baffled me even more - my DLLs built from sources on the same box cannot find MSVCR80.DLL and MSVCP80.DLL, however the executable seems to be alright in respect to those two DLLs i.e. when I open the executable with dependency walker it shows that the MSVC?80.DLLs can be found, but when I open one of my DLLs it says they cannot. That's where I am completely out of ideas what to do so I'm asking you, dear stackoverflow :) I admit I'm a bit blurry on the whole side-by-side thing, so general reading on the topic will also be appreciated.

    Read the article

  • (Ordered) Set Partitions in fixed-size Blocks

    - by Eugen
    Here is a function I would like to write but am unable to do so. Even if you don't / can't give a solution I would be grateful for tips. For example, I know that there is a correlation between the ordered represantions of the sum of an integer and ordered set partitions but that alone does not help me in finding the solution. So here is the description of the function I need: The Task Create an efficient* function List<int[]> createOrderedPartitions(int n_1, int n_2,..., int n_k) that returns a list of arrays of all set partions of the set {0,...,n_1+n_2+...+n_k-1} in number of arguments blocks of size (in this order) n_1,n_2,...,n_k (e.g. n_1=2, n_2=1, n_3=1 -> ({0,1},{3},{2}),...). Here is a usage example: int[] partition = createOrderedPartitions(2,1,1).get(0); partition[0]; // -> 0 partition[1]; // -> 1 partition[2]; // -> 3 partition[3]; // -> 2 Note that the number of elements in the list is (n_1+n_2+...+n_n choose n_1) * (n_2+n_3+...+n_n choose n_2) * ... * (n_k choose n_k). Also, createOrderedPartitions(1,1,1) would create the permutations of {0,1,2} and thus there would be 3! = 6 elements in the list. * by efficient I mean that you should not initially create a bigger list like all partitions and then filter out results. You should do it directly. Extra Requirements If an argument is 0 treat it as if it was not there, e.g. createOrderedPartitions(2,0,1,1) should yield the same result as createOrderedPartitions(2,1,1). But at least one argument must not be 0. Of course all arguments must be = 0. Remarks The provided pseudo code is quasi Java but the language of the solution doesn't matter. In fact, as long as the solution is fairly general and can be reproduced in other languages it is ideal. Actually, even better would be a return type of List<Tuple<Set>> (e.g. when creating such a function in Python). However, then the arguments wich have a value of 0 must not be ignored. createOrderedPartitions(2,0,2) would then create [({0,1},{},{2,3}),({0,2},{},{1,3}),({0,3},{},{1,2}),({1,2},{},{0,3}),...] Background I need this function to make my mastermind-variation bot more efficient and most of all the code more "beautiful". Take a look at the filterCandidates function in my source code. There are unnecessary / duplicate queries because I'm simply using permutations instead of specifically ordered partitions. Also, I'm just interested in how to write this function. My ideas for (ugly) "solutions" Create the powerset of {0,...,n_1+...+n_k}, filter out the subsets of size n_1, n_2 etc. and create the cartesian product of the n subsets. However this won't actually work because there would be duplicates, e.g. ({1,2},{1})... First choose n_1 of x = {0,...,n_1+n_2+...+n_n-1} and put them in the first set. Then choose n_2 of x without the n_1 chosen elements beforehand and so on. You then get for example ({0,2},{},{1,3},{4}). Of course, every possible combination must be created so ({0,4},{},{1,3},{2}), too, and so on. Seems rather hard to implement but might be possible. Research I guess this goes in the direction I want however I don't see how I can utilize it for my specific scenario. http://rosettacode.org/wiki/Combinations

    Read the article

  • Counting the number of objects that meets a certain criteria

    - by Candy Chiu
    The title doesn't tell the complete story. Please read the message. I have two objects: Adult and Child. Child has a boolean field isMale, and a reference to Adult. Adult doesn't reference Child. public class Adult { long id; } public class Child { long id; boolean isMale; Adult parent; } I want to create a query to list the number of sons each adult has including adults who don't have any sons. I tried: Query 1 SELECT adult, COUNT(child) FROM Child child RIGHT OUTER JOIN child.parent as adult WHERE child.isMale='true' GROUP BY adult which translates to sql select adult.id as col_0_0_, count(child.id) as col_1_0_, ... {omit properties} from Child child right outer join Adult adult on child.parentId=adult.id where child.isMale = 'true' group by adult.id Query 1 doesn't pick up adults that don't have any sons. Query 2: SELECT adult, COUNT(child.isMale) FROM Child child RIGHT OUTER JOIN child.parent as adult GROUP BY adult translates to sql: select adult.id as col_0_0_, count(child.id) as col_1_0_, ... {omit properties} from Child child right outer join Adult adult on child.parentId=adult.id group by adult.id Query 2 doesn't have the right count of sons. Basically COUNT doesn't evaluate isMale. The where clause in Query 1 filtered out Adults with no sons. How do I build a HQL or a Criteria query for this use case? Thanks.

    Read the article

  • Get the Time Interval without ITimer

    - by ronag
    In my application I am hosting a flash activex control, based on the following implementation. However I need to know in what fps the control is running in when it is "ticked". The only way I know of to do this is to implement ITimerService and ITimer to get the vtimeInterval argument from ITimer::Advise. However, I do not want to control my own custom ITimer, instead I want the control to be timed using the default timer (basically sends WM_USER + 1 messages to the message queue at proper intervals) which is used when a custom ITimer is not provided. How can I read the vTimeInterval while still using the default timer?

    Read the article

  • Has anyone ever had OpenCV to work with Python on MacOS?

    - by ?????
    I've been trying on and off for the past 6 months to get OpenCV to work with Python on MacOS. Every time there's a new release, I try again and fail. I've tried both 64-bit and 32-bit, and both the xcode gcc and gcc installed via macports. I just spend the past two days on it, hopeful that the latest OpenCV release, that appears to include Python support directly would work. It doesn't. I've also tried and failed to use this: http://code.google.com/p/pyopencv/ I've been using OpenCV with C++ or Microsoft C++/CLI for the past few years, but I'd love to use it with Python on a Mac because that is my primary development environment. I'd love to hear from anyone who's actually done this.

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >