Posts

Showing posts from March, 2013

Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

audio - Playing stereo wav file in android -

i playing stereo wav file in android in application using soundpool in infinite loop. i changing left right channel sound using setvolume, every 1 second int looper = 0; timerhandler() { if(looper == 0) { soundpool.setvolume(sid, 0, 1) ; looper = 1; } else { soundpool.setvolume(sid, 1, 0) ; looper = 0; } } its working fine in emulator. on device not getting stereo effect. can issue. could "the device" has single (mono) output?

c# - Windows form hanging problem -

consider scenario: have 2 forms (form1 , form2). when button clicked in form1, loads form2. form2 contains gridcontrol show data. since data large, form2 takes time load. freezes whole application. i access form1 while form2 loading. possible? you use backgroundworker load data in separate thread avoid blocking main thread.

Where can I find diagrams for drupal? -

i need diagrams, logic database diagram (entity relationship diagram) of drupal. i've tried http://drupal.org/node/1161 links broken. when install drupal mysql database, suggest using fine " mysql workbench " , reverse engineer database. no matter structure, find nice er-diagramm no matter drupal version. for more figures: through docs , community pages. there is, example, nice illustration how forms working.

jquery - Dialog _ jQuerymobile -

i want open dialog box based on ajax result. how create/open dialog .js file? anyone me. thanks in advance. if link file this: <a href="foo.html" data-rel="dialog">open dialog</a> it's done ajax anyway and degrades nicely people lesser js support. the way want it: create wrapping div content , give data-role=dialog attribute, call .dialog() on it, or .page() if dialog doesn't work. update: jqmbeta2 introduces 'create' event have trigger on stuff instead of using .page

richfaces - rich:modalPanel closes without Validation -

i trying validate data in inside rich:modalpanel; behavior see quite strange. i have dropdown , add button dropdown, first time when try add data dropdown clicking add button validations successful, how oever when once user adds data first time , tries enter new data second time opening newadduserdialog; , when validation fails, modal panel hides. if remove code hiding modal panel (oncomplete event inside a4j:commadbutton), window closes on click of buttion. <rich:modalpanel id="newadduserdialog" autosized="true"> <a4j:outputpanel id="addname_panel" styleclass="largepanel"> <a4j:form> <rich:messages layout="list" showdetail="false" errorclass="validationerror" /> <h:panelgrid columns="2" cellpadding="10" cellspacing="10" width="100%"> <h:outputlabel

TCPDF library in JOOMLA! component outputs html in PDF -

i have component in joomla exports pdf, problem i'm encountering pdf exported unreadable because html of joomla! page in inserted after , before pdf itself. i have made standard structure of component , call like index.php?option=com_listado_factura&task=exportar_pdf being com_listado_factura name of component , exportar_factura function of controller exports pdf. i've looked everywhere , couldn't find solution, thanks the solution call: ob_end_clean(); before $tcpdf->output();

css - Create a thumbnail image if a video type file is uploaded -

my requirement if user had added video type link create thumbnail name had provided added video link , play button image in center if user clicks on take him link provided. a sample type expecting given here i had researched lot creating thumbnails (youtube videos can provided urls not can of type) so had zeored on process. questions how mock image showed in above dynamic image of text , transperent icon foreground html tags no jquery

ruby on rails 3 - My application is showing EXTRA info...which is NOT needed -

i have action called 'list' , defined like def list @subjects = subject.order("subjects.position asc") end and list view looks like <div> <h2>subjects</h2> <%= link_to("add new subject",{:action=>'new'},:class=>'action new')%> <table class="listing" summary="subject list"> <tr class="header"> <th>&nbsp;</th> <th>subject</th> <th>visible</th> <th>pages</th> <th>actions</th> </tr> <%= @subjects.each |subject| %> <tr> <td><%=subject.position%></td> <td><%=subject.name%></td> <td class="center"><%=subject.visible ? 'yes':'no' %></td> <td class="center"><%=subject.pages.size%></td> <td

OSX Server: apache2 running but “Problem loading page” -

i have setup osx server 10.6, updates installed, started apache2, running: sudo apachectl graceful i see in /var/log/apache2/errorlog [fri dec 17 10:11:49 2010] [notice] apache/2.2.15 (unix) configured -- resuming normal operations also ps -ef | grep httpd shows several processes: 0 49388 1 0 0:00.05 ?? 0:00.07 /usr/sbin/httpd -d foreground 70 49389 49388 0 0:00.00 ?? 0:00.00 /usr/sbin/httpd -d foreground 70 49390 49388 0 0:00.00 ?? 0:00.00 /usr/sbin/httpd -d foreground 70 49391 49388 0 0:00.00 ?? 0:00.00 /usr/sbin/httpd -d foreground 70 49392 49388 0 0:00.00 ?? 0:00.00 /usr/sbin/httpd -d foreground ... in httpd.conf edited documentroot: servername bioinfo.mni.fh-giessen.de:80 documentroot "/volumes/serverhd2/web_documents" errorlog "/var/log/apache2/error_log" <directory "/volumes/serverhd2/web_documents"> order allow,deny allow &

objective c - What is the difference between valueforKey:, objectForKey:, and valueForKeyPath:? -

i have 2 questions: what difference between valueforkey: , objectforkey: ? 1 nsdictionary s ( objectforkey: ) , others valueforkey: , or reverse? also difference between valueforkey: , valueforkeypath: ? has got core data? please help. valueforkey: part of nskeyvaluecoding protocol , therefore part of key-value coding framework, allows access class properties name @ runtime. that's how nibs loaded, example — names of properties associated connections loaded , values set directly name. contrasts way visual interface design tools work in other languages, generating lots of hidden statically compiled code. objectforkey: defined on dictionaries only, , looks object key. nsdictionary class stores connections between values , keys. so, valueforkey: used on nsdictionary return meta information dictionary, such count of objects inside it, list of keys, etc. objectforkey: used dictionary. at runtime, difference objectforkey: method opaque implementation. val

java - Use Spring Security with JPA -

i new spring. we using spring security feature. database connectivity: eclipselink implementation of jpa. database: mysql while using spring security, configuration of authentication provider follows,- <authentication-provider> <jdbc-user-service id="userdetailsservice" data-source-ref="datasource" /> </authentication-provider> but in jpa not define datasource, use persistence unit provider jpa.persistenceprovider. so how configure authentication provider use jpa database connectivity? what should data-source-ref field contain use database authentication? thank in advance. basically need implement userdetailsservice yourself . so example have user entity, , userdetailsservice implementation user , convert userdetails object (or entity have implement userdetails ). sample implementation: public class myuserdetailsservice implements userdetailsservice{ private entitymanager entitymanager; @pers

How do I schedule a cron job to run every hour and a half? -

possible duplicate: how can set cron run commands every 1 , half hours? i know every 2 hours is: * */2 * * * command-to-run but how schedule cron job run every hour , half? you can two cron jobs: 0 0,3,6,9,12,15,18,21 * * * myprog myargs 30 1,4,7,10,13,16,19,22 * * * myprog myargs this has advantage of working on ancient systems don't support /2 -type syntax.

java - JUnit test — analysing expected Exceptions -

this question has answer here: in java how can validate thrown exception junit? 9 answers in junit, i'm using annotation expect exception in tests. is there way analyse exception? example, expect criticalserverexception , want verify content of getmessage method. if have junit 4.7 or above try expectedexception there example in this question , copied below: @rule public expectedexception exception = expectedexception.none(); @test public void testrodnecislorok(){ exception.expect(illegalargumentexception.class); exception.expectmessage("error1"); new rodnecislo("891415",dopocitej("891415")); }

c++ - Simultaneous TCP Open -

i implementing "simultaneous tcp open".that means both peer try connect each other @ same time. confused whether listen rquired or not in case. or tell me sequence of socket need called each client. i implementing tcp hole punching. thanks, from wikipedia's article on tcp hole punching : because both parties connection each other (e.g. 2 x connect(), no listen(), accept(), etc.) generate outbound traffic there problem with: tcp sequence numbers acknowledgment numbers the required state after three-way-handshake: each host must have acknowledge number == other sequence number + 1. achieved through sequence , acknowledgement number coordination. listen() not needed. sequence depends on available.

certificate - PKCS#12 import fails on some Windows XP configurations fail "CertUtil: The system cannot find the file specified." -

i have .p12 ( pkcs#12 ) certificate file imports on xp machines, not on others. the file contains tree of certificates (see below). on failing machine mentions error: certutil: -importpfx command failed: 0x80070002 (win32: 2) certutil: system cannot find file specified. what might cause error? machine works: c:\post-install-scripts>certutil -v -f -user -p "example" -importpfx "client.p12" "noexport" 402.203.0: 0x80070057 (win32: 87): ..certcli version host.example.nl -- host.example.nl-e493af87-491e-4c3-55290 host.example.nl -- host.example.nl-e493af87-491e-4c37-9c4d-5a183f833394 420.62.0: 0x80090016 (-2146893802): microsoft base cryptographic provider v1.0 420.69.0: 0x80090016 (-2146893802): host.example.nl-e493af87-491e-4c37-9c4d-5a183f833394 certificate "cn=host.example.nl, o=example, l=location, c=nl" added store. machine fails: c:\post-install-scripts>certutil -v -f -user -p "example" -importpfx "

windows - How to view the variable values in release builds -

i want able see variable values while debugging release application. have set compiler option z7 , given /debug , /pdb: linker option. have pdb application. with set able put break point (windbg) inside code , hits properly. not able see variable values. the locals window shows pointer value cant see contents of same. instance if have pointer structure has int inside it, shows value of pointer. if expand same clicking + in tree, see variable name value <memory access error> how should make release builds show variable values? many times, cannot see them because don't exist. if @ optimized assembly code, find many intermediate variables removed in favor of performance. you're seeing, , way around follow disassembly , watch right memory locations / registers.

c# dllimport of MsiGetShortcutTarget(msi.dll) failed with error 1603 under Windows 7 -

i want resolve advertised msi shortcut in c# described here: how parse "special" .lnk files, aka. msi shortcuts aka. windows installer advertised shortcuts using c# [dllimport("msi.dll", charset = charset.auto)] private static extern uint32 msigetshortcuttarget( string szshortcuttarget, [out] stringbuilder szproductcode, [out] stringbuilder szfeatureid, [out] stringbuilder szcomponentcode); public static string parseshortcut(string file) { stringbuilder product = new stringbuilder(maxguidlength + 1); stringbuilder feature = new stringbuilder(maxfeaturelength + 1); stringbuilder component = new stringbuilder(maxguidlength + 1); uint32 res = msigetshortcuttarget(file, product, feature, component); ... } i use vs 2010 , tried different settings "platform target" and/or "target framework". msigetshortcuttarget returns 1603 (a fatal error occurred during installation) under windows 7. i tried same c++ ,

Java's Float.floatToIntBits implementation code in C\C++ -

i want source code java's float.floattointbits() implementation code in c\c++. this seems best solution: #include <cstring> unsigned float_to_bits(float x) { unsigned y; memcpy(&y, &x, 4); return y; } of course depends on float , unsigned consuming 4 bytes.

m2eclipse dependency to open project in workspace is missing when run project -

i'm working on application contains several modules. modules defined independent maven-projects , have dependencies between each other. question let talk example there exists project-a , project-b , project-b depends on project-a. dependency defined in pom of project-b. as long project-b opened in eclipse, m2eclipse includes jar-file of project-a class path , can run project-b pressing ctrl + f11 (or select "run" in eclipse's "run"-menu). if both projects opened in eclipse, dependency resolved eclipse-project , no more jar-file , run-command fail because m2eclipse obiously not include project-a's target-folder class-path. does has hint how can open both projects in eclipse , let project-b run? tomka. i'm quite new maven & m2eclipse myself, have tried disabling workspace resolution ([someproject] -> maven -> disable workspace resolution) ?

Tool to detect non-dotted relative imports in Python? -

it's considered bad python use imports this: import my_module when doing relative import , work: from . import my_module is there tool can detect these non-dotted relative imports in code , warn me update them dotted syntax? my project has hundreds of python modules , automatically. (possibly such tool override __import__ , detect bad imports happen when run program.) does know of such tool? [reposted answer because apparently did trick] 2to3 automatically convert them, because it's compulsory in python 3. here's relevant source code if want modify purposes. alternatively, run 2to3 fixer: 2to3 -w -f import myproject/

Native XML Web Services for SQL Server 2008 -

i want share few small tables sql server 2008 database. client html/javascript based. started native xml web services sql server, it's deprecated in sql server 2008 . is there other quick , cheap solution, rather building data service scratch? i don't know built in functionality of sqlserver, using odata interface, described here (there explains how build scratch using stackoverflow database). it's using entity framework, , it's nice have, quick build, doesn't require knowledge it, , it's easy tweak further.

javascript - prepare to focus first active element in a container -

i have container on page should prepared focusing, i.e. when user pressed tab button, first active element in container must focused. the simplest way have thought far find last active element before container, focus , blur it. work? there simpler way? how find last active element before container (cross-browser)? i not want change tabbed elements order, want define next element selected. please use raw javascript, not frameworks. the thing can think of looping on container child nodes , try focusing them until succeed: <script type="text/javascript"> document.onkeyup = function (e) { if (!e) e = window.event; var keycode = e.keycode || e.which; if (keycode == 9) { focusfirst(document.getelementbyid("mycontainer")); } } function focusfirst(element) { try { element.focus(); } catch(ex) {} if (document.activeelement == element) return true; (var = 0; < element.childnode

c++ stl vector causing memory overflow? -

i making extensive use of stl vectors manage memory (de-) allocation of large arrays of data. in particular generating perspective projections of anatomical structures large number of angles (180 in 2 degree steps), processing , analysing results. results used define radiation fields radiotherapy. it seems if arrays exceed size (>3 anatomical structures) memory overflows. in particular error follows terminate called after throwing instance of 'std::out_of_range' what(): vector::_m_range_check this result of using at, bounds checking, rather faster [] operator. if have <=3 structures error not occur. i have tracked error down following block of code bool dicomcp::assignbeamlet(int beamletnumber, beamlet &b1) { //std::cout << "\ninside dicomcp::assignbeamlet (int, beamlet &)\n"; if (!this->isset) { this->beamlets.at(beamletnumber).setleftright(b1.left,b1.right); this->isset=true; return true; } else i

.net - SqlCommandBuilder not assigning ConnectionString -

i'm using devexpress xtragrid in layout view edit created database row. code use load data: public function setdata(byval connstring string, byval tabla string) boolean dim d new datatable dim cmd new sqlcommand try using conn new sqlconnection(connstring) conn.open() cmd.connection = conn m_tabla = tabla if (m_id = "") cmd.commandtext = "select * " & m_tabla else cmd.commandtext = "select * " & m_tabla & " idcaptura = '" & m_id & "'" end if m_adapter = new sqldataadapter(cmd) m_dataset = new dataset() m_adapter.fill(m_dataset, m_tabla) grdmetadata.datasource = m_dataset.tables(m_tabla) return true end using catch ex exception return false end try end function the database can different c

.net - Unable to Open .DBF Files in Windows 7 That Had Worked Under XP -

i have vb.net application let me preview .dbf files come in of our clients. application attempts spit out csv file can use in our various environments. application worked under windows xp 32 bit. our company upgraded of windows 7 x64 has caused application fail. verified target build application x86 , not "any cpu" , rebuilt app same issues occur. it used system.data.odbc , connection.connectionstring = "driver={microsoft dbase vfp driver (*.dbf)};sourcetype = dbf;sourcedb=" & dbfsourcepath & ";exclusive=no; collate=machine;backgroundfetch=no;" . location of failure @ connection.open() . error given is: "error [im001] [microsoft][odbc driver manager] driver not support function". i noticed drivers vfp not installed , access dbf drivers did not work similar post here . fix listed there install vfpro sp2, however, not have foxpro installs install service pack on top of. tried install oledb driver vfp 9.0 , using system.data.oledb

How to convert simple array into two-dimensional array(matrix) in javascript (or jquery) -

imagine have array a = array(1, 2, 3, 4, 5, 6, 7, 8, 9) and want convert 2-dimensional array (matrix of n x m), instance this: a = array(array(1, 2, 3), array(4, 5, 6), array(7, 8, 9)) note, rows , columns of matrix changeable. something this? function listtomatrix(list, elementspersubarray) { var matrix = [], i, k; (i = 0, k = -1; < list.length; i++) { if (i % elementspersubarray === 0) { k++; matrix[k] = []; } matrix[k].push(list[i]); } return matrix; } usage: var matrix = listtomatrix([1, 2, 3, 4, 4, 5, 6, 7, 8, 9], 3); // result: [[1, 2, 3], [4, 5, 6], [7, 8, 9]]

java - Looking for ideas for Multipart Form Handling on Web Service -

i'm playing around writing web service runs on android handles uploading photos. writing server, , not have control on client. inside of message small soap message, , binary data. trying figure out if there's library can parsing of 2 pieces. apache commons fileupload looked obvious choice, however, seems heavily intertwined servlet libraries, , don't know if it's possible (or if it's idea) put j2ee infrastructure on phone. parsing myself doesn't seem bad. i'm not familiar raw http layers/protocol, looks the boundary delimiter string given in content type header. if find , index past those, should able find 2 halves of multi-part message need deal with. @ least that's seem think after looking @ wireshark trace of client talking real server. any thoughts appreciated. -kevin have looked using mtom ? check out tutorial if fits needs!

Remove trailing "=" when base64 encoding -

i noticing whenever base64 encode string, "=" appended @ end. can remove character , reliably decode later adding back, or dangerous? in other words, "=" always appended, or in cases? i want encoded string short possible, that's why want know if can remove "=" character , add before decoding. thanks the = padding. wikipedia says an additional pad character allocated may used force encoded output integer multiple of 4 characters (or equivalently when unencoded binary text not multiple of 3 bytes) ; these padding characters must discarded when decoding still allow calculation of effective length of unencoded text, when input binary length not multiple of 3 bytes (the last non-pad character encoded last 6-bit block represents zero-padded on least significant bits, @ 2 pad characters may occur @ end of encoded stream). if control other end, remove when in transport, re-insert (by checking st

Safari - How do I create pixel-perfect layouts without PixelPlugin (firefox addon)? -

pixelperfect ff addon overlays image onto browser viewport. there alternative or port of addon/extension safari? this useful if it's own site, maybe: http://codecanyon.net/item/xprecise/78685

xslt, how to 'flatten' the tag structure for unknown number of child tags -

my source file looks this: <x> <names> <name>name1</name> <name>name2</name> </names> <codes> <code>code1</code> <code>code2</code> </codes> <stuff> stuff </stuff> </x> and i'd transform output: <out> <y> <name>name1</name> <code>code1</code> <stuff> stuff </stuff> </y> <y> <name>name2</name> <code>code2</code> <stuff> stuff </stuff> </y> </out> i don't know number of name , code tags in source file, know numer of names equals number of codes. please share tips, how it. this transformation : <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:output omit-xml-declaration="yes" indent="yes"/> <xsl:template

How to access Android activity class instance fields? -

suppose have 2 classes extends activity; activitya , activityb, , declared in manifest xml. now, want call activityb activitya , access activityb's fields. intent myintent = new intent(myapplication.getinstance().getapplicationcontext(), activityb.getclass()); startactivityforresult(myintent,0); this code not return object of activityb, have tried instantiation manually such that: activityb actb=new activityb(); that's ok, how pass intent? is possible? now, want call activityb activitya , access activityb's fields. please don't. first, short of passing activities around via static data members or via service, impossible. second, create garbage collection issues, android want destroy old activities free memory, after does, still holding references activities other activities, negating work. third, holding destroyed instances of other activities, same reason in previous point -- android go on destroying activities whether or not. i c

Issue tracker for web agency workflow -

we're looking implementing issue tracker our web agency. problem issue trackers seem revolve around assumption issue bug, whereas in web agency environment, lot of issues (request, or whatever want call them) changes , additions current web site. it seems me lot of issue trackers assume you're working on 1 main software project, , uses project focus of tracker. issue tracker web agency 1 puts each separate client , issues @ heart of system, making easy them track , report issues. does know of issue tracker web agency workflow? other people using? in experience, issue trackers closely coupled workflow of organisation works in 1 place may complete misfit in another. said, basecamp work you?

Backend Programming: How does this work? -

i have been trying figure out. there more possibilities of having more 1 answer. know guys think well. for example, if go www.bookatable.com , try make table booking you'll see how booking widget works. questions how backend works? how can know how many tables available book? or how many seats? duplications? etc... my guess be, restaurant provides availability , capacity? based on how many seats have rather how many tables? my name magnus hultberg, work @ livebookings provide technology used in restaurants working bookatable (among other partners). we have developed / acquired number of restaurant table management / diary systems in restaurants working maintain availability, manage guest databases , run dining sessions see tables booked , status in example. that data aggregated centrally expose available tables , other related functionality booking partners bookatable.com through our off shelf booking tools , our api. hope helps.

networking - How to monitor my network connection with Java? -

is there sample code can report url pc connecting java? while use browser connect different sites , watch video online, should capture urls. doable in java? i don't want detailed traffic, record urls. the fastest way going to capture output of command-line tshark program (for @ least windows , linux). works on linux box: sudo tshark -f 'port 80' -r 'http' -v | grep -a 1 '^hypertext transfer protocol' and produces output like: running user "root" , group "root". dangerous. capturing on eth0 hypertext transfer protocol /questions/4494294/r-gplots-barplots-how-to-fix-bar-width-independent-of-paper-setting http/1.1\r\n -- hypertext transfer protocol http/1.1 200 ok\r\n -- hypertext transfer protocol /posts/4494294/ivc/086e http/1.1\r\n -- hypertext transfer protocol http/1.1 204 no content\r\n -- hypertext transfer protocol [truncated] /__utm.gif?utmwv=4.8.6&utmn=20455052&utmhn=stackoverflow

c# - linq to sql optimized a group with multiple joins -

i need generating more efficient linq query: table: positions -positionid -name table: person -personid -name, etc... table: personposition -personid -positionid i need result set groups people assigned each position: positionid person 1 john bob frank 2 bill tom frank, etc... my first thought linq query: from perspos in personpositions join pers in persons on perspos.personid equals pers.personid group pers perspos.positionid groups select new {groups.key, groups} which works great, produces following sql: select [t0].[positionid] [key] [personposition] [t0] inner join [person] [t1] on [t0].[personid] = [t1].[personid] group [t0].[positionid] go -- region parameters declare @x1 int = 3 -- endregion select [t1].[personid], [t1].[userid], [t1].[firstname], [t1].[lastname], [t1].[email], [t1].[phone], [t1].[mobile], [t1].[comment], [t1].[permissions] [personposition] [t0] inner join [pe

android - Problems with SQLite database, error when creating -

i got error when start app: 12-20 22:27:01.447: error/database(716): failure 1 (near ":00": syntax error) on 0x1a4338 when preparing 'create table permission ( fk_email1 varchar(100) not null, fk_email2 varchar(100) not null, validated tinyint(4) default 0, hour1 time default 08:00:00, hour2 time default 20:00:00, date1 date default null, date2 date default null, weekend tinyint(4) default 0, fk_type varchar(45) default null, primary key (fk_email1,fk_email2))'. here code creating database: private static final string permission_table_create = "create table permission (" "fk_email1 varchar(100) not null, fk_email2 varchar(100) not null, " "validated tinyint(4) default 0, hour1 time default 08:00:00, " "hour2 time default 20:00:00, date1 date default null, " "date2 date default null, weekend tinyint(4) default 0, " "fk_type varchar(45) default null, primary key (fk_email1,fk_email2))"; private s

python - In Django, is there a built in filter which can mark these as safe? -

&gt; &lt;strong&gt; html tags, , more (these 3 examples) is there filter render these in django template, but keep tags escaped . no, there isn't - if mark safe , nothing escaped. if it's unsafe , be. there isn't way this content varying degrees of safe - if want this, you'll have write yourself.

Passing PHP GET into a jQuery function -

i'm using bit of jquery code uses li items select tab displayed. "tabs" divs. jquery code: $(document).ready(function() { //when page loads... $(".tab_content").hide(); //hide content $("ul.tabs li:first").addclass("active").show(); //activate first tab $(".tab_content:first").show(); //show first tab content //on click event $("ul.tabs li").click(function() { $("ul.tabs li").removeclass("active"); //remove "active" class $(this).addclass("active"); //add "active" class selected tab $(".tab_content").hide(); //hide tab content var activetab = $(this).find("a").attr("href"); //find href attribute value identify active tab + content $(activetab).fadein(); //fade in active id content

iphone - Inheriting UIView - Losing instance variables -

bit of objective-c rookie, i've looked around answer haven't been able find 1 forgive me if obvious question. basically, need draw on screen segments of circle (for instance, 90 degree segment, horizontal , vertical line meet @ bottom left , arc connects end points). i've managed achieve in custom class called circlesegment inherits uiview , overrides drawrect . my issue achieving programatically; need way of creating circlesegment class , storing in desired angle before draws segment itself. here's have far: circlesegment.h #import <uikit/uikit.h> @interface circlesegment : uiview { float anglesize; uicolor *backcolor; } -(float)convertdegtorad:(float)degrees; -(float)convertradtodeg:(float)radians; @property (nonatomic) float anglesize; @property (nonatomic, retain) uicolor *backcolor; @end circlesegment.m #import "circlesegment.h" @implementation circlesegment @synthesize anglesize; @synthesize backcolor; // initia

visual c++ - add non "type library" dll as reference to VS C++ 2008 -

Image
i received request colleague work out why specific dll cannot added reference in visual studio 2008 version 9.0.21022.8 rtm ms .net framework version 3.5 sp1. the language used visual c++ 2008, have never done in language, although i've done bit in c# before... please check following 2 error messages, first 1 came laptop, second colleague's: from google research afraid target dll is: not type library. confirmed running tlbimp utility: tlbimp c:\test\tm1api.dll ...... error ti0000 : input file 'c:\test\tm1api.dll' not valid type library what mean, convert type library? not .net assembly or registered activex control. dll not programmed in vs afraid. how verify this? basically confused, because 2 vs 2008 show different error messages, issue specific vs 2008 only? or there general solution in vs sort of thing? many in advance. you've got regular old dll. use dllimport access methods. aware there kinds of data marshalling issues

Generate HTML file from rspec -

how generate html report rspec? building off previous answer, pretty simple: rspec /directory/containing/specs/** --format h > output.html i run root of rails app following path spec/**. hope helps. if have non "_spec.rb" files in there might need modify path argument.

asp.net mvc - [HttpPost]public ActionResult Create(FormCollection collection) VERSUS [HttpPost]public ActionResult Create(Dinner dinner) -

in scott hanselman's book (chapter 1), provides 2 options implement [httppost] create action method. the first 1 relies on tryupdatemodel update model object based on incoming form fields. when incoming form fields contains invalid input, modelstate.isvalid set false. [httppost] public actionresult create(formcollection collection) { dinner dinner = new dinner(); if (tryupdatemodel(dinner)) { dinnerrepository.add(dinner); dinnerrepository.save(); return redirecttoaction("details", new { id = dinner.dinnerid }); } else return view(dinner); } the second method utilize model passed create action method arg follows: [httppost] public actionresult create(dinner dinner) { if (modelstate.isvalid) { dinnerrepository.add(dinner);

c# - How can we make the backward button disable in the all browsers? -

possible duplicate: disable browser's button hi everyone,i have portal site , want make backward button disable state after user gets logout.is possible c# programming?or need go client side scripts javascript or jquery?please me regarding . you can't on client server-side code (c#) except send content browser. there javascript things can manipulate history degree, guess have architecture problem here; there's no reason should prevent clicking 'back' because have logged out. application should detect logged out, , present them appropriate content. finally, answer question: can't disable button. period.

variables - Php script, query ran from value thats passed in -

i pretty new @ php, quick note android application calling script, not having users make script lol. there series of checkboxs , when check off ones appends script string builder. trying run query based on value of variable being passed in. this, mssql_query("update userdata set browsescript = '".$_request['sqlscript']."' userdata.username = '".$_request['username']."'"); and says . $_request[''] can grab values pass in. but time .$_request[''] whole script, want this mssql_query($_request['sqlscript']); and thats want run query thats in value, query correct, not return value, think may have type of syntax error or something, said new php. help. not posting whole code because running ok, cant query run. need assistance mssql_query part again. first of there huge security flaw in doing . should sanitalize , escape variables use in queries example using mysql_real_escape_str

Eclipse action/macros -

does know how force eclipse actions after starting? e.g. open file, click menu item, change properties in dialog etc. thanks escripts eclipse scripting plugin. @ this link see, after installing , creating script, how can have executed changing shortcut use start eclipse.

Jquery dynamic text effect / class problem -

i have html file containing table rows n columns. each row contain button, has functions. first, has submit data in row php file, not printing anything. button have change text , text in column 5 of corresponding row. change text effect of button working well. change text effect of column 5 buggy. text of column5 in first row changing, no matter button click.. can fix problem me?? thanks in advance :) blasteralfred <head> <title></title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <style> .style1 { background-color: #c3d9ff; font-family:arial,sans-serif; } .style2 { text-align: center; font-weight: bold; } .style3 { background-color: #ffffff; font-family:arial,sans-serif; text-align: center; font-weight: bold; } body { font-family:verdana, arial, helvetica, sans-serif; font-size:15px; background-color: ; } .delete_button {

objective c - How to capture iPhone screen with animating UIImageView? -

i have uiimageview placed on view , want capture iphone screen while uiimageview animating. i can capture screen shots of still frames of uiimageview this: [[myview layer] renderincontext:context]; however when uiimageview animating throguh [myimageview startanimating] then, animating frames not captured. is there alternative renderincontext available @ moment can capture animating frames well? note: know uigetscreenimage() no longer accepted apple after ios4 update. calayers use presentationlayer represent current state of layer while animating. calayer 's -presentationlayer method returns presentation layer. might want try [[[myview layer] presentationlayer] renderincontext:context]; capture contents.

android - Get the Ringtone title from RingtonePreference -

i have ringtonepreference used select ringtone broadcasted receiver used in alarm application. display title (the titles displayed in list see when choose ringtone) of selected ringtone in summary of ringtoneprefernce. somehow id3 tag? ringtones mp3 not might not idea? what is: sharedpreferences prefs = preferencemanager.getdefaultsharedpreferences(getbasecontext()); strringtonepreference = prefs.getstring("ringtonepref", "default_ringtone_uri"); this make strringtonepreference "content://media/internal/audio/media/55" not informative user. how can this? uri ringtoneuri = uri.parse(strringtonepreference); ringtone ringtone = ringtonemanager.getringtone(context, ringtoneuri); string name = ringtone.gettitle(context);

Adding text scale to jQuery UI Slider -

how add scales poor, excellent, in jquery ui slider plugin |-------|--------|-------| poor excellent verygood try using filament group's jquery ui selecttouislider plugin

jsf 2 - Where can I find the primefaces tag library documentation? -

where can find primefaces tag library documentation such this: http://primefaces.prime.com.tr/docs/tag/index.html ? i have jar, sources of primefaces. apidoc supplied "primefaces 2.2.rc2 api", not "tag library documentation generator - generated documentation" maybe should try generating source, or maybe jar (although think javadocs not in bytecodes) ? here lies answer ethermion : descriptions dropped 2.2. nothing netbeans. you've got. optimus.prime : descriptions available in documentation promote primefaces user's guide 2.2. and this thread started me

java - Is there anything else to do Audio in 92khz to 192khz? -

i spend lot of time researching/finding best developer friendly framework or libraries cross platform deal solid/accurate/lipsync sort of audio solution. still not find 1 can used cross platform. i tried gstreamer (was best one) best linux covers celt/vorbis/speex (encoder/decoder), gstreamer great job linux. porting gstreamer windows , mac platform not friendly, , lot of restrictions, , facing lot of problems, found myself not best way build better application, way know audio. is there audio libraries or framework can handle lowest latency cross platform ? no matter language c/ada/lua/python/java..., study libraries. build own freedom of audio quality on internet musicians/conversation peer 2 peer in rtp method have maximum range of 192 khz. expecting experts, advise. my project is: 1. peer 1 - playing electrical guiter uk (london) 2. peer 2 - playing drums usa (new york) 3. peer 3 - playing bass guiter uk (luton) and peer 4 listening, , doing recording in holland (amste

Events Argumens JavaScript -

hello people have follow doubt: i'm manipuling activex object html tag : <object classid="clsid:3751b5d4-d348-11d0-ad02-0060970c3d2f" id="sdo_prr" name="sdo_prr" width="0" height="0"></object> ; and object return me events followin tags: <script language="javascript" for="sdo_prr" event="atprintrawend"> <!-- can put line code in here. //--> </script> to understand tag above explain yours attributes: when put attribute for="sdo_prr" , want script connected directly subject matter. when put attribute event , want script waiting event object, ie, script executed when object in question fire event atprintrawend . now question: event has argument in need it, argument event in c # example: eventargs e. thanks , regards, milton câmara gomes try defining event way instead: <script type="text/ja

wpf - Draw a line with a gradient brush (fade out from start to end point) -

my task pretty simple: draw line point point b , set different colors @ point , b, e.g. white @ , black @ b fade out line. i tried doing using lineargradientbrush: var brush = new lineargradientbrush( color.fromargb(255, 0, 0, 0), color.fromargb(255, 255, 0, 0), new point(0, 0), new point(1,1)); var pen = new pen(brush, 10.0); dc.drawline(pen, new point (300, 300), new point(300, 100)); but not produce wanted results since gradientbrush mapped according bounding box of object. therefore, results line going 100/100 200/200 , line going opposite direction same (which not want). how solve using wpf? thanks. edit: need use low level graphics functions (such drawline) performance reasons because draw lot of lines. how use lineargradientbrush article examples in both xaml , c# code. try approach , please tell me need. take attention please lines drawn in opposite directions. public partial class window1 : window { publ

ruby on rails - object.valid? returns false but object.errors.full_messages is empty -

i'm confuse objects can't save, simplified model class subscription < activerecord::base belongs_to :user, :class_name => "user", :foreign_key => "user_id" has_many :transactions, :class_name => "subscriptiontransaction" validates_presence_of :first_name, :message => "ne peut être vide" validates_presence_of :last_name, :message => "ne peut être vide" validates_presence_of :card_number, :message => "ne peut être vide" validates_presence_of :card_verification, :message => "ne peut être vide" validates_presence_of :card_type, :message => "ne peut être vide" validates_presence_of :card_expires_on, :message => "ne peut être vide" attr_accessor :card_number, :card_verification validate_on_create :validate_card def validate_card unless credit_card.valid? credit_card.errors.full_messages.each |message| errors.add_to_base me

vsto - Open XML SDK - Adding a macro programatically to a Word 2007 document -

i trying dynamically add new custom ribbon in word 2007 document following teh manual method described in article :- http://msdn.microsoft.com/en-us/library/aa338202(v=office.12).aspx . the article specifies following :- a) create xml file named customui.xml contain elements want display in tab , put same in folder named customui. b) rename word 2007 document .zip. add above "customui" folder zip file. c) add following relationship "_rels/rels" file in .zip file :- <relationship type="http://schemas.microsoft.com/office/2006/ relationships/ui/extensibility" target="/customui/customui.xml" id="customuirelid" /> do have code sample achieve same using openxml sdk? example, how add "ribbonextensibilitypart" (which contains ribbon xml) document? edit :- this how did above mentioned steps:- string documentfilename = <path of docx file>; string ribbonxml = <path of ribbon xml file

mmapping in Python C modules - any pitfalls to be aware of? -

i'm writing python module in c , intend mmap largeish blocks of memory (perhaps 500 mb). there working in same process space python interpreter should careful of? no, you're fine. on 32-bit systems, run out of virtual memory, or virtual memory fragmentation not have single chunk big enough map many huge files want. pitfall isn't particular cpython.

mysql - My working fine PHP scripts aren't working anymore -

i've been using long time , stopped working. don't why php changes on you. help. the problem these 2 lines: $res = mysql_query("select num ywsite item='sitehits'", $db); $num = mysql_result($res,0,"num"); here's rest of script: <?php $res = mysql_query("select num ywsite item='sitehits'", $db); $num = mysql_result($res,0,"num"); $equals = $num + 1; mysql_query("update ywsite set num='$equals' item='sitehits'"); ?> that seems rather complicated way increment number. instead: update ywsite set num = num + 1 item = 'sitehits' if fails use mysql_error see error. cause of error incorrect table or column name.

windows - Is there a command line alternative to the MSMQ management console available in the Computer Management snap-in? -

i using computer management snap-in inspect msmq status. specifically, outgoing queues. i wondering if there command line utility let me so. i.e. running utility display outgoing queues , status. thanks. no. you'd need write own app or script (or find 1 else has written). there's nothing in product you.

javascript - doesnt work in IE -

here javasript: function random_imglink() { var myimages = [ {image: "/documents/templates/projedepo/banner/canon.jpg", url: "/index.cfm?fuseaction=objects2.detail_product&product_id=612&stock_id=612"}, {image: "/documents/templates/projedepo/banner/indigovision.jpg", url: "http://www.url2.com"} ]; var ry=math.floor(math.random()*myimages.length); var randomimage = myimages[ry]; var randomimagelink = '<a id="random_link" href="' + randomimage.url + '"><img style="z-index:1;position:absolute; left:70px; top:360px;" border="0" align="absmiddle" src="/documents/templates/projedepo/banner/daha_fazlasi.jpg" /></a><img id="random_img" src="'+randomimage.image+'" height="420" width="964" />

silverlight - generate Grid from template -

howdy, i've got question regarding phone 7... want generate couple of grids in stackpanel - since have same layout thought great idea use datatemplates ... but found grid object has no "datatemplate" property , i'm kinda stuck ... template use following: <datatemplate x:key="speise"> <grid> <textblock height="36" margin="8,43,104,0" textwrapping="wrap" text="textblock" verticalalignment="top"/> <textblock horizontalalignment="right" height="36" margin="0,44,8,0" textwrapping="wrap" text="textblock" verticalalignment="top" width="92"/> </grid> </datatemplate> the way thought of creating objects is: grid blubber = (grid)this.resources["speise"]; but not working ... think it's again short thing, have no clue