Posts

Showing posts from May, 2011

Responsive page height as a div expands html css -

my situation: on page have multiple collapsible panels in right hand column of main content. @ moment happens when expand panel (which contains large amount of text) goes off page. therefore meaning user can't read it. due fact height hard coded. want happen when div expands, if reaches max height of page, page height expands incorporate of text. question: there way make possible page height expands along div? my css: .container { width: 1000px; margin: 0px auto; background-color:white; height: 0px auto; } #page { overflow: hidden; width: 900px; padding: 0px 50px 50px 50px; background-color: #ffffff; } #content { float: right; width: 580px; } thankyou suggestions instead of using height try set position "absolute" , 0px top , bot on .container? .container { width: 1000px; margin: 0px auto; background-color:white; top: 0px; bottom: 0px; }

c - Why am I getting a segfault here? -

code split data training / test subsets below. note data_points 1 long vector of size items*attr, , data_labels vector of size items. int split_data(int items, int attr, double *data_points, int *data_labels, double **split_train_points, int **split_train_labels, double **split_test_points, int **split_test_labels) { srand(time(null)); int i, j; double temp0, temp1; double sorter[items][2]; *split_train_points = malloc(floor(split_prop*items * attr) * sizeof(double)); *split_train_labels = malloc(floor(split_prop*items ) * sizeof(int)); *split_test_points = malloc(ceil((1-split_prop)*items * attr) * sizeof(double)); *split_test_labels = malloc(ceil((1-split_prop)*items ) * sizeof(int)); // create 2d array element number in 1 column , random number in other (i = 0; < items; i++) { sorter[i][0] = i; sorter[i][1] = rand() / (double)rand_max; } // sort random number column (i = items-1; > 0; i--) { (j = 1; j <= i;

jQuery Variable width slider -

i hate asking these kind of questions, running out of time. i prefer write sliders , carrousels etc own time limited. having tried numerous different carrousels, none seem want. what need carousel full-width , has fixed height. items shown should variable , widths of items, width of slider should filled slider items, if shown partially , should circular. i created jsfiddle: http://jsfiddle.net/bfs3q/ mighy explain question better, used caroufredsel plugin need not show items partially. perhaps if knows how caroufredsel, here used: $("#slider").caroufredsel({ width: "100%", align:"left", height: 150, direction :"left", items: { minimum: 1, start: 8, width: "variable", height: 150, visible: "variable" }, scroll: { items: 1, easing: "linear" }, auto:

Using Portable Class Libraries with Windows 8 / Windows Phone 8 MVVM - Page Navigation -

i'm developing app both windows 8 , windows phone 8. chose implement portable class library , share between 2 platforms. problem can't figure out how handle page navigation in pcl. i've used example folowing tutorial: using portable class library highly appreciated. thanks. the best approach create own abstraction around navigation. i'd create interface inavigationservice , , in non-pcl assemblies each platform create implementation of interface wrapping appropriate control (frame winrt , phonenavigationframe windows phone 8). i'd recommend looking @ source of caliburn.micro has similar approach abstract navigation. here sample shows how this: sharing code: adding navigationservice

.net - menu loading error in XNA project to load 3D menu -

i trying 3d menu in xna getting error following "the name 'item_ontap' not exist in current context." new xna programming.thank in advance. //modelmenugame.cs public class modelmenugame : microsoft.xna.framework.game { graphicsdevicemanager graphics; spritebatch spritebatch; spritefont font; model menuitemmodel; vector3 cameraposition; matrix view; matrix projection; list<modelmenuitem> menu; int totalmenuitems = 4; rectangle leftregion; rectangle rightregion; int currentindex = 0; public event eventhandler ontap; public modelmenugame() { graphics = new graphicsdevicemanager(this); content.rootdirectory = "content"; targetelapsedtime = timespan.fromticks(333333); // extend battery life under lock. inactivesleeptime = timespan.fromseconds(1); }

javascript - swipeJS with jquery mobile -

Image
i tried implement swipejs in jquery mobile application. here code of page on implement swipejs. full code: http://jsfiddle.net/unths/ (output on jsfiddle not same) <div id="slider" data-role="page"> <div data-role="content" id="contentslider"> <div id='myswipe' style='max-width:500px;margin:0 auto' class='swipe'> <div class='swipe-wrap'> <div><b>1</b></div> <div><b>2</b></div> <div><b>3</b></div> </div> </div> <div style='text-align:center;padding-top:20px;'> <button onclick='myswipe.prev()'>prev</button> <button onclick='myswipe.next()'>next</button> </div> </div> my problem is, following output. every "picture" on side. no picture slide. i have no idea whats problem is. :( i got workin

nsurl - how to convert %20 to space in Iphone SDK -

i working on app, in interacting web-service of time. getting problem when added space on somewhere convert space %20 when converting url request. googled couldn't find healthy solution according requirement because changing when url request. here doing. url = [url stringbyaddingpercentescapesusingencoding:nsutf8stringencoding]; request = [nsurlrequest requestwithurl:[nsurl urlwithstring:url]]; nslog(@"request : %@", request); [[nsurlconnection alloc] initwithrequest:request delegate:self]; and on nslog show me %20 ever space given. if know kindly suggest me better way solve issue. great me. in advance. you converting spaces %20 instruction: url = [url stringbyaddingpercentescapesusingencoding:nsutf8stringencoding] but necessary in order correct nsurlrequest , characters need conversion. you can reconvert them "normal" characters using other nsstring method: – stringbyreplacingpercentescapesusingencoding

iphone - UIScrollView in IOS -

i have gridview using, has header, side bar , gridview inside, have setup scrolling it's not working way want it. i'm trying make scrolling when scroll horizontally left side bar stay while grid scrolls when scroll vertically want move grid. , wanted header @ top same, vertically scrolling make stay , horizontally scroll make move grid. i have done scroll view moves , doesn't work right. so can please me, thanks. the best way so, move inside views of scollview in opposite direction of scrollview example have uiview called "bar" in scrollview, need detect every time scollview scolls delegate , move "bar" it: - (void)scrollviewdidscroll:(uiscrollview *)scrollview { // move horizontal if (self.lastcontentoffsetx != scrollview.contentoffset.x) { [bar setframe:cgrectmake(scrollview.contentoffset.x,bar.frame.origin.y, bar.frame.size.width, bar.frame.size.height)]; } // move vertical if (self.lastcontentoffsety != sc

c# - Starcounter LogSource -

i'm trying out starcounter beta, , create logsources. i did find class starcounter.logsources , has property hosting of type starcounter.logging.logsource . but don't understand how define own log source, appreciated. sorry documentation wasn't enough in case; it's 1 of things working on improve. the starcounter.logsources class single place keep few well-known log sources, sql , hosting (that mentioned). these used database engine. to create , start logging own source, it's easy as: var log = new logsource("foo"); log.logwarning("i've break loose!"); just make sure you've referenced starcounter.logging assembly.

html - addClass, removeClass, css jquery functions does not work -

i found this page , need change font color black white. i tried these ways did not work: jquery add class function (to add class span tag) jquery remove class function(to remove class scrollingnews marquee tag) jquery css function (to add css span tag) code: $(document).ready(function() { $('#tickerv span').addclass('test'); $('marquee').removeclass('scrollingnews') $('#tickerv span').css({color: white}); }); please can help? thanks try this $('span').css({ 'color': 'red'});

Java code to generate JSON hierarchical path -

i working on project need parse json in java , display hierarchical path of json key/node mentioned below. i'm developing program in java using jackson api not able readily available api return me hierarchical path of current key/node json. json data - {“tomcat-users”: { “role”:[ {“@rolename”:”manager-gui”}, {“@rolename”:”manager-script”}, {“@rolename”:”manager-jmx”}, {“@rolename”:”manager-status”} ], ”user”:{ “@username”:”admin”, ”@roles”:”manager-gui,manager-script”, ”@password”:”admin” } } } output should like - column 1 column 2 --------------------------------------------------------------------------- tomcat-users -> role[1] -> @rolename manager-gui tomcat-users -> role[2] -> @rolename manager-script tomcat-users -> role[3] -> @rolename manager-jmx t

php - How to Select 1 Row From Each 10 Rows in MySQL -

i recording real time change of given signal database table. then draw line graph visualize change of signal level. i want (10n+1) th rows in table make rough graph. 10 arbitrary. user may change value. does know how make just using mysql query if no, go php after selecting data. here table structure is: |id |signal1 |signal2 | signal 3 | +----------+----------+----------+------------+ |1 |0.41452 | 1.32135 | 0.31231 | ... if have auto_incrememt id column, can select rows divisible n select * tablename1 mod(id,10)=0; // id divided 10 remainder equal 0 (exact) or without sequential column id's select * ( select @row := @row +1 rownum, colname1 ( select @row :=0) r, tablename1 ) ranked rownum % 10 = 1

KeyListener error -

i have problem adding keylistener aplication: app.game not abstract , not override abstract method keyrelased(java.awt.event.keyevent) in java.awt.event.keylistener i try create new public class keyadapt . gives same error. code of application the: public int x = 100, y = 100; public class game extends jframe implements keylistener { public game() { super(); setdefaultcloseoperation(jframe.dispose_on_close); setlocationrelativeto(null); setundecorated(true); setlayout(null); setvisible(true); } public void paint (graphics gdc) { gdc.clearrect(0, 0, getsize().width, getsize().height); getgraphics().drawoval(x, y, 20, 20); } public void keypressed(keyevent e) { if (e.getkeycode() == keyevent.vk_up ) { y++; } if (e.getkeycode() == keyevent.vk_down ) { y--; } if (e.getkeycode() == keyevent.vk_right ) { x++;

java ee - Exception Reason while reading pdf in jsp -

i have wrote jsp servlet read pdf using itextpdf , end exception can tell me reason exception page.jsp <html> <%@page import="java.io.file"%> <%@page import="java.io.*"%> <%@page import="javax.servlet.*"%> <%@page import="com.itextpdf.text.image"%> <%@page import="com.itextpdf.text.document"%> <%@page import="com.itextpdf.text.documentexception"%> <%@page import="com.itextpdf.text.pdf.pdfreader"%> <%@page import="com.itextpdf.text.pdf.pdfimportedpage"%> <%@page import="com.itextpdf.text.pdf.pdfwriter"%> <%@page import="com.itextpdf.text.pdf.pdfcontentbyte"%> <% response.reset(); response.setcontenttype("application/pdf"); response.setheader("content-disposition", "inline;filename=saba_phbill.pdf"); file file = new file( "d:\\tnwrd_docume

css3 - Is it possible to create a button pointing downward (image included) with only CSS? -

Image
i create using css. possible? if so, can guys me out? fairly easy borders , pseudo element: <a href="#" id="button">all</a> #button::after { content: ""; border: 64px solid transparent; border-top: 12px solid orange; position: absolute; top: 29px; left: 0; } demo

Not able to get the stored procedure's result in variable in sql server? -

this question has answer here: get value output sql server stored procedure variable 1 answer i have hierarchy of stored procedures calling 1 in below: 1 2 3 now doing is: first of showing 1st level sp . create proc proc_test3 ( @id uniqueidentifier, @value varchar(100) ) declare @outputvalue varchar(100) if @id='2' begin exec @outputvalue= proc_test2 @id @value select @outputvalue end here second level : create proc proc_test2 ( @id uniqueidentifier, @value varchar(100) ) declare @outputvalue varchar(100) if @id='2' begin exec @outputvalue= proc_test1 @id @value select @outputvalue end and here last 3rd level : create proc proc_test1 ( @id uniqueidentifier, @value varchar(100) ) update tblsample set value=@value id=@id select 1 i have paste example in-actual code complex read, have implemented in simpler way every can understand e

javascript - Jquery image slider works perfectly from right to left, but from left to right I cannot get it centered -

i'm working on photography portfolio display/gallery slider. i have half working prototype, cannot life figure out why centers images in 1 direction not other :s http://jsfiddle.net/k88yg/3/ interestingly if resize window , call move_slide() function second time goes right place... happening? can shed light? i believe quite quirky problem. fresh pair of eyes can me allot. so far code: jquery(window).load(function() { // function set_slide_width(add_extra) { if (!add_extra) {add_extra = 0;} var slide_width = 0; $("#barely_slide article img").each(function(){ slide_width += $(this).outerwidth(); }); $("#barely_slide article").css("width",slide_width + add_extra); } // set_slide_width(); // function move_slide() { var focus_margin = 0; var img_real_height = 0; // var add_extra = 0; //var prev_deduct = 0;

c# - Charecter Textfile to binary Textfile -

i have been searching everywhere have had no luck yet. i have text file contains set of records , trying convert , save 1's , 0's .. every time use byte [] arr=encoding.utf8.getbytes(recordss) ; and write using byte writer still have same record file no difference. so question there way convert string binary , write file in binary format. using c# way thanks in advance , here code far public static void serialdata() { filestream recfile = new filestream("records.txt", filemode.open, fileaccess.readwrite); //file used records streamreader recordread = new streamreader(recfile); string recordss = recordread.readtoend(); //reads record file recordread.close(); recfile.close(); byte [] arr=encoding.utf8.getbytes(recordss) ; filestream file = new filestream("temp.txt", filemode.create, fileaccess.write); streamwriter binfile = new streamwriter(file); for(int =0; < arr.count();i++) binfi

linux - grep exclude multiple strings -

i trying see log file using tail -f , want exclude lines containing following strings: "nopaging limit is"` , `"keyword remove is" i able exclude 1 string this: tail -f admin.log|grep -v "nopaging limit is" but how exclude lines containing either of string1 or string2 . two examples of filtering out multiple lines grep: put in filename.txt : abc def ghi jkl grep command using -e option pipe between tokens in string: grep -ev 'def|jkl' filename.txt prints: abc ghi command using -v option pipe between tokens surrounded parens: egrep -v '(def|jkl)' filename.txt prints: abc ghi

jquery masonry broken when changing line height -

i have few options people poor eyesight 1 of change line-height menu, however, when line-height changed, masonry blocks overlap each other. when re-size window small , again, looks fine. reloading page doesn't help. should add event make work? line-height applies elements, not masonry. you should try reloading masonry after new line-height selected. $(#your_masonry_container').masonry( 'reload' ); it used in demo - http://masonry.desandro.com/demos/adding-items.html

sip - Asterisk 11 not transcoding -

i have defined ip address / domain in sip.conf , defined in way forced call come on g729 now reloaded asterisk after exiting sip.conf saving it and called number making thu debug on .. expecting call on g729 call comes on pcmu or pcma (ulaw / alaw) any ideas? my sip.conf [ip] host = ip type = peer port = 8060 disallow = allow = g729 canreinvite = no very likly use other section. do following: asterisk -r core set verbose 5 sip set debug on and check output.

Microsoft Access 2007 - 2010 database compatibility? -

i have 2007 database opened running access 2010. they deleted tables , saved database database doesn't open on pc running access 2007. i believed there compatibility between 2007 , 2010 - assume i'm wrong? thanks reading. the issue when saving file in access 2007 format not save 2007 compatible syntax. idiots @ microsoft chose break backwards compatibility in rush release on schedule. other recreating forms , reports out of luck.... hope kept copy of original code.

PHP Custom Authentication Approach -

i in process of building custom backend user control panel in php. i seeking advice on how best manage authentication of users. have written own custom registration , login system (i not intend use server based authentication). plans set session variable once user authenticated , use allow/disallow access. is correct approach or insecure, want protect against users might attempt by-pass authentication, , valid users want able restrict data, example user 4 shouldn't see users 1,2 or 3's personal data. how easy mask/trick/cheat php session variable? a session variable data stored on server. every sessions contains unique identifier connects cookie session ( stored data ). when don't have identifier cant request session. the safety issue here cookie can hijacked. better security need check on ip address. for example: if($login === true) $session['userdata'] = array("ip" => "11.11.11.11", "userid" => "5

iphone - View for Retina 3.5 displayed like Retina 4 -

Image
i have iphone app retina 3.5. 1 of views set size "retina 3.5 fill screen". added toolbar view. however, when run app on iphone 5 view displayed full screen (like on retina 4) , toolbar somewhere in middle of view. here settings xcode: and here screenshot iphone 5: any thought how can make sure view displayed retina 3.5 on iphone 5 ? is there particular reason why don't want work 4 inch display? iphone 5 users (at least me anyways) having app isn't built larger display annoying thing ever. users pay have more screen real estate , not making app them isn't taking advantage of screen real estate. also, apple made auto layout more versatile. means in future there going more screen sizes coming up, sooner or later have learn how make apps behave correctly using auto layout.

ASP.Net How prompt user to upload an image and store it to a database? -

i have user registration page , clicking on browse button allow user select image local machine , upload database. image can retrived user display next name on asp.net webpage. i have never done before nor can find on web. therefore, can direct me page or kind enough show me how code process of selecting , uploading image access database. thank you. this site has example on how it: http://www.mikesdotnetting.com/article/123/storing-files-and-images-in-access-with-asp.net

extjs - Dynamically display a message when text box in clicked -

how dynamically display message when textfield clicked/has value , when delete contents of textfield message must disappear you can use listeners on textfield. haven't tested following code can try that. { xtype: 'textfield', messagetip: undefined, listeners: { afterrender: function(text) { //textfield doesn't have click even't use afterrender put click event on element //u can use text.inputel.on({ aswell input element , not label text.getel().on({ click: function() { //create tip here text.messagetip = ext.create('ext.tip.tip', { //configuration }).show(); } }); }, keypress: function(text) { if (text.getvalue() == '') { //hide message text.messagetip.hide() } } } }

java - Why the emphasis on typed attributes/methods in MBean definition? -

from oracle's definition of mbeans : mbeans managed beans, java objects represent resources managed. mbean has management interface consisting of: named , typed attributes can read , written. named , typed operations can invoked typed notifications can be> emitted mbean why emphasis on typed in each of points above? java typed language , attributes/methods in java class have type attached them. finding definition confusing. or missing fundamental here? using typed mean different? jmx has more restrictive typing characteristics because often, types providing form of "identity" or signature bean attribute or operation. in addition, jmx supports notion of open types complex type broken down primitive definitions can represented externally jvm (perhaps in jconsole specific class might not in classpath.) don't hung on though... means mbean's attributes defined name, , type. no surprise there :)

devexpress - Add option for BarButtonItem not appearing in Visual Studio form Designer -

sometimes when open visual studio form designer, see [add] text create new barbuttonitem, other times don't. has led me search way create new button several times now. idea might causing this? try right click bar manager, , check show designtime enhancements . here a link may help.

asp.net - Telerik: Unable to get value of property 'open': Object is null or undefined -

i've got web site uses telerik controls. have editing form opens in radwindow. functionality exists on 2 separate pages 1 works second radwindow never opens. i've stared , stared @ 2 pages trying figure out went wrong cannot figure out. errors: 1.) telerik.web.ui.webresource.axd:3 uncaught typeerror: cannot set property 'control' of undefined 2.) telerik.web.ui.webresource.axd:11319 uncaught typeerror: cannot call method 'open' of undefined this 1 has legible code. window.radopen=function(b,a){var c=getradwindowmanager(); return c.open(b,a);//error here page radwindow components: <telerik:radwindowmanager id="radwindowmanager2" runat="server" modal="true" showcontentduringload="false"> <windows> <telerik:radwindow runat="server" id="rweditcust" width="500px" height="500px" title="edit cust" modal="true" reloadons

scorm2004 - Should I set cmi.objectives.n.id via Javascript scorm API? -

should set cmi.objectives.0.id before set up, example, cmi.objectives.0.competition_status? it's in order interpret req_72.4.3.5: "since cmi.objectives.n.id required to set first prior other objective information , if sco attempts set..." e.g.: scorm.setvalue('cmi.objectives.0.id', 'obj1'); //? scorm.setvalue('cmi.objectives.0.completion_status', 'completed'); (updated) sorry, reason thought discussing interactions, not objectives. answer has been modified address objectives. yes, objective required have id. can set id via javascript api (scorm rte) or via manifest. id must set before can perform other actions on objective, such set completion_status. if sco requesting store objective information, sco required set identifier first (unless initialized means), prior other objective information. once cmi.objectives.n.id has value, data model element not allowed reset different value. page rte 4-97 if a

python - How can a program that uses GUI be constructed? -

Image
i have started python, 2 weeks ago. now, trying create guis pygobject using glade. however, puzzled on how general layout of program should be. should use class main program , signals or should separate them? is there "best approach" this? or in below humble approach of mine, should not use classes @ all? how communicate between functions in below example? example, how set parent parameter of gtk.messagedialog function main window of program? python code: #!/usr/bin/python try: gi.repository import gtk except: print('cannot import gtk') sys.exit(1) # confirm , exit when quit button clicked. def on_button_quit_clicked(widget): confirmation_dialog = gtk.messagedialog(parent = none, flags = gtk.dialogflags.destroy_with_parent, type = gtk.messagetype.question, buttons = gtk.buttonstype.yes_no,

diff - Correct Git replacement of entire file -

i've committed file on git, has several changes, not different old file. rather pick out changes, git has made 1 big delete; whole file, , 1 big insertion; new file. error, there large unchanged sections, e.g. file starts number of "using" statements, none of have changed. this annoying means i'll lose "blame" history. is there way make git redo diff? have done cause this? merging branch when happened. git not store diff, stores version of file tree each commit. diff created git show not stored in git internal db. in case, can see file has been renamed if use -m option of git diff -m[<n>], --find-renames[=<n>] detect renames. if n specified, threshold on similarity index (i.e. amount of addition/deletions compared file’s size). example, -m90% means git should consider delete/add pair rename if more 90% of file hasn’t changed. that should trick you.

java - List view getting stuck and the animation is not smooth when displaying images from server -

i displaying images in listview using baseadapter. it's displaying images url, , when i'm scrolling it's getting slow @ loading time. so sticking , animation isn't smooth. can please give solution this? if thats case loading images url might become slow depends on network, you can load images in background , on ui part can show spinner text such loading this might ease ui freezing part.

eclipse - Multiple Android projects with same GIT submodule -

i wanted adopt submodules git android projects stumbled problems. backstory i have multiple projects many use same external library (android library-project), in order make git cleaner , make git each project contain needed material though of using git sub-modules android library project. part works fine got library included sub-module projects. issue but android uses these library-projects regular project added project , can add same project once in eclipse. if need work on more 1 project @ time have use multiple instances of eclipse/workspace instead of using eclipse regular way. is there way have 1 instance of library project in eclipse , @ same time have projects reference respective libraries? or other suggestions how should handle this? any appreciated you cannot have library project single instance in eclipse following reason. each project uses library might reference different version of library. since submodule physical checkout (working directo

c# 4.0 - Can't get EntityFunctions.TruncateTime() to work -

i using entity framework code first. using linq entity want grab record based on datetime value. here current code: /// <summary> /// method check , see if parsed game exists on /// database. if yes, true returned, otherwise false returned. /// </summary> /// <param name="context">the db context use</param> /// <param name="hometeam">the name of home team game.</param> /// <param name="awayteam">the name of away team game.</param> /// <param name="date">the date of game</param> /// <returns></returns> public bool doesgamealreadyexist(pcontext context, string hometeam, string awayteam, string date) { string dtobjformat = "dd mmm yyyy"; datetime dt; datetime.tryparseexact(date, dtobjformat, cultureinfo.invariantculture, datetimestyles.none, out dt); var result = context.games.where(x => entityfunctions.truncatetime(x.start) == dt.date)

How do you apply DataTemplates defined in the Window.Resources to all Infragistics Panes when they are floating? -

i using infragistics xamdockmanager handle docking , undocking panels within application. have window defined uses dockmanager specify several different panes. define several datatemplates in window.resources data can presented when bind 1 of classes. everything works fine when of panes docked in application; however, when undock pane , floating, doesn't work quite well. if data being viewed, still displayed properly, if change data adding list or selecting different item, new information not rendered according datatemplate. instead, displayed though don't have data template; displays full class name. the ways have found datatemplates apply when panes undocked either specify data templates in resources section each individual pane, or specify them in app.xaml resources section applies entire application. unfortunately, not want same templates apply on entire application, latter option doesn't work. have placed datatemplates own resourcedictionary, can referenc

asp.net - Membership.OpenAuth with Twitter works but keeps asking to Authorize App -

i using asp.net forms (not mvc) along out of box templated solution logging using facebook, twitter, etc (all wrapped in microsoft.aspnet.membership.openauth). everything seems working fine except 1 thing: every time user logs in twitter, being redirected twitter , asked authorize application. regardless of whether have done (i.e. user logins first time, authorizes against twitter app, redirected our site perfectly. log out, , go log in again, , re-prompted authorize. application shows in list of approved apps under user's twitter account. i have ready places people having similar problems, not using microsoft libraries. seem point using different url when launching twitter, however, don't seem able find level of granularity ms libraries. has been able reproduce/solve issue using these libraries? not intimately familiar how works, notice dotnetopenauth part of references. if library feeding membership.openauth classes, perhaps there update need? dotnetopenauth.o

javascript - detect string-length on paste on maxlength-set input -

this long shot, thought might ask. have text input maxlength of 100, there anyway of detecting, on paste, if user attempted paste text string length greater 100(before shortened automatically)? thanks. $('#limitedtext').paste(function(){ if($(this).val().length > 100) { //do somthing } }); <input type = "text" id = "limitedtext" maxlength = "100"> you remove maxlength attribute , instead add onchange listener current value , truncate 100.

java - android animated menu background -

i developing android app @ moment. have main menu. pretty plain - 4 buttons in it. want background of menu animated live wallpaper f.e. in fact want use static background image , slide 1-2 other images horizontal through it. did research , found out live wallpapers came api 2.1. , fit needs app should downcompatible api - when view animations, renderscript as. came api 3.1 , tutorials build on that. so right im missing advice start of. apreciate every kind of help! as adviced tried tween animations - pretty followed tutorial http://mobile.tutsplus.com/tutorials/android/android-sdk-creating-a-simple-tween-animation/ and in emulation device working charme .. when run on native api 2.1 device no animation shown .. havent considered ? first of kudos class stacker gave me advice go tween animations - fit needs thx that! - unfortunately animation wasnt shown on api 2.1 devices. following tuturial set tween animation "clouds_pass.xml" - <set xmlns:and

flex - How do I change the font size to export the pdf in datatables plug in error -

the following code gives error. please me. my command : d:\flex_sdk_4.6\bin>mxmlc --target-player=11.1.0 -static-link-runtime-shared-lib raries=true -library-path+=lib zeroclipboardpdf.as loading configuration file d:\flex_sdk_4.6\frameworks\flex-config.xml error: d:\flex_sdk_4.6\bin\zeroclipboardpdf.as: error: file found in source-path 'zeroclipboardpdf' must have same name class definition inside file 'zeroclipboard'. the resolved problem. file name , class name must same... zeroclipboardpdf.as in class name changed zeroclipboard zeroclipboardpdf.

save - Magento product not saving -

i have come across different kind of problem. in magento products uploaded not updating anymore. in detail, when open products update , click save button, nothing happens. started happening suddenly, working fine before. please help, big problem. dont know , files check. may missed mandatory field fill. check every tab if have error asking fill fields. or, there javascript errors. check if js errors there, , post here.

user interface - Android : first activity launched -

a strange behavior i'm tearing eyes on since afternoon, i'm givin understanding perhaps has idea (yeah, i'm beginner, has idea ^^). situation : mainactivity.java (first 1 called, 1 of interest here) public expandablelistview listclubs; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); listclubs = (expandablelistview) findviewbyid(r.id.explstmainclubs); appglobal.createdistricts() ; elvadapterdistrictsclubs adapter = new elvadapterdistrictsclubs(this); listclubs.setadapter(adapter); } it's code in class. basically, i'm filling expandablelist adapter relies on what's created in createdistricts() method (creates business objects, districts containing clubs containing members, events, etc.). basically (again ^^), runs fine, on first start explist works expected, rest of app. if hit button mainactivity, however, , rerun

windows - Change modification time stamp with vbscript -

i need change modification time stamp in windows files vbscrip after copying them. thanks you can setting folderitem.modifydate property. described here . sample code: set objshell = createobject("shell.application") set objfolder = objshell.namespace("c:\scripts") set objfolderitem = objfolder.parsename("file.jpg") objfolderitem.modifydate = "01/01/2008 8:00:00 am"

excel - Comment vba code from another VBA CODE -

i comment lines contains msg box code vba. i'm trying library vba extensibility doesn't found solution. any welcome. this code: sub commentcode() dim vbproj vbide.vbproject dim vbcomp vbide.vbcomponent dim codemod vbide.codemodule dim linenum long const quote = ' set vbproj = activeworkbook.vbproject set vbcomp = vbproj.vbcomponents("thisworkbook") set codemod = vbcomp.codemodule codemod linenum = .createeventproc("open", "workbook") linenum = linenum + 1 .insertlines linenum, quote end end sub first, please change const quote = ' to this: const quote = "'" basically quote (or rem ) string , needs enclosed in quotes. as vb extensibilty , may need delete line once found, , insert new line comment @ beginning. see chip pearson: programming in vba editor

Save XML data into database as columns in C# -

i'm writing c# application watch newly created xml files, , want insert of data in these xml files sql database. 1 file 1 row in database. what best , easiest way this? what have done far defined datatable columns want xml. after use readxml on dataset. give me dataset 1 table , 1 row, , columns want. far it's perfect. can't find way insert new datarow mssql database. don't have unique id row yet. make easier? don't want map dataset database, i'm doing insert... you can id: string query = "insert employees (employeeid, name, phone) "+ "output inserted.employeeid "+ "values (newid(), 'john kris', '99-99999')"; guid lastid = (guid)command.executescalar(); the rest of things sound ok me.

qt - QProgressBar on QStatusBar : how to remove the 2 little vertical lines on either side of the QprogressBar? -

i add qprogressbar following qlabel qstatusbar following code ,but qprogressbar lined 2 little vertical lines . wonder how remove 2 vertical lines ? import sys pyqt4.qtgui import * pyqt4.qtcore import * class mainwindow(qmainwindow): def __init__(self, parent=none): super(mainwindow, self).__init__(parent) self.resize(800, 600) self.lb=qlabel('finding resource ') self.pb = qprogressbar() self.pb.setrange(0, 0) # self.pb.settextvisible(false) self.statusbar().addpermanentwidget(self.lb) self.statusbar().addpermanentwidget(self.pb, 1) if __name__ == "__main__": app = qapplication(sys.argv) ui = mainwindow() ui.show() sys.exit(app.exec_())

asp.net mvc - Error with one-to-many relationship in MVC Entity Framework 4 -

i following error when run code-first mvc app , try , visit either developeraccountmodel details page or view loads parent object , collection of developeraccountmodel: the navigation property 'redirects' not declared property on type 'developeraccountmodel' . @ point, not accessing property (which exist!) attempting load developeraccountmodel. [table("sitedata")] public class developeraccountmodel { [required] [regularexpression("^[0-9]*$")] [display(name = "user id")] [key] [column("_rowid")] public long rowid { get; internal set; } // other properties removed [display(name = "redirects")] [notmapped] [inverseproperty("developeraccount")] public list<siteredirectmodel> redirects { get; internal set; } } and dependent model [table("siteredirects")] public partial class siteredirectmodel { [key] [column("_rowid")] [di

php - Send a mail with Zend Framework : "Connection could not be established" -

i'm working on "old" php/zend project right now. installed locally, fine except part app sends confirmation mail after user has completed form. the error have "connection not established" this code : public function sendmail($user, $gain=null) { global $config; $this->_view->url = $config->app->url; $tr = new zend_mail_transport_smtp($config->app->mail->server); zend_mail::setdefaulttransport($tr); $mail = new mgmail($config->app->mail->key, true); $mail->setfrom($config->app->mail->from, $config->app->mail->fromname); if ($gain == null) { $object = $config->app->mail->object->inscription; $render = $this->_view->render('inscription.phtml'); } else { switch ($gain) { case 'peignoir': $gain_name = 'un '.$gain; case 'casquette': $gain_name = 'une '.$gain; } $object = sprin

heroku - Why does setting debug to false in django settings stop app from loading in devlopment and production? -

in settings have set debug=false instead generated 500 error in both dev , production. looked around , came across ( setting debug = false causes 500 error ) , tried out. allowed_hosts = ['www.heroku.com'] but did not work, not doing right? hosting heroku your app not hosted on www.heroku.com. instead, try allowed_hosts = [".herokuapp.com"]

javascript - HTML5 videos as splash screen for Sench Touch iOS App -

i wants show html5 video splash screen sench touch ios app. using following code: index.html: <video id="splashscreen" autoplay="autoplay" width="100%" height="100%" src="train.mp4" type="video/mp4"></video> <script type="text/javascript"> function embedvideo() { var el = document.getelementbyid('splashscreen'); el.src= "train.mp4"; el.load(); } </script> and in app.js: launch: function() { var task = ext.create('ext.util.delayedtask', function () { ext.fly('splashscreen').destroy(); }); task.delay(4000); ext.viewport.add(ext.create('tec.view.main')); } it shows play controls don't want shown , doesn't next scre

jboss7.x - slf4j don't work in JBOSS when using openJpa module -

my ear application runs fine when don't use openjpa. once use open jpa "slf4j fail load class blaaa ". how configure openjpa module use sl4j provide pom.xml , avoid error? i use jboss 7.1.1 pom.xml <properties> <slf4j.version>1.7.3</slf4j.version> <logback.version>1.0.10</logback.version> </properties> <dependency> <groupid>org.slf4j</groupid> <artifactid>slf4j-api</artifactid> <version>${slf4j.version}</version> </dependency> <dependency> <groupid>ch.qos.logback</groupid> <artifactid>logback-classic</artifactid> <version>${logback.version}</version> </dependency> <dependency> <groupid>ch.qos.logback</groupid> <artifactid>logback-core</artifactid> <version>${logback.version}</version>

android - ongoing notification opening existing Activity -

i want show notification while timer running , when user clicks notifiaction opens timer activity. mnotificationmanager = (notificationmanager) getsystemservice(context.notification_service); intent intent = new intent(this, activity.class).addflags(intent.flag_activity_reorder_to_front); pendingintent pendingintent = pendingintent.getactivity(this, 0, intent, pendingintent.flag_update_current); the problem right when start timer , press home , click notification opens activity running timer. but when start timer, open activity (via actionbar.navigation_mode_list ), press home , click notification opens new activity (empty). i thought addflags(intent.flag_activity_reorder_to_front); (thats used navigate between activities) im using android:launchmode="singletop" , android:configchanges="orientation|screensize" for every activity. i wouldn't rely on activity persisting , unnecessary store timer start time sha

How to handle a 204 response in jquery ajax? -

as have declared success , error ajax options, response 204, ajax method goes option success leads error. as per documentation can use, statuscode or complete methods disadvantage here have declare status code 2?? series, 3?? series, 4?? series! these response dynamic , not sure http status code. so, better way handle http status code in jquery ajax? the jqxhr objects returned $.ajax() of jquery 1.5 implement promise interface. third argument in done function jqxhr object. object has property http status code of result. jqxhr.done(function(data, textstatus, jqxhr) {}); alternative construct success callback option, .done() method replaces deprecated jqxhr.success() method. refer deferred.done() implementation details. link $.ajax({ url: "http://fiddle.jshell.net/favicon.png", beforesend: function ( xhr ) { xhr.overridemimetype("text/plain; charset=x-user-defined"); } }).done(function ( data, tex

java - Dynamically load jar in groovy -

i have groovy script createwidget.groovy: import com.example.widget widget w = new widget() this script runs great when run this: $ groovy -cp /path/to/widget.jar createwidget.groovy but, wanted hardcode classpath within script, users not need know is, modified createwidget.groovy follows (which 1 of ways modify classpath in groovy): this.getclass().classloader.rootloader.addurl(new file("/path/to/widget.jar").tourl()) import com.example.widget widget w = new widget() but fails runtime error on import: unable resolve class com.example.widget . this unorthodox , thinking can't mess rootloader prior import or else? // use groovy script's classloader add jar file @ runtime. this.class.classloader.rootloader.addurl(new url("/path/to/widget.jar")); // note: if widget.jar file located in local machine, use following: // def localfile = new file("/path/tolocal/widget.jar"); // this.class.classloader.rootloader.addurl(local

php - Storing values in two MySQL tables -

i have scenario in not sure do. i have website user can update status. allowing use of hash tags possible user post might like: went great hike today!! #hiking now, intend store post in table appropriately named "posts" structured this: post_id | user_id | text | date now, when user submits form holds post text run script create array of hash tag terms user used , store them in array. can loop through array , insert tags aptly named "tags" table. structure of table this: tag_id | post_id | user_id | tag the problem not know post_id of post until after insert data "posts" table (post_id primary key , auto increment). now, thinking select last row of data "posts" table user (after insert post), , in turn use returned post_id query inserts tag data "tags" table. seems not best way? question is: is best solution or there better way go scenario? i brand new stack overflow, don't please down vote me. comment , tell m

javascript - How do i show links and more in twitter bootstraps popover? -

lets have unordered list icons (here one): <ul> <li class="in-row"><a href="#" id="meddelanden" data-content="content here..." data-title="meddelanden" data-toggle="clickover" data-placement="left"> <i class="icon-globe"></i></a> </li> </ul> with these included files html document: <script type="text/javascript" src="../js/jquery.js"></script> <script type="text/javascript" src="../js/bootstrap.js"></script> <script> $('#meddelanden').popover('animate'); </script> it appear fine , content shown when press icon, have links , breaks , stuff in popover container. how can this? yes can. try using popover content , html attributes... see doc http://jsfiddle.net/4jhzg/ html <ul> &l