Posts

Showing posts from January, 2012

image - jQuery cropper/area selector with zoom/pan function -

i'm searching jquery plugin image area selection. need extract x, y rectangle , save coordinates in database. i have working case already, question if plugin supports both crop/area selection , zooming/panning. i've been through plugins on page http://techslides.com/image-zoom-drag-and-crop-with-html5 , none of plugins support both. it's image of 1000x1000 perfect if zoom in , make selection, zoom out while still having aspect ratio of image/zoom setting. i hope can me in right direction. if doesn't exist, i'm going develop , make public others use :-) best regards jens

haskell - Leksah, jump to definition within current package and to names defined in packages installed in Sandbox -

Image
i'm using leksah 0.15.0.1 built ghc 7.10.1. here problem : if ctrl+click on function name system wide installed library leksah goes definition, fine! however , (go definition) not work 1) functions defined within edited package 2) functions defined in packages located in sandbox. for example in picture below, can jump definition of sdl.quitevent not definition of appinput . which strange because appinput defined in same file editing , sdl.quitevent defined in system wide installed cabal package. any idea how fix this? might going wrong ?'

html - Ease in ease out on background image hover -

i'm having issues getting background image hover ease in , out effect on bordered link , honest don't know 1 use. image either moves transition or nothing @ all. great. thanks! http://codepen.io/anon/pen/zgewxe .cta { margin: 0; padding: 1.4em 0 1.4em 0; cursor:pointer; display:block; text-align:center; width:100%; font-size: 2.3em !important; color:#fff !important; font-weight: 700; font-style: italic; text-transform: uppercase; border: 0; background-image: url(http://i.imgur.com/balv0x5.jpg); background-repeat:no-repeat; background-position:center center;} .cta:hover { text-decoration:none; border: 0; opacity:0.8; } a.cta {border-bottom: none !important; text-decoration: none;} .cta span {border: #fff 3px solid; padding: 0.3em;} .cta span:hover {background-image: url(http://i.imgur.com/mrbbt4f.jpg); background-repeat:no-repeat; background-position:center center; } <a class="cta" href="learn-more" title="understand data today!"> ...

node.js - pm2 start app.js is exiting after 15 restarts -

npm start start app fine when do: pm2 start app.js i get: [pm2] spawning pm2 daemon [pm2] pm2 daemonized [pm2] process app.js launched ┌──────────┬────┬──────┬──────┬────────┬─────────┬────────┬─────────────┬──────────┐ │ app name │ id │ mode │ pid │ status │ restart │ uptime │ memory │ watching │ ├──────────┼────┼──────┼──────┼────────┼─────────┼────────┼─────────────┼──────────┤ │ app │ 0 │ fork │ 4681 │ online │ 0 │ 0s │ 11.508 mb │ disabled │ └──────────┴────┴──────┴──────┴────────┴─────────┴────────┴─────────────┴──────────┘ use `pm2 show <id|name>` more details app in logs get: [pm2] starting streaming logs [all] process pm2: 2015-06-04 17:12:37: app name:app id:0 exited code 0 pm2: 2015-06-04 17:12:37: starting execution sequence in -fork mode- app name:app id:0 pm2: 2015-06-04 17:12:37: app name:app id:0 online pm2: 2015-06-04 17:12:37: app name:app id:0 exited code 0 pm2: 2015-06-04 17:12:37: starting execution sequence in -fork mod...

java - Netbeans Platform's toolbars are black when launching from inside IntelliJ -

Image
i trying port 1 of applications on netbeans platform. since intellij user, prefer work favourite ide - , luckily there tutorials that. after setting need, building first test application (empty window) wanted go ahead , launch app inside intellij. sadly not easy might sound (or didnt find other way yet) followed this tutorial , created following "starter" class: /** * represents starter netbeans platform. * * original code of modified class can found @ * <a href="http://netbeans.dzone.com/using-maven-and-intellij-idea">this article</a>. */ public class netbeansstarter { private static final string branding = "swordsmith"; private static final string workdir = "application" + file.separatorchar + "target"; private static final string user = workdir + file.separatorchar + "userdir"; private static final string home = workdir + file.separatorchar + branding + file.separatorchar + "pl...

ruby - whenever gem development environment rails not working -

i have rails application , want perform cron job(every 5 mins in development) via whenever gem... i have rake task in: lib/tasks/appname.rake code inside is: namespace :appname desc "importing data overnight" task import_data_overnight: :environment puts "importing..." object.import_data end end when in terminal run: $bundle exec rake appname:import_data_overnight my development database gets updated perfectly. adding in whenever gem put in: gemfile: gem 'whenever', require: false cd project ran: $wheneverize . inside config/schedule.rb : set :environment, :development set :output, {:error => "log/cron.log", :standard => "log/cron.log"} every 5.minutes rake "appname:import_data_overnight" end save file, inside terminal ran: $whenever --update-crontab --set environment=development this output in cron.log : jun 4 13:05:00 jatins-macbook-pro.local /usr/sbin/cron[34183]: (j...

tomcat - Java webapp can't write image to folder created by webapp -

i have web application, have several actions. 1 of actions writes image folder out of context, lets to: /home/user/images/subfolder1/image.jpg now, action copies image folder located inside images, different extension, lets to: /home/user/images/subfolder2/subsubfolder2-1/image.png now, first image form, second image path first image saved, both images written same method: inputstream in = new fileinputstream(origen); outputstream out = new fileoutputstream(destination.getabsolutepath()); while ((len = in.read(buf)) > 0) { out.write(buf, 0, len); } the webapp creates every folder, including "subfolder2/subsubfolder2-1/" using mkdirs() if don't exist. this works fine in test enviroment running ubuntu 14.04 apache tomcat 6.0.43, but, on production, centos 6(or 6.5), same apache tomcat version, image created, no data written it, mean, image.png file created, size 0. folders have correct permissions, drwxrwxrwx, image.png reason, lacks them, having...

Populate GPO from Text File using VBScript or other -

ok, need create gpo allows our users use specific programs. gpo location: user configuration policies administrative templates [...] system run specified windows applications then setting gpo enabled , clicking on list of allowed applications --> show... i have created excel spreadsheet containing names of programs , associated executable files other pertinent information can organize, add, delete, etc. executable files need allow our users access to. this spreadsheet dumps executable files text file. here example of text file looks like: acrobat.exe chrome.exe calc.exe . . . there lot of entries , these subject change. trying create script take text file , populate gpo automatically. don't care if have open window , run it, not need run task scheduler (although amazing if has code ready). need populate ridiculous amount of executable filenames fields. here code found (vbscript) when run, should populate fields automatically, cannot run in group...

ios - UICollectionView setting the last cell a section -

i'm working on carousel view works uicollection has form: [cell1][cell2][cell3] ... [cell n][ + ] so uicollection has 1 section. each cell has content except last one. last cell ( n+1 ) have plus button inside allows user insert new cell in carousel. i wrote code datasource method cellforitematindexpath know if cell @ current index path last cell: if ([indexpath section] == sectionsamount - 1 && [indexpath row] == rowsamount - 1) { formationcollectionviewcell * cell = [collectionview dequeuereusablecellwithreuseidentifier:@"cellformation" forindexpath:indexpath]; return cell. } the last cell of carousel okay, when scroll horizontally in carousel, the last cell generated @ index of carousel, , replaces other cells during scroll . think it's problem on reusable cell. can me please? this want: [cell1][cell2][cell3] ... [cell n][ + ] after init carousel have that: [cell1][cell2][cell3] ... [cell n][ + ] so it's okay, when s...

Force initial zoom in HTML or JavaScript -

i have html/bootstrap/javascript project seems scale in such way looks best @ 125%. is there way force browser start @ 125%? i've tried <meta name="viewport" content="width=device-width, initial-scale=1.25"/> but did not seem work. any appreciated. i wouldn't recommend giving page initial zoom. unnecessary hack different across browsers, if looked same, why not use css , html give page want? zoom accessibility feature users , shouldn't controlled site itself. rewrite css has same 125% zoom. and reiterate, cross browser issues problem, reason use css/html effect want.

ruby on rails - Devise Redirect After Cancellation -

i want redirect customers survey after cancel subscription, having difficult time getting session destroyed along redirecting survey. organizations_controller.rb: def cancel if @organization.subscription.cancel redirect_to "http://example.com/contact/cancel?organization=#{@organization.resource_id}" else flash[:error] = "an error has occurred." redirect_to settings_profile_path end end how can utilize devise destroy_user_session_path , redirect suvery @ same time without overriding redirect path of normal user signing out. need work when organization cancels. i don't quite understand question. want destroy session logging out user? if so, try this: in application controller add private method def after_sign_out_path_for(user) if blah redirect_to :foo else redirect_to :bar end end

debugging - Watch a value instead of an address? -

i'm new reverse-engineering in , been having real difficulty find makes message box appears in application don't have source code for. i tried using slow search text see if find "error when trying download (...)". looks message text received wire and, therefore, not const string inside binary. i have absolutely no clue of function because can't "instantly break" when message pops up, know if there way create watch value kind of thing? the idea make ida prepared break if address has int32 value 65000 (decimal) assigned it. if want "watch value 'error when trying download (...)'" - you'd find out complicated, resource heavy, although possible. you'd have "trace" every opcode processor executes , check ever need (e.g - stack) value (or pointer it), can done pin tools . tool allows efficiently execute assembly code wish between each opcode, function call or "block" (as represented in ida), ...

php - why the if else statement does not run the else statement? -

i have problem if , else statement in php never runs else statement. the input form in html: <input type="radio" name="marital_stat" id="single" value="single" />single <input type="radio" name="marital_stat" id="married" value="married" />married <input name="age" type="text" size="5" maxlength="3" placeholder="30" required/> <input name="work" type="radio" id="employee" value="employee" />employee <input name="work" type="radio" id="own" value="own" /> own business <input name="work" type="radio" id="jobless" value="jobless" />jobless <input name="place" type="radio" id="urban" value="urban" />urban <input name=...

wordpress - how to merge item in the cart into one product session Woocommerce? -

i have tough question don't have reputation add bounty answering. need merge on item show in cart 1 product 1 variation product in woocmmerce. think solution, item in cart array, want make new array of product array , possibly give name! please :)

Picking image from gallery on Nexus 5 (Android 5.1.1) returning null, working on other devices -

i have app has function allows user pick image gallery. here code doing that: @onclick(r.id.imageview_fragmentuploadlayout_uploadedart) public void setuploadedartimageview () { //startactivityforresult(new intent(intent.action_pick, mediastore.images.media.internal_content_uri), get_from_gallery); intent intent = new intent(); // show images, no videos or else intent.settype("image/*"); intent.setaction(intent.action_get_content); // show chooser (if there multiple options available) startactivityforresult(intent.createchooser(intent, "select picture"), get_from_gallery); } and onactivityresult method: public void onactivityresult(int requestcode, int resultcode, intent data) { super.onactivityresult(requestcode, resultcode, data); //detects request codes if(requestcode == get_from_gallery && resultcode == activity.result_ok && data != null) { selectedimageuri = data.getdata(); selectedimage...

windows 8 - Segoe UI font size seems to differ between desktop and WinRT -

Image
i have stupid question, we're confused. our designer making screens winrt (win 8.1) application on adobe illustrator, using, usual, segoe ui. problem font sizes he's using drastically different on both surface pro 3, , own laptop i'm developing. it's not looks bigger, that's normal, resolutions different. proportions off. has text segoe ui size 52, , takes lot more % screen size while running windows store app on illustrator. i figured font sizes different on winrt , desktop environment. test this, ran winrt app, took screenshot of screen text size. compared against, example ms word, zoom 100% (so should "real" size), same text, same font size. still looks way bigger while running on app. what missing? shouldn't both texts same, if text on word , text on winrt being displayed on same computer, same resolution? example: can see both texts having different sizes. thanks!

.net - PayPal - update shipping information after SetExpressCheckout -

the following question related paypal api. using paypal express checkout, using .net. with our software, there 2 different ways user can checkout using paypal. 1 select payment option checkout page. if there way, have entered shipping information , selected shipping method, , of (shipping information, shipping total, shipping discounts) passed paypal via setexpresscheckout function. redirected on-site confirmation page click button confirm payment (which calls doexpresscheckoutpayment) amount being paid. works, page gives user ability change preferred shipping method before hitting confirm. changing shipping method changes shipping total , may affect shipping discount , tax total. cannot find way update information in paypal before confirming order (via doexpresscheckoutpayment). in case, passing amount function different order total given via setexpresscheckout. the other way customer can checkout can click paypal checkout button on cart page. if user checks out in way, not se...

javascript - Android JsResult onJsAlert when to use confirm and when to use cancel? -

ive been running through webviewdemo andriod whereby allowing ability call native code javascript , vice-versa. public boolean onjsalert(webview view, string url, string message, jsresult result) { log.d(log_tag, message); result.confirm(); return true; } with regards result.confirm() , why or when call confirm or cancel ? it doesn't make difference, can call either .confirm() or .cancel() inside onjsalert . in javascript, window.alert() doesn't return value, impossible figure out in javascript, method has been called on java side. guess, jsresult used here avoid introducing dedicated class. if want able return boolean value javascript code, use window.confirm() , onjsconfirm ; if want return string, use window.prompt() , onjsprompt .

Convert non english string to normal String in Java -

i required validate text against baselines. for ex: string a="la panthère"; string b="la panth&#232;re"; i know string b contains html literals using apache stringescapeutils gives me string b="la panth&#232;re"; b=stringescapeutils.unescapehtml(b); output:- la panthère however not know whats stored in string a. somewhere got know might ascent literals , hence tried below code a=normalizer.normalize(a, normalizer.form.nfkd); note: tried forms of normalizer nothing worked. can 1 please me in how make string in same fashion of b ? as jesper mentions, è pattern typically indicates mis-encoding. at point, you're out of luck. remedial actions such replacing è not advisable, nor safe. escaping or normalizing string out of scope, problem @ source , has nothing html conversion or accent normalization. however, there simple idioms convert string different encoding. the example below: simulates windo...

javascript - Transition icon when hover -

i've code .pictos { display: block; height: 70px; margin: 160px 0 30px; padding: 0 17%; width: 100%; } .pictos > div { background: none repeat scroll 0 0 rgba(0, 0, 0, 0.2); border: 1px solid #fff; border-radius: 50%; display: table-row; float: left; height: 70px; width: 70px; margin: 0 0 0 50px; } .pictos a.standard:hover, .pictos a.standard:focus { background: url("http://s11.postimg.org/91k4hiqe7/standard.png") no-repeat scroll 50% -39px rgba(120, 182, 55, 1); } .pictos > div { border-radius: 50%; display: inline-block; height: 45px; margin: 12px; text-decoration: none; text-indent: -9999px; transition: 500ms cubic-bezier(0.645, 0.045, 0.355, 1) 0s; width: 45px; } /* hide */ .pictos > div .standard-hover { border-radius: 50%; display: inline-block; height: 45px; margin: 12px; text-decoration: none; text-indent: -9999px; transition: 500ms cubic-bezier(0....

string - Python newbie here - Index Error: list index out of range -

i had web scrapper made works fine point sorts acquired data dumped e_data. i'm complete python newbie, , appreciated. the error: traceback (most recent call last): file "c:\wamp\www\_clients\dstest\web_scrape2.py", line 78, in <module> customer = row.find_all('td')[2].gettext().split() indexerror: list index out of range the faulty code: if re.findall('\\bnew\\b', str(e_data)) != []: row in e_data.find_all('tr'): if re.findall('</table>', str(row)) == [] , re.findall('\\bnew\\b', str(row)) != []: job_no = row.find('a').string customer = row.find_all('td')[2].gettext().split() move_date = row.find_all('td')[3].gettext() result = {'job_no': job_no, 'customer': customer, 'move_date': move_date} print json.dumps(result) else: print "data unavailable" content of e_data: <center><b><h3> tota...

powershell - Is it possible to write build message from powershellscript? -

if have build template tfs, , in template in post-build script row make call powershell script, there way transfer output ps script build log? you can use "invokeprocess" workflow activity invoke powershell , write stdoutput , erroutput buildlog.

php - Bootstrap grid panels rows whitespace -

i have website bootstrap, , i'm dynamicly loading content php panels, enclosed in divs col-md-6 . after 2 entries script close row , start new 1 ( <div class="row"> ). when 1 panel taller in row there ugly whitespace under smaller panel. how can rid of whitespace, , make panels stack under each other in 2 rows? update: jsfiddle tried lot of things provided link, nothing works. here version jquery script (my preferred solution)

ios - How to get a specific video area in Swift AVPlayer? -

Image
i working on swift base mac os-x application. user choose video file , nsview controller play video using avplayerview. user can draw rectangle on avplayerview , have achieved functionality. how show selected area video in rectangle camera preview layer @ right bottom? here output: here code: var videourl = nsurl() // video file url file chooser var videosize = nssize() // here video resolution size kept i.e. 720*480 var player:avplayerview! // avplayerview play video var camerapreviewlayer:avplayerlayer! //the right bottom camera preview layer var rectanglelayer:avplayerlayer! // rectangle draw on avplayer while mouse dragging var isclicked = false var startpoint = nspoint() // holds starting point location of mouse pointer while draging var rect:nsrect! override func viewdidload() { super.viewdidload() self.player = avplayerview() self.player.frame.origin = cgpoint(x: 0, y: 0) self.player.setframesize(self.videosize) self.player.player = avplayer...

ios - UIImage not showing on UIBarButtonItem -

Image
i have uinavigationcontroller extension adds rightbarbutton navigationbar . have add 4 navigationcontrollers , problem in 2 showing correctly other 2 have button without image. button works in 4 of them (even ones doesn't have image) func addreportbutton() { let reportimage = uiimage(named: "report_btn") let reportbutton = uibarbuttonitem(image: reportimage, style: .plain, target: self, action: "reportbuttonpressed") navigationbar.topitem?.rightbarbuttonitem = reportbutton } the following screenshots debugger well thing had code remove black line below navigationbar , causing problem

javascript - Calling Code-Behind function from AJAX directly without page load -

i trying call code behind function directly. @ moment able call function pageload event of ajax.aspx.vb , pass response through variable on ajax.aspx <%= m_result %> . works fine. however, not want go through pageload event, target function directly without having put data <%= m_result %> . possible? i using dotnetnuke functionality comes ascx controls. so, in ascx control have ajax as: <script type = "text/javascript"> function jsfunction() { var xx = 1; $.ajax({ type: "post", url: "/top3/desktopmodules/top3all/ajax.aspx/gettestdata", data: { 'spageindex': xx}, }).done(function (response) { onsuccesstest(response); }); } function onsuccesstest(response) { document.getelementbyid("<%= lbltest.clientid%>").innerhtml = response; } </script> in ajax.aspx.vb: protected m_resul...

java - Modifying Dijkstra's Algorithm to find shortest path with largest weighting -

i'm in need of piece of code finds shortest path between nodes greatest weighting. example, quickest route d, greatest weighting: - b- --e / \ / d \ / \ c - -f so right shortest abd or acd. once weighting applied, code should choose longest path out of 2 (counter-intuitive, huh?). i'm trying modify algorithm dijkstra's algorithm, end traversing entire graph. know how this? algorithm can code myself immensely. run bfs source (let s ) on graph find length of shortest path s target t , let d . mark d(s,v) - distance s node v . create subgraph g'=(v',e') of g such that: v in v' if distance source ( s ) @ d - d(s,v) <= d . e=(u,v) in e' if: both u , v in v' . create new graph g*=(v*,e*) , v'=v* , , edge (u,v) in e* if in e' , d(s,u) < d(s,v) . set new weight function w*(u,v) = -w(u,v) , , run bellman ford on g* using w* . the heaviest shortest path in g s t of weight -d(...

haskell - how to use ghci online- *h e l p*; it just scrolls fast? -

when tried save current ghci session using :save command got error prelude> :save unknown command ':save' use :? help. prelude> then when type :? got ton of output zoomed past screen; how read 1 page @ time? there unix less command there in ghci? you run ghci shell , use shell redirection. works me on windows: echo :? | ghci > help.txt more help.txt i expect work on unix, although can't try it.

mysql - SQL UPDATE query taking too long -

so new mysql, , trying run query update column if cell value present in both tables, , query taking forever run (it's been running 10 minutes , no result yet). 1 of tables 250,000 rows, , other 80,000, i'm not sure why taking long. query using is: use the_db; update table1 join table2 on table2.a = table1.b set table1.c = "y"; i've changed names of tables , columns, query same. i've looked @ other answers on here , of them take long time well. appreciated, thanks. for query: update table1 join table2 on table2.a = table1.b set table1.c = 'y'; you want index on table2(a) : create index idx_table2_a on table2(a); also, if there multiple values of a match each b , generating lot of intermediate rows, , have big impact on performance. if case, phrase query as: update table1 set table1.c = 'y' exists (select 1 table2 table2.a = table1.b); and need same index. the difference between queries...

linux - rpmbuild does not preserve permissions of directories -

i have application in /opt/myapp need pack rpm package using fpm follows: fpm -e -s dir -t rpm --name 'myapp' --version '1.0' --iteration "12345" --directories /opt/myapp --epoch 0 /opt/myapp (other options not relevant here) all files , directories in myapp owned root (both user , group). there directory called "help" different permissions like drwxrwxrwx. i.e. users can write directory. when inspect spec file generated fpm, has %defattr(-,root,root,-) and directories (%dir) , files listed, expect original permissions preserved in package. however, when inspect using rpm -qlvp myapp.rpm the permission on "help" directory reset to: drwxrwxr-x i.e. other users cannot write there anymore. first guess add option --rpm-use-file-permissions but made things worse, because files in rpm owned user called fpm. edited: i've achieved result using --rpm-use-file-permissions --rpm-user root --rpm-group root but s...

python - pandas dataframe check specific columns for same values -

is there way check , sum specific dataframe columns same values. for example in following dataframe column name 1, 2, 3, 4, 5 ------------- a, g, h, t, j b, a, o, a, g c, j, w, e, q d, b, d, q, when comparing columns 1 , 2 sum of values same 2 (a , b) thanks you can use isin , sum achieve this: in [96]: import pandas pd import io t="""1, 2, 3, 4, 5 a, g, h, t, j b, a, o, a, g c, j, w, e, q d, b, d, q, i""" df = pd.read_csv(io.stringio(t), sep=',\s+') df out[96]: 1 2 3 4 5 0 g h t j 1 b o g 2 c j w e q 3 d b d q in [100]: df['1'].isin(df['2']).sum() out[100]: 2 isin produce boolean series, calling sum on boolean series converts true , false 1 , 0 respectively: in [101]: df['1'].isin(df['2']) out[101]: 0 true 1 true 2 false 3 false name: 1, dtype: bool edit to check , coun...

onsen-ui gestures not working -

i need implement menu exact same looks onsen sliding-menu,but slides top. thinking use onsen gestures able drag menu, gestures sample provided in onsen guide not work. missing something? <ons-gesture-detector> <div id="detect-area" style="width: 300px; height: 300px;background-color:blue;"> swipe here </div> </ons-gesture-detector> <script> alert("in"); $(document).on('swipeleft', '#detect-area', function() { alert("swipe"); }) </script> try this, should work. don't forget add jquery first. <ons-gesture-detector style="height: 300px; margin: 50px 50px;"> <div id="hoge" style="border: 1px solid #ccc; background-color: #f9f9f9; width: 100%; height: 300px; line-height: 300px; text-align: center; color: #999;"> ... </div> </ons-gesture-detector> <...

android - login to app using facebook not working -

i've started app has facebook login. integrated facebook sdk , done following things. activity.java public class startactivity extends fragmentactivity { private callbackmanager callbackmanager; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); facebooksdk.sdkinitialize(getapplicationcontext()); callbackmanager = callbackmanager.factory.create(); if (build.version.sdk_int >= build.version_codes.lollipop) { window window = this.getwindow(); window.addflags(windowmanager.layoutparams.flag_draws_system_bar_backgrounds); window.clearflags(windowmanager.layoutparams.flag_translucent_status); } setcontentview(r.layout.activity_start); if (savedinstancestate == null) { getsupportfragmentmanager() .begintransaction() .add(r.id.fragment_container, new loginfragment()) .commit(); } } } loginfragment.java public cl...

jquery - Trying to call Javascript Function when SharePoint List View Web Part is filtered -

i have javascript colour row in sharepoint list view web part depending on values in column. part works fine , rows coloured correctly upon page load. issue have when list filtered (if click on of column headers , arrange ascending or descending order) formatting lost , colours disappear. i'm looking way formatting stay or reapplied after filter action has completed. if page refreshed, filter selected remain in place , colours return. i need way colours reapplied once filter has been applied instead of on page load. thanks in advance. here current js: spclienttemplates.templatemanager.registertemplateoverrides({ onpostrender: function(ctx) { var rows = ctx.listdata.row; (var i=0;i<rows.length;i++) { var trimmed = rows[i]["age"] var final = trimmed.replace(",", ""); var oneweek = final < 7; var onetotwo = final >= 7 && final <= 14; var twoormore = final ...

c# - WPF DataBinding to control properties -

i have issue whereby not receiving updates through bindings. i have label bound extentwidth of textbox property via datacontext. my binding works , displays value of 0 in label not update after this. extentwidth read property, i'm not sure if affects binding in way have label binds text when set know can receive updates. (button updates text , label updated) below code demonstrate issue. xaml <window x:class="testharnesses.views.window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" title="window1" height="300" width="300"> <grid> <stackpanel> <contentpresenter x:name="contentpresenter" content="{binding}"></contentpresenter> <label x:name="lblextentwidth" content="{binding extentwidth, mode=oneway}...

android - SpannableString not working when using AppCompat theme -

Image
i'm unable spannablestring work when set apptheme theme.appcompat.light.darkactionbar. i have button , text set spannablestring. when use holo theme text renders expected, when switch appcompat theme span effects seam ignored. how can spannablestring work using appcompat theme? styles.xml - when switching between 2 themes different results... <resources> <style name="apptheme" parent="theme.appcompat.light.darkactionbar" /> <!--<style name="apptheme" parent="@android:style/theme.holo.light" />--> </resources> ... button uses spannablestring public static class placeholderfragment extends fragment { public placeholderfragment() { } @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view rootview = inflater.inflate(r.layout.fragment_main, container, false); button button = ...

javascript - JQuery 1.4.4 and Datatable 1.7 not working -

i needed datatables. might missing here:- below html <div id="cfcphonedirectory"> <table id="dynamicphonedirectory"> <thead> <tr><th>phone book</th><th>last name</th><th>first name</th><th>number</th></tr> </thead> </table> and script var rawxmldata = "<phonebooks><phonebook><name>phonebook1</name><type>global</type><contacts><contact><lname>elis</lname><fname>jason</fname><number>1234567890</number></contact><contact><lname>randell</lname><fname>mark</fname><number>7895896710</number></contact><contact><lname>flower</lname><fname>andy</fname><number>8796024589</number></contact></contacts></phonebook><phonebook><name>phonebook2...

groovy code "(wangwang as Man).shout(10)" throws java.lang.NullPointerException -

i new groovy. wrote below code public interface man{ public void say(); public int shout(int x); } def wangwang = { println("wangwang!"); println(it) } //(wangwang man).say() (wangwang man).shout(10) i run in groovyconsole. , here's output wangwang! 10 exception thrown java.lang.nullpointerexception @ com.sun.proxy.$proxy18.shout(unknown source) @ man$shout.call(unknown source) @ consolescript10.run(consolescript10:13) it has prints out "10", why throw exception? very interesting scenario, indeed! i'd that's because groovy tries cast null value returned println int defined interface. if change return type of method shout void problem goes away. the problem goes away if approach other side - if make closure return value e.g. def wangwang = { println("wangwang!"); println(it) } or maybe if try running code below may make matter clearer (println (10)).class

javascript - Making URL, that keeps updating which is generated by span and id, clickable and opening in new tab -

i trying make url clickable , open in new window. how url being displayed , updated on html page: python code: def data_cb(): return jsonify(waiting=await_take_pic()) javascript code: jquery(document).ready(function() { var tab = 1; function update_values() { $script_root = {{ request.script_root|tojson|safe }}; $.getjson($script_root+"/_data", function(data) { $("#waiting").text(data.waiting) }); if(tab == 1){ settimeout(update_values, 3000); } } html code: <p>picture url update: <span id="waiting"></span></p> this html line displays url keeps updating pictures being taken. if copy , paste url on new window can display picture. i have tried sort of combinations , syntax make href, open.window, or onclick make url clickable , opens picture in new window haven't b...

php - passing array to a jquery function -

i want pass array parameter of jquery function. when alert array function array() { [native code] } this error tried in php. here sql functions self written. sure. , throughout loop printing data data table. works. want show other thing when button clicked. $i=0; for(;$i<sql_num_rows($result);$i++) { $row= sql_fetch_array($result); $j = 0; $data[$i][$j++] = $row['user_id']; $data[$i][$j++] = $row['first_name']; $data[$i][$j++] = $row['last_name']; $data[$i][$j++] = $row['user_address']; $data[$i][$j++] = $row['user_phone'];; $data[$i][$j++] = "<button onclick='update_user_info($row)'>detail</button>"; } and in javascript function update_user_info(user_info) { alert(user_info) } can me how can array value. array has value $row['name'] , $row['email'] ..... need these values. please help

plc - Difference Between OPC UA and OPC DA? -

please explain difference between opc ua , opc da ? in condition 1 should used, , if example can provided both opc ua , opc da, helpful opc-ua successor opc-da. has many benefits, 1 of prominent being platform agnostic. there sdks available in multitude of languages , opc-ua can implemented on tiny embedded device running linux, desktop running windows, or server running os of choice. for new development, given choice, opc-ua should used. reason use opc-da @ point in time if you're connecting legacy product supports opc-da , cannot replaced or upgraded.

html - How to maintain the background image until end of the page -

i have short example: code css: body{ background:url(decupate/test/images/ppp.jpg); bacground-size:contain; backgoun-repeat:none; } i put picture understand want do. http://i61.tinypic.com/10xeeeb.jpg if put background size: cover appears end there incomplet image. how can solve problem? thanks in advance! you have use html instead of body ,see code below : html { background: url(images/bg.jpg) no-repeat center center fixed; -webkit-background-size: 100% 100% cover; -moz-background-size: 100% 100% cover; -o-background-size: 100% 100% cover; background-size: 100% 100% cover; /* set padding , margin "0" */ margin: 0; padding: 0; /* set position rules */ top: 0; left: 0; }

sql server - What is the meaning of the prefix N in T-SQL statements? -

i have seen prefix n in insert t-sql queries. many people have used n before inserting value in table. i searched, not able understand purpose of including n before inserting strings table. insert personnel.employees values(n'29730', n'philippe', n'horsford', 20.05, 1), it's declaring string nvarchar data type, rather varchar you may have seen transact-sql code passes strings around using n prefix. denotes subsequent string in unicode (the n stands national language character set). means passing nchar, nvarchar or ntext value, opposed char, varchar or text. to quote from microsoft : prefix unicode character string constants letter n. without n prefix, string converted default code page of database. this default code page may not recognize characters . if want know difference between these 2 data types, see post: what difference between varchar , nvarchar?

android - Error with extends Fragment -

i trying working don't can. want login facebook don't now. example? public class login extends fragment { @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savestancestate){ view view = inflater.inflate(r.layout.activity_login, container, false); loginbutton = (loginbutton) view.findviewbyid(r.id.login_button); loginbutton.setreadpermissions("user_friends"); loginbutton.setfragment(this); // callback registration loginbutton.registercallback(callbackmanager, new facebookcallback<loginresult>() { }); return inflater.inflate(r.layout.activity_login, container, false); } your return purposed new inflated view , code should this: view view = inflater.inflate(r.layout.activity_login, container, false); ... return view;

machine learning - R: caret and nnet Error with big data -

i've problem. i've dataset lot of features. when try perform nnet caret r give me error. if try perform smaller part of features, nnet converge. here code: > dim(traint) [1] 130 3413 > nnfit <- train(target ~ ., data = traint, + method = "nnet", + trcontrol = fitcontrol#, + #trcontrol = ctrl, metric = "roc", + #verbose = true#, + #tunegrid = nngrid + ) wrong; accuracy metric values missing: accuracy kappa min. : na min. : na 1st qu.: na 1st qu.: na median : na median : na mean :nan mean :nan 3rd qu.: na 3rd qu.: na max. : na max. : na na's :9 na's :9 error in train.default(x, y, weights = w, ...) : stopping in addition: there 50 or more warnings (use warnings() see first 50) > > nnfit <- train(target ~ ., data = traint[,1:100], method = "nnet", trcontrol =...