Daily Archives

Articles indexed Thursday December 30 2010

Page 16/34 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • Help needed for writing a Set Based query for finding the highest marks obtained by the students

    - by priyanka.sarkar_2
    I have the below table declare @t table (id int identity, name varchar(50),sub1 int,sub2 int,sub3 int,sub4 int) insert into @t select 'name1',20,30,40,50 union all select 'name2',10,30,40,50 union all select 'name3',40,60,100,50 union all select 'name4',80,30,40,80 union all select 'name5',80,70,40,50 union all select 'name6',10,30,40,80 The desired output should be Id Name Sub1 Sub2 Sub3 Sub4 3 Name3 100 4 Name4 80 80 5 Name5 80 70 6 Name6 80 What I have done so far is ;with cteSub1 as ( select rn1 = dense_rank() over(order by sub1 desc),t.id,t.name,t.sub1 from @t t ) ,cteSub2 as ( select rn2 = dense_rank() over(order by sub2 desc),t.id,t.name,t.sub2 from @t t ) ,cteSub3 as ( select rn3 = dense_rank() over(order by sub3 desc),t.id,t.name,t.sub3 from @t t ) ,cteSub4 as ( select rn4 = dense_rank() over(order by sub4 desc),t.id,t.name,t.sub4 from @t t ) select x1.id,x2.id,x3.id,x4.id ,x1.sub1,x2.sub2,x3.sub3,x4.sub4 from (select c1.id,c1.sub1 from cteSub1 c1 where rn1 =1) as x1 full join (select c2.id,c2.sub2 from cteSub2 c2 where rn2 =1)x2 on x1.id = x2.id full join (select c3.id,c3.sub3 from cteSub3 c3 where rn3 =1)x3 on x1.id = x3.id full join (select c4.id,c4.sub4 from cteSub4 c4 where rn4 =1)x4 on x1.id = x4.id which is giving me the output as id id id id sub1 sub2 sub3 sub4 5 5 NULL NULL 80 70 NULL NULL 4 NULL NULL 4 80 NULL NULL 80 NULL NULL 3 NULL NULL NULL 100 NULL NULL NULL NULL 6 NULL NULL NULL 80 Help needed. Also how can I reduce the number of CTE's?

    Read the article

  • How to check the type of inputAvailable in iPad?

    - by iphoneDev
    Hi, I am implementing the sound recording functionality in my iPad app. I want to prompt the user to attach his headphone with microphone for better performance.For this I need to check that whether the user has connected the headphone with microphone or not. In the AVAudioSession there is a method inputIsAvailable.But this method returns 'Yes' for the inbuilt mic of iPad also.So,please suggest how to detect that whether the headphone with mic is connected to the device or not??

    Read the article

  • OSGI bundle (or service)- how to register for a given time period?

    - by Alec
    Hello, all! Search did not give me a hint, how can i behave with the following situation: I'd love to have 2 OSGI implementations of the same interface: one is regular, the other should work (be active/present/whatever) on the given time period (f.e for Christmas weeks :)) The main goal is to call the same interface without specifying any flags/properties/without manual switching of ranking. Application should somehow switch implementation for this special period, doing another/regular job before and after :) I'm a newbie, maybe i do not completely understand OSGI concept somewhere, sorry for that of give me a hint or link, sorry for my English. Using Felix/Equinox with Apache Aries.

    Read the article

  • No Hibernate Session bound to thread exception

    - by Benchik
    I have Hibernate 3.6.0.Final and Spring 3.0.0.RELEASE I get "No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here" If I add the thread specification back in, I get "saveOrUpdate is not valid without active transaction" Any ideas? The spring-config.xml: <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="org.hsqldb.jdbcDriver"/> <property name="url" value="jdbc:hsqldb:mem:jsf2demo"/> <property name="username" value="sa"/> <property name="password" value=""/> </bean> <bean id="sampleSessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> <property name="dataSource" ref="sampleDataSource"/> <property name="annotatedClasses"> <list> <value>com.maxheapsize.jsf2demo.Book</value> </list> </property> <property name="hibernateProperties"> <props> <!-- prop key="hibernate.connection.pool_size">0</prop--> <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.dialect">org.hibernate.dialect.HSQLDialect</prop> <!-- prop key="transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</prop> <prop key="hibernate.current_session_context_class">thread</prop--> <prop key="hibernate.hbm2ddl.auto">create</prop> </props> </property> </bean> <bean id="sampleDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName"> <value>org.hsqldb.jdbcDriver</value> </property> <property name="url"> <value> jdbc:hsqldb:file:/spring/db/springdb;SHUTDOWN=true </value> </property> <property name="username" value="sa"/> <property name="password" value=""/> </bean> <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="sampleSessionFactory"/> </bean> <bean id="daoTxTemplate" abstract="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> <property name="transactionManager" ref="transactionManager"/> <property name="transactionAttributes"> <props> <prop key="create*"> PROPAGATION_REQUIRED,ISOLATION_READ_COMMITTED </prop> <prop key="get*"> PROPAGATION_REQUIRED,ISOLATION_READ_COMMITTED </prop> </props> </property> </bean> <bean name="openSessionInViewInterceptor" class="org.springframework.orm.hibernate3.support.OpenSessionInViewInterceptor"> <property name="sessionFactory" ref="sampleSessionFactory"/> <property name="singleSession" value="true"/> </bean> <bean id="nameDao" parent="daoTxTemplate"> <property name="target"> <bean class="com.maxheapsize.dao.NameDao"> <property name="sessionFactory" ref="sampleSessionFactory"/> </bean> </property> </bean> and the DAO: public class NameDao { private SessionFactory sessionFactory; public void setSessionFactory(SessionFactory sessionFactory) { this.sessionFactory = sessionFactory; } public SessionFactory getSessionFactory() { return sessionFactory; } @Transactional @SuppressWarnings("unchecked") public List<Name> getAll() { Session session = this.sessionFactory.getCurrentSession(); List<Name> names = (List<Name>)session.createQuery("from Name").list(); return names; } //@Transactional(propagation= Propagation.REQUIRED, readOnly=false) @Transactional public void save(Name name){ Session session = this.sessionFactory.getCurrentSession(); session.saveOrUpdate(name); session.flush(); } }

    Read the article

  • how to convert video from one format to another using php

    - by Meena
    hi i want to include the vedio download option in my webpage. I am using ffmpeg, but it seems to work very slow. Is there is any other way to do this or how to spead up the ffmpeg. i am using this code to get the frames from the vedio. to convert the vedio $call="ffmpeg -i ".$_SESSION['video_to_convert']." -vcodec libvpx -r 30 -b ".$quality." -acodec libvorbis -ab 128000 -ar ".$audio." -ac 2 -s ".$size." ".$converted_vids.$name.".".$type." -y 2> log/".$name.".txt"; $convert = (popen("start /b ".$call, "r")); pclose($convert); to get the frame from the vedio exec("ffmpeg -vframes 1 -ss ".$time_in_seconds." -i $converted_vids video_images.jpg -y 2>); but this code does not generate any error its loading continously.

    Read the article

  • xpath for xquery in SQL

    - by Haroldis
    Hi all, I have a xml filed in sql table the xml have the structure like these <root> <element> <sub name="1"> <date>the date <date> </sub> <sub name="2"> <date>the date <date> </sub> <sub name="3"> <date>the date <date> </sub> ..... <element> </root> how i can get the date of the element with the name 1? I have prove : /root/element/sub[Name = "1"]/date/text() but nothing hapen. any ideas?

    Read the article

  • Unicode To ASCII Conversion

    - by Yuvaraj
    Hi all, i creating an small application in Delphi 2009. here i got problem that when i run my application in WindowsXP its working but it is not working in Windows95. i know the problem that 95 will not support Unicode. if anyone knows the solution please tell me. and also i have one more idea that converting Unicode to ASCII. is it possible please tell how to do that. Thanks in Advance Worm Regards, Yuvaraj

    Read the article

  • Generating SQL change scripts in SSMS 2008

    - by Munish Goyal
    I have gone through many related SO threads and got some basic info. Already generated DB diagram. After that i am unable to find a button/option to generate SQL scripts (create) for all the tables in diagram. "Generate script" button is disabled, even on clicking the table in diagram. However i enabled the auto-generate option in tools-designer. But what to do with previous diagrams. I just want an easy way to auto-generate such scripts (create/alter) and would be gud if i get auto-generated stored procs for insert/selects/update etc. EDIT: I could do generate scripts for DB objects. Now: 1. How to import DB diagram from another DB. 2. How to generate (and manage their change integrated with VS source control) routine stored-procs like insert, update and select. Ok let me ask another way, can experts guide on the usual flow of creating/altering tables (across releases), creating stored-procs (are stored-procs the best way to go ?) and their change-management using SSMS design tools and minimal effort ?

    Read the article

  • New Office 2010 theme added for creating current UIs

    - by Webgui
    Visual WebGui offers its developers a set of out-of-the-box themes which they can easily apply to their applications. This allows developers to focus on the development and business logic rather than dealing with UI design missions. However, design tools and customization freedom are available for those who need to customize current themes or create their own custom theme. As part of the constant updates and enhancements to Visual WebGui and its developer CompanionKit a new available theme was added last week. The new theme applies the latest Microsoft UI - Office 2010 to Visual WebGui and allows developers and/or end users (of 6.4.0 and above) to switch their Web applications UI to the successful design of Office 2010. After the latest update the new theme is integrated into the Visual WebGui Developers CompanionKit which now matches Visual WebGui 6.4.0 Release version's infrastructure. The update also includes several enhancements to existing controls and features and the addition of some new ones. Go to the CompanionKit

    Read the article

  • NTOP gives warnings on startup

    - by FR6
    I just installed ntop 1.4.4 and when I start it, it give me infinite warnings "packet truncated": ... RRD_DEBUG: umask 0066 RRD_DEBUG: DirPerms 0700 THREADMGMT: RRD: Started thread (t2992630672) for data collection THREADMGMT[t2992630672]: RRD: Data collection thread starting [p30923] INIT: Created pid file (/var/run/ntop.pid) THREADMGMT[t3086329552]: ntop RUNSTATE: INITNONROOT(3) Now running as requested user 'nobody' (99:99) Note: Reporting device initally set to 0 [eth0] (merged) THREADMGMT[t3086329552]: ntop RUNSTATE: RUN(4) THREADMGMT[t2982140816]: NPS(1): Started thread for network packet sniffing [eth0] THREADMGMT[t2982140816]: NPS(eth0): pcapDispatch thread starting [p30923] THREADMGMT[t2982140816]: NPS(eth0): pcapDispatch thread running [p30923] THREADMGMT[t3047009168]: SIH: Idle host scan thread running [p30923] THREADMGMT[t3057499024]: SFP: Fingerprint scan thread running [p30923] **WARNING** packet truncated (8814->8232) **WARNING** packet truncated (10274->8232) **WARNING** packet truncated (8814->8232) **WARNING** packet truncated (8814->8232) ... Do I need to configure something? I tried to access the web interface (http://localhost:3000) but it does not work. Note: I'm on CentOS. EDIT: Not sure if it helps but there is my "ifconfig": eth0 Link encap:Ethernet HWaddr 00:16:76:BC:7E:77 inet addr:192.168.0.221 Bcast:192.168.0.255 Mask:255.255.255.0 inet6 addr: fe80::216:76ff:febc:7e77/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:15496640 errors:0 dropped:0 overruns:0 frame:0 TX packets:19256813 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:836230629 (797.4 MiB) TX bytes:608496148 (580.3 MiB) Memory:dffe0000-e0000000

    Read the article

  • Comparing Nginx+PHP-FPM to Apache-mod_php

    - by Rushi
    I'm running Drupal and trying to figure out the best stack to serve it. Apache + mod_php or Nginx + PHP-FPM I used ApacheBench (ab) and Siege to test both setups and I'm seeing Apache performing better. This surprises me a little bit since I've heard a lot of good things about Nginx + PHP-FPM. My current Nginx setup is something that is a bit out of the box, and the same goes for PHP-FPM What optimizations I can make to speed up the Nginx + PHP-FPM combo over Apache and mo_php ? In my tests using ab, Apache is outperforming Nginx significantly (higher requets/second and finishing tests much faster) I've googled around a bit, but since I've never using Nginx, PHP-FPM or FastCGI, I don't exactly know where to start PHP v5.2.13, Drupal v6, latest PHP-FPM and Nginx compiled from source. Apache v2.0.63 ApacheBench Nginx + PHP-FPM Server Software: nginx/0.7.67 Server Hostname: test2.com Server Port: 80 Concurrency Level: 25 ---> Time taken for tests: 158.510008 seconds Complete requests: 1000 Failed requests: 0 Write errors: 0 ---> Requests per second: 6.31 [#/sec] (mean) Time per request: 3962.750 [ms] (mean) Time per request: 158.510 [ms] (mean, across all concurrent requests) Transfer rate: 181.38 [Kbytes/sec] received ApacheBench Apache using mod_php Server Software: Apache/2.0.63 Server Hostname: test1.com Server Port: 80 Concurrency Level: 25 --> Time taken for tests: 63.556663 seconds Complete requests: 1000 Failed requests: 0 Write errors: 0 --> Requests per second: 15.73 [#/sec] (mean) Time per request: 1588.917 [ms] (mean) Time per request: 63.557 [ms] (mean, across all concurrent requests) Transfer rate: 103.94 [Kbytes/sec] received

    Read the article

  • nginx load balance with IIS backend servers waiting Host header

    - by Elgreco08
    i have a ubuntu 10.04 with nginx /0.8.54 running as a load balance proxy named: www.local.com I have two IIS backend servers which responds on Host header request web1.local.com web2.local.com Problem: When i hit my nginx balancer on www.local.com my backend servers respond with the default server blank webpage (IIS default page) since they are waiting for a right host header (e.g. web1.local.com) my nginx.conf upstream backend { server web1.local.com:80; server web2.local.com:80; } server { listen 80; location / { proxy_pass http://backend; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $proxy_host; } } any hint ?

    Read the article

  • backup util for binary/media files. (to use with source control)

    - by acidzombie24
    I am using git for my source control. I dont backup media such as gifs, pngs, etc. I am thinking everytime i tag a release it would be a good idea to backup the media files as well. But i dont want to make several copies of the same file each time i create a tag. I'd like an app to handle checking if the file already exists and handles restoring everything to a version i like What util might i use to do this? I'm using windows 7.

    Read the article

  • Remote connect into macbook pro at a different resolution

    - by user60277
    Hello, I have a Dell laptop with Windows 7 on it. Its resolution is 1920x1080. I want to connect to a macbook pro at that resolution. The macbook pro has a resolution of 1440x900 so when I VNC into it, I can only see 1440x900 box with black borders on full resolution. The macbook pro can drive resolutions of 2560x1440. What program do I use to connect to the macbook at full (1920x1080) resolution. I can use remote desktop and connect from the dell laptop to another dell laptop that has a 1440x900 max. resolution. However in case of Remote desktop connection I can expand the window to be 1920x1080. I'm using TightVNC viewer on Windows. Thanks

    Read the article

  • WordPress : mise à jour de sécurité très importante qualifiée de critique par le créateur du CMS, qui invite à l'appliquer sur-le-champs

    WordPress : mise à jour de sécurité très importante Qualifiée de critique par le créateur du CMS qui invite à l'appliquer sur-le-champs Mise à jour du 30/12/10 WordPress, le moteur de blog en PHP qui se transforme de plus en plus en CMS ultra-complet, doit être mis à jour rapidement. C'est en tout cas le message que donne de son équipe de développement qui vient de sortir, en pleine période de fête, une mise à jour de sécurité qualifiée de « importante ». La période, très calme et où beaucoup de responsables web sont en vacances, n'est pas propice à ce genre de patch. Matt Mullenweg, le créateur de WordPress, en a bien c...

    Read the article

  • Google va renforcer ses mesures anti-cloacking, un changement important qui pourrait impacter les sites mobiles et les contenus riches

    Google va renforcer ses mesures anti-cloacking Un changement important qui pourrait impacter les sites mobiles et les contenus riches Comme résolution du nouvel an, Google a décidé de resserrer l'étau sur le « cloaking », cette pratique qui consiste à présenter aux moteurs de recherche un contenu différent de celui présenté à l'utilisateur. Souvent utilisée à des fins de spam, cette technique est réprimée par Google et les autres moteurs de recherche. Pourtant, de nombreux webmasters la trouvent utile pour améliorer le référencement de sites conçus avec des technologies encore mal prises en compte par les bots des moteurs de recherche, comme le Flash ou le Rich Medi...

    Read the article

  • Webcenter 11g Patch Set 3 (PS3) - Formação para Parceiros - 19/Jan/11

    - by Claudia Costa
    O Oracle WebCenter Suite consiste num conjunto integrado de soluções  baseadas em standards de mercado, com o objectivo de criar aplicações de negócio, portais corporativos, comunidades de interesse, grupos colaborativos, redes sociais, consolidar sistemas aplicacionais web e potenciar as funcionalidades web 2.0 dentro e fora de uma organização. Toda a solução está em conformidade com os principais Standards de mercado e baseia-se numa arquitectura totalmente orientada ao serviço (SOA). Venha conhecer nesta sessão as novas funcionalidades do Webcenter Suite 11g PS3. Agenda 09.30h Boas Vindas e Introdução 09.40h Oracle & Enterprise 2.0 - João Borrego 10.00h Introduction to Oracle WebCenter Suite as a User Experience Platform (UXP) - Monte Kluemper 10.40h Coffee Break 11.00h Building Rich UIs with Oracle WebCenter Portal - Monte Kluemper 12.00h Interactive Q&A Session - João Borrego e Monte Kluemper 12.30h Almoço 14.00h Deep-dive into WebCenter Technical Architecture - Monte Kluemper 15.30h Final da Sessão Target: - Equipas de Venda e Comerciais (manhã)- Equipas Técnicas e de pré-venda (tarde) Data e Local:19 de JaneiroLagoas Park Hotel Para este Workshop os lugares estão limitados. Por favor aguarde um email de confirmação de sua inscrição.Inscrições : Email Para mais informações, por favor contacte: Claudia Costa / 21 423 50 27

    Read the article

  • I Start!

    - by andyleonard
    I originally titled this post "I Quit!" but decided that doesn't set the proper tone and definitely does not match my feelings about the upcoming transitions in my life. "I Start!" is much more appropriate! Introduction I've tendered my resignation from the position of Manager, ETL Team, Data Management Group, Molina Medicaid Solutions effective Friday 14 Jan 2011. "There I Was..." In 2008 my consultant billable-days - the metric I use to determine how business is going - dropped from 20 / month...(read more)

    Read the article

  • An XEvent a Day (29 of 31) – The Future – Looking at Database Startup in Denali

    - by Jonathan Kehayias
    As I have said previously in this series, one of my favorite aspects of Extended Events is that it allows you to look at what is going on under the covers in SQL Server, at a level that has never previously been possible. SQL Server Denali CTP1 includes a number of new Events that expand on the information that we can learn about how SQL Server operates and in today’s blog post we’ll look at how we can use those Events to look at what happens when a database starts up inside of SQL Server. First...(read more)

    Read the article

  • Value of Internationalization in the iPhone App store?

    - by hotpaw2
    I have several iOS/iPhone apps that have been continually selling in small amounts in over 2 dozen different countries, even though the app UIs and all the store descriptions are only in English. In a few countries where English is not the official or native language, a few apps are selling far better than is proportionate for those country's population size compared with the U.S. So why Internationalize apps? What kind of increase, if any, in sales might a typical app see if it is Internationalized into given local languages? Which major languages might be likely to see the greatest improvement in app sales or downloads due to a localized app description?

    Read the article

  • Unicode To ASCII Conversion [closed]

    - by Yuvaraj
    Hi all, i creating an small application in Delphi 2009. here i got problem that when i run my application in WindowsXP its working but it is not working in Windows95. i know the problem that 95 will not support Unicode. if anyone knows the solution please tell me. and also i have one more idea that converting Unicode to ASCII. is it possible please tell how to do that. Thanks in Advance Worm Regards, Yuvaraj

    Read the article

  • How would you want to see software intellectual property protected?

    - by glenatron
    Reading answers to this question - and many other discussions of software patents - it seems that most of us as programmers feel that software patents are a bad idea. At the same time we are in the group most likely to lose out if our work is copied or stolen. So what level of Intellectual Property Protection does code and software need? Is copyright sufficient? Are patents necessary? As software is neither a physical object nor simple text, should we be thinking of a third path that falls somewhere between the two? Do we need any protection at all? If you had the facility to set up the law for this, what would you choose?

    Read the article

  • SQL: empty string vs NULL value

    - by Jacek Prucia
    I know this subject is a bit controversial and there are a lot of various articles/opinions floating around the internet. Unfortunatelly, most of them assume the person doesn't know what the difference between NULL and empty string is. So they tell stories about surprising results with joins/aggregates and generally do a bit more advanced SQL lessons. By doing this, they absolutely miss the whole point and are therefore useless for me. So hopefully this question and all answers will move subject a bit forward. Let's suppose I have a table with personal information (name, birth, etc) where one of the columns is an email address with varchar type. We assume that for some reason some people might not want to provide an email address. When inserting such data (without email) into the table, there are two available choices: set cell to NULL or set it to empty string (''). Let's assume that I'm aware of all the technical implications of choosing one solution over another and I can create correct SQL queries for either scenario. The problem is even when both values differ on the technical level, they are exactly the same on logical level. After looking at NULL and '' I came to a single conclusion: I don't know email address of the guy. Also no matter how hard i tried, I was not able to sent an e-mail using either NULL or empty string, so apparently most SMTP servers out there agree with my logic. So i tend to use NULL where i don't know the value and consider empty string a bad thing. After some intense discussions with colleagues i came with two questions: am I right in assuming that using empty string for an unknown value is causing a database to "lie" about the facts? To be more precise: using SQL's idea of what is value and what is not, I might come to conclusion: we have e-mail address, just by finding out it is not null. But then later on, when trying to send e-mail I'll come to contradictory conclusion: no, we don't have e-mail address, that @!#$ Database must have been lying! Is there any logical scenario in which an empty string '' could be such a good carrier of important information (besides value and no value), which would be troublesome/inefficient to store by any other way (like additional column). I've seen many posts claiming that sometimes it's good to use empty string along with real values and NULLs, but so far haven't seen a scenario that would be logical (in terms of SQL/DB design). P.S. Some people will be tempted to answer, that it is just a matter of personal taste. I don't agree. To me it is a design decision with important consequences. So i'd like to see answers where opion about this is backed by some logical and/or technical reasons.

    Read the article

  • H1 vs H2 vs Other for website title/logo and SEO

    - by Ilian Iliev
    It is a common practice for front-end developers to put the website title or logo in H1 tag and the title in H2. But most of the time the title of the page/article is more important because it caries the content value. So my question is what is the best approac from semantic and seo viewpoint. Examples: logo - H1, title - H1 logo - H1, title - H2 logo - H2, title - H1 logo - other tag, title - H1 Provided other variants if you think they will have bigger effect.

    Read the article

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