Posts

Showing posts from March, 2015

php - Do I need to format a twitter status before outputing it to a web page? -

php - Do I need to format a twitter status before outputing it to a web page? - so, looking @ how other web pages have sorted out, , found http://www.phppennyauctiondemo.com/ (below auctions, there's twitter updates part). they format twitter statuses next way before outputing web page: <script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"> ... var status = twitters[i].text.replace(/((https?|s?ftp|ssh)\:\/\/[^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!])/g, function(url) { homecoming '<a href="'+url+'">'+url+'</a>'; }).replace(/\b@([_a-z0-9]+)/ig, function(reply) { homecoming reply.charat(0)+'<a href="http://twitter.com/'+reply.substring(1)+'">'+reply.substring(1)+'</a>'; }); ... </script> my question is: why? , do? also, should aswell? until now, i've used twitters[i].text. without formating...

Debugging taskdef Java class from Eclipse ANT -

Debugging taskdef Java class from Eclipse ANT - i have read posting how debug java code when using ant script in eclipse kind of want newish ant , still little confused i using 3rd party classes off sourceforge (so no license issues) , have xml file references suite of tasks <project name="utility-mine"> <taskdef resource="mine.tasks"/> </project> and mine.tasks file lists task names , classes phone call below. one of classes malfunctions when called ant can accept, allegedly, fileset in order include or exclude files or directories doesn't, want able debug in situ in eclipse , set break points in java code class, how go current setup obv taskdef resolves class , not called direct unlike link above. please if possible provide "dullard" level reply , instruction cos thicky :) thanks. debugging ant

windows mobile - TCP socket read hangs when wi fi connection breaks -

windows mobile - TCP socket read hangs when wi fi connection breaks - i facing peculiar problem read on tcp sockets when wi fi connectivity goes off , 1 time again reconnects scenario : continously pinging server on windows pocket pc device on wi fi. when device in area of wifi weak signal strength , socket read blocks indefinately , freezes device totally , when wi fi signal strength becomes stronger read homecoming , previous operations on screen executed. can give solution problem this feature of tcp -- tcp reliable, if there's sort of network problem (such wifi signal loss describe), info buffered , held until problem goes away, @ point info sent 1 time again , connection resume. you can modify or tune behavior bit changing tcp timeout values -- if connection unable send info @ timeout period (usually 10 minutes default), connection shut down. depending on api using may able alter timeout several seconds instead (though careful of maki...

Android SDK tools revision 12 has problem with Proguard => error conversion to Dalvik format failed with error 1 -

Android SDK tools revision 12 has problem with Proguard => error conversion to Dalvik format failed with error 1 - this question has reply here: android: getting error: conversion dalvik format failed 11 answers i have updated android sdk tools revision 12, application can't exported previous proguard setting. received "conversion dalvik format failed error 1", library utilize "jcifs". have tried cleaning , rebuilding, create new project, , reassembling , believe have done can read in internet. new bug new sdk? suggest don't update time beingness if project utilize proguard. update 1: tried export simple hello application proguard set, still same message. looks broken version of sdk tool. update 2: have delete whole tools folder in sdk directory , re-create backup of sdk tools revision 11 it. @ to the lowest degree can go work ...

Flash AS3 XML Listener infinite trigger -

Flash AS3 XML Listener infinite trigger - i trying read xml file , display content in simple list component or @ console. problem event listener triggered in infinite loop. the code: var myxml:xml; var myloader:urlloader = new urlloader(); myloader.addeventlistener(event.complete, processxml); myloader.load(new urlrequest("/songs/songs.xml")); function processxml(e:event):void { myxml = new xml(e.target.data); trace(myxml.*); } the xml file: <?xml version="1.0" encoding="utf-8"?> <songs> <song>sleep away.mp3</song> <song>kalimba.mp3</song> </songs> the output: <song>sleep away.mp3</song> <song>kalimba.mp3</song> <song>sleep away.mp3</song> <song>kalimba.mp3</song> <song>sleep away.mp3</song> <song>kalimba.mp3</song> <song>sleep away.mp3</song> <song>kalimba.mp3</song> <song>sl...

html - Why cant my anchor fire this javascript object? -

html - Why cant my anchor fire this javascript object? - i have page linked javascript object: //the constructor function function newsscroller() { } //now set config objects using json construction newsscroller.prototype.config = { serviceurl : '/newsprovider.svc/rest/getnews/', pageindex : 0 } //the argumented constuctor object newsscroller.prototype.init = function () { this.getnews(this.config.pageindex); console.log(this.config.pageindex); } newsscroller.prototype.decreasepage = function () { console.log('current page index ' + this.config.pageindex); } then have page ready declaration: <script> $(document).ready(function () { var newsscrollerforpage = new newsscroller(); newsscrollerforpage.init(); newsscrollerforpage.decreasepage(); }); </script> which produces result: current page index 0 i want phone call function anchor tag have: ...

c# - RichTextBox not processing new line/carriage return characters -

c# - RichTextBox not processing new line/carriage return characters - i seem experiencing unusual issue richtextbox control, programming in c# in visual studio 2008. i'm reading stream of file that's beingness written windows console (with output redirection), , i'm reading programme (essentially, i'm recreating what's known in unix world "tail"). when array of bytes read in, i'd homecoming new line line, , go on reading. however, seems rtb not respond new line or carriage homecoming characters. example, i've tried appending \n , \r\n , , environment.newline string beingness written, nil seems working. keeps writing across same line. here code seems causing trouble: string convertedbuffer = system.text.encoding.utf8.getstring((byte[])e.userstate); outputbox.appendtext(convertedbuffer + "\n"); i'm @ loss here, can help? its because set outputbox.multiline property false prevents command showing text...

Flex Spark Datagrid fixed column, horizontal scrolling -

Flex Spark Datagrid fixed column, horizontal scrolling - how can create datagrid have first column fixed , scroll reset horizontally , vertically? the spark datagrid not back upwards locked rows , columns. options if need locked columns either old mx datagrid or advanceddatagrid or our ultimate datagrid. flex datagrid

asp.net - T-SQL Select and count from different table? -

asp.net - T-SQL Select and count from different table? - i have table ( threads ) containing field ( id ). select every row threads , number of rows in table posts field posts.thread same threads.id . how can done in sql? (something pseudo-sql: select *, count(* posts posts.id=threads.id) threads ) select t.id, count(p.thread) threads t left outer bring together posts p on t.id = p.thread grouping t.id asp.net sql tsql

ruby on rails - Why isnt my application_helper.rb helping? -

ruby on rails - Why isnt my application_helper.rb helping? - im doing michael hartl's first-class tutorial series on ruby on rails here: http://ruby.railstutorial.org/ruby-on-rails-tutorial-book and im having issue in 4.1.1, refactors title of pages rely on application)helper.rb set tag. ive done said in book, , reason never seems kick in. each title of page has name given in @title variable in pages_controller.rb or if omit sort of controller error displayed title should be. code @ github: https://github.com/ekimia/mtwitter thanks helping ruby on rails newbie out. in app/views/layouts/application.html.erb alter <%=@title%> <%=title%> . if prepend "@" seek access variable @title set in controller. without "@" phone call title method (or helper rather), defined in app/helpers/application_helper.rb ruby-on-rails

c# - User IP Address , Using Proxy or Not , Some Help -

c# - User IP Address , Using Proxy or Not , Some Help - please see below codes : private string getuseripaddress() { string user_ipaddress = string.empty; string user_ipaddressrange = request.servervariables["http_x_forwarded_for"]; if (string.isnullorempty(user_ipaddressrange))//without proxy detection { user_ipaddress = request.servervariables["remote_addr"]; //or //client_ipaddress = request.userhostaddress; //or //user_ipaddress = request.servervariables["remote_host"]; } else////with proxy detection { string[] splitter = { "," }; string[] ip_array = user_ipaddressrange.split(splitter, system.stringsplitoptions.none); int latestitem = ip_array.leng...

javascript - How do I get the absolute position of a mouse click from an onClick event on the body? -

javascript - How do I get the absolute position of a mouse click from an onClick event on the body? - i trying absolute position (top , left) of mouse click relative browser/body, not parent elements within body. i have listener bound body, e.pagex , e.pagey giving me position relative div. note can leverage jquery , yui functions. code not work correctly: //getting position function _handleclick(e) { var info = { absx: e.pagex, absy: e.pagey}; _logclickdata(data); } //binding function var methods = { init: function () { $("body").click(_handleclick); } }; according (http://docs.jquery.com/tutorials:mouse_position), should give absolute positions. offsetx/y gives relative position. edit nov 2013: original "mouse position" link seems broken, the documentation pagex contains illustration utilizes jquery pagex / y . page offset method contains relevant examples. javascript onclick position absolute

java - Correct Exception to throw when a duplicate key insertion is attempted? -

java - Correct Exception to throw when a duplicate key insertion is attempted? - repeatedly see comments avoiding throwing generic runtimeexception , trying follow guideline. i have class aggregates sortedmap property setting allow or disallow duplicate keys. trying figure out exception should throw when duplicate keys disallowed , effort made add together one. i checked java docs exception class , none of known direct descendants seemed suitable. go ahead , create own eduplicatemapkey class illustration , throw that? if so, how avoid ending big pile of class files, 1 each custom exception type? what considered "best practice" here? create own exception. illustration java ee has duplicatekeyexception , can similar custom map. java exception-handling

pumping items out to csv file using python scrapy - issue with how outputted in csv file -

pumping items out to csv file using python scrapy - issue with how outputted in csv file - having issue want add together output csv file not start below field name placed in next row in sequence opposed placing @ row 2 when populating playermins item in csv file. can please tell me code going wrong?? here is: class espnspider3(basespider): name = "espn3.org" allowed_domains = ["espn3.org"] start_urls = [ "http://scores.espn.go.com/nba/boxscore?gameid=310502004" ] def parse(self, response): hxs = htmlxpathselector(response) item = espnitem() rows = [] playername = [] playermins = [] # player names p_names = hxs.select('(//table[@class="mod-data"][1]/tbody/tr)//a/text()').extract() p_name in p_names: print p_name yield espnitem(playername=p_name) # minutes p_minutes = hxs.select('(//table[@cl...

PDF annotations in Java -

PDF annotations in Java - actually, still have not got exact way add together different types of annotation/lines/boxes/highlights using mouse straight on pdf. i have tried different api (pdfbox, icepdf, itext, aspose) , able add together text, text annotation, box annotation, images, each 1 have issue like: when add together object, add together in new page when add together object remove old data i want utilize existing icepdf viewer add together text, not allow it. , if seek mix other api icepdf, not able mouse click position need add. there 1 api (ice pdf) allow add together box annotation direct on gui mouse allow other things. if not possible in pdf viewer there class allow this? i'm open commercial library/class 1 time fee that. i think bfo have added quite few annotation tools. have looked @ tool? java pdf icepdf

asp.net mvc 3 - Css changes in code, doesnt show when debugging mvc 3 application -

asp.net mvc 3 - Css changes in code, doesnt show when debugging mvc 3 application - i utilize line @html.editorfor(c => c.amount, new { @class = "editor" }) and in site.css have code: .editor { width: 100; } also utilize line <link href="@url.content("~/content/site.css")" rel="stylesheet" type="text/css" /> in head of _layout but when debug application, textbox(editor) not 100px wide. it's though none of changes in css file showing. i'm using firefox, , tried clear cache in firefox, no result. you should supply unit: .editor { width: 100px; } asp.net-mvc-3

.net - Keep your filthy designer hands off my property values! -

.net - Keep your filthy designer hands off my property values! - is there attribute can set on control's property prevent designer-generated code ever setting value it? http://msdn.microsoft.com/en-us/library/system.componentmodel.designerserializationvisibilityattribute.aspx this looks useful. .net controls designer

html - How do I create a new line in JavaScript? -

html - How do I create a new line in JavaScript? - i have appended textbox div area. want goto new line in div after that, for loop prints column of textboxes instead of row. i tried this: <div id="timearea"> </div> var br = '<br/>'; br.appendto("#timearea"); however not work. code be? you need create element using createelement() method append kid element using appendchild() method var br = document.createelement("br"); document.getelementbyid("timearea").appendchild(br); javascript html

vba - How to implement metaphone in Microsoft access? -

vba - How to implement metaphone in Microsoft access? - i want utilize metaphone algorithm pattern matching in microsoft access. found 1 code on http://www.snakelegs.org/2008/01/18/double-metaphone-visual-basic-implementation/ doesn't works, instead, microsoft access 2007 hangs up. i have tried soundex, doesn't suffice purpose. any help appreciable... @daredev, cannot straight reply question, can direct resources regarding fuzzy search examples in vba/access. unfortunately in german: josef syrovatka: http://access.primary.at/downloads/vortrag_syrovatka.zip michael zimmermann: http://donkarl.com/downloads/aek/aek13_dubletten.zip both presentations along sample databases. ms-access vba metaphone

ruby on rails - Rescuing from Twitter Gem -

ruby on rails - Rescuing from Twitter Gem - i have tweets_controller #called when user submits twitter form def message unless current_user session[:twitter_message] = params[:twitter_message] #sets message form it's available send_tweet in tweet.rb after pass through omniauth redirect_to '/auth/twitter' #redirects authorize via omniauth/twitter , create user else @auth = authorization.find_by_user_id(current_user) tweet.update_status(@auth, params[:twitter_message]) redirect_to edit_user_path(current_user), :notice => "tweet sent." end end i'm trying rescue when status update fails. want display flash message user, -- far can seem get: def self.update_status(auth, msg) @token = auth.token @secret = auth.secret @message = msg @t = twitter::client.new twitter.configure |config| config.consumer_key = '[key]' ...

delphi - What do you log in your desktop applications to improve stability? -

delphi - What do you log in your desktop applications to improve stability? - i've started using smartinspect in delphi applications because users running bugs/problems couldn't reproduce on machine. when have general thought of problem i'll monitor application in few specific places confirm or not working. when bug doesn't have obvious cause, sense lost. don't know start logging in order narrow downwards problem. there mutual techniques or best practices using logger? smartinspect seems quite powerful, don't know quite log or how organise logs info meaningful , useful catching bugs. note: i'm using smartinspect assume answers should suitable logging package. here guidelines tried implement in my own opensource logging unit, it's generic, , state, should suitable logging package: make several levels (we utilize sets) of logging, tune logging info needed; log exceptions, handled 1 try...except block - , add together exceptio...

listview - Android keep tabview when click on a list view item -

listview - Android keep tabview when click on a list view item - i have tabview 3 tabs. in 1 tab have listview . have each item on list display new window/activity/intent when click on it. possible , still have tabview displaying @ same time? thanks yea possible. need activitygroup class, helps navigation in tabactivity , , tabs remain visible , accessible. here usefull link tutorial. but using activitygroup creates little, little complexity context , opening dialog s (adding new windows) in kid activity (ies), more understand miner complexity. android listview android-activity window tabview

Android: ListView Selector set to null? -

Android: ListView Selector set to null? - i want disable selector listview . that's when click items there no indication has been clicked. i tried in listview tag: android:listselector="@null" , didn't work set android:listselector="#00000000" seek this. android css-selectors android-listview

javascript - Strange behavior (ajax long-polling channel) "refuses" connection from normal browser? -

javascript - Strange behavior (ajax long-polling channel) "refuses" connection from normal browser? - when re-create link http://q55.queue.vkontakte.ru/im639 and place currect browser tab, press enter, "load", address changes, content still same (you're still in question). what's that? programmatical behavior ? i not seeing anything. not because nil available. alfred@alfred-laptop:~/node/contact$ curl -v http://q55.queue.vkontakte.ru/im639* connect() q55.queue.vkontakte.ru port 80 (#0) * trying 87.240.134.232... connected * connected q55.queue.vkontakte.ru (87.240.134.232) port 80 (#0) > /im639 http/1.1 > user-agent: curl/7.21.0 (i686-pc-linux-gnu) libcurl/7.21.0 openssl/0.9.8o zlib/1.2.3.4 libidn/1.18 > host: q55.queue.vkontakte.ru > accept: */* > < http/1.1 204 no content < server: nginx/0.7.59 < date: mon, 11 jul 2011 18:49:25 gmt < content-type: text/html < connection: keep-alive < * connection...

c++ - template class with static data member used across DLL/SO -

c++ - template class with static data member used across DLL/SO - suppose have such template class: template <class t> class queue { public: static int size; }; template <class t> int queue<t>::size = 0; and export function in d.dll utilize queue parameter: void changequeuesize(queue<int>& q) { q.size = 100; } and utilize exported function in a.exe: queue<int> q; q.size = 10; changequeuesize(q); int updatedsize = q.size; since queue class generated class template in 2 projects, there 2 copies of code, static info member. so calling changequeuesize won't alter queue size here, update class's static member, happens have same class name. what can solve problem? is weak symbol in gcc capable of address this? much. you cannot set templates in library in way might think. can set actual, instantiated class definitions in library. templates code generation tool, , can set generated code library....

c# - Finding out what's slowing down ASP.NET pages -

c# - Finding out what's slowing down ASP.NET pages - i have rather 'heavy' asp.net page, , speed unacceptable - there lot of database communication, , displaying big grids. want find out what's causing slowdown, , working there. are there tools built visual studio 2008, or 3rd party tools, that'll allow me this? you utilize asp.net trace figure out slowing downwards in page. c# asp.net

javascript - enlarging image on mouse hover without pushing other images using Jquery? -

javascript - enlarging image on mouse hover without pushing other images using Jquery? - i trying create image enlargement effect when hover mouse on image thumbnail 1 google images using. however, encountering problem enlarged image keeps pushing other image location depending on enlarged image's position. here's have far: <style> img{float:left;} </style> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#i1").mouseover(function(){ $("#i1").animate({height:300,width:300},"fast"); }); $("#i1").mouseout(function(){ $("#i1").animate({height:96,width:128},"fast"); }); }); </script> <img id="i1" src="http://www.dpstudiolab.com/weblog/wp-content/uploads/2007/11/display-pop-up-2.thumbnail.jpg" > <img id="i2" src=...

android - Button press add new row to a ListView programmatically, how to? -

android - Button press add new row to a ListView programmatically, how to? - my main layout main.xml has button , edittext , empty listview below: <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="fill_parent" android:layout_width="fill_parent" > <linearlayout android:id="@+id/input_area" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <edittext android:id="@+id/input_field" android:layout_height="40dip" android:layout_width="fill_parent" android:layout_weight="5" /> <button android:id="@+id/send_btn" android:layout_width="60dip" android:layout_height="3...

C# MySql Class // Connection Open and Close -

C# MySql Class // Connection Open and Close - i got problem. stack! don't know if need new class it! want methode closing connection via button click. i created constructor: public string server; public string username; public string pwd; public string db; mysqlconnection conn; string connstring; public dbverb(string eserver, string eusername, string epwd, string edb) { this.server = eserver; this.username = eusername; this.pwd = epwd; this.db = edb; } and 2 methods: public void connect(system.windows.forms.label lblstatus) { seek { connstring = string.format("server={0};user id={1}; password={2}; database={3}; pooling=false", this.server, this.username, this.pwd, this.db); conn = new mysqlconnection(); conn.connectionstring = connstring; if (conn != null) ...

tsql - Converting Access Pivot Table to SQL Server -

tsql - Converting Access Pivot Table to SQL Server - i'm having problem converting ms access pivot table on sql server. hoping might help.. transform first(contacts.value) firstofvalue select contacts.contactid contacts right bring together contactrecord on contacts.[detailid] = contactrecord.[detailid] grouping contacts.contactid pivot contactrecord.wellknownname ; edit: responding of comments contacts table has 3 fields contactid | detailid | value | 1 1 scott contactrecord has like detailid | wellknownname 1 | firstname 2 | address1 3 | foobar contractrecord dyanamic in user @ anytime can create field added contacts the access query pulls out contactid | firstname | address1 | foobar 1 | scott | null | null which pivot on wellknownname. key here number of columns dynamic since user can, @ anytime, create field contact. beingness new pivot tables altogether, i'm wonder...

jquery - I'm trying to get divs to show consecutively on click -

jquery - I'm trying to get divs to show consecutively on click - this 'click' trigger: <li class="booking"><a href="#page_7">book me</a></li> here's jquery: <script type='text/javascript'> $('.booking').click(function(){ $('#svc_panel')fadein(function(){ $('#date_panel,#time_panel,#confirm_panel')hide(); }); }); $('.date_button').click(function(){ $('#date_panel').fadein(function(){ $('#svc_panel,#time_panel,#confirm_panel,').hide(); }); }); $('.time_button').click(function(){ $('#time_panel').fadein(function(){ $('#svc_panel,#date_panel,#confirm_panel').hide(); }); }); $('.confirm_button').click(function(){ $('#confirm')....

intellij idea - Update external libraries with intelij and java -

intellij idea - Update external libraries with intelij and java - simple plenty really. i'm using apache jars, i'll create changes jar's every often. these jars listed external libs in intelij (i.e classpath looking install dir of jar's). when create changes intelij doesn't seem know new implementation. have remove jar external library , re-ad it. does know have intelij picks changes automatically ? i've done clean , rebuild project had little effect. you can go preferences -> build, execution, deployment -> build tools -> maven -> importing , check box says import maven projects automatically . in mac, can command + shift + a , come in action reimport , click on reimport maven projects . intellij-idea

wpf - Cannot build a platform-specific XAML Browser Application in visual studio -

wpf - Cannot build a platform-specific XAML Browser Application in visual studio - i trying build xbap setting platform target x86, , got next error. cannot build platform-specific xaml browser application. if hostinbrowser property set 'true', either not set platformtarget property or set 'anycpu' is there reason why disabled? it's disabled because can't command user(s) browser. xaml browser application browser independent. you can avoid error targeting cpu on configuration manager. wpf visual-studio 64bit xbap

objective c - iPhone identify home button pressed -

objective c - iPhone identify home button pressed - how identify if app in background when home button clicked , not external events (sms, call, video call)? if application sent background, applicationdidenterbackground will getting called. if sms, phone call , video call, then, applicationwillresignactive will getting called first. u can identify that. iphone objective-c events button home

objective c - gluNewQuadric leaking memory -

objective c - gluNewQuadric leaking memory - when checked application leak instruments (x-code tool, programme in objective-c), saw #living "malloc 48 bytes" allocations growing bigger , bigger. also, instruments leaks there. if check responsible caller, says "glunewquadric". checked net bit , found people having same complaints, not many, , found no working solution. put glutinit(&argc, argv); in "main.m", , increment of #living seems have gone downwards bit, still growing persistently. place utilize glu glutsolidsphere glutwiresphere any suggestions on how prepare this? here's pro-tipp: don't utilize glut rendering primitives. there quick testing , not meant serious bussines. few weeks ago posted 2 lengthy answers on how draw sphere using pure opengl without resorting glu or glut: how create 3d sphere in opengl using visual c++ how animate solid sphere on curve objective-c opengl memory-leaks glut

xcode - iPhone App Dev - Embedding a view into a parent view -

xcode - iPhone App Dev - Embedding a view into a parent view - i have questionnaire app consists of several questions. questions have standardised format consists of question (pulled database) , slider answering (they 0-5 scaled based questions). i have created 2 xib files. 1 questionnaire , 1 question. want questionnaire.xib have navigation controller responsible swapping views (i.e. changing questions) when user has answered question. xib need embed several question.xib's animate in user presses next button in navigation controller of questionnaire.xib. how possible embed 1 xib navigation based xib.. if want load nib without instantiating controller it, can use: – loadnibnamed:owner:options: it homecoming array top-level object defined in xib file. you load way xib related individual question, , place uiview (or other uikit objetcs) defines in questionnaire's view. iphone xcode uinavigationcontroller xcode4

java me - Set the size of text in label in LWUIT j2me -

java me - Set the size of text in label in LWUIT j2me - is there way set size(means font size,i want create text larger contaning font size of 17-20) of text in label in lwuit j2me. you can set big text 2 ways. use resourceedit , create new big font in font tab. alter label#unselected font new big font. use next code, new label("sample").getstyle().setfont(font.createsystemfont(font.face_system, font.style_plain, font.size_large)); for more info see article, using font lwuit java-me fonts label lwuit

c++ - Template class for non-inline member functions -

c++ - Template class for non-inline member functions - i trying follow illustration here: http://www.justsoftwaresolutions.co.uk/threading/implementing-a-thread-safe-queue-using-condition-variables.html but dont want inline function definitions class definition. will have set template<typename data> concurrent_queue<data>:: in front end of function defs , constructors? yes, will, , definitions still need in header file. why uses inline definitions- because have inline anyway. c++ templates

asp.net - Adding controls to dropdown -

asp.net - Adding controls to dropdown - i need add together link button command dropdown list item.is possible add together kid controls drop downlist ?if not how can accomplish this? you can not add together controls dropdown list, why want ? utilize gridview, datalist , repeater command instead. asp.net drop-down-menu

python - how do I get django runserver to show me DeprecationWarnings and other useful messages? -

python - how do I get django runserver to show me DeprecationWarnings and other useful messages? - i've updated django installation 1.2 1.3. on developer scheme didn't warnings deprecated calls. 1 time moved code onto production apache server, saw many 'deprecationwarning' messages in apache logs. how have phone call runserver these these messages too? currently phone call this: python manage.py runserver --verbosity 2 the runserver command ignores verbosity option: https://code.djangoproject.com/ticket/15132 i'd recommend setting logger , directing output stderr: https://docs.djangoproject.com/en/1.3/topics/logging/ for example: import logging logger = logging.getlogger('django') # django's catch-all logger hdlr = logging.streamhandler() # logs stderr default formatter = logging.formatter('%(asctime)s %(levelname)s %(message)s') hdlr.setformatter(formatter) logger.addhandler(hdlr) logger.setlevel(logging.warnin...

list - Python: creating dictionary from a bunch of "key: value" strings? -

list - Python: creating dictionary from a bunch of "key: value" strings? - suppose have loaded list: info = ['apple: 1', 'orange: 2', 'grape: 3'] how can turn like info = {line[0]: line[1] line.split(': ') in info} so have dict? you're close! >>> info = ['apple: 1', 'orange: 2', 'grape: 3'] >>> info = dict(line.split(': ') line in info) >>> info {'orange': '2', 'grape': '3', 'apple': '1'} you way tried in python 2.7+, you'd have split lines separately, using dict better. here's mean: info = ['apple: 1', 'orange: 2', 'grape: 3'] info = {fruit:num fruit, num in (line.split(': ') line in info)} python list dictionary

jquery - Sliding panel jumping back to home when clicked -

jquery - Sliding panel jumping back to home when clicked - i made vertical sliding panel on 1page website (click psssst on top right). in works fine, slides , downwards (still little bump on button when sliding, no biggy). the problem when scroll right , click sliding panel jumps origin of page. how can fix/prevent this? can view problem here: http://www.basenharald.nl/3d thanks in advance! it seems have two problems: the first problem (you've fixed it, think) the click event on anchor sending '/#' url. happens because anchor element has href of "#" , default behavior of browser send url. in order prevent happening, should utilize e.preventdefault() in click event handlers, or return false if want stop event propagation (because that's how jquery works). the sec problem it seems after preventing default behavior, clicking on '#open' or '#close' still bringing scroller initial state. in firebug can see there handl...

php - how to set up rotating images? -

php - how to set up rotating images? - so i've been looking around way rotate background image, every 7 or 8 seconds. problem seems me unclear how go using javascript of php code. set under tag or go in body? or upload server? sorry if seems basic question, begginer. also best code use? in opinion. upload images in folder on server each image number file number /images/bg/... then utilize next function alter background of body var currentimageindex = 0; var maximageindex = 10; settimeout(function() { currentimageindex = currentimageindex + 1; if(currentimageindex > maximageindex) currentimageindex = 0; $(body).css("background-image", "/images/bg/" + currentimageindex + ".jpg"); }, 7000); remember utilize 0's image background image default (in css) php javascript jquery html css

twitter - How to connect to twitpic API with PHP? -

twitter - How to connect to twitpic API with PHP? - i can't connect twitpic api. i've tried this: $post = array ( 'key' => 'fghgfhdfghf', 'consumer_token' => 'retert', 'consumer_secret' => 'ertertwerwtetey', 'oauth_token' => 'wety43y4y4wy', 'oauth_secret' => 'seryeryereshrh', 'message' => 'ffff', 'media' => file_get_contents('http://img.yandex.net/i/www/logo.png') ); $ch = curl_init(); curl_setopt($ch, curlopt_url, 'http://api.twitpic.com/1/upload.json'); curl_setopt($ch, curlopt_returntransfer, 1); curl_setopt($ch, curlopt_ssl_verifypeer, 0); curl_setopt($ch, curlopt_post, true); curl_setopt($ch, curlopt_verbose, true); curl_setopt($ch, curlopt_postfields, $post); $response = curl_exec($ch); echo $errno = curl_errno($ch); curl_close ($ch); echo $response; what's wrong code? can give me illustr...

c# - SQL Server and how to handle the type of error without conflict -

c# - SQL Server and how to handle the type of error without conflict - i utilize sql server 2008 , asp.net c# , have stored procedure returns calculated rows. i want check parameters values before doing process , want homecoming custom error message if parameters values wrong. in ui side, must homecoming different text , utilize different window according error type. example: errors when parameters values wrong. non handled errors. i utilize kind of sp in database, tried utilize state argument , severity argument identify type of error. have conflicts non handled error returning same state number parameter error, , wrong window comes up. if utilize severity level, guess sp homecoming error same severity number in cases. i give quick illustration have improve view: create procedure dbo.getdata @date1 date, @date2 date begin -- check parameters if @date2 < @date1 begin raiserror(n'date 2 cannot less date 1', 16, 2); -- ...

regex - Using Javascript and Regular expression to get content inside the html body -

regex - Using Javascript and Regular expression to get content inside the html body - possible duplicate: how extract body contents using regexp i have response text having total page content html,head,body.i want content within body.how accomplish using regx.please help accomplish this. a dom parser reliable method extracting info this, regex can pretty decent job if html sane. (i.e. text: <body or: </body not occur within comments, scripts, stylesheets, cdata sections or attribute values. , body element start tag attributes not contain the: > character.) regex captures contents of first innermost body element (should ever one): var bodytext = ''; var m = text.match(/<body[^>]*>([^<]*(?:(?!<\/?body)<[^<]*)*)<\/body\s*>/i); if (m) bodytext = m[1]; it implements jeffrey friedl's "unrolling-the-loop" efficiency technique quite fast. javascript regex

java - Transaction Isolation Level -

java - Transaction Isolation Level - i seek describe problem in jpa transaction isolation levels. database structure: table1 -> pk defined date ('ddmmyyyy') table2 -> fk table1 jpa( isolation level :: read_commited ) - code: query query = em.createquery("from table1 trd trd.id = :d"); query.setparameter("d", date); table1 t = null; try{ t = (table1) query.getsingleresult(); }catch(javax.persistence.noresultexception e){ t = null; } if(t==null){ t=new table1 (date); em.persist(trd); } for(table2 q:tables2){ q.settable1(t); em.merge(q); } so procedure check if record exists in db , if not create new one. method corect if scheme in based on 1 thread. otherwise there possible situation this: thread 1 : check if entity represent date exists in database thread 2 : same both of them think such record has not exist yet, add together new one. o...

syntax - Excel VBA - 1004 run-time error, Application or object-defined error -

syntax - Excel VBA - 1004 run-time error, Application or object-defined error - i'm trying go through range of cells in worksheet , write formula in each one. maintain getting error: run-time error '1004' application-defined or object-defined error the code looks right now: sub updateformulasfornamedrange() 'application.calculation = xlcalculationmanual 'application.screenupdating = false dim row, col, fieldcount integer colcount = 13 rowcount = 60 col = 1 colcount row = 1 rowcount dim strcolcharacter if col > 26 strcolcharacter = chr(int((row - 1) / 26) + 64) & chr(((row - 1) mod 26) + 65) else strcolcharacter = chr(row + 64) end if worksheets("rawdata1").cells(row, col).formular1c1 = "=if(numbers1!$e$" & col & "<>0;numbers1!" & "$" & strcolcharacter ...

firefox - How do I log/aggregate data from Firebug's Net panel? -

firefox - How do I log/aggregate data from Firebug's Net panel? - so want know how can log info firebug's net panel. more specifically, want able log each time e.g. 'load' (event) know able utilize persist function in net tab itself. not enough. can't click through each request writing downwards times. there easier way this? did seek netexport, firebug extension? firefox firebug logging aggregate

c# - How do I use the PHP Pack function to pack an integer into a byte array? -

c# - How do I use the PHP Pack function to pack an integer into a byte array? - the next c# code used in service have inherited, convert little integer 3 bytes can sent on socket. int = 12345; byte[] info = new byte[] { (byte)i, (byte)(i >> 8), (byte)(i >> 16)}; var result = data[0] + (data[1] << 8) + (data[2] << 16); using php opening socket service. communications protocol written @ byte level, have send bytes on php socket. i have determined this, have utilize pack function. <?php $binarydata = pack("cccc", 0xff, 0x00, 0x00, 0x00); socket_write($sk, $binarydata, $binarydatalen); ?> the first byte tells server client wants do, , in case next 3 bytes must represent integer conforming formulae shown in c# implementation above. the problem have, no matter try, cannot create 3 byte array integer matches c# implementation. i appreachiate , vote 1 can help me solve this, experienced php developer think might k...

Can we detect a live image for perfoming augmented reality using Qualcomm QCAR sdk -

Can we detect a live image for perfoming augmented reality using Qualcomm QCAR sdk - i want observe image of hand(wrist) using qcar sdk of qualcomm can place virtual object (e.g watch) on it. possible accomplish using qualcomm sdk. can observe live image of hand everytime using qcar-sdk. no. qcar can reliably observe , track planar (i.e. flat) images, , image needs have characteristics, such sufficient contrast , complexity. can't track 3d surfaces, hand. you'd need have person hold tracking target, or attach hand (e.g. using glove ). augmented-reality

sql - How do I sum one column within a grouping of another column? -

sql - How do I sum one column within a grouping of another column? - this problem: name date presents bob march 3 2011 1 bob june 6 2008 2 bob jan 3 2012 3 mary feb 14 1986 4 mary apr 10 2001 5 mary jan 3 2012 6 kate march 3 2011 7 kate jan 3 2012 8 kate oct 9 2013 9 celia march 3 2011 10 celia feb 14 1986 11 celia july 4 2011 12 celia jan 3 2012 13 celia feb 14 1991 14 so goal add together amount of presents kate , celia got on same days if received @ on days. what need kind of this, except much bigger info set. size of info set around 100,000 entries. i need reply in sql, or access 2003 query. if presents number of presents kate or celia or somepne else got on particular date: select name, date, sum(presents) total_on_date table name in ('kate','celia') grouping name, date and no means sql genius ...

c++ - OpenCV how to get bool true if images are `==`and false if not? -

c++ - OpenCV how to get bool true if images are `==`and false if not? - so seek code like: cv::mat m1, m2; cv::videocapture cap(0); { cap >> m1; cap >> m2; } while(cv::norm(m1,m2)==0); frames+=2; //... but seems not work. how bool if frames info contents captured photographic camera same or not? your method fails because in real photographic camera videostream (from code see capture camera) every 2 frames not equal because of noise, changing illumination, little photographic camera motion etc. can alter check this: cv::norm(m1,m2) < epsilon where epsilon unsigned number can find (it depends on criteria). fast , simple solution. look @ karlphillip's link more efficient solution. c++ image opencv camera

c++ - pointers and char arrays -

c++ - pointers and char arrays - i think simple question... i've tried finding specifics , can't. code: #include <iostream> using namespace std; int main() { char * veggie_burger = "delicious"; cout<<endl<<veggie_burger<<endl; (int count = 0; count < 9; count++){ cout<<veggie_burger[count] <<" @: " <<&veggie_burger[count] <<endl; } cout<<&veggie_burger; homecoming 0; } this output delicious d @ delicious e @ elicious l @ licious @ icious c @ cious @ ious o @ ous u @ us s @ s 001df7d4 (or wherever)] what difference between &veggie_burger[n] , &veggie_burger ? shouldn't pointer pointing place in memory &veggie_burger[3] stores 'l' , not start sequence of characters @ 'l'? veggie_burger[n] same *(veggie_burger+n) , &veggie_burger[n] means veggie_burger ...

iphone - Best way to pass variables between views -

iphone - Best way to pass variables between views - i new xcode & objective-c (having come php) have started play around , finding hard pass variables between views have far: game_info.h #import <uikit/uikit.h> @interface game_info : uiviewcontroller { iboutlet uitextfield *groupname; iboutlet uisegmentedcontrol *gametype; } @property (nonatomic,retain) iboutlet uitextfield *groupname; - (ibaction) gametypepicker; - (ibaction) keyboardhide; - (ibaction) backbtn; - (ibaction) nextbtn; @end game_info.m #import "i_dare_youviewcontroller.h" #import "game_info.h" #import "game_tdor.h" @implementation game_info @synthesize groupname; // next button -(ibaction) nextbtn{ if ([groupname.text length] == 0) { // alert uialertview *alert = [[uialertview alloc] initwithtitle:@"group name" message:@"please come in groupin...

c++ - Comparisons of arbitrary arithmetic types: does anyone know an implementation? -

c++ - Comparisons of arbitrary arithmetic types: does anyone know an implementation? - while writing several math utilities bumped need implement generic utility can perform comparisons between 2 fundamental arithmetic types. began coding, became clear operation not straightforward seems, since need right handling of corner cases, when types have different precision, i.e. rounding strategy during conversion between types becomes important. consider: float a1 = 4.8f; int a2 = 4; assert(a2 != (int) a1); //fails erroneously since truncated a1 float b1 = 40000000.0f; //can represent 40000000 , 40000004 accurately long b2 = 40000002; assert(b1 != (float) b2); //fails erroneously since truncated b2 the above can implemented using c++0x type traits automatically select appropriate algorithm according template arguments supplied comparing function. however, quite complex , there's quite lot of places bugs can creep, don't think inventing myself worthwhile. know library im...

python - check if url exist at fanfiction.net -

python - check if url exist at fanfiction.net - i trying find out lastly chapter number of story @ www.fanfiction.net fun. thought since has fixed pattern of url increment chapter number till time gives me url not exist. to find whether url existed tried out script @ stackoverflow ques however found out not give response error of > 400 , rather gives message along 200 response. best way identify page exists or not. here link exists exists , here 1 not exist does not exist how can ? edit 1 thanks gregschoen worked out. hope right though :) i checked out values resp.getheader("last-modified", none) , gives date active links , none not. thanks lot if head request on urls supplied, last-modified set on valid pages not on invalid pages. easy way key on valid pages, since server not responding proper http code. python httplib

ASP.NET MVC JSON over Fluent Nhibernate Model -

ASP.NET MVC JSON over Fluent Nhibernate Model - i trying homecoming jsonresult using mvc controller standard json(object) method. object of type model1 built fluent nhibernate. model1 has property of type model2 . in debug mode see environment creates proxy descendant class of model2 called castle.proxies.model2proxy . used internally fluent nhibernate, believe, satisfy mappings. , in run time, actual model1.model2 of type castle.proxies.model2proxy . the problem when model1 serialized, model2 beingness serialized too. , serializer seems seek serialize properties of object, including generated castle , not needed me. ok if did not cause exception. namely, somewhere within object circular reference presents , exception caused it. here exception text: system.invalidoperationexception: circular reference detected while serializing object of type 'system.reflection.runtimemodule' i double checked domain , found no circular references there, blaming castle. c...

jquery - Keep sub menu open -

jquery - Keep sub menu open - in menu sub categories slide down. used css maintain sub menu open when on main categorys page, jquery slideup() function disables on mouseout. maintain sub-menu open when on main categories page. <div id="sidebar"> <ul> <li class="main"> <a href="real_estate.php" class="real_estate">real estate </a> <ul class="sub" id="sub_real_estate"> <li> <a href="consulting.php">consulting services</a></li> <li> <a href="investment.php">investment</a></li> <li> <a href="property_mgmt.php">property management</a></li> <li> <a href="development.php">development</a></li> </ul> </li> <li class="main"> <a href=...

php - Using Batik with Yii - Fails in the app but works in terminal -

php - Using Batik with Yii - Fails in the app but works in terminal - i'm trying add together svg .png conversion yii app, using batik rasterizing library. i'm working locally on mac running osx 10.6.7, php 5.3.4 , java 1.6.0_24. when run php script deals conversion, using... $output = shell_exec(java -jar batik/batik-rasterizer.jar -m image/png -d pdf_temp/file.png -w 800 pdf_temp/file.svg) batik fails (unhelpful) error: about transcode 1 svg file(s) converting file.svg pdf_temp/file.png ... file_1310581599.png error while converting svg however, using... java -jar batik/batik-rasterizer.jar -m image/png -d pdf_temp/file.png -w 800 pdf_temp/file.svg ...in terminal works treat , saves .png file in /pdf_temp/ directory along original .svg so what's different php/apache environment that's causing batik fail when terminal fine? edit: after chatting colleagues think fact java needs run root - terminal not within web server. adding... ...

c# - HTML Generation from Xml File -

c# - HTML Generation from Xml File - i have requirement generate html page xml file, xml file contain input type control. there style sheets , java script validation methods. can 1 gives me tool this. thanks you can utilize xsl transformations generate html output xml. these transformations can applied @ runtime using system.xml.xsl namespace. c# html xml

using joomla (or even just PHP), how would you obfuscate a PDF filename? -

using joomla (or even just PHP), how would you obfuscate a PDF filename? - i have file, phone call secret.pdf, offer download. however, maintain having url can copied / pasted or typed out www.website.com/pdf/secret.pdf (no fishing files!). for instance, user clicks on link, , gets kgsjgldsg.pdf. user b clicks same link, gets asadsfsefaw.pdf. point is, random filename used reference same file, secret.pdf. ive googled php file obfuscator, , joomla filename obfuscator, , have had no luck. ideas or pointer in right direction much appreciated. you add together get variable based on time, valid 1 min (should enough). so request /pdf/getpdf.php?key=xxxxxxxxx make key salted hash based on current time on server, instance closest number dividable 5 (when it's 17:17 you'd utilize 17:15, etc). then generations 'current' hash on getpdf.php file, , if same, stream pdf. this not stop people using link, link valid 5 minutes. addendum: should create ...

.net - Check/DeCheck all items in Check-list box vb.net -

.net - Check/DeCheck all items in Check-list box vb.net - a couple of questions check list boxes: how check/decheck item in list how re-create or delete checked items in list while can scan checkeditems , checkedindices properties, cannot modify them @ same time. create re-create of collection , process re-create instead. uncheck checked items: dim checkedindices(checkedlistbox1.checkeditems.count - 1) integer checkedlistbox1.checkedindices.copyto(checkedindices, 0) each index integer in checkedindices checkedlistbox1.setitemchecked(index, false) next delete checked items: dim checkeditems(checkedlistbox1.checkeditems.count - 1) object checkedlistbox1.checkeditems.copyto(checkeditems, 0) each checkeditem object in checkeditems ' alternateively, add together code re-create checkeditem here. checkedlistbox1.items.remove(checkeditem) next edit: changed array declarations (.count - 1). vb's declaration syntax in infuriating sometim...

encoding - Converting MySQL ANSI input to UTF-8 -

encoding - Converting MySQL ANSI input to UTF-8 - i've decided switch web app ansi utf-8. after converting encoding of hardcoded files in notepad++ (which conversion, not changing character set) , setting new meta tag utf-8, need convert database data. this info has been inputted on ansi forms, stocked utf8_general_ci according phpmyadmin. can't alter mysql stocking encoding then, because it's right 1 (apparently?). on web pages, accent characters (é, à, etc.) loaded db appear �. i think found solution this blog: update `ressources` set `title` = convert(convert(`title` using binary) using utf8); however, 0 rows affected on phpmyadmin. thought why? mysql encoding utf-8 ansi

SQL Server 2000 - Update rows and return updated rows -

SQL Server 2000 - Update rows and return updated rows - i wondering how rewrite next sql server 2005/2008 script sql server 2000 didn't have output yet. basically, update rows , homecoming updated rows without creating deadlocks. thanks in advance! update table set locked = 1 output inserted.* locked = 0 you can't in sql server 2000 cleanly what can utilize transaction , lock hints prevent race condition. main problem 2 processes accessing same row(s), not deadlock. see sql server process queue race condition more, please. begin transaction select * table (rowlock, readpast, updlock) locked = 0 update table set locked = 1 locked = 0 commit transaction i haven't tried this, seek select in update trigger inserted. sql sql-server sql-server-2000

Scala scripts in Windows batch files -

Scala scripts in Windows batch files - in programming in scala, gives description on how run scala scripts batch files (link). for windows ::#! @echo off phone call scala %0 %* goto :eof ::!# i'm having problem googling ::#! . mean? know :: denotes comment , in unix #! direction shell used, here? , ::!# ? what %0 %* mean, , necessary express this? is possible run multiple scripts same batch file? this gimmick, works. intends replicate unix shell's ability invoke particular command process shell file. so, here's explanation: ::#! lines starting :: comments in windows shell, comment. @echo off don't show lines executed here on. @ @ origin ensure line won't shown. call scala %0 %* transfer execution scala script. %0 means name of file (so scala can find it), , %* parameters passed in execution. for example, these lines in file called count.bat , , invoked typing count 1 2 3 . in case, line execute scala co...