Posts

Showing posts from June, 2013

sorting - CUDA - How to make thread in kernel wait for it's children -

i'm trying implement simple merge sort using cuda recursive (for cm > 35) technology, can not find way tell parent thread launch it's children concurrently , wait it's children computation, since cudaeventsynchronize() , cudastreamsynchronize() host only. __syncthread() not archive desired effect, since parent's next line should executed after it's children has completed computation. __global__ void simple_mergesort(int* data,int *dataaux,int begin,int end, int depth){ int middle = (end+begin)/2; int i0 = begin; int i1 = middle; int index; int n = end-begin; cudastream_t s,s1; //if we're deep or there few elements left, use insertion sort... if( depth >= max_depth || end-begin <= insertion_sort ){ selection_sort( data, begin, end ); return; } if(n < 2){ return; } // launches new block sort left part. cudastreamcreatewithflags(&s,cudadevicescheduleb

vector - Determine coplanar (or collinear) points in higher dimensions with Java -

in java, best way determine if point (of have many) given in 6 dimensions lies on same plane other points in 6-dimensional space? it's clear how in 2d , 3d, far know of concepts such cross product, etc, not generalise higher dimensions (or specific few). it helpful find way answer same question points on lines in 6d. more general, have given higher dimensional point cloud , want determine if of these points lie on same plane. in n-dimensional space, point lies in same hyperplane n (non-degenerate) others, if volume of simplex, formed these (n+1) points, zero. simplex volume calculated through determinant |1 x1 y1 z1 ...| |1 x2 y2 z2 ...| v = 1/n! |1 x3 y3 z3 ...| |1 x4 y4 z4 ...| |..............| note formula corresponds cross product check collinearity in 2d case, mixed product check coplanarity in 3d case etc

matlab - Accelerometer with FFT - strange output -

Image
after reading lot of research , works on subject still have got problems applying fft accelerometer data. of code taken official matlab example: fft 1 dimension . after more reading i've found question: fft , accelerometer data: why getting output? there suggestion use windowing. after more reading i've added hamming window code. my data looks on plot: and code using fft: fs = 1/0.02; %0.02 comes picking sample each 20ms m = size(data,1); w = hanning(m); yw = w.*data; n = pow2(nextpow2(yw)); y = fft(yw,size(n,1)); f = (0:size(n,1)-1)*(fs/size(n,1)); power = y.*conj(y)/size(n,1); figure plot(f,power) the problem plot code looks that: can tell me wrong code? honest i'd excepted better (something this: http://imgur.com/wgs43 ) that's why asking question. edit: data can found here: https://dl.dropboxusercontent.com/u/58774274/exp.txt your fs 50 highest frequency in data can fs/2 = 25hz . see if code helps. fid = fopen('1.txt','r&

Best way to pass name from HTML file upload to PSQL statement using Ruby? -

for example: <form action="/new/details"> <input type="file" name="upload" accept="file_extension"> <input type="submit"> </form> 'upload' needs inserted psql statement using ruby db.exec("copy details '?????' delimiter ',' csv;")

file - Tilde (~/) not working on if then statement in Shell script -

this question has answer here: tilde expansion in environment variable 2 answers i have following script file=${file:-letsdump.sh} checkfile="~/mysql_backup/$file" if [ -e "$checkfile" ]; mv ~/mysql_backup/$file ~/mysql_backup/$file-bak-$(date +%d%m%y_%h%m).bak else echo 'file doesnt exist' fi i know file there, thinking ~/ ? it never finds file double quotes (really, quotes) prevent ~ being expanded. use instead: checkfile=~/mysql_backup/"$file" ...or, better, use $home in scripts, , consider ~ facility interactive/human use only.

amazon web services - AWS Elastic Load Balancer on a Single Instance containing two instance of application running on different ports -

i have 2 application on single ec2 instance running on ports 8090 , 8091. want use single elb these 2 instances , both applications same. but same elb port cant map different listeners ie 8080 -> 8090 8080 -> 8091 want whenever hit elb either 1 of 2 application in 8090 or 8091 should invoked. elb doesn't support mapping specific host. elb maps port port backend instances. use 2 elbs dns round robin? option setup haproxy roll own solution load balancing.

Is it possible to run MapReduce locally, without HDFS and Hadoop cluster? -

given develop mapreduce tasks in windows system , before moving them hdfs cluster run mapreduce locally. want check how work mapper logic, inputsplits, input/output formats etc. possible? hadoop runs in 3 modes. 1.local mode 2.psuedo mode 3.distributed mode. the 1 looking local mode. can debug mapreduce code eclipse before run in 2 or 3 modes. this step step guide run application in local mode helps lot debug application. hope helps!

To use my C# client do I need to instal Oracle Client? -

i have developped c# client connects oracle database. i know please, if ship application, should user instal oracle client use ? or fine if ship oracle.dataaccess.dll file ? thank in advance answer. according this article , if use oracle managed provider don't need else provider itself in article read odp.net available in 2 flavors. first, odp.net, unmanaged driver, contains unmanaged code, meaning of libraries relies on have been compiled directly machine code rather .net bytecode. odp.net 12.1 introduces second flavor, odp.net, managed driver, managed, meaning entire driver , supporting client , networking libraries have been compiled .net bytecode , run entirely inside common language runtime, .net virtual machine. and page can download provider free.

Using CSS ":contains:" with WebDriver in Python -

i'm migrating selenium webdriver test cases unittest py.test , seeing issue when attempt use *:contains() command on css selector. here's example of line fails: webdriverwait(driver, 60).until( expected_conditions.element_to_be_clickable((by.css_selector, "body.yui-skin-sam div[id=navigation] ul[id=mainnav] li span:contains(home)")) ) any time i've attempt command css selector not contain *:contains() , works fine. otherwise, either timeoutexception or invalidelementstateexception. i've tried using following instead: expected_conditions.element_located_to_be_selected " .element_to_be_clickable " .element_to_be_selected " .presence_of_element_located " .text_to_be_present_in_element " .visibility_of_element_located i'm sure issue has more attempting use *:contains() . attempting use by.name, by.xpath, or other object

ios - UITabBarController selectedIndex lagging by one click -

i have been using tabbarcontroller selectedindex determine whether navigation bar should displayed. working fine of today, line of code: self.tabbarcontroller.selectedindex is giving last selected index rather selected index. running line of code in viewwillappear make sure particular view has index 1 in tabbarcontroller not show navigation bar on first view. but it's reporting 1 click behind. example, when click on 2nd index , 1st index, last click shows having selected view controller @ index 2 though have clicked on view controller index 1. also, selectedindex listed correctly first time click on view controller never correct after first time viewed via tabbarcontroller. i've looked on tabbarcontroller class reference, seems selectedindex property should straightforward. missing? the problem have viewwillappear called before index has changed. first, tabbarcontroller shouldselectviewcontroller -> viewwillappear -> tabbarcontroller didselectviewco

Enterprise Architect Quick LInker Arrow Hide/Show -

my quick linker arrow has disappeared. after looking @ user guide, cannot find how hide/show it. there last week, not today. had friend open same file on computer , quick linker arrow displayed. the quick linker can switched on or off going tools > options > links , setting or clearing quick linker "enable" option.

sql - What do these trigger errors mean -

hey guys earlier. have ran new problem. few steps later in homework needed add additional part trigger. trigger needs subtract 1 number of copies. when number of copies hits 0 should display unavailable. have been trying last few hours figure out , came with. or suggestions appreciated!! create or replace trigger unavailable_rule before insert on transaction each row begin if :new.date_rented_out not null , :new.date_returned null , num_copies=1 update video set num_copies = num_copies - 1, status = 'unavailable' vid_num = :new.vid_num; else num_copies = num_copies - 1; end if; end; / show errors; 6/4 pl/sql: sql statement ignored 7/15 pl/sql: ora-00971: missing set keyword 13/13 pls-00103: encountered symbol "=" when expecting 1 of f ollowing: := . ( @ % ; 14/2 pls-00103: encountered symbol "end" your update statement misformed. instead of: update video num_copies = num_copies -1 set sta

android - ImageView appears in the wrong place in LinearLayout -

i'm following tutorial head first android development , can't figure out why linearlayout not working should. here xml code: <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" tools:context=".mainactivity" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <textview android:id="@+id/imagetitle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/test_image_title"/> <textview android:id="@+id/imagedate" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/test_image_date"/> <imageview android:id="@+id/imagedisplay" android:layout_width="wrap_content&quo

c# - Resizeable grid columns -

i have 4 panels arranged 1 column after another. each panel fixed except 3rd one, should big possible. i want able toggle visibility of 1st, 2nd, , 4th panels. i tried using grid , toggling different columns: <grid grid.row="1" name="resizablepanels"> <grid.columndefinitions> <columndefinition width="40" name="gridcoltools"/> <columndefinition width="100" name="gridcolstamps"/> <columndefinition width="*" name="gridcolcanvas"/> <columndefinition width="256" name="gridcolpropertiesandlayers"/> </grid.columndefinitions> ... <grid> but hides panels without repositioning , resizing 3rd panel. i tried wrappanel, couldnt work because 3rd panel's size unknown. how can toggle visibility of columns , resize appropriately? you need make width of hideable columns "auto"

algorithm - Finding union of 2 sorted arrays (with duplicates) -

i'm trying find union of 2 sorted arrays (with duplicates) feel i'm not coming elegant code (what have works btw, feel can reduce lines of code). lets have 2 vectors = {1,3,3,4,4,4,5,7} , b = {1,3,3,3,5,5,5,6,8,9} , want store union in vector called unionvector (which 1,3,4,5,6,7,8,9) here's code: #include <iostream> #include <vector> using namespace std; // prints contents of vector void printvector(vector<int> a){ if(a.size() == 0) return; else{ for(int = 0; < a.size(); i++) cout << a[i] << '\t'; } cout << endl; } // print union of 2 sorted arrays duplicates void printunion(int *a, int asize, int *b, int bsize){ if(asize == 0 && bsize == 0) return; else{ vector<int> unionvector; int = 0; int j = 0; int last = 0; // insert smaller of first element regardless if(a[i] < b[j]){ unionvector.push_back(a[i]); i++; } else if (b[j]

unit testing - PowerMock on Android Project -

hello powermock users, i trying write android testcases using powermockito. using eclipse ide , run tests "android junit tests" when mockito v1.9.5 (along dexmaker-1.1.jar & dexmaker-mockito-1.1.jar) test pass. of test have mocks , don't. when add powermock-mockito-1.5.6-full.jar libs folder , change imports import static org.powermock.api.mockito.powermockito.*; things start break. ( using mock() , when() calls ) below testcase class: @runwith(powermockrunner.class) @preparefortest({authsettings.class}) public class networkservicesimpltest extends activitytestcase{ @override protected void setup() throws exception { super.setup(); system.setproperty("dexmaker.dexcache", getinstrumentation().gettargetcontext().getcachedir().getpath()); thread.currentthread().setcontextclassloader(getclass().getclassloader()); obj = new myobj(); } private myobject obj; public void testsimpletest() {

ios - Displaying alert from app delegate before displaying alert from viewDidload -

i attempting display message contained within push notification through app delegate outlined in parse.com documentation. the problem having in viewdidload method first view controller, presenting alert user must see before use app. how can call method app delegate after user sees alert viewdidload method? edit: so have, suggested in comments, added global variable set true once have displayed alert viewdidload method, notification alert appdelegate still not appear. here app delegate.m file: - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { // override point customization after application launch. [parse setapplicationid:@"xxxxxxxxxxxxxxxx" clientkey:@"xxxxxxxxxxxx"]; // register push notitications, if running ios 8 if ([application respondstoselector:@selector(registerusernotificationsettings:)]) { uiusernotificationtype usernotificationtypes

javascript - Performant append to array of existing DOM elements -

i have following piece of code, loops on array of dom objects, runs test , appends text node if returns true. $.each( selections, function ( i, e ) { var test = some_test(e); if(test) { $(e).append('passed'); } }); whilst code works fine, on large set going perform lot of appends dom. article on reasons use append correctly demonstrates how appending dom far more performant : var arr = reallylongarray; var texttoinsert = []; var = 0; $.each(arr, function(count, item) { texttoinsert[i++] = '<tr><td name="pietd">'; texttoinsert[i++] = item; texttoinsert[i++] = '</td></tr>'; }); $('table').append(texttoinsert.join('')); my question performant way make changes set of existing dom elements without having call .append on each element ? above example demonstrates creation of new element. way ? what makes live dom manipulations slow fact it's causing dom reflows

javascript - AJAX Unload not firing -

i need run process when user exists or leaves page. have following code received question posted: <script> var unloaded = false; $(window).on('beforeunload', unload); $(window).on('unload', unload); function unload() { if (!unloaded) { $.ajax({ type: 'post', async: false, url: '/function/left/@viewbag.id', success: function () { unloaded = true; $('body').css('cursor', 'default'); }, timeout: 5000 }); } } the problem /function/left event never fired. wrong?

libgdx - Sprite not following body / fixture -

im trying make sprites stay on top of there static bodies (actually fixtures) when camera / screen moves. need achieve this? background : have player (which dynamic, polygonshape, set box), camera follows player moves upwards in screen. every x amount of meters generate (static) rectangle few meters in front of player. rectangle body im trying draw sprite on top of, problem when draw it, sprite stays static on screen , doesnt stay ontop of body/fixtures. my game screen follows player so: box2dcamera.position.y = player.getposition().y + box2dcamera.viewportheight / 2 - (player.bodyheight); box2dcamera.update(); im using libgdx-utils lib draw sprite ontop of rectangle follows: box2dsprite box2dsprite = new box2dsprite(kidsgame.res.gettexture("badlogic")); fixture.setuserdata(box2dsprite); sb.begin(); box2dsprite.draw(sb, world); sb.end(); thanks help a spritebatch uses matrix4 rendering. matrix4 should set camera s combined matrix. camera.com

python - How to access an array with TAL -

i have python file creates array path image , page url self.banner1 = [self.context.defaultbanner1.filename,self.context.defaultbanner1burl] i want access within page using tal. have tried without success <h1 tal:content="view/banner1[0]"></h1> how access array using tal? you can't path expression, can use python expression: <h1 tal:content="python:view.banner1[0]" />

io - Reading Directory for all files of a specified file type -

i want know how following... i have directory, let's call directory "d:\folder\" , has file types .json, .lua, etc , need able put appropriate files in table based off file type. how do via lua without external libraries? also, how can other information on files, size, date modified, etc via lua , store info? as yu hao said in comment , lua doesn't have methods list of files in folder or access attributes of files. in terms of external libraries, can use lua filesystem module has need or winapi if looking windows-specific solution. both small libraries can compiled quite using mingw. if looking windows-only-no-external-library solution, should able run "dir" command , process results using io.popen. can parse captured output , file names, sizes, , dates based on that. can file size using file:seek , since may parsing anyway, can output. don't think there simpler that. how searching pattern represents , characters file posses , .fi

unity3d - Google Cardboard Magnet Refresh Not Working in Unity -

i need google cardboard magnet. created ball game , want when pull magnet, ball jump. first round, magnet works fine, when restart level (by falling down) magnet doesn't work anymore. used script called magnetsensor.cs ( https://github.com/theqwertman/unitycardboardtrigger/blob/develop/magnetsensor.cs ). here's ball control script. if can, please me. try me format code when pasting inside of unity forums; don't know how to. that's why code messy: var rotationspeed = 100; var jumpheight = 8; var hit01 : audioclip; var hit02 : audioclip; var hit03 : audioclip; var disttoground : float; function start () { disttoground = collider.bounds.extents.y; } function update () { var rotation : float = rotationspeed; rotation = time.deltatime; rigidbody.addrelativetorque (vector3.back rotation); magnetsensor.onmagnetpull += jumponmagnet; } function isgrounded () : boolean { return physics.raycast(transform.position, -vector3.up, disttoground + 0.1); }

html - Javascript - extract span value -

hi there wondering how span value="example" object using javascript. playlist = document.getelementbyid("list"); playlist.addeventlistener("click",playnext,false); function playnext(){ var next = playlist.value; alert(next); } as html <span id="list" value="neededvalue">object1</span> i unable extract "neededvalue" span object, have had success returning innerhtml span. thanks, you want use data attribute store value. here article on , how use them http://html5doctor.com/html5-custom-data-attributes/

jquery - Ajax to refresh mutpliple parts of View -

i need advice on using ajax. designing view show tabulated data in main (upper) part. each row link select refresh / fill 2 div containers data corresponding link select clicked. i know use $.load() or $.get() helpers of jquery $('#select') trigger async request ajax. $.get() has overloaded version send object routesvlue controller. think need javascript function this. there's 1 thing don't know how sort out, easy do. need somehow distinguish between select links can execute same javascript function requesting different data. hope makes sense. value provide distinction id. so have 20 select links , each of them should execute function, send request based on different id, data html, json etc. , refresh div containers corresponding data. i don't know if should use partialviews or json or partialviews in 1 partialview! how can sort it. ps> think can use @html.actionlink(0 avoid hardcoded strings in ajax. edit: let's have data: number

css - jQuery sticky navigation not animating back quickly enough -

i've put "sticky navigation" using jquery , css. navigation animates , slides down top of screen once user has scrolled past point. works fine. what want have animate , scroll out of sight when user scrolls past same point @ navigation slid down. once top of page navigation should there @ top normal. half working, navigation doesn't animate out of sight until user right @ top of page, ruining illusion. what need correctly animate out of sight on scroll up? here's jquery: $(document).ready(function() { var nav = $(".header-main"); var sticky_navigation_offset_top = 100; $(window).scroll(function() { var scroll_top = $(window).scrolltop(); // our current vertical position top if (scroll_top > sticky_navigation_offset_top) { if (!nav.hasclass('header-main-sticky')) { nav.addclass("header-main-sticky").css({ top: '-100px' }).

firebase - Push command creating error: Cannot read property 'replace' of undefined -

i've seen variations of question in context of angularjs kendogrid backbonejs answers related frameworks , none of them address directly @ straight-up firebase level. since i'm not using of those, answers not helpful me. i create following ref: var loginref = new firebase('https://f30s.firebaseio.com/pablo/pages/login'); i try following push: loginref.child('clientevents').push( { create_account : true } ); the push writes firebase in proper directory structure, console produces error: uncaught typeerror: cannot read property 'replace' of undefined what doing wrong?

eloquent - Laravel - retrieve direct/indirect pivot table subscribers -

i having hard time figuring out in laravel; subscriber relationship have 2 pivot tables: a subscriber can subscribe question: question_subscriber id question_id subscriber_id 1 2 3 2 2 4 3 3 1 4 3 2 a subscriber can subscribe user: user_subscriber id user_id subscriber_id 1 1 6 2 1 7 3 2 1 normal questions table question owner: questions id question user_id 1 abc? 1 2 xyz? 1 3 123? 2 the pivot relationships setup correctly in models, , can pull out foreach, subscribers question, $question->subscribersquestion $subscriber , or subscribers user, $user->subscribersuser $subscriber : but how can pull out all subscribers belong user (directly or indirectly (through question own))? for example, these should retrieved subscribers user 1 : 6 // subscribed directly 7 // subscribed directly 3 // subscribed through quest

jsf 2 - refresh lazy loaded Primefaces datatable when a method performs an update -

when update data in database jdbc method, persisted primefaces datatable doesn't refreshed. refreshing page doesn't show change either change seen when server restarted , init has been called again. there way make primefaces refresh it's datatable content after persist data using jdbc method? note: jdbc method different managed bean add/update/delete database entity. i hope question clear enough. here datatable: <p:datatable value="#{warehousemanagedbean.lazymodel}" var="showstock" widgetvar="warehousetable" rows="10" rowsperpagetemplate="20,30,50" paginator="true" lazy="true" paginatortemplate="{currentpagereport} {firstpagelink} {previouspagelink} {pagelinks} {nextpagelink} {lastpagelink} {rowsperpagedropdown}"> <p:column headertext="raw material" sortby="#{showstock.rwcode}" filterby="#{showstock.rwcode}" filterstyle="

c - unsigned char array of 8 bits to unsigned char -

i've created function turns unsigned char unsigned char array of size 8 (where each index contains either 0 or 1, making 8 bits of given char). here 100% working version: unsigned char * uchartobitarray(unsigned char c) { unsigned char * bits = malloc(8); int i; for(i=sizeof(unsigned char)*8; i; c>>=1) bits[--i] = '0'+(c&1); return bits ; } i need create function exact opposite of now. meaning, take , unsigned char array of size 8, , turn regular single unsigned char. effective way of doing so? thanks help! the function needlessly complex , obscure. suggest replacing this: void uchartobitarray(char bits[8], uint8_t c) { for(uint8_t i=0; i<8; i++) { if(c & (1<<i)) { bits[7-i] = '1'; } else { bits[7-i] = '0'; } } } now convert back, go other way around. check bits[i] , set c |= (1<<i) if found '1' .

r - combine data frames after for loop -

i have list. start loop, in loop first convert variable names strings , assign list contend strings right name right content. after loop has finished want combine item#1 #4 list, item#2 , #5 ect. when combining items following: error in [.data.frame(loopvariable, , "f_corrected_normed_error") : undefined columns selected later 1 when want calculations inorganicnostdcondition here code example: residuallist = list(iaea_c2_nostdcondition = iaea_c2_nostdcondition, iaea_c2_eastd = iaea_c2_eastd, iaea_c2_ststd = iaea_c2_ststd, iaea_c2_bothstd = iaea_c2_bothstd, tiri_i_nostdcondition = tiri_i_nostdcondition, tiri_i_eastd = tiri_i_eastd, tiri_i_ststd = tiri_i_ststd, tiri_i_bothstd = tiri_i_bothstd ) c = 8 for(j in 1:c) { #convert list variable string later usage in filename unique identifier!!

datastep - SAS task. Need to pick records conditionally -

i have been given task solve, i'm quite new programming language. when flag 0, have pick next immediate record, provided flag variable has 3 or more consecutive records value 1. have been going @ hours. below datastep. please suggest. data two; input usubjid visit flag; cards; 1001 1 1 1001 2 1 1001 3 0 1001 4 1 1001 5 1 1001 6 1 1002 1 1 1002 2 1 1002 3 0 1002 4 1 1002 5 1 1003 1 0 1003 2 1 1003 3 1 1003 4 1 1003 5 1 ; run; output be:- usubjid visit flag 1001 4 1 1003 2 1 this have tried far. proc sort data = 2 ; usubjid ; run; proc transpose data = 2 out = tran ; usubjid ; id visit ;var flag ; run; data b ; set tran ; if ( ( _1 = _2 ) , ( _1 = _3 ) ) or ( ( _2 = _3 ) , ( _2 = _4 ) ) or ( ( _3 = _4 ) , ( _3 = _5 ) ) or ( ( _4 = _5 ) , ( _4 = _6 ) ) ; run; proc sort data = b ; usubjid ; run; data c ; merge ( in = ) b ( in = b ) ; usubjid ; if ;

c# - Why do i get different decimal points? -

i created structure contains several fields. in structure have property calls method creates string out of number logging purposes. when use property in structure different decimal points vs when directly call actual method creates log-string! suppose have 9990m, if use structure 9990.0000 , when call method directly prints 9990.00 this method : private static string createlog( long userid, decimal amount, long transactionid, decimal totalcash) { values = string.format("{0}{1}{2}{3}", amount, userid, transactionid, totalcash); return values; } and structure looks this: public struct accountstruct { public long user_id; public decimal amount; public long transaction_id; public decimal current_cash; string valuestobeloged {

angularjs - Setting up Angular service in Controller using routeProvider -

i have following: when('/admin/foo', { controller: foolistctrl, templateurl: 'frontend/partials/admin/foo-list.html', resolve: { aliasnames: ['printingservice', function(printingservice){ return printingservice.listarray(????); }] } }). the controller: function foolistctrl($scope, restangular, aliasnames) { $scope.aliasnames= aliasnames; } the printingservice: app.service('printingservice', [function() { return { listarray: function(thearray) { var result= "{"; result += thearray.join(", "); result += "}"; return result; } }; }]); im html page, have ng-repeat, , each object in repeat has array, i'm wondering how call service using each object's array. ng-repeat loop on objects have array, , need pass each array service, example: <div ng-repeat="obj in objects">{{o

iphone - Equivalent of android volley library to handle multiple simultaneous uploads in iOS -

in current project need upload 16 images simultaneously.in android using volley library this.in ios how can this?.i know it's bit of complex thing.i have 16 buttons on ui , user should use button upload images @ same time selecting images gallery.so it's maximum 16 uploads simultaneously. you can use restkit library network requests. build on top of afnetworking library. - restkit

bluetooth - Detect nearby mobile devices from an iOS app -

is possible create ios app scan nearby mobile devices (eg. iphone, android, ipad etc), without needing run custom app on nearby mobile devices? i have tried using corebluetooth so, running on iphone 6+: [self.centralmanager scanforperipheralswithservices:nil options:nil]; but nearby device detects imac, not detect ipad air 2, or bluetooth earpiece. am doing wrong? core bluetooth works bluetooth low energy (a.k.a. bluetooth 4.0) devices, not classic bluetooth ones. in order discoverable, device has advertise 1 or more ble services. can implement cbperipheralmanager , there's sample code apple "scanner" , "peripheral" side. note way can discover or discovered other mobile devices, android smartphones. i don't know if it's possible detect hotspot or handoff ble services. core bluetooth not allow access "raw" bluetooth low energy advertisement packets, apple filter out stuff. if want detect ios devices (and no other ble d

database - Rails/Active Record - I'm not sure of what to do with data that is innate to my application rather than user-provided -

i realize title sounds little confusing. can clarify. suppose have static product category information (e.g., category titles such "tvs," "computers," "cell phones," etc.). these aren't user-submitted data; these categories exist default within database. maybe each category (or category record, since we're talking databases) has both name , description property. this, again, exists default within site, i'd have enter these values manually. no problem. what's bit confusing me how go adding database it's there, if, during development of application, need work across multiple computers , need provide each computer access same default data. also, once application in production, default data need present, too. i hope clear , not clumsily worded. basically, want know how seed database data, not testing in development use in production. realize rails has seed.rb, i've heard that used merely stub data. need figure out how seed d

python - Checking code for deprecation warnings -

consider following sample code: data = [] try: print data[0] except indexerror error: print error.message there nothing syntactically wrong (using python2.7) code except if run python with warnings turned on , see deprecationwarning : $ python -w test.py test.py:5: deprecationwarning: baseexception.message has been deprecated of python 2.6 print error.message list index out of range fyi, because .message deprecated since python2.6 , removed in python3 . now, i'd find places in project .message called on exception instance by using static code analysis tools. end goal, i'm planning have check running part of daily build&test&code quality check task , raise error if syntax still used. is possible? pylint , pyflakes or other code analysis tools capable of? i found pep8 tool has several similar checks implemented, instance, has_key() usage check: $ cat test.py my_dict = {} print my_dict.has_key('test') $ pep8 test.py test.py:2

java - After Scroll background and images are shuflling in Listview -

when scroll dynamic data shuffling .any way can stop . have tried view holder no luck .my doing wrong . nice .thanks in advance public view getview(int position, view convertview, viewgroup arg2) { textview title, title_sub1, title_sub2, sub1, sub2; imageview img, lock; boolean isenable = false; try { if (convertview == null) { convertview = relativelayout.inflate(context, r.layout.protection_home, null); } int label; int icon; if (mfeatures != null) { label = mfeatures.get(position).label; icon = mfeatures.get(position).icon; isenable = mfeatures.get(position).isenable; } else { label = item[position]; icon = itemimg[position]; } title = (textview) convertview.findviewbyid(r.id.pro_title); title_sub1 = (textview) convertview.findviewbyid(r.id.sub_title1); title_sub2 = (text

login to remote windows machine through batch file from another windows machine -

my remote windows server restarts @ fixed time , need login daily after restart , since have scheduled few tasks in server , run when loged in , please me automate login process , can through batch files ? can restart if have windows 2008 or above can use task scheduler. open control panel , run task scheduler. right click on action menu , run create task. create task usual select "run whether user logged on or not" , (if need) select "run hightest privileges" checkbox. go triggers tab , click "new" button. there many conditions run task. select "at stratup" , click ok. in action tab select "new" button. there select in action "start program". click browse button , select script or batch file. click ok. repeat necessary. click ok again , create new task. good luck.

php - JForm error when creating a joomla component -

i'm new joomla! extension development, , i'm developing simple component,the idea of component insert couple of data database. in admin when people click on new button should enable them insert values according form created. here problem when click on new button show's me error: jform::getinstance not load file far have created basic mvc model joomla! interface needs. need help. thank you.(i'm using joomla! version 3.0) that error because joomla not loading form correctly. can't else without looking @ code, sorry. if want see how component works clean, functional written code, check http://component-creator.com . creates complete component crud functions in 5-10 mins. regards, andrés

r - Combine a specific row from many data frames into one data frame -

i have 20 data frames (dat.table1 dat.table20) this: > dat.table1 mean sd lb ub 1 -3.251915678 0.09831336 -3.44979982 -3.0579865 2 0.529393596 0.09403571 0.34492156 0.7138352 3 0.437666296 0.09555116 0.25218768 0.6230282 4 0.386773612 0.09338021 0.20630132 0.5708987 5 0.259218892 0.10023005 0.06538325 0.4610775 6 -0.048387041 0.07875680 -0.20517662 0.1020621 7 0.086933460 0.08688864 -0.08462830 0.2565562 8 0.206235709 0.08200178 0.04710170 0.3658142 9 0.343474976 0.08204759 0.18539931 0.5062159 10 -0.354694572 0.08556581 -0.52609169 -0.1916891 11 -0.270542304 0.07349095 -0.41319234 -0.1291315 12 0.124547080 0.08323933 -0.04331230 0.2836064 13 0.005354652 0.10487004 -0.20677503 0.2061523 14 0.296131787 0.08235691 0.13605602 0.4593168 15 0.246056104 0.07536908 0.09803849 0.3959664 16 0.271052276 0.08347047 0.10437983 0.4354910 17 -0.005474416 0.09352408 -0.19415321 0.1736560 > dat.table2

Bootstrap table word wrap is not working? -

i have problem bootstrap table. bootstrap table style works fine wide screens when tried see tablet pc columns overlapping on each other. please me out. .table{ table-layout:fixed; word-wrap:break-word; } <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> <div class="table-responsive"> <table class="table"> <thead> <tr> <th>cbee id</th> <th>first name</th> <th>last name</th> <th>created on</th> <th>email</th> <th>facebook id</th>