Posts

Showing posts from April, 2012

php - htacess Redirect request for pdf to another domain with the pdf; Mask domain -

i lot of php have admit every time htaccess confused. can following? note in following examples names of pdfs appended url's generated dynamically. user requests: abc.com/uploads/pdfs/worlds_most_informative.pdf. the actual location of pdf at: xyz.com/uploads/pdfs/worlds_most_informative.pdf. i need have when pdf opens in browser user still sees: abc.com/uploads/pdfs/worlds_most_informative.pdf in browser address bar. i have tried in vain adapt of other answers, without success. appreciated. as pointed out in comments, can follow instructions of this question , use mod_rewrite , mod_proxy together. rewriterule ^uploads/pdfs/(.*)\.pdf$ hhttp://example.org/uploads/pdfs/$1.pdf [p] [p] this way doesn't matter if name of file dynamically generated, because regex uses matching groups.

vb.net - Add Pivot Table to Existing Worksheet -

using vb.net can create excel pivot table in new worksheet, when try create same pivot table below data set within same worksheet fails create pivot table. code below shows working code , non-working code. missing. ' adding pivot table new worksheet works fine xlbook .worksheets.add(after:=.worksheets(.worksheets.count)) end xlbook.pivotcaches.create(sourcetype:=excel.xlpivottablesourcetype.xldatabase, sourcedata:="orders table!r1c1:r26c19", _ version:=excel.xlpivottableversionlist.xlpivottableversion12).createpivottable(tabledestination:="sheet3!r3c1", tablename:="pivottable1") xlsheet = xlbook.worksheets("sheet3") xlsheet.cells(3, 1).select() ' adding pivot table existing "orders table" worksheet fails xlbook.pivotcaches.create(sourcetype:=excel.xlpivottablesourcetype.xldatabase, sourcedata:="orders table!r1c1:r26c19", _

java - JPA Foreign Key constraint violation cannot insert Null -

Image
i have simple user , roles entities 1 many mapping. 1 user many roles. getting error when try save user entity. setting role object user before calling persist. below snap shot of entities. user: package com.petpe.ejbadmin.entity; import java.io.serializable; import java.util.date; import java.util.set; import javax.annotation.generated; import javax.persistence.basic; import javax.persistence.cascadetype; import javax.persistence.column; import javax.persistence.entity; import javax.persistence.fetchtype; import javax.persistence.generatedvalue; import javax.persistence.generationtype; import javax.persistence.id; import javax.persistence.namedqueries; import javax.persistence.namedquery; import javax.persistence.onetomany; import javax.persistence.table; import javax.persistence.temporal; import javax.persistence.temporaltype; import javax.validation.constraints.notnull; import javax.validation.constraints.size; import javax.xml.bind.annotation.xmlrootelement; import java

How to convert time and date to Unix timestamp on Apache PIG? -

i have tuple containing (date, time, ip, id) (23/04/2014, 19:14:30,192.168.5.28, al00000) and need convert date , time unix timestamp (1398280470, 192.168.5.28, al00000) how can that? ref : http://pig.apache.org/docs/r0.11.1/func.html#datetime-functions input : 23/04/2014,19:14:30,192.168.5.28,al00000 pig script : a = load 'input_data.csv' using pigstorage(',') (date:chararray,time:chararray,ip:chararray,id:chararray); b = foreach generate tounixtime(todate(concat(date, time),'dd/mm/yyyyhh:mm:ss', 'gmt')) unix_time, ip, id; output : (1398280470,192.168.5.28,al00000)

Javascript output only showing once -

how come can output render javascript once? try show again , doesn't work? $(function() { $('#access').keyup(function () { var access = $('#access').val(); var note = $('#note'), // notice *1000 @ end - time must in milliseconds ts = (new date(access * 1000)).gettime() + 1 * 24 * 60 * 60 * 1000; $('#countdown').countdown({ timestamp: ts, callback: function(days, hours, minutes, seconds) { var message = ""; message += days + "<small class='white'>d</small>, "; message += hours + "<small class='white'>h</small>, "; message += minutes + "<small class='white'>m</small>, "; message += seconds + "<small class='white'>s</small>"; note.html(message);

mysql - Where not equal to substrings array -

so have 2 tables, 1 called cmdr_group , 1 called groupuser. attempting list of groups user not in, proving difficult. groupuser has multiple users each group, each own id. now understand why query won't work putting here demonstrate thought process. select t1.*, t2.userid cmdr_group t1 left join groupuser t2 on t2.groupid = t1.id t1.id != (select groupid groupuser userid=90792652); if need information in tables let me know. now think understand. approach using not exists or not in : select g.* cmdr_group g not exists (select 1 groupuser gu gu.userid = 90792652 , gu.groupid = g.id ); this query follows question. overall query fetching groups. not exists checking user not in group.

Error java.lang.NullPointerException while calling class method -

im attempting make program takes names, dates of start, salary of employees. ive made several classes including calling class: testworker.java public class testworker { public static void main(string[] args) { worker w1, w2, w3; w1 = new worker ("robert william hunter", "23/10/2005", 35000.00); w2 = new worker ("john smith", "15/11/2005", 25000.00); w3 = new worker ("mary jane hull", "06/09/2007"); w2. setsalary(20000.00); w2.setsupervisor(w1); w3.setsupervisor(w1); system.out.println("number of workers = " + worker.gethowmanyworkers() +" \n"); system.out.println("supervisor of john " + w2.getsupervisorname()); system.out.println(w1.tostring()+" \n"); system.out.println(w2.tostring()+" \n"); system.out.println(w3.tostring()+" \n"); } } worker.java publ

ruby on rails - Validate existence of submodel in 'has_one' relation -

i have 2 models, 1 post , genre . i'm creating new post given genre_id . best way of validating if genre given id exists? i'm validating presence of genre_id, it's not enough. validates :genre_id, presence: true i know can check whether genre exists in controller, prefer have in post validator object. you can explicitly tell rails validate genre association , not attribute, genre_id with: has_one :genre validates_presence_of :genre validates_presence_of

c++ - alternative to VideoCapture::set in opencv -

i have been writing code in have take 2 frames per iteration absdiff(); cp>>frame1; cp>>frame2; absdiff(frame1,frame2,out) frame1 getting 0,2,4,6,8,10,.... frame2 getting 1,3,5,7,9,11,.... not getting combinations of frame1,frame2. let's call process-1 but,i needed frame1 0,1,2,3,4,5,6,..... , frame2 1,2,3,4,5,6,7,...... so,i used cp.set(cv_cap_props_pos_frames,cp.get(cv_cap_props_pos_frames)-1); to set next frame number of frame2 instead of frame2+1.now ,i getting desired output. getting combinations of frame1,frame2. let's call process-2 but, processing speed process-2 1/5 of process-1 so,i guessing setting videocapture property i.e next frame position responsible decreasing speed.am wrong?if not, there other way desired output. you're not wrong. repositioning video way slow. you're better reading frames in sequence , handling pairing yourself.

url rewriting - URL Rewrite to external website not working on IIS 8.5 but works on IIS 7.5 -

<rule name="reverse proxy externalwebsite.com" stopprocessing="true"> <conditions> <add input="{request_filename}" matchtype="isfile" negate="true" /> </conditions> <match url="/(.*).cgi" /> <action type="rewrite" url="http://externalwebsite.com/cgi_bin/{r:0}" logrewrittenurl="true" /> <servervariables> <set name="http_referer" value="http://externalwebsite.com" /> </servervariables> </rule> basically, want rewrite request internalwebsite.com/cgi_bin/*.cgi externalwebsite.com/cgi_bin/*.cgi above rule works on windows 7 system iis7.5 version. doesn't work on windows 8.1 system iis8.5. gives generic 404.4 error. i've made sure url rewrite module , application request routing module installed on both systems. guesses on can wrong? i had missed silly thing. make sure root n

asynchronous - spring batch AsynchJob Launcher ,Error in setting job repo -

hi below configuration creating asynchlob launcher <bean id="joblauncher" class="org.springframework.batch.core.launch.support.simplejoblauncher"> <property name="jobrepository" ref="&amp;jobrepository" /> <property name="taskexecutor" ref="taskexecutor" /> </bean> <bean id="taskexecutor" class="org.springframework.core.task.simpleasynctaskexecutor" /> <bean id="jobrepository" class="org.springframework.batch.core.repository.support.mapjobrepositoryfactorybean" /> i'm getting below error error creating bean name 'batchjoblauncher': injection of autowired dependencies failed; nested exception org.springframework.beans.factory.beancreationexception: not autowire field: private org.springframework.batch.core.launch.support.simplejoblauncher com.batch.launcher.batchjoblauncher.asyncjoblauncher; nested except

java - Spring transaction not rolling back due to closed connection -

i have pretty large transaction, annotated @transactional . there few long-running queries in it, runs fine. 20% of time connection appears getting forcibly closed outside of transaction, , when transaction tries continue doing work, fails following stack trace. worse, transaction not rolling back. jdbc commits default on connection close. however, spring should setting connection's auto-commit false using following before opening transaction ( spring @transactional , jdbc autocommit ). i've confirmed version using still this. use simplejdbctemplate execute queries , connections obtained apache commons dbcp pool. is issue dbcp thinks connection stale (as transaction has few long-running queries in it) , pool tries reclaim connection, committing along way? shouldn't autocommit=false prevent this? have other suggestions? thanks using (all pretty old): springjdbc 2.5 oracle jdbc drivers 11.1.0.7 (ojdbc6) apache commons dbcp 1.2.1 stack trace: activity thre

javascript - Can multiple IDs be included in a jQuery "on click"? -

i have 2 on click event handlers identical: $('#imgpretravel').on( "click", function() { $('#pretravel').addclass('finaff-form-help-hide'); $('#posttravel').addclass('finaff-form-help-hide'); $('#posttsec0').removeclass('finaff-form-help-hide'); }); $('#imgposttravel').on( "click", function() { $('#pretravel').addclass('finaff-form-help-hide'); $('#posttravel').addclass('finaff-form-help-hide'); $('#posttsec0').removeclass('finaff-form-help-hide'); }); (the difference being ids - imgpretravel , imgposttravel ). can combine them 1 on click function and, if need comma-separated? iow, should this, similar way multiple classes can assigned element: $('#imgpretravel #imgpretravel').on( "click", function() { $('#pretravel').addclass('finaff-form-help-hide'); $('#posttravel'

c# - Creating a "Car" class with Accelerate method, and associate Accel and Decel buttons on form with created class -

taking c#.net class , have been introduced new concept of using class form. it's online class , instructor has given instructions, unclear, @ least me. unfortunately, responses students questions vague , basically, in nut shell, told figure out, here. below instructor gave us. ========================================================================= uml: model: string, currentspeed: decimal, topspeed: decimal, , accelerate (change speed: decimal) accelerate adds changespeed (which can positive, negative or 0) currentspeed. currentspeed can never exceed topspeed or less 0 e.g. if currentspeed 10 , dchangespeed -20, currentspeed becomes 0 general requirements: top speed combo box filled numbers 60, 70, 80 …. 200 (at run time) change speed combo box filled numbers 1, 2, 3 ….200 (at run time) user must select combo box (cannot enter own numbers) button action requirements: accelerate same model, increases current speed change speed new model, sets cur

android - OverridePendingTransition(): How to modulate transition speed -

i have list view. set on click listener. if user clicks on list item, new activity "slides" view. background activity remains static , fixed on screen. how make new activity panel_slider "slide faster" panel_slider.xml <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android"> <translate android:fromydelta="0" android:toydelta="0%p" android:duration="600" /> </set> main_activity_slider <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android"> <translate android:fromydelta="100%p" android:toydelta="0" android:duration="700" /> </set> intent intent intent = new intent(mainactivity.this, playpanel.class); startactivity(intent

JavaScript prompt in function not saving value -

i have div that, when tapped, calls onclick function called door(). prompt comes up, , when user types prompt, goes away. i made if statement saying: if variable (i) greater 3 (which happens when user clicks div again after typing prompt) alert user typed in prompt. my problem comes when user re-clicks div. alert pops saying value of prompt says "undefined" instead of user entered. why? here's code: <!doctype html> <html> <head> <style> #mainwall{position: absolute; width: 98%; height: 98%; border: 3px solid brown; } #door{position: absolute; left: 49%; width: 5%; height: 10px; background: green; bottom: 1%;} #widthcorridor{position: absolute; width: 5%; height: 98%; left: 49%; background: red; bottom: 18px;} #maincorridor{position: absolute; width: 98%; height: 5%; left: 1%; background: red; bottom: 50%;} </style> </head> <body> <d

converting queue to linked list when using operator== c++ -

i have queue , linked list. trying call operator== function in linked list through queue function. assignment asking me compare 2 queues , see if same. have included functions each file giving me trouble. the error message i'm getting " c2664 'bool list::operator ==(list &)': cannot convert argument 1 'const q' 'list &' " queue.h class q { public: q(); q(const q &queue); ~q(); bool operator==(const q &queue); private: list queue; }; queue.cpp q::q(){}//constuctor q::q(const q &queue){}//copy constructor q::~q(){}//deconstuctor bool q::operator==(const q &queue1)//this problem { return queue.operator==(queue1); } list.h class list { private: struct node { int data; node* next; node() : next(null) {} //define our own default constructor node(int data) : next(null), da

c# - How to parse text data from a binary file -

hi have binary file contains lots of resources , using c# want find , parse text objects in file in ascii below lots of binary junk before onmap 0 131072 "description " 0 "name" "flag" "flag" 7900.000000 0.000000 1499.999268 2.000000 6.000000 8.000000 1.000000 1.000000 1.000000 0 0 0 -1 1 0 0 -1 0.101900 2 36 255 followed line break lots of binary junk after these objects each object begins tag onmap here, values separated white space , strings double quoted , must read in order written, don’t know data in file want search through binary until onmap found , read properties list once found onmap dont know how parse properties in. i recommend locating beginning of string getting format of file contain points beginning of string. code below work under situations, not guaranteed. gnu utilities same. utilities should used quick solutions. binary data pseudo random , possible 5 character match possible, remote. using system;

css - Google Chart in div with overflow-x: scroll results in large scroll area -

jsfiddle here. i have multiple google charts wrap in div container overflow-x: scroll on smaller screens users can scroll see full chart. however, scroll area becomes large (see jsfiddle) lot of white space. have tried setting width of actual chart div (chart in example) no avail. edit: here's code, div charts contains google charts. <div id="charts"> <div id="chart"></div> </div> and css: #charts { direction: rtl; overflow-x: scroll; overflow-y: hidden; } #chart has div element grandchild holding tabular chart data position: absolute; left: -10000px; on that's creating white space. wouldn't matter , graph uses property hide element off screen direction: rtl changes box model orientation. #chart div div { overflow: hidden; } or target element , switch left right : [aria-label="a tabular representation of data in chart."] { left: auto !important; right: -10000px; }

Haskell non exhaustive patterns in function for recursion -

it gives multiple declaration of "mph" here code dotproduct x y = sum(zipwith (*) x y) matrixproduct x y = mph [] x y mph acc [] b = acc counthelp countacc c [] = countacc counthelp countacc c (d:ds) = counthelp ((dotproduct c d) : countacc) c ds mph acc (a:as) b = mph ((counthelp [] b) : acc) b can explain little bit me? suppose input x = [[1,2,3],[4,5,6]] y = [[7,9,11],[8,10,12]] matrixproduct x y it should give martix [[64,58],[154,139]] what think each time taking out first list of first matrix when the matrix become empty list recursion stop.

Google Directions Api JavaScript linking API key into php file -

i have simple index.php linked apache server in xampp on windows. trying see how google direction service api works javascript example , want play bit. in order make use of it, need create server key, correctly added ip address , generated random key me. have key how put php file allows me view map because of course 1 example , gives me authorization error. i read on google developers page "to specify key in request, include value of key parameter." may problem how do if answer? api key declared right @ bottom. <!doctype html> <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no"> <meta charset="utf-8"> <title>directions service (complex)</title> <style> html, body { height: 100%; margin: 0; padding: 0; } #map { height: 100%; } #warnings-panel { width: 100%; height:10

arrays - bash- find average of numbers in line -

i trying read file line line , find average of numbers in each line. getting error: expr: non-numeric argument i have narrowed problem down sum= expr $sum + $i , i'm not sure why code doesn't work. while read -a rows in "${rows[@]}" sum=`expr $sum + $i` total=`expr $total + 1` done average=`expr $sum / $total` done < $filename the file looks (the numbers separated tabs): 1 1 1 1 1 9 3 4 5 5 6 7 8 9 7 3 6 8 9 1 3 4 2 1 4 6 4 4 7 7 with minor corrections, code runs well: while read -a rows total=0 sum=0 in "${rows[@]}" sum=`expr $sum + $i` total=`expr $total + 1` done average=`expr $sum / $total` echo $average done <filename with sample input file, output produced is: 1 5 7 5 2 5 note answers because expr in

entity framework - PostgreSQL with EntityFramework in MonoDevelop on Ubuntu -

i tried configure project in monodevelop on ubuntu, use entityframework npgsql provider, following official steps . however, seem wrong suggested configuration file (or i'm missing something), can't rid of error: the entity framework provider type 'npgsql.npgsqlservices, npgsql.entityframeworklegacy, version=2.1.0.0, culture=neutral, publickeytoken=5d8b90d52f46fda7' registered in application config file ado.net provider invariant name 'npgsql' not loaded. make sure assembly-qualified name used , assembly available running application. see http://go.microsoft.com/fwlink/?linkid=260882 more information. does have simple working example of application connecting postgresql using entity framework in monodevelop? please try npgsql 3.0.3 (the error says 2.1.0), correct package entityframework6.npgsql, not npgsql.entityframeworklegacy.

scala - How to make JUnit4 lifecycle callbacks work in ScalaTest with JUnitRunner? -

according scalatest documentation it's possible use junitrunner run tests. assumption was, if runs junitrunner, callback methods (i.e. methods marked @before or @after annotation should work well. apparently assumption wrong. i've created simple example demonstrate it: import org.junit.before import org.junit.runner.runwith import org.scalatest.{funsuite, _} import org.scalatest.junit.junitrunner @runwith(classof[junitrunner]) class test extends funsuite { @before def before() = { println("before test") } test("nothing") { println("test started") } } if run example, you'll see test started line, not before test . i'm aware of scalatest lifecycle callbacks, thing need make junit callbacks work somehow. want write test play 2.4 application , thing it's play.test.withbrowser class relies on junit callbacks. found workaround issue: var testbrowser : testbrowser = _ before { new withbrowser {

ms access - How to update recordset? How to pass data value from a datagrid to textbox and edit in VB6? -

i using vb6 in system. want pass selected row value of datagrid textbox , edit record. i'm getting error every time run code. "either bof or eof true, or current record has been deleted. requested operation requires current record." here's codes in update button. please help. in advance! :d private sub cmdedit_click() dim conn new connection dim myrs new recordset dim sql integer conn.open "provider=microsoft.jet.oledb.4.0;datasource=c:\users\fscndcit\desktop\gstd\gstddb.mdb" myrs.cursorlocation = aduseclient myrs.open "select * table1 id = '" & datagrid1.text & "'", conn, adopendynamic, adlockbatchoptimistic frmgosee.txtid.text = myrs!id 'this line highlighted. frmgosee.txtgstd.text = myrs!gstdcode frmgosee.txtgstdcode.text = myrs!workgroup frmgosee.txttl.text = myrs!tl frmgosee.txtdepthead.text = myrs!depthead frmgosee.txtparticipants.text = myrs!participants frmgosee.txtcoach.text = myrs!coach frmgosee.txtp

Beginner: Min Value in Array (Java) -

when execute program, prints max value fine, min value prints zero. continue scratching head... can see wrong here? looking. import java.util.scanner; public class minmax { public static void main(string[] args) { scanner kb = new scanner(system.in); int [] numbers = new int[5]; int max = numbers[0]; int min = numbers[0]; (int = 0; < numbers.length; i++) { system.out.println("enter next number:"); numbers[i] = kb.nextint(); if (numbers[i] > max) { max = numbers[i]; } if (min > numbers[i]) { min = numbers[i]; } } system.out.println("the maximum value in array " + max); system.out.println("the minimum value in array " + min); } } the issue when array declared, ints in array set 0. setting min numbers[0] set m

vba - Performance hit when selecting dynamic menu items for an Excel custom UI -

i have stitched excel workbook dynamically populates custom ui drop down menus. here's code populates menu sub getfilterbyteam(control iribboncontrol, byref content) content = "<menu xmlns=""http://schemas.microsoft.com/office/2009/07/customui""><button id=""team1"" label=""team1"" onaction=""filterteam""/><button id=""team2"" label=""team2"" onaction=""filterteam""/><button id=""team3"" label=""team3"" onaction=""filterteam""/><button id=""team4"" label=""team4"" onaction=""filterteam""/><button id=""team5"" label=""team5"" onaction=""filterteam""/><button id=""team6"" label=""team6&q

How do I install a previous version of Python into a virtualenv? -

this question has answer here: is possible install version of python virtualenv? 11 answers i had python3 installed globally, made virtualenv. want change python version inside python2.7. trying install python2.7 gives me option of installing hard disk. how can specify version in virtualenv? first , foremost, is. if take @ virtualenv --help , see have option specify python executable using -p flag. however, problem different since have python3 linked python executable. in another question is talked about. however, isn't anwer since involves making, , symlinking new python installation. instead, better use python version manage live pyenv or pythonz . myself prefer pyenv . if on *nix machine, follow instructions outlined here . once installation complete, should see few instructions towards end of installation. # load pyenv automatically addin

android - Custom LegendForm for MPAndroidChart PieChart -

currently default supported legendform types are: legendform.line legendform.circle legendform.square is there way have custom piechart? this: http://s2.postimg.org/xhmy4stfd/capture.png this not possible default. have modify library achieve this.

php - Bootstrap Photo Gallery from MySQL database -

new programming , halfway through website development course here questions not dumb. want display 4 random images mysql database (the images stored in uploads folder) , code follows. works fine laying out gallery code bootstrap not displaying images across page anymore. thx in advance help <?php require 'includes/dbconnection.php'; $sql = "select * uploads order rand () limit 4"; $result=mysqli_query($conn, $sql) or die ('problem: '.$sql)."<br>"; ?> <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="css/bootstrap.min.css"> <link rel="stylesheet" href="css/custom.css"> <title>pete's fishing adventures</title>

Taking PostgreSQL backup through PHP on Windows server 2008 R2 -

i trying backup of database through php.i using yii postgresql. have tried below code , working on local wamp server. below code not working on server windows server 2008 r2. if echo result of join(' ', $dumpcmd) , copy command prompt, works. public function actionbackup() { $path = yii::app()->basepath . '/data/backup/'; $file=$path."data.backup"; unlink($file); putenv("pgpassword=postgres"); $dumpcmd = array("pg_dump", "-i", "-u", escapeshellarg("postgres"), "-f", "c", "-b", "-v", "-f", escapeshellarg($file), escapeshellarg("mydb")); exec( join(' ', $dumpcmd), $cmdout, $cmdresult ); putenv("pgpassword"); if ($cmdresult != 0) { # handle error here... echo "error: cou

facebook's object debugger says 'we're sorry, but something went wrong' -

i set ogp tags on website. though should ok, facebook's object debugger says 'something went wrong'. here's website. https://makeyourownemblem.herokuapp.com/showemblem/2 btw use following gems. meta-tags, sitemap_generator could give me advice?

javascript - Meteor performance: Multiple subscriptions vs only 1 performance -

morning everyone! i have design question haven't managed find answer , maybe more knowledgeable people give me input. i'm writing app requires small amounts of data multiple sources. @ moment it's written template level subscriptions, each 1 subscribing data needs (each subscription returns 20-25 small documents max) is efficient way performance perspective? or 1 subscription returning necessary cursors @ once work better? thank you

linux - Why does `change_protection` hog CPU while loading a large amount of data into RAM? -

we have built in memory database, eats 100-150g ram in single vec , populated this: let mut result = vec::with_capacity(a_very_large_number); while let ok(n) = reader.read(&mut buffer) { result.push(...); } perf top shows time spent in "change_protection" function: samples: 48k of event 'cpu-clock', event count (approx.): 694742858 62.45% [kernel] [k] change_protection 18.18% iron [.] database::database::init::h63748 7.45% [kernel] [k] vm_normal_page 4.88% libc-2.17.so [.] __memcpy_ssse3_back 0.92% [kernel] [k] copy_user_enhanced_fast_string 0.52% iron [.] memcpy@plt the cpu usage of function grows more , more data loaded ram: pid user pr ni virt res shr s %cpu %mem time+ command 12383 iron 20 0 137g 91g 1372 d 76.1 37.9 27:37.00 iron the code running on r3.8xlarge aws ec2 instance, , transparent hugepage disabled. [~]$

ios - Swift 2.0 Defer Not working in XCode 7.0.1? -

i have simple block of code defer block, playground not executing defer block. doing wrong? the following gets printed: "step 1" "step 3" "step 4" "step 5" import uikit print("step 1") { defer { print("step 2") } print("step 3") print("step 4") } print("step 5") are sure looking @ console? if so, there must bug in playground. here got code: http://i.stack.imgur.com/en6kn.png