Posts

Showing posts from April, 2012

javascript - jQuery sortable label click event is not working -

i created list sort few cities , using jquery-ui plugin draggable sorting. problem sorting working, when try serialize values nothing , when check chrome dev tools see following error: error: uncaught error: cannot call methods on sortable prior initialization; attempted call method 'serialize' jquery-1.8.3.min.js:487 v.extend.error jquery-1.8.3.min.js:487 (anonymous function) jquery-ui-1.10.1.custom.min.js:6 v.extend.each jquery-1.8.3.min.js:536 v.fn.v.each jquery-1.8.3.min.js:416 e.fn.(anonymous function) jquery-ui-1.10.1.custom.min.js:6 (anonymous function) dragcity.php:365 v.event.dispatch jquery-1.8.3.min.js:1141 o.handle.u jquery-1.8.3.min.js:1061 php/html code: <div class="row-fluid" id="sortable_portlets"> <div class="span4 column sortable"> <!-- begin portlet portlet--> <?php $lisres = mysql_query("select `cityid`, `name`, `cityodr` `tbl_city`"); ...

Add WebView with PageCurl effect in Android -

i trying display text in android has text numbers , bullets have achieved using html page. familiar on how add webview using pagecurl, unable display contents of webview in android. code : private int[] mbitmapids = { r.layout.sample, r.layout.sample, r.layout.sample, r.layout.sample, r.layout.sample, r.layout.sample }; this how using page curl, xml files added array displayed in page curl. have tried far : view sample = getlayoutinflater().inflate(r.layout.sample,null); = (webview) sample.findviewbyid(r.id.admission_procedure_webview); we.loadurl("file:///android_asset/admission_prcedure.html"); i know dumb had try something. googled on unable find solid lead. had mentioned impossible achieve it. found em @ here , here . using 1 of popular page curl library. how add web view page curl ? appreciated. after long search, found library helps in achieving page turn in android webview. please noted not page curl has decent ...

uitableview - UITableViewCell inheritance -

Image
i have xib file. in xib create lot of cell app. i have same left part in uitableviewcell , right different. how can inheritance 1 cell cell, if both uitableviewcell load nib (one nib or different)? thank you there no concept of inheritance among nib files. option duplicate original file , make necessary changes. generally speaking, use xibs layout custom cell, set class of cell in xib custom class , go there it's implementation file. however it's not possible (to knowledge) have base xib inherit from. i think cleanest approach have separate xib each cell design.on implementation side, define class files, can use inheritance there.

jquery - Fade in/out multiple divs -

here's final version works fine! so, have multiple divs, each containing button fade in div, , fade out themselves. when fade in 1 div, other divs (faded in button) shall fade out. mabe difficult understand, here fiddle div 1 button fade-in div 2 (display:none;) <div class="cnt" id="cnt-1">content 1<br> <div class="btn" id="btn-1">button 1</div> </div> <div class="cnt" id="cnt-2">content 2<br> <div class="btn" id="btn-2">button 2</div> </div> div 3 button fade-in div 4 (display:none;) <div class="cnt" id="cnt-3">content 3<br> <div class="btn" id="btn-3">button 3</div> </div> <div class="cnt" id="cnt-4">content 4<br> <div class="btn" id="btn-4">button 4</div> </div> and on.....

java - proper method of constructing subject lines with special characters and tokens in SendGrid -

This summary is not available. Please click here to view the post.

PHP 5.5 setlocale() not working in CLI on Windows? -

i'm diagnosing user problems german locales. running php -r "setlocale(lc_all, array('de_de','deu_deu)); echo 10.01;" gives 10.01 running <?php echo(setlocale(lc_all,array('de_de','deu_deu'))); echo 10.01; via wamp stack gives german_germany.1252 10,01 this shows locale active , decimal_point has changed. is known restricting setlocale doesn't work in cli? after opening issue php turns indeed out bug: https://bugs.php.net/bug.php?id=65230 funny (or rather not) broken behavior won't fixed or documented: and after all, locale has such issues on platform. solution use intl or custom localization functionality.

awk - add the names to file1 based on file2 -

i have 2 files file1 , file2. of names in file2 not in file1. add names in file1. file1 anna 14/2 = 7.0 alex 23/6 = 3.8 deffy 27/3 = 9.0 hobert 24/9 = 2.7 file2 anna alex benny cathar deffy hobbert sam my desired output shown below. anna 14/2 = 7.0 alex 23/6 = 3.8 benny 0/0 = 0 cathar 0/0 = 0 deffy 27/3 = 9.0 hobert 24/9 = 2.7 sam 0/0 = 0 your appreciated! kent$ awk 'nr==fnr{a[$1]=$0;next}a[$0]{print a[$0];next}{print $1,"0/0 = 0"} ' f1 f2|column -t anna 14/2 = 7.0 alex 23/6 = 3.8 benny 0/0 = 0 cathar 0/0 = 0 deffy 27/3 = 9.0 hobbert 0/0 = 0 sam 0/0 = 0

PHP unable to load dynamic library "php_pdo_oci.dll" -

Image
i'm running apache 2.4.7 php 5.5.9 on windows 8. installed phpunit , warning image "warning" started pop up. yes enabled extension loading in php.ini "extension_dir" correct folder , there file named "php_pdo_oci.dll" in folder. tried use different apache , php releases, didn't help. suggestions how fix this? the ..._oci.dll part of oracle c interface. unless need use oracle, suggest go relevant line inside php.ini file , uncomment loading of extension. however, if need use extension, you’ll need install free oracle client libraries , add them path. oracle has article installing php , oracle instant client linux , windows on how this.

java - JavaFx: How to install a Tooltip on ImageView -

i tried this: public void addtargetcard(missioncard mcard) { int card = mcard.getid(); leftside.getchildren().removeall(targetcardbox); image image = new image( mainapp.class.getresourceasstream("images/target" + card + ".png")); imageview imageview = new imageview(); imageview.setimage(image); imageview.setfitheight(81); imageview.setfitwidth(108); imageview.setpreserveratio(true); imageview.setpickonbounds(true); tooltip.install(imageview, new tooltip(inttocity(mcard.getstart()) + " - " + inttocity(mcard.getfinish()))); targetcardbox.getchildren().add(imageview); leftside.getchildren().add(targetcardbox); } can explain me why tooltip doesn't work - got no idea did wrong. (it's first time use tooltips's) somebody else told me imageview doesnt work tooltips , gave me workaround - have again no tooltip when move mouse on label public voi...

multithreading - Multiple pre-emptive thread pools in TBB -

we have requirement create number of real time processing chains 1 running @ n hz , others running @ x, y , z hz in single process. x, y , z multiple (not simple multiple) of n. example 1 chain running @ 1hz , others running @ 3hz , 4hz. each processing chain needs make use of tbb parallelize of computations etc. , needs have pool of tbb worker threads match number of hardware processors, higher frequency chains need pre-empt lower frequency chains in order system work. how can achieved using tbb? it seems documentation not possible create competing pools of tbb workers pre-empt each other, since tbbs task groups etc. seem share single pool of real threads , there not appear anyway set real system priority of tbb worker thread, or missing something? first, tbb not designed real-time systems. though, requirement of few hz looks relaxed quite enough. second, tbb not designed serve thread pool. suggests user-level non-preemptive task scheduler instead of preemptive thread...

caching - WebApi - Redis cache vs Output cache -

i have been studying redis (no experience @ - studied theory), , after doing research, found out being used cache. e.g. stackoverfolow self. my question is, if have asp.net webapi service, , use output caching @ webapi level cache responses, storing kind of key/value (request/response) in server's memory deliver cached responses. now redis in memory database, how me substitute webapi's output caching redis cache? is there advantage? i tried go through answer redis-cache-vs-using-memory-directyly , guess didn't got key line in answer: "basically, if need application scale on several nodes sharing same data , redis (or other remote key/value store) required." i storing kind of key/value (request/response) in server's memory deliver cached responses. this means after server restart, server have rebuild cache . won't case redis. 1 advantage of redis on homemade in-memory solution persistence (only if that's issue , did not plan...

jquery - Mixing Javascript and Mouse Events in Paper.js -

i trying time mouse zooming mouse wheel working nice on paper.js. this necessitates use javascript well, since paper.js not have mousescroll event. $(document).ready(function() { $('#canvas').bind('mousewheel dommousescroll mozmousepixelscroll', function(e) { var delta = 0; e.preventdefault(); if (e.type == 'mousewheel') { //this chrome/ie delta = e.originalevent.wheeldelta; } else if (e.type == 'dommousescroll') { //this firefox delta = e.originalevent.detail*-1; //firefox reverses scroll force to re-reverse... } if (delta > 0) { //scroll var zoomcenter = e.point.subtract(paper.view.center); var movefactor = toolzoomin.zoomfactor - 1.0; paper.view.zoom *= toolzoomin.zoomfactor; paper.view.center = paper.view.center.add(zoomcenter.multiply(movefactor/toolzoomin.zoomfactor)); toolzoomin.hittes...

c - Integer to byte array Little Endian and vice versa -

i want methods convert integer byte array (little endian), , byte array (encoded in little endian way) integer in c; regardless if work on le or machine. are these functions fine this? void int2bytearrayle(int x,unsigned char *bytearray) { bytearray[0]=x; bytearray[1]=x>>8; bytearray[2]=x>>16; bytearray[3]=x>>24; } void bytearrayle2int(unsigned char *bytearray, int*x) { *x=bytearray[0] | (bytearray[1]<<8) | (bytearray[2]<<16) | (bytearray[3]<<24); } ps. work if x signed? what trying convert between host byte order , network byte order. , need functions htonl , ntohl . to convert host network byte order use: uint32_t n = (uint32_t)htonl((uint32_t)h); and in opposite direction: int h = (int)ntohl((uint32_t)n); these functions aware of endianness of host platform. if execute code on big endian machine, these functions nothing. on little endian machine functions reverse bytes. in comments intimate communicati...

python - Flask use the same blueprint across files -

this project structure: - app.py - views/ - admin/ - __init__.py - note.py - album.py in views/admin/__init__.py created blueprint: admin_bp = blueprint('admin_bp', __name__, url_prefix='/admin') and i'd use blueprint in both note.py , album.py what i've tried: # note.py views.admin import admin_bp @admin_bp.route('/note/list') def list_notes(): pass but seems url rule not generated @ all thanks. are loading blueprint in app.py? from admin import admin_bp app.register_blueprint(admin_bp) ensure importing note.py & album.py inside admin/__init__.py . this should load urls. if fails may worth printing contents of url map: print app.url_map regards

android - Get draw bounds/rect of a view -

Image
i'm developing app lot of views can rotated - it's map of physical objects. have detect when 2 objects (all objects rectangles/squares) overlapping , if user has performed single/double/long tap on object. reason need know drawing bounds of view. let's @ example image bellow - green rectangle rotated 45 degrees. need coordinates of 4 corners of green rectangle. if use view.gethitrect() returns bounding box (marked in red) of view, of no use me. do know how coordinates of edges of view? the solution think of subclass view, manually store initial coordinates of corners , calculate new values on every modification view - translation, scale , rotation wondering if there better method. p.s. app should working on android 2.3 4.0+ solutions welcomed. thanks pskink explored again matrix.mappoints method , managed proper coordinates of corners of rectangle. if running on android 3.0+ can view's matrix calling myview.getmatrix() , map points of interest. ...

python - How to unit test a function that does not return anything? -

is possible find values of local variables in function mocking? class a: def f(self): = 5000 * 10 b().somefunction(a) how write unit test function? have mocked somefunction not want testing scope go outside block. way can test rest of function checking if value of variable 50000 @ end of function. how do this? with interaction testing, check value somefunction called with. happens inside function, should tested in unit test of function.

javascript - jquery unterminated string literal when loading dynamic content -

$str loading dynamic content admin panel (tinymce) in following format $str = 'first line second line third line'; when try access variable gives me unterminated string literal <script type="text/javascript"> $(document).ready(function() { var = '<?php echo $str;?>'; $('#abc').html(a); }); </script> <div id="abc"></div> when convert string $str = 'first line second line third line'; not give error string in above way. when dumping php variable javascript, use json_encode . this: var = <?php echo json_encode($str); ?>; note no quotes around php code, important! php add quotes , escape correctly.

Multiple counts in grep? -

so have big log file each line contains date. count number of lines containing each date. i came awful solution, consisting of manually typing each of following commands: grep -c "2014-01-01" big.log grep -c "2014-01-02" big.log grep -c "2014-01-03" big.log i have written small python script, seems overkill. there quicker / more elegant solution? you can maybe use of regex , uniq -c count results. see example: $ cat 2014-01-03 aaa 2014-01-03 aaa 2014-01-02 aaa 2014-01-01 aaa 2014-01-04 aaa hello 2014-01-01 aaa and let's 2014-01-0x , being x digit, , count them: $ grep -o "2014-01-0[0-9]" | sort | uniq -c 2 2014-01-01 1 2014-01-02 2 2014-01-03 1 2014-01-04 note piping sort needed make uniq -c work properly. can see more info in answer what meaning of delimiter in cut , why in command sorting twice? .

c++ - GetCurrentThreadId returns different threadId -

i call mentioned windows api. returns different thread id id returned _beginthreadex . code following, threadtest *_threadtest = new threadtest(); thread *_thread = new thread(startroutineforthread,_threadtest); constructor thread class is, threadwin::threadwin(void * (*_startroutine)(void *), void * _argument, bool _isjoinable) { unsigned int _threadaddress; unsigned int threadid = _beginthreadex( null, 0, (unsigned int (__stdcall *)(void *))_startroutine, _argument, 0, &_threadaddress ); } startroutineforthread function start routine thread following, void* startroutineforthread(void* _argument) { threadtest *_threadtest = (threadtest*)_argument; _threadtest->run(); return null; } void threa...

jquery - Save HTML as PDF (With CSS(in different file) in ASP.NET C# MVC? -

i doing search on net since 3 days , have tried many examples no success. want render .cshtml view page pdf using either client or server side code. tried jspdf giving no result. please help. isn't there easy way? have @ resources mentioned in article - http://www.codeproject.com/questions/425227/html-to-pdf-conversion-using-csharp & below: http://pdfcrowd.com/web-html-to-pdf-net/ convert html content pdf using c# , asp.net you may need generate html @ server side views , convert pdf file.

android - UnsatisfiedLinkError when calling C++ method in C++ file from Java file -

it looks popular problem, and still not find out solution. package name : app.cloudstringers java file : completed.java static { try { system.loadlibrary("ffmpeg"); } catch (unsatisfiedlinkerror e) { log.d("", "error : " + e.tostring()); } } // define native method public native int getstring(); @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.page_completed); // call native method log.d("", "" + getstring()); c++ file : ffmpeg.cpp #include <jni.h> #include <android/log.h> #include <string.h> #ifdef __cplusplus extern "c" { #endif jniexport jstring jnicall java_app_cloudstringers_completed_getstring(jnienv* env, jobject thiz) { jstring strret = env->newstringutf("helloworld jni !"); return strret; } #ifdef __cplusplus } #endif android.mk file local_pat...

javascript - Jquery Image AND link swap using same variable? -

i have product page has multiple images, large image shown in main box, , thumbnails of additional images underneath. when clicking on main image, fancybox fires , see larger image in lightbox effect. i'm using jquery swap out images on page, , works fine: <script> $('#thumbs').delegate('img','click', function(){ $('#largeimage').attr('src',$(this).attr('src').replace('width=80&height=80','width=470&height=525')); }); </script> and code in main area: <div class="prodrightcolumn"> <div class="productmainimage" id="panel"> <a id="largelink" href="~/images/@product.image1" rel="gallery2" class="fancybox" title="@product.title"> <img id="largeimage" src="~/images/@product.image1?width=470&height=525&mode=crop" alt="@product.title"...

file - Java while(input.hasnextline) loop not exiting? -

so i'm supposed determine number of lines in text file (a 100 lines containg numbers) , create array the number of lines, first while loop used find out number of lines in text file never exits. second loop exacts same 1 works fine. please me out! static void main(string[] args) throws exception{ java.io.file file = new java.io.file("seriesofnumbers.txt"); //file instance scanner input = new scanner(file); //scanner int m =0 ; while (input.hasnextline() && !input.equals(null))// ** loop never exits, tried { k++; } double[] numberarray = new double[k]; int v = 0; while (input.hasnextline())// when exit first loop 1 exits fine { numberarray[j] = (double) input.nextint(); j++; } you never consuming input in first loop, input.nextline() . you looping until input.hasnextline() becomes false, never happens, because not consume input.

python - Sort nested dictionary by values -

i trying sort dictionary dictionary inside. how dict looks like: {'pos2': {'stegano': 0, 'sum': 200, 'misc': 100, 'web': 0, 'ppc': 0, 'crypto': 0, 'admin': 0, 'vuln': 0, 'forensics': 0, 'hardware': 0, 'reverse': 0, 'recon': 100}, ...} i want sort 'sum' key stored in nested dict. have tried different solutions here sort nested dictionary value, , remainder value, in python , here sorting nested dictionary lists in python work fine on python 2.x doesn't work on python 3.x. give me advice how implement kind of sort ? simply return desired sort key each item sorted(inputdict.items(), key=lambda item: item[1]['sum'])

Linux "Default Permissions" for Future Files recursively? -

i have cache folder needs 777 inside. existing ones, , newly/future created files, folders, sub-folders, etc. lets say: /var/www/html/cache so how in linux (or rhel) please? you should running following command in /var/www/html/cache umask 000 this subtracts 000 system defaults give default access permission files of 666 ( rw-rw-rw- ) , directories of 777 ( rwxrwxrwx ). umask manual

android - Retrace for DexGuard -

i use dexguard obfuscation. have stack trace crash log , mapping file. when run retrace.bat , giving stack trace , mapping file, output still in obfuscated format. are using proguard 's retrace.bat? cannot deobfuscate stack traces obfuscated dexguard. solution use dexguard 's retrace tool instead: java -jar /var/dexguard/lib/retrace.jar -verbose mapping.txt trace.txt dexguard's backwards compatible, i.e., can retrace proguard obfuscated stack traces.

ios - NSURLSessionDataTask dataTaskWithURL completion handler not getting called -

i have been learning objective c lately, , decided try connections. everything great nsurlconnection, until discovered outdated, , tried work nsurlsession. i trying simple example, can't seem app run code inside completion block. here code used: nsurl * url = [nsurl urlwithstring:@"http://api.openweathermap.org/data/2.5/weather?q=london,uk"]; nslog(@"2"); nsurlsessionconfiguration *defaultconfigobject = [nsurlsessionconfiguration defaultsessionconfiguration]; nslog(@"3"); nsurlsession *defaultsession = [nsurlsession sessionwithconfiguration: defaultconfigobject delegate: nil delegatequeue: [nsoperationqueue mainqueue]]; nslog(@"4"); nsurlsessiondatatask * datatask = [defaultsession datataskwithurl:url completionhandler:^(nsdata *data, nsurlresponse *response, nserro...

java - How do I get input from buttons I created using a loop? -

i'm trying make simple calculator in java using swing, , i've created buttons following way: //our number keypad public static jpanel numbers(){ //our panel return jpanel panel = new jpanel(); //create , add 3x4 grid layout panel gridlayout gl = new gridlayout(3, 4); panel.setlayout(gl); //for creating , adding buttons panel for(int = 0; < 10; i++){ //create new button name value of string name = "" + + ""; jbutton button = new jbutton(name); //add action listener button.addactionlistener(handler); //add button panel panel.add(button); } return panel; } my question how reference each specific button in event handler? can't think of way without having manually create each button rather using loop. thanks. in listener, call event.getsource() , , return button has been pressed. text of button, , have number. or create different instance...

Refreshing makers (ClusterItems) in Google Maps v2 for Android -

i'm using google maps android api utility library , i'm downloading images internet want use markers. way i'm doing in following snippet: class markeritemclusterrenderer extends defaultclusterrenderer<markeritem> { ... @override protected void onbeforeclusteritemrendered(markeritem item, final markeroptions markeroptions) { super.onbeforeclusteritemrendered(item, markeroptions); mimageloader.get(item.getimageurl(), new imagelistener() { @override public void onerrorresponse(volleyerror error) { log.i("xxx", error.tostring()); } @override public void onresponse(imagecontainer response, boolean isimmediate) { if (response != null && response.getbitmap() != null) { mimageicon.setimagebitmap(response.getbitmap()); bitmap icon = m...

jquery - Upload a file on drop event javascript in internet explorer -

i need upload file on drop event in browser, need identify whether file dragged same window or other window (may local drive). if file drag , dropped same window don't need show upload popup in ie appears.below code used. $("body").on('drop', function (e) { e.preventdefault(); var files = e.originalevent.datatransfer.files; if (files) { showmultipleupload(files); } else { $.alert("error"); } }); i have tried following methods didn't work e.srcelement, e.originalevent.srcelement, e.target having dom in drop file, no matter dragged from. e.originalevent.fromelement null. disable mousedown body. $("body").on('mousedown', function (e) { e.preventdefault(); }); /* worked can't perform click event same body tag. */ i had set event bubbling parameter false, unfortunately can't upload files. i.e. if...

java - Button not updating its text -

i'm working android game. when application start show button ("start") start game. when user lose, application should show original view , changing button text "restart". when start application works fine when user lose original view (button text not changed) , button not responding. have 2 classes : gameactivity , gameview : in gameactivity have : protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); init(); } public void init() { setcontentview(r.layout.activity_catch_game); fruitview = (catchgameview) findviewbyid(r.id.l3infocatchgameview1); fruitview.setactivity(this); if (bstart == null) { //when launch app bstart = (button) findviewbyid(r.id.start); bstart.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { buttonstartclickeventhandler(); } }); } else{ bstart.settext...

localization - Localisation issue -

i have set mvc4 environment have created localisation using simple resx files in resources directory. naming of file have used xxxxx.resx , xxxxx.nl.resx. this worked brilliantly. have changed (brilliant) third party application (resxmanager.com) since expect use lot of different languages. application however, uses "xx-xx" convention creating various language files. so far, good. able manage resource files without problem. issue however, application doesn't use correct resource files. culture , uiculture indicate browser working in right (i.e. nl-nl) culture proper resources not selected. have tried various settings in web.config ([ui]culture="auto", [ui]culture="xx-xx", [ui]culture="xx" etc) i'm stuck on next. is able put me right direction?

Cakephp 2.45 format text in input to include "-" between letters -

i have need make input box formatted so: "x-x-xx-xxxxx" type first x appear "x-" next entered "x-x-", , on, kind of phone number. here current input: model: function getallfflnums($userids=null) { $ffls=array(); $cond = array(); $cond['userfirearm.user_id']=$userids; if($userids) { $res = $this->find('list', array('conditions'=>$cond, 'fields'=>array('userfirearm.received_ffl_number') )); foreach($res $row) { $ffls=$res; } } return $ffls; } controller: $conditions = array(); if ($userid) { $conditions['userfirearm.user_id'] = $userid; } $sel_rffl=array(); $sel_rffl = $this->userfirearm->getallfflnums($this->request->data['userfirearm'] ['user_id'] = $userid); $this->set(compact('sel_rffl'));` and view: echo $this->form->input('received_ffl_number', array( 'empty' => 'enter vaild ffl number', 'label...

java - Android Display Web View -

hi i'm working on android application uses web view. works on api levels, i'm having problems on api 9 (gingerbread 2.3.5). it's inconsistent whether works or not. i've used following code work on froyo: webview.setwebviewclient(new webviewclient(){ @override public boolean shouldoverrideurlloading(webview view, string url) { if (uri.parse(url).gethost().equals(urlstring)) { // web site, not override; let webview load page return false; } // otherwise, link not page on site, launch activity handles urls intent intent = new intent(intent.action_view, uri.parse(url)); startactivity(intent); return true; } @override public void onreceivedsslerror (webview view, sslerrorhandler handler, sslerror error) { handler.proceed(); } }); but doesn't hit when debugging on api level 9 (gingerbread 2.3.5). h...

restrict view based on user's value in model using rules in controller- yii -

is there way restrict view based on user's input in model in controller? want hide/show own page based on own choice. profile_hide_show values of 'p'=>public, 'f'=>friends, , 'm'=>me public function accessrules() { return array( array('allow', 'actions'=>array('view'), 'users'=>array('?'), //?based on user's selection in model, ), ); } the yii access control allows perform basic control before descending local methods of controller. you can enable access control using 'expression' attribute of access control list. example : public function accessrules(){ $owner_id = $this->loadmodel()->owner_id; return array( array('allow', 'actions'=>array('action1'), 'expression'=>"{$user->id}=={$owner_id}", ), array('a...

ios - Cocoapods error with XCode 5.1 -

i updated xcode 5.1 version , when try build project following error: pods rejected implicit dependency 'libpods.a' because architectures 'armv7s' didn't contain required architectures 'armv7 armv7s' any solution? i've tried updating cocoapods gem no success. this should fix problem: 1.delete "pods" project workspace in left pane of xcode , close xcode. 2.run "pod install" command line recreate "pods" project. 3.re-open xcode , make sure "build active architecture only" set "no" in build settings of both "pods" project , own project. 4.clean , build. more on topic: https://stackoverflow.com/a/22336208/1041311

android - I would like to backport the AndroidKeystore from 4.4, but I receive an "access to class not allowed" -

i propose new security provider public class backportandroidkeystoreprovider extends provider { private static final long serialversionuid = 1l; public static final string provider_name = "xxxandroidkeystore"; public backportandroidkeystoreprovider() { super(provider_name, 1.0, "android keystore security provider"); // java.security.keystore put("keystore." + backportandroidkeystore.name, backportandroidkeystore.class.getname()); // java.security.keypairgenerator put("keypairgenerator.rsa", backportandroidkeypairgenerator.class.getname()); } } a keystore provider class backportandroidkeystore extends java.security.keystorespi { public static string name = "aa"; @override public key enginegetkey(string alias, char[] password) throws nosuchalgorithmexception, unrecoverablekeyexception { ... } and keypair generator. public class backportandroidkeypairge...

c# - Exchange WebService EWS FindAppointmens 501: Not Implemented -

Image
we have exchange server 2010 sp2 running here on premise. i'm using ews managed api (i've tried both api/dll version 1.2 , 2.1) connect it. i'm able retrieve calendar, ews service name , version info, on line " var appointments = calendar.findappointments(calenderview); " 501 - not implement exception (see image). i've searched net can't find info on error, nor find info on msdn. below code use: main method: private void main_load(object sender, eventargs e) { connectwithexchange(); getcalendaritems(); } instantation /// <summary> /// http://msdn.microsoft.com/en-us/library/office/ff597939(v=exchg.80).aspx /// </summary> private void connectwithexchange() { // 01. instantiate exchangeservice _exchange = new exchangeservice(exchangeversion.exchange2010_sp2); // 02. connect credentials _exchan...

postgresql - ranking a data set in SQL, excel or tableau? -

i have data set filled race drivers recording of each of lap times 10 laps. request not show lap times rankings each lap ( ex. jeff gordon lap 1: 1st, lap 2: 5th, lap 3: 9th, lap 4: 3rd, etc) i have pgadmin, tableau , excel done. sound direction appreciated. you didn't give detail tables, like: select driver_name, lap_number, dense_rank() on (partition lap_number order lap_time) rank_in_lap, dense_rank() on (order lap_time) overall_rank lap_times order driver_name, lap_number; more details window functions in manual: http://www.postgresql.org/docs/current/static/functions-window.html http://www.postgresql.org/docs/current/static/tutorial-window.html

java - How to wire Spring service by interface in parent module? -

i'd create parent/framework module , define service makes use of interface methods. the interface implementation should provided implementation project. somehow injection not work. why? framework module: package de.test; @service public class baseserviceexecutor { @autowired private icustomservice service; public void run() { service.use(); } } interface icustomservice { void use(); } @configuration public class frameworkappconfig { } implementation module: package de.test.impl; @service public class mycustomservice implements icustomservice { @override void use() { //custom impl } } appcontext.xml: (within implementation project) <context:component-scan base-package="de.test" /> @configuration @import(frameworkappconfig.class) @componentscan("de.test") public class implappconfig result: caused by: org.springframework.beans.factory.nosu...

r - How to test all sample combinations for significant differences? -

i'm analyzing dataset of 9 plots in r , want compare them each other. responding variables not distributed. now question: there 9+8+7+...+2+1=45 pair-combinations tested. can r automatically? if yes, how? wish-output box-whisker plot 9 plots on x-axis, responding variable on y-axis , lowercase letters above plots indicate significant differences. thanks in advance! this should started: #some data x <- rlnorm(100, mean=1:4) df <- data.frame(x=x, g=c("a", "b", "c", "d"), stringsasfactors=false) #pairwise mann-whitney-u-test pairwise.wilcox.test(df$x, df$g, p.adjust.method = "bonferroni") # pairwise comparisons using wilcoxon rank sum test # #data: df$x , df$g # # b c #b 0.0016 - - #c 6.3e-09 0.0020 - #d 1.9e-13 2.0e-08 0.1823 # #p value adjustment method: bonferroni

html - MySQL Database store image url and php page display it? -

i wondering if there’s way store image url in database unique numeric id, , php page display image getting data (the image url) database , displaying user on image.php page? an example of be: - having image url http://www.example.com/images/image10.jpg (where url stored in database, alongside id of 10) - having image.php page retrieves image url database , displays image on same page (the image.php page) (and doesn’t redirect image url) - example result being image.php?id=10 image.php file source image url database image id of 10 (using example: www.example.com/images/image10.jpg) , display (so viewing image if viewing www.example.com/images/image10.jpg instead url http://www.example.com/image.php?id=10 ) is there way this? i'm new php , mysql not code - trying experiment :) thanks in advance! edit: think people getting confused bad description (sorry abot that). i've noticed in answers have included actual image url in code - dont understand why though. example...

jquery - Fill array with json response -

i'm trying populate array in validation code distinct values 1 column, , logic on focus on element send ajax request , populate array json response. i'm still novice in jquery , seems cant right, if can help. $('input#search').on("focus", function(){ $.ajax({ type:"get", datatype: "json", url:"ajax_php/get_distinct_cities.php", success:function(data){ $.each( data.city, function( i, itemdata ) { cities[i] = itemdata; }); } }); }); php: <?php mysql_connect("localhost","root",""); mysql_select_db("pickante"); $sql = "select distinct city uc_items"; $result = mysql_query($sql); $cities = array(); while($row = mysql_fetch_assoc($result)) { $ci...

c# - Display Data in textbox based on search (by word) -

i trying simple function in program find data in db , bring back. doing using 2 text boxes. translation function when search 1 word in first text box should display translated/matched word db in second texbox. cant work, heres code anyway... string strprovider = @"path here"; string strsql = "select jpn vocab eng '" + textbox1.text + "%'"; oledbconnection newconn = new oledbconnection(strprovider); oledbcommand dbcmd = new oledbcommand(strsql, newconn); newconn.open(); dbcmd.commandtype = commandtype.text; oledbdatareader dr = dbcmd.executereader(); while (dr.read()) { textbox2.text = dr.getstring(0); }

Finding combinations of rows that combined do not exceed a value in mySQL -

this question requires explanation. assume have table items. each item has multiple characterics, called id, score, value , size (all integers). some of items grouped unknown groups of 3 each item can in 0 or 1 group each group (another table) lists amount of items (3) , combined score, size , value of 3 items example table items tables: items(id,size,score,value) group(grpid,tsize,tscore,tvalue) example content items(1,2000,3000,4000) ,(2,4000,5000,8000) ,(3,8000,3000,1000) ,(4,12000,1000,400) groups(1,14000,11000,13000) -> matches item 1,2,3 combined imagine items table has hundreds 1000 records , typically 10 groups of 3 items followup question: 4, 5 or 10 sized groups. what efficient way find possible groups (in theory search find more 1 combination of 3 items match groups totals)? welcome unlucky ones: encountered subset sum problem , np-complete , not solvable in polynomial time in general. (more or less) restricted problem gro...

character encoding - Using Java Normalizer to convert accent ascii to non-accent but to exclude some symboles -

i have set of data have accented ascii in them. want convert accent plain english alphabets. achieve following code : import java.text.normalizer; import java.util.regex.pattern; public string deaccent(string str) { string nfdnormalizedstring = normalizer.normalize(str, normalizer.form.nfd); pattern pattern = pattern.compile("\\p{incombiningdiacriticalmarks}+"); return pattern.matcher(nfdnormalizedstring).replaceall(""); } but code missing exclude characters, don't know how can exclude characters conversion, example want exclude letter "ü" word düsseldorf when convert, doesn't turn dusseldorf word. there way pass exclude list method or matcher , don't convert accented characters ? do not use normalization remove accents! for example, following letters not asciified using method: ł đ ħ you may want split ligatures œ separate letters (i.e. oe ). try this: private static final string tab_00c0 = "...

java - how do i add String array to JSON -

i writing code in servlet gets data database , returns client. having problems inserting array of dates have collected , adding them json object return client. here code i'm trying keeps giving errors dates = classdatesdao.getdate(dates); arraylist<string> classdates = new arraylist<string>(); classdates = dates.getclassdates(); response.setcontenttype("application/json"); jsonobject dates = new jsonobject(); dates.put("dates", new jsonarray(classdates)); in ide error on classdates in jsonarray the constructor jsonarray(arraylist) undefined you passing arraylist instance instead of array . so, convert list array , pass argument this dates.put("dates", new jsonarray(classdates.toarray(new string[classdates.size()]))); note : json api has method signature accepting java.util.collection . so, using other library or older version

javascript - Object[object Object] has no method 'slitslider' -

i getting error 'object[object object] has no method 'slitslider' when trying implement slider on page. don't know quite of javascript don't know why happening. this script: <script type="text/javascript"> $(function() { var page = (function() { var $nav = $( '#nav-dots > span' ), slitslider = $( '#slider' ).slitslider( { onbeforechange : function( slide, pos ) { $nav.removeclass( 'nav-dot-current' ); $nav.eq( pos ).addclass( 'nav-dot-current' ); } } ), init = function() { initevents(); }, initevents = function() { $nav.each( function( ) { $( ).on( 'click', function( event ) { var $dot = $( ); ...

maven - Gradle download dependency error -

i'm trying add following dependency: compile group: 'com.cedarsoft.commons', name:'test-utils', version:'5.0.9' gradle downloads couple of jars , i'm getting following error: pom relocation other version number not supported in gradle : xml-apis#xml-apis;2.0.2 relocated xml-apis#xml-apis;1.0.b2. please update dependency directly use correct version 'xml-apis#xml-apis;1.0.b2'. resolution pick dependencies of relocated element. artifacts , other metadata ignored. any ideas why , how solve issue? configurations.all { resolutionstrategy { force 'xml-apis:xml-apis:1.4.01' } } or use 1.0.b2. issue there pom of xml-apis redirects 2.0.2 (as khmarbaise wrote) same group , artefact, version being 1.0.b2, somehow fools gradle (or underlying ivy) resolution mechanism. the credit goes mark petrovic gradle forum

ios - Including a bundle in XCode 5 -

Image
i new ios programming. i looking use google sign-in in ios app. read through google docs , have understood needs done. there 1 sentence not understand how - if plan use sign-in button provided sdk, include googleplus.bundle in xcode project add target. i not know how include bundle xcode project , add target. googled not find answer. can me here? copy bundle file project, described here . you'll see following dialog: here you'll need 2 things: check checkbox "copy items destination group's folder." check checkboxes next names of projects you'll using goolge sdk. click "add"

Which files to edit? Maven & archiva -

i cannot conclude, after reading, , why necessary change in order download artifacts archiva repository using maven. i have archiva set on server , trying run simple maven project artifacts in archiva repo , download them. which settings.xml change? 1 on server or local copy? does pom.xml need changed @ all? your local ~/.m2/settings.xml file (or %userprofile%\.m2\setting.xml under windows). there can set: <mirrors> <mirror> <id>yourrepo-id</id> <name>yourrepo-name</name> <url>http://yourrepo/archiva</url> <mirrorof>*</mirrorof> </mirror> </mirrors> or, add <profile/> <activebydefault>true</activebydefault> , add <repositories> / <pluginrepositories> in there. <?xml version="1.0"?> <settings> <profiles> <profile> <id>add-repositories</id> ...

c# - Filling ViewBag from database returns NullReferenceException -

i'm working asp.net mvc 4 , i'm building registering form new members. each member has role (administrator or simple user). i'm trying populate dropdownlist database , i'm doing in controller : [httpget] public actionresult test() { viewbag.roles = context.roles.tolist(); return view(); } however, i'm getting nullreferenceexception error , don't see why. roles table has records don't know why returning null exception. if of code, it's context not initialized. want like: [httpget] public actionresult test() { using (var context = new mydatacontext()) { viewbag.roles = context.roles.tolist(); return view(); } }

javascript - Different version of jquery for Bootstrap and other library files -

i have javascript library supports jquery 1.5 , have front end (bootstrap , other such library) require jquery 1.8. how can use 2 set of jquery different library files? i aware of no-conflict facing problem… i have load jquery 1.5 first (some restriction)… load jquery 1.8 load javascript library require jquery 1.8. call jquery. jquery.noconflict.. code similar: <script src="js/jquery.1.5.js"></script> <script src="js/jquery.1.8.js"></script> //i want bootstrap use v 1.8 <script src="bootstrap.js"></script> <script> var $jq1 = jquery.noconflict(true); </script> //now rest of program should use jquery 1.5 is valid solution?? edit 1: based on reply user3388636 i see library using jquery instead of $....i hope works in case also?? this should work?? <script type="text/javascript" src="js/jquery-1.5.js"></script> <script type="text/javascript...