Posts

Showing posts from June, 2015

apache rewrite wild card subdomain name to query string? -

i've search google , read many websites, still have no clue. basically, want internally redirect subdomain names query strings. here's example: users type user1.mywebsite.com the url above stays same users, want server intepret mywebsite.com/user?name=user1 can me? thanks. you can match hostname in rewritecond . rewritecond %{http_host} (.+)\.mywebsite.com rewriterule ^(.*)$ mywebsite.com/user?name=%1

jQuery widget framework alternatives -

what jquery widget frameworks there? aware of jquery ui, jquery tools , jquery mobile. with jquery widget framework mean frameworks provide multiple jquery based widgets. another interesting framework jquery easyui : http://www.jeasyui.com/ it has ton of things, panels, layout management items, menus , buttons, various form items (combo, pickers, grids, spinners, etc..), datagrids , complex trees.. take look, it's double licensed gpl/commercial. it's nice see there's lot of development in js ui frameworks :)

maven 2 - Selenium not closing the command window after executing the tests in IE -

we using maven bases selenium project test gui. after executing test, ie not able close selenium command window. using selenium.stop(); in @after method not closing command window test case passed. hence more browser sessions opening , server going out of resource , not responding more time. of test cases failing because of this. since 1 week facing issue. please me in solving it. plain guess: did try selenium.close(); in @after section? from javadoc: public void close() simulates user clicking "close" button in titlebar of popup window or tab.

c# - How to read contents of many textboxes to an array? -

i have write program (c#, wpf), data retrieved ~30 textboxes. i'd cycle textboxes through. tried create array of textboxes, didn't work because in every method had repeatedly reinitialize array. textbox[] subjects = { textbox1, textbox2, textbox3, textbox4, textbox5, textbox6, textbox7, textbox8, textbox9, textbox10 }; textbox[] credits = { textbox11, textbox12, textbox13, textbox14, textbox15, textbox16, textbox17, textbox18, textbox19, textbox20 }; textbox[] marks = { textbox21, textbox22, textbox23, textbox24, textbox25, textbox26, textbox27, textbox28, textbox29, textbox30 }; subject.subjectname = subjects[selection].text; subject.amountofcredits= convert.toint32(credits[selection].text); subject.mark = convert.toint32(marks[selection].text); main question is, if there other way cycle through controls without creating arrays of textboxes? thanks in advance. have considered using datagrid control? have 3 columns (subjects, credits , marks) , selected r

Checking string formats in Java? -

having problems doing class i'm taking, since missed class or two. (i know it's looked down on 'do someone's homework,' i'm not looking that.) the assignment follows: write program following: prompt input of someone's first, middle, , last name single string (using combination of upper , lowercase letters). check make sure name entered in correct format (3 names separated spaces). if input not correct, continue request input again until format correct. capitalize first letters of each part of name, , print out revised name. print out initials name. print out name in format of: lastname, firstname, mi. the major problem i'm having second part of assignment; got first part, , i'm sure can manage through rest, after second set up. import java.util.*; public class teststrings { public static void main(string[] args) { scanner key = new scanner(system.in); string name; system.out.print("enter name 'first middle

database - Can redis pipeline multiple commands that depend on previous ones? -

i'm very new redis , still playing around it. want test see if relevant project i'm not sure specific command i'm running. users on have got me convinced of performance benefits of using pipelines , transactions thought i'd ask how this. basically have 2 statements want issue , not have wait result(seems candidate pipe lining. looks this: does valuex exist? if insert valuey its pretty simple far ways have been looking seem wait response if valuex exists, , because i'm doing on billion loops of program grinds halt. is possible? if helps i'm using java haven't settled on client library(jedis or jredis, still testing). i'm not settled on redis leaning heavily towards it(seems i'm doing speed wise), suggestions acceptable. no, not possible moment accomplish such thing. seek feature missing moment, available 2.6 version of redis. it's called lua scripting. can execute server commands dependent of previous commands, in one, wit

Piping input into a c++ program to debug in Visual Studio -

this has been asked before, haven't been able find answers far. i'm trying start program multi-line input, i.e. don't want type in command line every time (as i'd make mistake). looked command line arguments , pasted input in there, interpreted every line being command. input in case helps: 8 c j b s x k j t o v y z l x r t s w o n m z y x e n s p r l l o b s t e r t g x a a j p e l k e k t r s l j e e e cat test baseball bake paste lobster stake zen locks rake gel slack jar dinosaur 0 put data in file go project properties in visual studio , select "debugging" category. in "command arguments" property type: < "path/to/the/file" now file fed program via standard input when debugger launched or when launch program within visual studio (but without debugger) using ctrl-f5. you can use vs macros specify project directory, etc. if want test file move along project.

Google App Engine (Java) App stopped working (all versions) -

all versions of app stopped working. similar unable load several versions of appengine project , seeing harddeadlineexceeded exceptions from logs: failed startup of context com.google.apphosting.utils.jetty.runtimeappenginewebappcontext@7881db{/,/base/data/home/apps/[my_app]/946.357282374521459350} com.google.apphosting.api.deadlineexceededexception: request (d505d1e88148a047) started @ 2012/03/08 04:17:00.300 utc , still executing @ 2012/03/08 04:18:00.917 utc. @ java.util.zip.zipfile.read(native method) @ java.util.zip.zipfile.access$1200(zipfile.java:57) @ java.util.zip.zipfile$zipfileinputstream.read(zipfile.java:476) @ java.util.zip.zipfile$1.fill(zipfile.java:259) @ java.util.zip.inflaterinputstream.read(inflaterinputstream.java:158) @ java.io.datainputstream.readfully(datainputstream.java:195) @ java.util.jar.jarfile.hasclasspathattribute(jarfile.java:482) @ java.util.jar.javautiljaraccessimpl.jarfilehasclasspathattribute(javautiljaracce

Asp.Net Application Architecture With Sencha Ext JS 4 -

i nice documentation ext js 4 applciation architecture. tells architecture contains 1 html page, others js. http://dev.sencha.com/deploy/ext-4.0.7-gpl/docs/index.html#!/guide/application_architecture if want use library asp.net mvc, how should architecture like? edit: mean there mvc architecture in ext js, 1 in asp.net. how combine these 2 architecture? you can check how dextop doing that. should check this demo app . source code available on github .

android - How to have openned four bitmaps with mores size than 1024x1024? -

i need open 4 bitmaps higher size 1024x1024, @ same moment. now can open 4 bitmaps if size doesn't exceed of 1024 in 1 of sides. how can solve this? it's must mi app. try increase size of max vm application heap size in virtual device settings 24 32.

sql - ODBC function for calendar week? -

question on odbc functions: i need iso 8601 calendar week sql datetime. in sql-server, syntax this: select datepart(iso_week, getdate()) in sql server 2005, iso_week doesn't exist, have use function this: http://blogs.lessthandot.com/index.php/datamgmt/datadesign/iso-week-in-sql-server now question: in order keep database-independant, possible iso-calendar week via odbc function ? odbc-functions (except getdate of course): select getdate() vt_sql_datetime_nondeterministic_function ,{ fn now() } vodbc_datetime_canonical_function ,{ fn curdate() } vodbc_dateonly_canonical_function ,cast(floor(cast(getdate() float)) datetime) vfloor_mine ,convert(char(8), { fn now() }, 112) v112_iso ,convert(char(10), { fn now() }, 104) v104_thomas ,{ fn convert({fn curdate()}, sql_date)} vodbc_proper -- testing odbc functions & syntax ,{ fn concat('abc', 'def')} odbc_concat ,{ fn concat(null, 'def')} odbc_concat_nullleft ,{ fn concat('

c++ - How to specify the QFileDialog::getExistingDirectory() method? -

with method/command: opencreatedirectory() { qstring directory = qfiledialog::getexistingdirectory(this, tr("choose or create directory"), "/home", qfiledialog::dontresolvesymlinks); } i can create new directory or choose existing one. there way disable possibility create new directory? also, there way disable possibility choose existing directory? to more precise: when use method above, window pops in can create new directory or open existing directory. want limit method, can create new directory without being able open existing directory or in other case limit method, can open existing directory without being able create new directory. you can prevent creation of new directory using these options: qfiledialog::dontusenativedialog | qfiledialog::readonly | qfiledialog::showdirsonly the options readonly doesn't have effect if use native dialogs, @ least on win

android - How to make a webview content invisible? -

i video in application vimeo.com , play in webview . problem when want make webview invisible, doesn't work. container disappears content still there, inactive(i mean cannot control it) there. works fine common website, in case doesn't. have tried of webview properties no result. i'm not looking stop,pause or resume video in way, want make of invisible. @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); mwebview = (webview)findviewbyid(r.id.wv); mwebview.getsettings().setjavascriptenabled(true); mwebview.getsettings().setpluginsenabled(true); //mwebview.loaddatawithbaseurl(null,"<html><body> <iframe id='video' src='http://player.vimeo.com/video/37817858?autoplay=1&api=1'" + //" width='300px' height='200px' frameborder='0'></iframe></html><body> "

php - How can I persist data with Symfony2's session service during a functional test? -

i'm writing functional test action uses symfony2's session service fetch data. in test class's setup method, call $this->get('session')->set('foo', 'bar'); . if output session data (using print_r($this->get('session')->all()); ) either in setup or in actual test method, foo => bar . if try outputting session data action being tested, empty array. know why happening, , how can prevent it? i should note if call $_session['foo'] = 'bar' within setup() data persisted , can access action - problem seems local symfony2's session service. firstly try using client's container (i'm assuming you're using webtestcase): $client = static::createclient(); $container = $client->getcontainer(); if still doesn't work try saving session: $session = $container->get('session'); $session->set('foo', 'bar'); $session->save(); i didn't try in functi

Textmate Snippet Regex to CamelCase a String -

i need create textmate snippet mirror input , make camel cased. the base snippet looks this: <a href="#${1}" data-toggle="tab">${1:tab 1}</a> example input: text here example output: sometexthere i tried doing following mirror replacement, regex captures first match: ${1/\a(\w+)\s?/(?1:\u$1)/ig} have looked @ "source" bundle in textmate? has "toggle camelcase / snake_case / pascalcase" command; take inspiration regex in there.

Simple jQuery Slideshow Script by Jon Raasch error -

i'm using simple jquery slideshow script jon raasch (http://jonraasch.com/blog/a-simple-jquery-slideshow) , works on english version of site, on spanish version doesn't work. it's same code. i'm not sure why works on 1 , not on other one. files linked correctly , don't see error in firebug. english version (this 1 works) http://www.stri.si.edu/ spanish version (this 1 doesn't work, stays on first image) http://www.stri.si.edu/espanol/index_test.php please help! -marisol your problem overwrote jquery on page prototype: <script type="text/javascript" src="http://www.stri.si.edu/js/prototype.js"></script> why using such old jquery version 5 years ago? anyway, solution either remove prototype if not used anything, or use jquery.noconflict the reason english page works overwrite prototype jquery on page. leads to believe dont need prototype , can remove it.

jQuery (non plugin) tooltip using jQuery ui position - How can this be improved? -

i need reviewing basic tooltip using jquery ui position. jquery tooltip gets title attribute off link , creates tooltip on hover of link. how can code improved , or made more efficient? wanted post here in hopes helps others. sure spent enough time on thought simple. here code (would love people post alternate versions): http://jsfiddle.net/pn4bw/ $(".tip a").hover( function() { var tiptext = $(this).attr("title"); $("<div class='tooltip' style='display:none;'>" + tiptext + " </div>").insertafter(this); $('.tooltip').position({ my: "left top", at: "right top", of: this, collision: "flip" }); //is there better way select tooltip? $(this).next().fadein(500); //should fade in way? }, function() { //should use better selector? $(this).next().fadeout('slow', function() { $(this).remove(); }); });​ should using ui posit

imagemagick: translate a .png image by dx, dy pixels -

i can't find docs in imagemagick pertain translating image dx,dy pixels. can me? want produce image that's same size original, shifted, , new pixels set color x. i believe looking for convert originalimage.png -virtual-pixel colorofnewpixel -distort affine 'originalx,originaly newx,newy' translatedimage.png this further documented examples @ imagemagick v6 examples -distorting images under distortions using control points heading.

php - JASFinder and CKEDITOR returning url -

i desparate answer somewhere else, hope somone can me here. using jasfinder uploader ckeditor in website. i have 1 little big problem. using php connector , have set config.php below: $config['userfilespath'] = site_url.'/gallery/' ; site_url constant http://127.0.0.1 the problem when select uploaded image jasfinder in ckeditor, path returned contains dot (.) @ beggining, have go image properties , remove dot url manually. returned url jasfinder ckeditor .http://127.0.0.1/gallery/file.jpg i wondering if somone knows fix remove dot ok, find soloution, hope others :p open filemanager.js in scripts folder of jasfinder, locate line number 509 find line of code: url : '.' + urldir + filename, the fix remove dot. iwll result: url : '' + urldir + filename, but! kcfinder better alternative jasfinder.

GWT RPC possible in window closing handler? -

i'm listening window close event: closehandlerreg = window.addclosehandler(new closehandler<window>() { @override public void onclose(closeevent<window> event) { // ... } }); the documentation says no ui can shown in callback. gwt rpc calls? i'm trying make one, isn't showing on server (either in breakpoints or log statements). problem gwt rpc asynchronous , calls rpc services return immediately. in case window closed before browser has chance send underlying xmlhttprequest. if it's absolutely necessary should able hand-craft calling sort of servlet (not gwt rpc) "synchronous" xmlhttprequest. have here example: http://weblogs.asp.net/bleroy/archive/2005/12/15/433278.aspx but shouldn't doing of sort in window.onunload or window.onbeforeunload (these underlying dom events closeevent , closingevent window. perhaps there better way trying do.

javascript - Syle not getting applied to dropdown -

i've been tinkering little bit , can't quite understand why styles applied search text box not dropdown on template. ideas on why happening. http://jsfiddle.net/nnk7s/2/ template: http://kansasoutlawwrestling.com/peach/tables.html i can see what's happening, although don't know enough plugin tell why. there 2 "dropdown menus" in working example. 1 real html <select> tag <option> tags, form element hidden style="display: none" attribute. what you're seeing on page fancy, styled <div> tag designed dropdown menu. <select> tag there compatibility older browsers, or maybe if user has javascript disabled. you'll need figure out need plugin create fake dropdown overlay you. it's matter of creating <div> or other element , applying css class it.

ios - Redirection playback output of avplayer item -

what want take output samples of avasset corresponding audio file (no video involved) , send them audio effect class takes in block of samples, , want able in real time. i looking @ avfoundation class reference , programming guide, can't see way of redirect output of player item , send effect class, , there, send transformed samples audio output (using avassetreaderaudiomixoutput?) , hear there. see avassetreader class gives me way block of samples using [myavassetreader addoutput:myavassetreadertrackoutput]; [myavassetreadertrackoutput copynextsamplebuffer]; but apple documentation specifies avassetreader class not made , should not used real-time situations. have suggestion on look, or if having right approach? the mtaudioprocessingtap perfect this. leveraging avplayer, can avoid having block samples avassetreaderoutput , render them in audio queue or audio unit. instead, attach mtaudioprocessingtap inputparameters of avasset's audiomix, , you'll give

Selecting an item in AutocompleteTextview should load a list in android? -

i have 1 autocompletetextview, loading string array in it.. can search data typing firstletter .now need load list on selecting each item in autocomplete textview .. how possble? this autocompletetextview autocomplete = (autocompletetextview) customview.findviewbyid(r.id.myautocomplete); arrayadapter<string> adapter = new arrayadapter<string>(mainactivity.this, android.r.layout.simple_dropdown_item_1line, enton_web); autocomplete.setadapter(adapter); thanks in advance string s1="xcv"; string s2; string [] search=new string[20];<---- search list /** called when activity first created. */ @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); ac=(edittext)findviewbyid(r.id.edittext1); listview lv=(listview)findviewbyid(r.id.listview1); //ac.setthreshold(3); //l.add("pp"); s2=ac.gettext().tostring(); adapter=ne

c++ - GTK y-axis padded label doesn't vertically ALIGN_BOTTOM? -

i'm trying align label there space on top , not on bottom. want 30 between label1 , label2 not between label2 , label3. set label2 y padding 30 , on label2 y gtk::align_bottom, doesn't seem work. instead end looks in screenshot 30 on top , 30 on bottom of label2. know there ways around want know wrong code? can't figure out. tried changing pack options didn't work. here screenshot , here sample code: int main( int argc, char *argv[] ) { gtk::main kit( argc, argv ); gtk::window window; window.set_default_size( 400, 400 ); gtk::label label1( "this first label." ); gtk::label label2( "this second label." ); gtk::label label3( "this third label." ); label2.set_padding( 0, 30 ); label2.set_alignment( gtk::align_right, gtk::align_bottom ); gtk::vbox vbox; vbox.pack_start( label1, false, false, 0 ); vbox.pack_start( label2, false, false, 0 ); vbox.pack_start( label3, false, false, 0 );

cordova - How to deploy phonegap to different platform? -

i understand need create each platform using same sources, if original 1 build using android, okay import project include android jar library, android xml, , others? , also, can test ex android phonegap app ipad? or maybe iphone? mentor ask me develop android phonegap keep asking test using ipad. can or not? you need understand of phonegap app native application launches webview, navigator window. so, written in objective-c ios, java android , on.. have create project each os want develop on. also, can't try android app on ipad ios don't understand java application..

sql - user defined type variable is not clearing the value inside the transaction -

Image
i have scenario use temporary user defined type variable in transaction, temporary variable not clearing value inside transaction. create type [int_list_table] table([item_id] [int] null) go declare @int_val bigint -- create temp table 5 rows ;with temp(int_val) (select 1 union select int_val = 1 + int_val temp int_val < 5 )select * #int temp; set nocount on declare intcursor cursor fast_forward select int_val #int open intcursor fetch next intcursor @int_val while(@@fetch_status = 0) begin begin try begin transaction -- temprory table store integer value declare @table [int_list_table] insert @table select 1 2 = @int_val -- @table should have resultset @ @int_val = 2, once filled values 3 , 4 select 'user table type value' = item_id, 'loop integer value' = @int_val @table commit transaction end try begin

android - Need some explaining -

so weirdest thing ever happen me during programing. yes im no pro @ programing im learning go. ive got app talking server, socket in main thread, reading done in separate class , thread , writing in separate class asynctask. the problem locationmanager. talk server , write/read commands fine, implemented locationmanager , listener. i proceeded implement method update textview new coordinates on locatinchanged. far good. thing when use emulator control in eclipse , send coordinates app crashed stringoutofboundsexception (ive programed 3 years never seen this). looked @ code stepped through , on. read stacktrace, logcat, console , everywhere think of got me nowhere. until went readerthread wich looks this: public class readerthread extends thread { public void run() { new thread(new runnable(){ public void run(){ try { //establish bufferedreader read socket/server. in = new buf

java - IndexOutofBoundException why? -

i got small problem got error java.lang.indexoutofboundsexception: index: 29, size: 29 when launch 1 code error in line if ((listaswiat != null && listaswiat.get(x) != null) || harm.get(y).getdzientygodnia(x + 1).equals("nd")) dunno why index should 30 not 29 any1 can help? for (int y = 0; y < harm.size(); y++) {//wiersze c1 = new pdfpcell(new phrase(harm.get(y).nazwa, stdfont)); c1.sethorizontalalignment(element.align_center); table.addcell(c1); c1 = new pdfpcell(new phrase("" + harm.get(y).getsumagodzin() + " / " + harm.get(y).normagodzin, smallfont)); c1.sethorizontalalignment(element.align_center); table.addcell(c1); (int x = 0; x < harm.get(y).dni.size(); x++) {//kolumny c1 = new pdfpcell(new phrase(harm.get(y).dni.get(x).godziny, smallfont)); //dla swiąt ustal kolor tła na czerwono //dla niedziel ust

json - JAVA and Flex via chrome error 2032. response body is too large -

i have application made using java , flex, communicate json. have tested many times , work well, after test stop working. in debug process notice when send httpservice request server via chrome i'm getting httpservice post error 2032. i tried problem , came across this: http://old.nabble.com/httpservice-post-error-2032:iostream-error-td16533829.html they there error may occurs when response body large. i made response size smaller , worked fine. this problem occurs via chrome. in network monitor view in flex builder see response error in tree view, when change raw view, see response body json expected , header http/1.1 200 ok. still httpservice invoke fault function, not result. the response size on 9kb invoke error. less working fine. i'm running java server tomcat v7.0 on windows 7 64 bit, , chrome 17.0.963.78 m. this error get: [rpc fault faultstring="http request error" faultcode="server.error.request" faultdetail="error: [io

java - How to dodge duplication using EL? -

i'm rewriting . jsp scriplets jstl / el , i'm facing issue. it's simple i'm new el , bit lost. here's i'm doing... in servlet/controller: final list<person> l = new arraylist<person>(); personlist.add(...); . . request.setattribute( "personlist", l ); and in . jsp : <c:foreach var="person" items="${personlist}"> ${person.name} </c:foreach> but i'm duplicating "personlist" because i'm using both in setattribute , in foreach . how can rid of duplication? ideally i'd have constant, public static final string , reference both servlet , .jsp (using el, not scriptlets). obviously reason want eliminate duplication if decide rename personlist to, say, persons (with 's'), need change 2 things , error-prone. if had constant, there 1 place i'd need make change. edit commented using constant, there still need 2 places change if changed name of constant.

sql - How to calculate average of a column and then include it in a select query in oracle? -

my table is-- create table mobile ( id integer, m_name varchar(20), cost integer ) and values -- insert mobile values(10,'nokia',100); insert mobile values(11,'samsung',150); insert mobile values(12,'sony',120); i know how calculate average on column cost, code is-- select avg(cost) mobile; and result 123 but want calculate average , show difference.i able but, not able add avg column in select query-- my code --- select id, m_name "mobile name", cost price,avg(cost) average, cost-(select avg(cost) mobile) difference mobile group id,m_name,cost; and output -- id mobile name price average difference 10 nokia 100 100 -23 11 samsung 150 150 27 12 sony 120 120 -3 what wants correct average column.. wants this--- id mobile name price average difference 10 nokia 100 123 -23 11 samsung 150 123 27 12

ruby on rails - Recaptcha error -

i have problem recaptcha gem. i'm using ubuntu on virtual machine (virtualbox). uses bridged network interface card, have internet access there , can see ubuntu host computer. when run rails s , go to 127.0.0.1:3000 on virtual machine fine. 192.168.0.103:3000 on host machine there error recaptcha box. input error: invalid referer box supposed be. why , how fix this? but, when tried host same application server same pair of keys, not generate error but, display "input error - invalid referer" instead of captcha in form. because, when getting pair of keys google api, specify domain name there. in that, use keys in local system, enter domain "localhost". but, these pair of keys not work when deploy application in server. so, application work in remote host, should pair of keys google api domain name, going deploy application. , use them in application. note: can have new pair of keys recaptcha using following link: http://www.goog

sql - How to best store and aggregate daily, weekly, monthly visits for quick retrieval? -

i using sql server 2008 , coldfusion 9. i need log visit web site. users logged in. need able retrieve how many times have logged in week, this, year , how many consecutive days, how stackexchange it. want able show calendar month , display days visitor visited. i not sure of best way store data or retrieve it. initial thought create daily or weekly table records every hit every user. store userid , timestamp this. table_visits_last_seven_days userid vistitdatetime 101 2012-10-06 01:23:00 101 2012-10-06 01:24:00 101 2012-10-07 01:25:00 102 2012-10-07 01:23:00 102 2012-10-07 01:24:00 102 2012-10-07 01:25:00 at end of each day, determine visited site , aggregate visits remove duplicate info. so, delete above data , insert table store data: table_visits_all_time userid vistitdate 101 2012-10-06 101 2012-10-07 102 2012-10-07 this data easy query , wouldn't store unnecessary data. i'd have of

Android x86 Network interfaces Down -

i working on android application , , using oracle vm , android x86 testing, wanted download newer version 3.x + , , found no generic ones except 2.2. however, used 4.0 version asus (note: mine hp), when tried connect eclipse getting ip, found network interfaces down. how can bring them , or there other method connect them eclipse? do following set network settings on android x86: on console (alt - cursor left) set ip address: ifconfig eth0 192.168.1.10 netmask 255.255.255.0 set gateway: route add default gw 192.168.1.254 dev eth0 set dns if needed.

Java/Swing: Obtain Window/JFrame from inside a JPanel -

how can jframe in jpanel living? my current solution ask panel it's parent (and on) until find window: container parent = this; // jpanel { parent = parent.getparent(); } while (!(parent instanceof window) && parent != null); if (parent != null) { // found parent window } is there more elegant way, method in standard library may be? you use swingutilities.getwindowancestor(...) method return window cast top level type. jframe topframe = (jframe) swingutilities.getwindowancestor(this);

php - Error "reporting" in a model -

i'm thinking of returning errors ocurred inside model, following way: class data extends ci_model { private $errors_list private function set_error($control,$error_string){ $this->errors_list[][$control] = $error_string; } public function get_errors($control){ // logic return $errors_array; } public function data(){ // error happens $this->set_error('user','your db seems empty!'); $this->set_error('dev','// db error in full'); return false; } } this way can treat them on controller: class data extends ci_controller { public function index(){ $this->load->model('data'); $data = $this->data->data(); if(!$data) // send $this->data->get_errors() user , logs else // send $data view } } is idea? potential drawbacks, , there bet

WordPress Inside Pages Default to Index Always? -

i set site wordpress using automatic setup through hosting provider. in wordpress, , it's working in can create pages. however, when go view page, defaults index page. example: if go www.site.com/about goes www.site.com it not show inside pages. cannot figure out why doing this. thoughts? have set new wordpress sites before , have not run problem. did miss step in set process? any appreciated, thank you. without putting hands on site difficult. is possible share link site? what theme using? using custom theme? if check if have file in theme folder called page.php , not same index file. try clicking on page preview button inside page editor. check url sure 1 expecting. have adjusted permalinks in wordpress configuration? double check valid. should */%post_id%/%postname%/* i hope of helped. try give little more info settings.

how to set an object into C++ from C# -

i want configure c++ project c#. e.g: if have class in c#: public class person { public person(){} public string firstname {get; set;} public string lastname {get; set;} public int age {get; set;} } then have list of persons: person per1 = new person(); per1.firstname = "per1"; per1.lastname = "last"; per1.age = 20; person per2 = new person(); per2.firstname = "per2"; per2.lastname = "last2"; per2.age = 21; then have: list<person> persons = new list(); persons.add(per1); persons.add(per2); my question how can pass ' persons ' list in c++ source. a sample appreciated! thanks in advance. you cannot pass list<> unmanaged c++, since has no access clr , wouldn't know it. what can define structure in c++ matches layout of c# class , pass exported c++ function expects array. depending on how control have on c# , c++ definitions, there things can make life

osx - Xcode: How to use separate Projects with cross-project references to embed a framework in your application? -

i using xcode 4.3. i have existing xcode project (originally created in xcode 3) embeddable mac os x framework. project has few targets, primary target in project framework. framework designed embedded in mac apps , has appropriate installation directory properties set. ( @executable_path/../frameworks ) i have new xcode project (created in xcode 4) mac os x application. there single mac app target in project. i combine old framework project and/or target new app project can build both app , framework source in single, combined build process. (i have done in xcode 3 many times, cannot figure out in xcode 4). i do not (unless it's way) want build framework separately , link app project. want combine framework target mac app project. here's apple's outdated documentation describing how want in xcode 3: embedding private framework in application bundle > using separate xcode projects each target how do in xcode 4? note: need know how add framework tar

get error code -11843 while exporting mp3 file in ipod library since iOS 5.1 -

i use avassetexportsession export mp3/m4a files in ipod library. method works on ios 5.0 , earlier. after upgrade ios 5.1, method doesn't work mp3 anymore, still works m4a. here source code. avurlasset *songasset = [avurlasset urlassetwithurl: [mediaitem asseturl] options:nil]; nslog (@"compatible presets songasset: %@",[avassetexportsession exportpresetscompatiblewithasset:songasset]); avassetexportsession *exporter = [[avassetexportsession alloc] initwithasset: songasset presetname: avassetexportpresetpassthrough]; nslog (@"created exporter. supportedfiletypes: %@", exporter.supportedfiletypes); nslog(@"output file type=%@",[mediaitem filetype]); nslog(@"export file path=%@",exportpath); exporter.outputfiletype =[mediaitem filetype]; nserror *error1; error1=0; if([[nsfilemanager defaultmanager] fileexistsatpath:exportpath]) { [[nsfilemanager defaultmanage

Cyrillic text extraction in Python/Django -

i'm using urllib2 open russian website , extract text it. however, instead of coming out "Беллона" it's coming out "Áåëëîíà". what's easiest way around this? figure out encoding webpage uses (probably utf-8 or iso 8859-5), , convert text unicode this: ustring = unicode(read_string, encoding=...) if need determine encoding of webpage dynamically, see this answer.

php - writing special characters to txt file -

i reading data remote file, got every thing working till point when write specific lines text file. problem here is, when write girl's goldtone 'x' cz ring becomes girl & apos;s goldtone &apos ;x & apos; cz ring in txt file. how write txt file retains text written above , not show character code actual character. sample of code. $content_to_write = '<li class="category-top"><span class="top-span"><a class="category-top" href="'.$linktext.'.html">'.$productname.'</a></span></li>'."\r\n"; fwrite($fp, $content_to_write); $linktext = "girls-goldtone-x-cz-ring"; $productname = "girl's goldtone 'x' cz ring"; var_dump string '<li class="category-top"><span class="top-span"><a class="category-top" href="stellar-steed-gallery-wrapped-canva

jQuery - Pausing and resuming a looping animation too quickly causes the queue to go haywire -

i have following code animates forever, pauses @ end of current animation on mouse enter, , resumes on mouse leave. works how want except 1 issue. if hover in , out of element (e.g. cutting across corner) causes kind of queue build , goes haywire. when check queue there's nothing strange in , animations not running in queued order. using following code waggle mouse in , out of grey area. when allow animations resume go haywire (also available @ http://jsfiddle.net/54ytx/ ). $('body').html('<div style="background: lightgrey;">testing</div>'); function do_animations() { // 0 or 1 console.log($('div').queue('fx').length); $('div') .delay(1000) // hardcoded numbers mean resuming bottom position takes longer doesn't matter in simple example .animate({'padding-top': '100px'}, 1000) .animate({'padding-top': '0px'}, 1000) // queue

html - send ID to PHP script and return img src tag from DB filename -

i trying easy sure have looked , tested , not doing right. have db stores image file name, need file name based on id in html , let me explain: <div class="slide"> <div class="image-holder"> <img src="img/asoft_table.jpg" alt="" /> </div> <div class="info"> <p>morbi tellus lorem, id scelerisque ligula. maecenas vitae turpis et.</p> </div> </div> <div class="slide"> <div class="image-holder"> <img src="img/soft_table.jpg" alt="" /> </div> <div class="info"> <p>sed semper, lorem ac lobortis bibendum, magna neque varius augue, vel

clojure - How do i get a modified Set after updating element for a specific key? -

i have set of objects (def books #{{:isbn 1 :title "programming clojure"} {:isbn 2 :title "joy of clojure"} {:isbn 3 :title "clojure in action"}}) how update object having given key (:isbn) , return modified set? (??? books :isbn {:isbn 1 :title "programming clojure" :author "halloway"}) in java, equality can defined using isbn , element can directly added set. idiomatic way of doing in clojure? if want kind of updates, should have associative structure. can turn set 1 , again: (-> (group-by :isbn books) (assoc-in [1 0 :author] "halloway") ; 1 isbn, 0 means "first" vals (->> (map first)) set) this code assumes :isbn unique (since said "key"). turns set map :isbn values sequences of corresponding records, updates first record :isbn 1 author, mangles set.

iis 7 - IIS App Pool/Restart and ASP.NET -

we using iis7 host asp.net web-based application. in environment administrators , developers can deploy code application on regular basis. the new code or app goes dll asp.net bin folder. upon deployment of new dll, iis restarts process, impacting (slowing down) online users. is there way configure iis run process in background , once ready make switch old state new without impacting users?! thanks in advance feedback! iis this, that's recycling about. it's loading dll's while old version of application still running. after completed recycling complete. however loading dll's part of getting web applications ready , there might initial loads loading/caching user db etc. these actions not part of recycle process , happen after dll's reloaded , recycling completed. a while ran issue application had huge startup time due heavy db activity/caching during startup. interested if there functionality allows execute code before recycle marked completed

java - How to extract the URL following an HTTPPost in Android -

i'm scratching head @ problem can't seem figure out. i'm trying extract url following httppost. allow me go through oauth process. currently i'm extracting whole website entity. for example: data posted https://mysite.com/login , redirect after post https://mysite.com/dashboard?code=3593085390859082093720 how 1 extract url? if need more information or can direct me in right direction, appreciated! thank you! import java.io.bufferedreader; import java.io.ioexception; import java.io.inputstream; import java.io.inputstreamreader; import java.util.arraylist; import java.util.list; import org.apache.http.httpresponse; import org.apache.http.namevaluepair; import org.apache.http.client.clientprotocolexception; import org.apache.http.client.httpclient; import org.apache.http.client.responsehandler; import org.apache.http.client.entity.urlencodedformentity; import org.apache.http.client.methods.httppost; import org.apache.http.impl.client.basicresponsehandler; i

How to do bulk file-editing in common lisp? -

i'd know how bulk-editing of files in common lisp. needed while , used perl , bash it. i'd know common-lisp solution out of curiousity. i used following: find -name '*.lisp' -execdir perl -0777 -pi.bak -e 's/foo/bar/mi' '{}' '+' and worked charm. the above command feeds files in directory (and subdirectories) perl program. perl program searches regex "foo" , replaces regex "bar", , saves new (edited) file in place. thanks guidance can provide on cl solution. how starting walk-directory , slurp file , close file , replace foo bar, write contents back, , then... rest. ;-)