Posts

Showing posts from June, 2011

matlab - How to multiply many gpuArray matrices in parallel? -

given matrices a 1 ,...,a n , b 1 ,...,b n stored gpuarray , want calculate matrices c i =a i *b i . all a i 's of same size, , b i 's of same (possibly different) size. how do fast on gpu, assuming n large , sizes of matrices relatively small? possible avoid using cuda? if have matlab r2013b, can use new gpuarray pagefun function.

javascript - get string of values of certain property from JSON -

i'm trying string of isbns google books bookshelf via api. here's attempt isn't working. (i'm trying use this snippet .) $.getjson("https://www.googleapis.com/books/v1/users/115939388709512616120/bookshelves/1004/volumes?key=myapikey", function (data) { console.log(data); var allisbns = []; (i = 0; < data.items.volumeinfo.industryidentifiers[0].identifier.length; i++) { allisbns.push(data.items.volumeinfo.industryidentifiers[0].identifier[i]); } alert(allisbns); }); fiddle looking @ object logged, data.items array (of length data.totalitems seems). furthermore, industryidentifiers[0].identifier seems string, , not array. therefore think wanted loop through data.items instead. also may worth noting should not going explicit index on industryidentifiers unless the spec calls out predefined order. recommend finding identifier type === "isbn_10" : for (var = 0; < data.items.length; i++) { (var j = 0; j < data.i

ios - Make an image view every time at launch -

i want splash image fade after 1 second after launch. so on top of .xib put image view splash image, ( first actual splash screen shows, when xib loaded image view same image shown, making it's same splash screen ) i use code in viewcontroller.m fade image [uiimageview beginanimations:nil context:null]; [uiimageview setanimationduration:1.0]; [imageloading setalpha:0]; [uiimageview commitanimations]; this works, if user goes xib , later switches back, shows 1 second splash screen again. i tried in viewcontroller.m -(bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { [uiimageview beginanimations:nil context:null]; [uiimageview setanimationduration:1.0]; [imageloading setalpha:0]; [uiimageview commitanimations]; return yes; } but apparently it's not getting called. is there other way, make image view fade @ launch? thanks lot, set property in app delegate . eg @property(nonatomic,ass

c# - Video player for application that loads RTMP feed -

good morning/afternoon. looking integrate rtmp player application creating play local live rtmp feed. recommend players? i've been looking @ osmf strobe media playback have not pulled trigger yet. you can find c# rtmp implementation @ https://code.google.com/p/rtmp-mediaplayer/ it tested work on windows, ios , android. need bass ( http://www.un4seen.com/bass.html ) output audio. video not supported base rtmp client code (netstream) exposes event gives video data arrive server.

java - WLST command to update JDBC DataSource URL -

i use weblogic console navigate data sources , update url in data sources. there way can same using wlst command. need update command. i need update url of data source. we via wlst script in different fashion: edit() # set url , remove target can redeploy without # restarting managed server startedit() cd("/jdbcsystemresources/"+dsname) targets = get('targets') # set array ob empty objects datasource's targets set('targets',jarray.array([], objectname)) cd("jdbcresource/"+dsname+"/jdbcdriverparams/"+dsname) set("url", dburl) save() activate() # reset thge original targets datasource refreshed startedit() cd("/jdbcsystemresources/"+dsname) set('targets', targets) save() activate() the thing found needed here changing url on datasource object not redeploy managed managed servers datasource attached to. if use managed servers, either have set targets empty, save datasource, set origina

java - Shorten a string in JTabel when cell is too small -

when cell small display whole string, shortens end adding '...'. instance: "this string" becomes "this is..." there way shorten @ beginning? "...a string". thx! jtable default uses jlabel rendering component, need tell label how shorten string. can implementing custom tablecellrenderer . perhaps can use left dot renderer starting point , extend it, if not suits needs.

Google Maps' custom marker doesnt have transparency -

i have png image place custom marker. code simple: <script type="text/javascript"> document.write('<div id="gmap" style="width:960px; height:360px;"></div>'); var map_center = new google.maps.latlng(xxx, xxx); var map = new google.maps.map( document.getelementbyid("gmap"), { zoom: 11, center: map_center, maptypeid: google.maps.maptypeid.roadmap, pancontrol: false, streetviewcontrol: false, maptypecontrol: false, styles: [ { featuretype: 'all', elementtype: 'all', stylers: [ { visibility: "on" }, { saturation: -100 } ] }] }); var pos; var marker; for(var = 0 ; < 10 ; i++) { pos = new google.maps.latlng(xxx, xxx); marker = new google.maps.marker({ position: pos, map: map, title: &#

java - Distribute application with user defined heap size -

we distributing java application exe file using install4j, , setting jvm parameters (e.g. vmparameters="-xmx512m ..." ). problem is, users needs different maxheapsize, , want allow user-defined jvm parameterization (say, launching .exe cmd params). how can achieve this? edit i know launch4j , other executable wrappers, couldn't find of works .exe file (only .jar s) eventually, colleague found answer - create .vmoptions file next .exe , add options want pass jvm (in case -xmx1024mb ).

html5 - Google Chrome 28 doesn't play mp4 videos -

i have issue @ moment cannot .mp4 videos play on google chrome 28, happens on windows 7 machines, not of them. as stands, able replicate issue on 3 windows machines out of five. even if enter direct url .mp4 file in address bar, chrome still won't play it. can here replicate issue? have used few different .mp4 files test, here's one: http://www.w3.org/2010/05/video/mediaevents.html i appreciate help. note: going chrome advances settings , turning off "use hardware acceleration when available" chrome able play video, option turned on default, not perfect solution problem. thanks lot. update: updating video drivers fixed it, again... not ideal solution... we had problem... both webm , theora/ogg worked fine in chrome , mp4 video worked fine on ie9 , in firefox. chrome fails. we manage fix updating video drivers (intel hd on dell pc), looks problem in h.264 acceleration used in chrome , old intel drivers

asp.net - SimpleMembershipProvider in WebSite with Profile -

i created new website in vs2012 - not project - added connection string, created tables, , using aspnet configuration created couple of roles , user, in turn automatically created appropriated tables in database: users, usersinroles, roles, memberships , roles. pretty working expected. 4.5 (simplemembershipprovider) doesn't create stored procedures , code used old membershipprovider. i wanted add fields in profile provider, use membershipprovider: <properties> <add name="mywhatever" type="system.int32" allowanonymous="false"/> </properties> but when try call in code behind, said "profile" doesn't exists. search on web , read vs2012, if create website, instead of project, doesn't come profile default have create custom one. following added following code in appcode cs: namespace mynamespace { public class userprofile : profilebase { public static userprofile getuserprofile(string user

regex - Perl: search for a match multiple times in a file -

in perl script, opened file , search string. successful. when search same string again right after search, seems script starts searching until end of file, , hence not able find match more. code like: open ( infile, "./input.txt") for($i=0; $i < 3; $i++){ print "i = $i\n"; $found = 0; while (! $found && ($line = <infile>)){ if ( $line =~ /string/ ){ print "found!\n"; $found = 1; } else{ print "not found!\n"; } } } close (infile); the input.txt file: string random2 random2 i expecting output be: i = 0 found! = 1 found! = 2 found! but turns out be: i = 0 found! = 1 not found! not found! = 2 can me this. started learning perl. you're getting because when read file in perl mark last position read in file won't read again, in case read whole file marked end of file , need reset position doing seek beginning again

php - Fooling around with xml -

i have poorly formed xml in php able contents of, problem strips html tags <content> <whatshere> <![cdata[ <h1>content</h1> ]]> </whatshere> <whatscoming> <![cdata[ <h2>i have no idea</h2> ]]> </whatscoming> </content> i doing: class coretheme_adminpanel_template_helper_grabupdatecontent{ private $_xml_object_content = null; public function __construct(){ if($this->_xml_object_content === null){ $this->_xml_object_content = simplexml_load_file('http://adambalan.com/aisis/aisis_update/test/update_notes.xml'); } } public function whats_here(){ $content = $this->_xml_object_content->whatshere[0]; echo $content; return trim($content); } } when call whats_here() <p>content</p> instead of <h1>content</h1> should. it looks th

ios - Audio file doesn't play in iPhone 5 -

i use code playing .caf audio file, same code works in iphone 4s , ipad 2 doesn't play @ in iphone 5... this code: -(ibaction)checksound:(id)sender { nsurl *url = [nsurl fileurlwithpath:[nsstring stringwithformat:@"%@/lunatic.caf", [[nsbundle mainbundle] resourcepath]]]; nslog(@"%@",url); nserror *error; self.audioplayer = [[avaudioplayer alloc] initwithcontentsofurl:url error:&error]; self.audioplayer.numberofloops = 0; self.audioplayer.volume = 1; nslog(@"log audioplayer: %@",audioplayer); if (audioplayer != nil) { [self.audioplayer preparetoplay]; [self.audioplayer play]; } if (audioplayer.playing == no) { nslog(@"not playing, error: %@",error); } if([[nsfilemanager defaultmanager] fileexistsatpath:@"file://localhost/var/mobile/applications/0d3f5169-8db1-4398-a09a-db2fbadf57ef/myapp.app/lunatic.caf"]) { nslog(@"file exist"); } else { nslog(@"file doesn't exist

php - Get information between two strings -

i have following php string $string = "hello world<br>- 8/7/2013<br>hello world"; so basically, need information between dash , space ( - ) , closest line break tag. appreciated! looked hours haven't been successful. don't think preg_replace either. strpos finds index of substring (optionally after specified index), so: $start = strpos($string, '- ') + 2; $end = strpos($string, '<br>', $start); $part = substr($string, $start, $end - $start); ta-da!

How to pass UDT array from excel vba to vb.net -

how pass array of user defined class type byref excel vba vb.net? have similar post deals passing double arrays here , tried using same method udt doesn't work. ideas? sorry answer own question (again) similar other question linked in question, able accomplish in same way answer other question. had change of refraction parameters around. in vb.net code take in parameter object, object's type (which recognizes object() array) , direct cast object array desired class array using following function in vb.net friend function comobjectarraytopointarray(byval comobject object) point() dim thistype type = comobject.gettype dim fibtype type = type.gettype("system.object[]") dim fibarray(0) point if thistype fibtype dim args(0) object dim numentries integer = cint(thistype.invokemember("length", bindingflags.getproperty, _ nothing, comobject, nothing)) redim fibarray(num

java - Where can I find the list of attributes name? -

i wondering if there list of attributes name referred when using following: however, can set dos attribute using setattribute(path, string, object, linkoption...) method, follows: path file = ...; files.setattribute(file, "dos:hidden", true); in case .ishidden() method referred hidden , isreadonly() ? have tried dos:readonly , other combination, without achieving result wanted. dou know link has list of attribute "reference"? in advance. http://www.kodejava.org/how-do-i-set-the-value-of-file-attributes/ // // set new file attributes. // files.setattribute(file, "dos:archive", false); files.setattribute(file, "dos:hidden", false); files.setattribute(file, "dos:readonly", false); files.setattribute(file, "dos:system", false);

java - how do I solve the brut.androlib.AndrolibException -

i having following exception after decoding apk in debug mode , trying build new apk in debug mode. confused , don't do. when try following getting same result. $java -jar ./apktool.jar d -d meet.apk out $java -jar ./apktool.jar b -d out meet.apk or this $./apktool d -d meet.apk out $./apktool b -d out meet.apk i following output i: checking whether sources has changed... i: smaling... i: checking whether resources has changed... i: building resources... exception in thread "main" brut.androlib.androlibexception: brut.common.brutexception: not exec command: [aapt, p, -f, /tmp/apktool4160944918573250929.tmp, -i, /root/apktool/framework/1.apk, -s, /home/lab2alex/documents/out/res, -m, /home/lab2alex/documents/out/androidmanifest.xml] @ brut.androlib.res.androlibresources.aaptpackage(androlibresources.java:193) @ brut.androlib.androlib.buildresourcesfull(androlib.java:301) @ brut.androlib.androlib.buildresources(androlib.java:248) @ brut.androlib.an

configuration - Xcode mach-o linker error when archiving project with test targets -

Image
i'm getting mach-o linker errors pointing missing files in test targets when try create archive, can build , run app on both on simulator , device without problems though. i've tried looking @ bundle loader , test host configurations test targets, , both fine. else cause this? in statution, solve issue change bit code enabled build settings. if use 3.party framework in project , these framework not supported bit code compression in release time. must change bit code enabled flag yes no. i hope someone.

delphi - Setting Segoe UI Light programmatically in TJvWizard -

Image
i'm using tjvwizard component , want set header title font use segoe ui light. in form oncreate method i'm doing following: procedure tform1.formcreate(sender: tobject); var i: integer; begin := 0 jvwizard1.pagecount - 1 begin jvwizard1.pages[i].header.parentfont := false; jvwizard1.pages[i].header.title.font.size := 16; jvwizard1.pages[i].header.title.font.name := 'segoe ui light'; end; end; this code sets font size correctly font doesn't change segoe ui light, instead keeps using parent font (which segoe ui.) as workaround, did this: procedure tform1.formcreate(sender: tobject); var i: integer; f: tfont; begin f := tfont.create; f.name := 'segoe ui light'; f.size := 16; := 0 jvwizard1.pagecount - 1 begin jvwizard1.pages[i].header.title.font.assign(f); end; f.free; end; this trick, smells funny me. also, don't know how assign works. keeps reference? should keep f.free line? edit: additional i

Install4j and Control Panel details -

Image
i'm looking @ install4j "register add/remove item" action , how affects appears in windows control panel programs area. i'm having problem "version" appears in control panel - doesn't match want displayed there, , can't seem figure out that's configured. i use compiler variables store product name , product version. these variables set in media file area under "customize project defaults/compiler variables" under "general settings/application info" in i4j, use "${compiler:product-name}" "full name" , "${compiler:product-version}" "version". these both set in media file. in "register add/remove item" action, "item name" field, use "${compiler:product-name} ${compiler:product-version}". this appears correctly in control panel name (sorry - had redact them posting). however, version appears in control panel not appear way want. i don't

amqp - RabbitMQ queue messages -

at rabbitmq web interface @ queue tab see "overview" panel found these: queued messages : ready unacknowledged total i guess "total" messages. "ready" , "unacknowledged" ? "ready" - messages delivered consumer? "unacknowledged" - ? message rates: publish deliver redelivered acknowledge and these messages? "redelivered" , "acknowledge"? mean? ready number of messages available delivered. unacknowledged number of messages server waiting acknowledgement(if client recieved message dont send acknowledge yet). total sum of ready , unacknowledged messages. second question: publish rate how many messages incomming rabbitmq server. deliver rate @ messages requiring acknowledgement being delivered in response basic.consume. acknowledge rate @ messages being acknowledged client/consumer. redelivered rate @ messages 'redelivered' flag set being deliver

android - Can I set a LayoutTransition with an Animation (instead of Animator)? -

i want make custom transitions on layout. i'd use xml defined "animation" because lets me use percentage values, while "animator" seems take pixel values. problem layouttransition seems take "animator" parameter. layouttransition lt = new layouttransition(); lt.enabletransitiontype(layouttransition.changing); lt.setanimator(layouttransition.disappearing, /*animator*/); view.setlayouttransition(lt); try using animator object defined xml animatorinflater.loadanimator(context, r.animator.your_animation) the xml uses tag: <objectanimator /> this different animation , has different set of properties. these can found at: property animations hope helps.

umbraco6 - Umbraco V6.1.3 Lucene Index Corruption -

just upgraded umbraco v6.1.1 site v6.1.3. went on workstation. copied files web server after deleting there, did same database. set directory permissions , ran site. site (which mvc) runs 2 issues can't fathom , appreciate with. one page errors read past eof error. view it's trying run. error on link in bold. @inherits umbraco.web.mvc.umbracotemplatepage @{ layout = "basepage.cshtml"; } <div class="row-fluid"> <div class="span12"> <h1>@umbraco.field("pagename")</h1> @umbraco.field("pagetext") </div> </div> <div class="row-fluid"> <div class="span12"> @foreach (var page in model.content.children) { <section class="well"> <h3>@page.name</h3>

login - Save username and password in a cookie, or send info to url on click -

please note - following post demo site only. not production site. the logic want perform goes this... buttonclick new window opens username/password entered user clicks 'login' user logged in. i have tried this... username:password1@university.edu/portal/server.pt and this... https://university.edu/portal/server.pt?username=someuser&password=somepassword but no avail... this internal company website , not have access outside world. internal demo only edit: assistance on building url has username/password built in can accomplish above logic.

ruby - Redis publish in rails 4 stops server thread -

sorry english, i'm newbie. trying use redis.publish feature rails 4 , redis gem push messages sse. i have block in controller logger.info "test1" $redis.publish "user", "test" logger.info "test2" where $redis - $redis = redis.new(:host => '127.0.0.1', :port => 6379, :db => 1,:timeout => 0) in initializer. server console in production print i, [2013-08-07t22:34:50.138232 #4679] info -- : test1 and nothing. request working, thread stops. by way, $redis.publish "user", "test" @ rails_env=production rails console run , message appear @ client. can me? upd: ruby 2.0-p247, rails 4, redis 3.0.4 don't use 1 connection in initializer subscribe , publish both. i created 2 connections, 1 subscribe in sse writer, 1 in controllers publish, , working normally.

python - Labels Aren't Changing -

i'm going post snippet of code, because essentially, same thing. string = '' time_calc = tk() time_calc.geometry('500x400') time_calc.title("calculate time") time_calc_frame= frame(time_calc).grid(row=0, column=0) jul_box = entry(time_calc) jul_box.insert(0, "julian date") jul_box.pack(side = top) jul_box.bind('<return>') def jd2gd(jd): global string jd=jd+0.5 z=int(jd) f=jd-z alpha=int((z-1867216.25)/36524.25) a=z + 1 + alpha - int(alpha/4) b = + 1524 c = int( (b-122.1)/365.25) d = int( 365.25*c ) e = int( (b-d)/30.6001 ) dd = b - d - int(30.6001*e) + f if e<13.5: mm=e-1 if e>13.5: mm=e-13 if mm>2.5: yyyy=c-4716 if mm<2.5: yyyy=c-4715 months=["january", "february", "march", "april", "may", "june", "july", "august", "september", "oct

android - Stopwatch on status/ notification bar -

i'm able use stopwatch / timer in activity. how can show stopwatch in notification bar ? i have starttime , elapsedtime values, so: how import/ show working stopwatch on notification bar ? how continue stopwatch on notification bar if app closed ?

r - Evaluating ddply within a function when passed ggplot2 aesthetic mappings as arguments -

i'm working on function create bean plots in ggplot2 , stuck on step calculating medians each group. i've tried couple of solutions @ object not found error ddply inside function , object not found error ddply inside function still unable work. error message returned "error in as.quoted(.variables) : object 'iv' not found" indicates it's not evaluting symbol iv in correct environment. if possible, keep method of passing variables function ggplot2 aesthetic mapping since using same aesthetic mappings violin , rug plots later on in function. the code function: ggbean <- function(data = null, mapping = null, ...){ require(plyr) x <- mapping[['x']] y <- mapping[['y']] # calculate medians each group medfn <- function(mydat, x1, y1){ z <- do.call("ddply",list(mydat, x1, summarize, med = call("median", y1, na.rm=true))) return(z) } res <- medfn(data, x, y) } sample data s

node.js performance for amazon EC2 instances with ECU's -

i have node.js server. undertsand 1 node process bound 1 cpu/core. have 2 core box, use cluster launch 2 processes utilize 2 cores of box. however, not able understand how work ec2 instances ecu concept. for eg. m1.large instance has 2 vcpus 4 ecu's (effective compute unit) when launch node.js cluster, launches 2 node processes. however, on desktop has 8 cores, launches 8 node processes. now wondering whether node.js sever on m1.large 2 cores , 4 ecus perform better box 2 cores , no ecu's please answer query. amazon ecu virtual core because virtual sever 2 real core of xeon processor.so box real 2 core perform better virtual ecu.and dont think amazon ecu same thing real cpu core amazon elastic cloud . far working nodejs , ec2 on production server set 2 thing utilize max cpu power of m1.large instance. multiple node process behind nginx reverse proxy load-balencer a. set different nodejs process on different port. b. on front of them nginx load bala

asp.net mvc - RemoteAttribute is not passing parameter to action? -

i trying use remoteattribute validate data element serverside using json. data field is: [display(name = "my number")] [required] [remote("isvalidmynumber","home",errormessage="bummer")] public string mynumber { get; set; } my controller is: public jsonresult isvalidmynumber(string mynumber) { var test = services.validatemynumber(mynumber); return json(test,jsonrequestbehavior.allowget); } my view is: <div class="editor-field"> @html.editorfor(model => model.checkinformation.mynumber) @html.validationmessagefor(model => model.checkinformation.mynumber) </div> the html generated is: <input class="text-box single-line" data-val="true" data-val-remote="bummer" data-val-remote-additionalfields="*.mynumber" data-val-remote-url="/home/isvalidmynumber" data-val-required="the number field required.&

c# - Getting my friend from facebook -

i'm learning facebook api writing simple console appliction. i'm trying simple things, code examples found on web (and in stackoverflow). the thing i'm trying do, getting of friends list [name, id]. i run code, #2500 error. here code: class program { static void main(string[] args) { facebookclient fbclient = new facebookclient(); dynamic result = fbclient.get("oauth/access_token", new { client_id = <removed app id>, client_secret = "<removed app secret>", grant_type = "client_credentials" }); fbclient.accesstoken = result.access_token; var friendlistdata = fbclient.get("/me/friends"); jobject friendlistjson = jobject.parse(friendlistdata.tostring()); list<fbuser> fbusers = new list<fbuser>(); foreach (var friend in friendlistjson["data"].children()) {

mono - Monodevelop debugging asp.net with xps Metadata file error -

i'm trying run simple asp.net application created monodevelop strange error cs0006: metadata file `/path_to_myhome/c' not found actually don't know how fix it. i've done several search on internet without success. appreciated.

Delphi: how to show up to 4 subpanels as grid -

i way in delphi 7 have on tpanel 1 4 panels/cells grid. can show n x m cells grid, n*m 1 4. each cell resizable splitter, each cell should contain custom tpanel or tframe or whatever. how can it? .net has special component. delphi has such component too? do need implement hand, ie make 4 panels / 3 splitters, , perform align assignments?

ruby on rails - ActiveAdmin building parent objects in child form -

i'd able assign industry_id new business model when create it..or..create new industry instance added new business model when creating new business here models class business < activerecord::base attr_accessible :name, :industry, :owner belongs_to :industry end class industry < activerecord::base attr_accessible :name has_many businesses accepts_nested_attributes_for :businesses end i have tried every way possible create form allow i've had no luck @ all. the formtastic documentation doesn't appear have examples of , neither activeadmin's.

java - Why did I get a "bad operand types for binary operator" error? -

i working on exercise incorporates 1 method another. know getminmax() method has empty array that's irrelevant purpose of exercise. code: public class square{ int area; public square[] getminmax(square[][] arr){ square[] list = new square[2]; return list; } public int getarea(){ return area; } public boolean isdifferencesignificant(square[][] arr){ boolean isit = false; square [] result = getminmax (arr); if((result[1] - result[0])< 0.5) //the line (16) in question isit = true; return isit; } } when compile following error: square.java:16: error: bad operand types binary operator '-' if((result[1] - result[0])< 0.5) ^ first type: square second type: square 1 error i'm lost , want know why error occurred. edit: rohit jain said "you meant - result[1].getarea() - result[0].getarea() " and lochemage said &qu

c# - DirectShowNet - Error when recreating graph for webcam after unplug/replug back in -

i've spent 4 hours trying figure out solution issue. basically, writing application in c# using directshownet shows video webcam, allows take snapshots, , change resolution of webcam. have device manager detects when webcam unplugged, replugged in. however, i'm having difficultly recreating graph after device has been plugged in. the first thing create filtergraph object , cast ifiltergraph3. then, make call: graphbuilder.addsourcefilterformoniker(devicemoniker, null, devicename, out sourcefilter) this call works when launch application, , if dispose of graph , create new one. however, time doesn't work when trying create graph after device plugged in. on 1 machine (win8 x64), receiving error: regdb_e_classnotreg - 0x80040154 - class not registered on machine (win7 x64), receiving error: regdb_e_iidnotreg - 0x80040155 - interface not registered i have tested both building code any cpu , x86 . also, have tested on other machines, independent of os, stil

.net - DotNetNuke Add/Manage New Role Issue -

i running dotnetnuke version 07.01.00 (2676) , reason when got users|manage roles|add new role hangs. able modify users , roles exist unable add new security role. are there settings can check see why not working? have read in cases db related issue. have 2 identical environments , both doing exact same thing. recent upgrade 07.01.00 (2676). any or direction appreciated. any other issues? i check couple of things. 1) on host/host settings page check if have "hosted" jquery selected, if so, try unchecking it. 2) errors in eventlog? 3) if open developer toolbar in browser, errors being thrown when click on option?

php - Multiple frameworks on one URL with Apache -

note: urls, usernames, etc. have been changed privacy. i designing api in flask, website in php. changed, moment both run side side on same url, call domain.com. flask api should located @ www.domain.com/api , php website @ www.domain.com. the apache file websites located at: /etc/apache2/sites-available/domain.com. using 1 of individual settings below , restarting apache, can framework run alone, have not figured out how them both in file , running without issues. flask (www.domain.com/api): <virtualhost *:80> serveradmin webmaster@domain.com servername www.domain.com wsgidaemonprocess api user=www-data group=www-data threads=5 wsgiscriptalias /api /home/user/public_html/api/api.wsgi <directory /home/user/public_html/api> wsgiprocessgroup api wsgiapplicationgroup %{global} order deny,allow allow </directory> </virtualhost> php (www.domain.com): <virtualhost *:80> serveradmin we

ruby on rails - setting the size of input fields -

i have rails form i'm trying change size of default fields using either :size or both :cols => "30", :rows => "10" in code below. however, form fields staying default size. there i'm doing wrong? <%= d.text_field c, :class => 'random', :value => "#{c}", :size => "30", :id => 'correction_data_'"#{c.parameterize}"%> or way <%= d.text_field @title, :class => 'random', :value => "#{@title}", :cols => "30", :rows => "10", :id => 'correction_data_'"#{@title.parameterize}"%> text_field doesn't consider rows , cols attributes, consider size attribute. text_area considers rows , cols , size attributes. text_field: <%= d.text_field c, :class => 'random', :value => "#{c}", :size => 30, :id => 'correction_data_'"#{c.parameterize}" %>

html - Are there reasons not to use ARIA states and roles as selectors in CSS? -

i'm working on making accessible site using, among other things, aria tags. occurred me attributes such aria-invalid selectors css target, rather using .error class. the benefit of leaner, more meaningful html, easier me hook css (and js). said, haven't seen done elsewhere i'm suspicious there downsides leveraging accessibility tags styling. suspect use of unconstrained attribute selectors makes less performant css, there other downsides haven't considered? attribute selectors flexible way manage styles large-scale css because attribute selectors have specificity of 0-0-1-0 . [aria-*] selectors fine use styling hooks, , recommend using custom [data-*] attributes fill in gaps might need one-off. class selectors should continue used, can elegant style extensions attribute selectors: [data-foo] { color: red; } [data-foo="bar"] { color: blue; } [data-foo="fizz"] { color: green; } each of these selectors has same speci

Implement Python 3's round function in Python 2.7 -

i using old codes written in python 3 in google-app-engine project using python 2.7. different round() algorithms in python 3 , python 2 gives me headache. there convenient way implement python 3's round() method in python 2.7? a further question: python 2 , python 3 handle integer operations quite differently. example following statements have different outputs in python 2 , 3: 2/4 # 0 in python 2, 0.5 in python 3 round(3/2) math.ceil(0.5) # 1.0 in python 2, 1 in python 3 any easy way convert codes python 3 python 2 while keeping behavior same? thanks! banker's rounding implemented in future . float division can made default __future__ import. from __future__ import division future.modified_builtins import round

c# - Best way to make application available for distribution -

i've developed software application , have reached point need find easier way supply updates users. i've created "installer" application - simple c# application connects ftp server, supplies credentials, brings down parts of application , assembles it. installer called main application if user chooses update version of application. (the first step of installer kill main application process, thereby allowing files overwritten.) determine if new version available, application reads simple text file hosted on website (i.e. www.mydomain.com/versionfile.txt) . text file contains latest version number, main application uses compare version. it works, can cumbersome if user on site not allow ftp access (which often.) so not subjective, here specific question: there secure way make application files available on website download? secure, mean c# installer application needs supply correct credentials before being able download application files users pc. i'

css - Need help on displaying text in a div when an Image Link is hovered over. -

to paint picture image have 2 divs 1 on top hold 5 thumbnail pics , bottom div has 5 lines of text. idea when hover on picture div want project name of displayed on bottom div. want happen 5 pictures. been searching everywhere , found things close dead end. appreciated trying student project. css can't wrap head around task. simple demo the html pretty simple. .photowrapper optional, , class placed on the a . <div class="photowrapper"> <a href="#"> <img src="//placehold.it/200" alt="" /> <div class="label">text</div> </a> </div> we need inline-block act image. .photowrapper { border: 1px solid black; display: inline-block; } .photowrapper { display: inline-block; } we default our label being transparent. when our .photowrapper hovered, text color changes. .photowrapper .label { color: transparent; } .photowrapper:hover .label { color: black

How can i add Spring API DOC to eclipse? -

i'm trying practice spring using spring tool suite(eclipse). everything fine, except want see api doc inside ide. for example, application context = new .... context.getbean() -> want see explanation method directly eclipse. but says. note: element neither has attached source nor attached javadoc , hence no javadoc found any idea? go build path , have added jars . there select jar , expand , select source attachment . click on edit , add source attachment . also can use build tools maven , download source code automatically.

Using maven to build an CXF & Spring Web Service EAR file for Weblogic 10.3.6 -

i have created simple cxf & spring web service , build war file using maven. need package web service ear file , deploy on remote weblogic server. i have tried searching web regarding how using maven build ear file cxf & spring web service not information. does have done before , able share how can go doing this? thanks! the maven-ear-plugin docs cover lot of this. weblogic specific part decide kind of production redeployment strategy used. if plan use "production redeployment" there additional entry make in ear manifest weblogic has version information application (more documentation ). here's example partial pom. <groupid>com.company.maven.sample</groupid> <artifactid>myearsimple</artifactid> <version>${my.ear.version}</version> <packaging>ear</packaging> <build> <finalname>myappear</finalname> <plugins> <plugin> <groupid>org

html - colspan not working in css table -

i'm trying achieve table first column twice long remaining 2 columns. when apply colspan=2 table nothing code in action http://jsfiddle.net/us96b/ raw code below <div class="datagrid"> <table>'; <thead><tr><th colspan="2">header</th><th>header</th><th>header</th></tr></thead> <tfoot><tr><td colspan="4"><div id="no-paging">&nbsp;</div></tr></tfoot> <tbody> <tr><td colspan="2">data</td><td>data</td><td>data</td></tr> <tr><td colspan="2">data</td><td>data</td><td>data</td></tr> <tr><td colspan="2">data</td><td>data</td><td>data</td></tr> <tr><td colspan

asp.net mvc 4 - Return View() or PartialView()? How to decide? -

i hava action: public actionresult getorders(int id) { ... } when access through hyperlink(~/order/getorders/1), want getorder return view() , whole page. when through @html.action("getorders") , want return partialview() part of page. now settled problem using erik philips's method. public actionresult getorders(int id) { var orders = db.order.where(a => a.adcompanyid == id).tolist(); viewbag.adcompanyname = db.adcompany.where(a => a.id == id).select(a => a.name).first().tostring(); if (controllercontext.ischildaction) { viewbag.ispartial = true; return partialview(orders); } viewbag.ispartial = false; return view(orders); } @{html.renderaction("getorders", new { id = model.id });} @html.actionlink("related orders", "getorders", new { id = item.id }) in getorders.cshtml: @if (viewbag.ispartial == false) { ... } to generate different view. queti m. porta same!

objective c - Filtering many-to-many count expression using existing subquery -

in app, have many-to-many relationship between tags , links follows : tags <<-->> links i trying return list of tags relate links have active tags, not included in active tags. i want obtain count of number of links have 'other' tags, needs limited active tags. using below, have been able return 'other' tags , count of links, count returned of links each tag. i able count links using similar approach 1 i'm using build subquery, struggling work. have tried using subquery generated in count nsexpression, errors when subquery evaluated. // test array of tag names self.activetagarray = [@[@"tag1", @"tag2"] mutablecopy]; nsfetchrequest *fetchrequest = [nsfetchrequest fetchrequestwithentityname:[tag entityname]]; // want exclude tags active nspredicate *activetagspredicate = [nspredicate predicatewithformat:@"not name in %@", self.activetagarray]; // build subquery string identify links have of active tags in ta

html5 - Newbie: Fusion Table Legend -

i public history major, mapping historical buildings in annapolis md. made google spreadsheet 1,415 historic properties , documentation fed , state databases. not coder. want turn mobile walking tour map people can choose type of house legend, victorian homes, or colonial homes, , have them plotted view , walk to. my questions are: 1. possible choose text column, primary style: victorian, , make legend? 2. can add audio files fusion table, can add stories property or person build property, people can listen story? 3. there way turn map app? again, not coder, taking 2 classes next semester learn making apps (html5), , need know if possible, , if have stuff can read laymen, i'd appreciate it. here link fusion table: historic annapolis map ( https://www.google.com/fusiontables/datasource?docid=1ruffu8craz6o_1xplh8xyhglt6pb04v2ly6oaec ) thanks. melanie is possible choose text column, primary style: victorian, , make legend? you coding, automatic legends w

php - Magento Customization Issues -

i building custom tool user can play around product (customize parts , add colors) , go ahead , buy. have far built in php integrate magento store. there way can connect magento product can passed through add cart etc? thanks. magento has support this. check configurable products , or custom options tab in product admin edit page. can use bundle products . if none of these fit needs may want rephrase question , explain need.

php - Debug MYSQLI Conversion -

i'm still bit new @ mysqli please go easy. i'm trying convert mysqli , i'm coming with. db_conx.php <?php $db_conx = mysqli_connect("localhost", "use", "pass", "db"); // evaluate connection if (mysqli_connect_errno()) { echo mysqli_connect_error(); exit(); } ?> <?php // connect mysql database include "includes/db_conx.php"; $sql = "select * content order id desc"; $result = mysqli_query($db_conx,$sql); $productcount = mysqli_num_rows($result); $bloglist = ""; if ($productcount > 0) { $adverts = array( 'test', 'test 2'); $counter = 0; while($row = mysqli_fetch_assoc($sqltwo)){ $id = $row["id"]; $article_title = $row["article_title"]; $category = $row["category"]; $author = $row["author"]; $date_added = $row["date_added"]; $article = $row["article"]; $short = substr(strip_ta

c# - Currency range and format validator for string field -

what correct currency data annotations following condition? numeric amount 2 decimal places. minimum amount $1.00; max amount $25000.00 here field. public string amount {get; set;} to check decimal places can use regularexpression annotation proper regex match number format: [regularexpression(@"(\.\d{2}){1}$")] to check minimum , maximum value must create our own custom attributes [mindecimalvalue(1.00)] [maxdecimalvalue(25000.00)] public string amount { get; set; } we can creating class deriving validationattribute , overriding isvalid method. see implementation below. [attributeusage(attributetargets.field | attributetargets.property, allowmultiple = false, inherited = true)] public class maxdecimalvalueattribute : validationattribute { private double maximum; public maxdecimalvalueattribute(double maxval) : base("the given value more maximum allowed.") { maximum = maxva

hadoop - what's the difference between distcp hdfs and hftp,why distcp hdfs is effective? -

what's difference between distcp hdfs , hftp, why distcp hdfs effective? copy hfds files between 2 cluster of different version。 distcp hftp should used when copying of data between 2 clusters of different versions(different versions of hadoop). command should executed destination cluster, (more specifically, on tasktrackers can write destination cluster) the source should specified hftp:///.

visual studio 2010 - Very slow debugging ASP.NET MVC 3 project -

i have solution contains 11 projects. main project asp.net mvc. when run project in debug mode (f5), main page of site loaded approximately 2 minutes. note! home page of site login form, there's not lot of sql queries. interestingly, when run project in without debug mode (ctrl + f5), main page of site loaded in few seconds. i tried solutions. example, found this solution . unfortunately, unable execute instructions written zeb kimmel . i glad advice , suggestions. p.s. have processor intel core 2 duo e6300, 3gb ram, windows 7 (32 bit). visual studio ide settings go tools - options , set following: projects , solutions - build , run. check "only build startup projects , dependencies on run" this prevent building projects time! environment – general uncheck "automatically adjust visual experience based on client performance" uncheck "enable rich client visual experience" uncheck "use hardware graphics acceleration