Posts

Showing posts from June, 2012

.htaccess - Trail slash is causing 404 error and improper url behavior: APACHE/ PHP -

hoping 1 of can help. developing using php, without framework, therefore of routing rules in .htaccess opposed .php so here problem. website http://example.com , navigation pretty straight forward, meaning if click 'press' page link go http://example.com/press or http://example.com/press/ both fine. however, if happen go http://example.com/press/ click internal link in nav, such 'about' etc.. not take '/example' rather '/press/example' shows 404 since there not page or directory handle this. i tried 'directoryslash off' in .htaccess did prevent of these pages showing if url has / @ end. i have basic .htaccess setup, see below: <ifmodule mod_rewrite.c> rewriteengine on # options -indexes # gen config # handle errors errordocument 403 /views/errors/404.php errordocument 404 /views/errors/404.php errordocument 303 /views/errors/404.php # url renamin rewriterule ^(about-us|about-us|about-us)/?$ views/about-us.php [l] rew...

android - Change keyboard language programatically -

in application user selects language , want show selected language when keyboard opens (if present in keyboard options). keyboard provides option, should possible. there big work around how - create own keyboard, , you'll have know keyboards you're aiming for. (which exact duplicate of regular keyboard) general guide on subject here & code samples . create custom keyboard view extends keyboardview in create static key value variable like static final int keycode_language_switch_eng = -102; static final int keycode_language_switch_urdu = -103; after in ime class have implemented inputmethodservice, create keyboards inside oninitializeinterface override function. like msymbolskeyboard = new keyboard(this, r.xml.qwerty2); mengqwertykeyboard = new keyboard(this, r.xml.eng_qwerty); after add these final static keys in onkey override function switch cases, , in cases set keyboards accordingly: setkeyboard(mengqwertykeyboard);

haskell - failing cabal install MissingH and network on Windows -

i installed new haskell version: haskellplatform-8.0.1-minimal-x86_64-setup-a, need package missingh, needs package network. cabal install network yields: $ cabal install network resolving dependencies... cabal: entering directory 'c:\cygwin64\tmp\cabal-tmp-6136\network-2.6.2.1' configuring network-2.6.2.1... configure: warning: unrecognized options: --with-compiler checking build system type... x86_64-unknown-cygwin checking host system type... x86_64-unknown-cygwin checking gcc... c:\progra~1\haskel~1\802e01~1.1\mingw\bin\gcc.exe checking whether c compiler works... no configure: error: in `/tmp/cabal-tmp-6136/network-2.6.2.1': configure: error: c compiler cannot create executables see `config.log' more details cabal: leaving directory 'c:\cygwin64\tmp\cabal-tmp-6136\network-2.6.2.1' failed install network-2.6.2.1 cabal.exe: error: packages failed install: network-2.6.2.1 failed during configure step. exception was: exitfailure 77 first, tried start c...

javascript - Removing Mouseovers -

i'm not programmer, know enough by. once in our group made bookmarklet remove mouseovers app use. broke , can't it. looked page want remove mouseovers , found: // disable mouseovers - msie doesn't behave when trigger mouseover before page loaded var olgateok=0; // enable mouseovers once page has loaded event.observe(window, 'load', function() { olgateok=1; }); i believe can use eventblock or prevent, i'm not sure. on top of i'm not sure on how refresh page via bookmarklet or if happens. i'm guessing simple thing prevent mouseovers, don't know enough figure out...any great. edit: sadly website behind firewall can not to. looked , don't think can "code" vendor of app not share. thank looking @ it. i'm going have dig in more , trial , error it... you should use removeeventlistener method - see the mdn documentation

What is the fastest way to log data to a MySQL sever within a PHP script? -

preamble: this post not how use php , mysql, or how write script logs information database. question meant work out best solution logging information on fastest way mysql database using php script! it's micro-improvements. thank you! situation: i've got php script working on server, delivers content fast customers. mysql server available on machine too, weapon of choice. track information requests. therefore, need log information somehow, , think best solution here flat database table information can stored. but need keep time low possible log have @ least no impact on response time, on many simultaneous requests. system has between 100k , 1m requests per day. of them between working hours ( 8 - 18 o'clock ). actual response time ~3-5ms, 1ms mean increase of 20%. the database table i've created flat , has no extras . index on table on id column, primary field auto_increment , because have unique identifier further jobs ( later on more this ). post ,...

javascript - How do I populate a Google Chart (API) with data from HTTP calls? -

i have chart i'm trying populate pulls data our abas erp system via http calls , populates said chart data. idea show monthly revenue each month in previous 3 years (for instance: jan 2014, jan 2015, jan 2016, feb 2014-2016, etc, etc) although @ (it's been couple weeks since worked on project) can have array of objects? function loadarray() { var = 0; var beginning2014months = ["20140101", "20140201", "20140301", "20140401", "20140501", "20140601", "20140701", "20140801", "20140901", "20141001", "20141101", "20141201"]; var closing2014months = ["20140131", "20140228", "20140331", "20140430", "20140531", "20140630", "20140731", "20140831", "20140930", "20141031", "20141130", "20141231"]; var beginning2015months = [...

angularjs - AngualrJs ionic : Error: [ng:areq] Argument 'TeamDetailCtrl' is not a function, got undefined -

i have controller : (function(){ 'use strict'; angular.module('eliteapp').controller('teamdetailctrl',['$stateparams',$ionicpopup,'eliteapi',teamdetailctrl]); function teamdetailctrl($stateparams ,$ionicpopup , eliteapi){ var vm = this; //console.log('$stateparams',$stateparams); //$stateparams using access parameters in link vm.teamid = number($stateparams.id); eliteapi.getleaguedata().then(function(data){ var team = _.chain(data.teams) .flatten("divisionteams") .find({"id":vm.teamid}) .value(); vm.teamname = team.name; vm.games = _.chain(data.games) .filter(isteamingame) .map(function(item){ var isteam1 = (item.team1id === vm.teamid ? true : false); var opponentname = isteam1 ? item.team2 : item.team1; var scoredisplay = getscoredisplay(isteam1 , item.team1scoredisplay...

ruby on rails - How to get records by month -

i have tried several solutions 1 close enough want this sale.all.group("date_trunc('month', created_at)").count but returns this {2016-07-01 00:00:00 utc=>19, 2016-04-01 00:00:00 utc=>70} is there can format? [month,number of sales] ?? using postgres db. try use extract function of postgresql, in rails code results = sale.all.group("extract(month created_at").select("extract(month created_at) month, count(*) count") p results[0].month if results[0]

java - How to read all records from table(> 10 million records) and serve each record as chunk response? -

Image
i try fetch record database using hibernate's scrollable result , reference this github project, tried send each record chunk response. controller: @transactional(readonly=true) public result fetchall() { try { final iterator<string> sourceiterator = summary.fetchall(); response().setheader("content-disposition", "attachment; filename=summary.csv"); source<string, ?> s = source.from(() -> sourceiterator); return ok().chunked(s.via(flow.of(string.class).map(i -> bytestring.fromstring(i+"\n")))).as(http.mimetypes.text); } catch (exception e) { return badrequest(e.getmessage()); } } service: public static iterator<string> fetchall() { statelesssession session = ((session) jpa.em().getdelegate()).getsessionfactory().openstatelesssession(); org.hibernate.query query = session.createquery("select l.id summary l") .setfetchsize(integer.mi...

iis - msdeploy build with TeamCity - ERROR_USER_NOT_ADMIN -

i've got 2012r2 continuous integration server teamcity installed on , webdeploy 3.5. i'm trying deploy build site hosted on server2012r2 using iis 8.5 (it has web deploy 3.5 installed) , getting error message: error code: error_user_not_admin [13:12:26][step 3/3] more information: connected 'myiisserver' using web deployment agent service, not authorize. make sure administrator on 'myiisserver'. learn more at: http://go.microsoft.com/fwlink/?linkid=221672#error_user_not_admin. [13:12:26][step 3/3] error: remote server returned error: (401) unauthorized. as can see error message can connect server can't authenticate credentials i'm specifying. command using: msdeploy -source:package='%packagefile%' -dest:auto,computername='http://%webserver%/msdeployagentservice',username="myiisserver\blibli",password="password",authtype="basic",includeacls='false' -verb:sync -disablelink:apppoolextension -d...

How to extract a specific folder's name in PHP? -

say have this: folder-one/folder-2/folder-3/myfile.php how able find name of "folder-2"? know if use basename(__dir__) 'folder-3' need find folder-2 , folder-one? use dirname basename . if __dir__ 'folder-one/folder-2/folder-3', can use: $dir = basename( dirname( __dir__ ) );

excel - Searching for Value of Date Formula with Find Method (VBA) -

a large program writing @ points needs find date (dd/mm/yyyy format). having trouble finding date, however, when result of date formula (specifically, '=edate(previouscell, 1)') in given cell. if input code, say, "1/1/2016" (as string), expect return first instance of date, created specified date formula in cell of worksheet. dim range range set range = sheet.cells.find(inputteddate, lookat:=xlpart) this fails return such. ideas? please share. thanks!

c# - ASP.NET MVC - Display value for a coded field -

after few years off asp.net, started come back, mvc. suppose have movie class this: public class movie { public int id { get; set; } [stringlength(60, minimumlength = 3)] public string title { get; set; } [display(name = "release date")] [datatype(datatype.date)] [displayformat(dataformatstring = "{0:yyyy-mm-dd}", applyformatineditmode = true)] public datetime releasedate { get; set; } [required] public int genre { get; set; } [range(1, 100)] [datatype(datatype.currency)] public decimal price { get; set; } [regularexpression(@"^[a-z]+[a-za-z''-'\s]*$")] [stringlength(5)] public string rating { get; set; } } i changed field genre in create/edit view user chooses selectbox according following: 1 = action; 2 = adventure; 3 = comedy; 4 = horror; 5 = disaster; 6 = political; 7 = thriller; is there easy way display corresponding "human" value instead of plain integ...

labview - calculate covariance matrix formula -

Image
i trying calculate 3d covariance matrix , use formula: but got different result when use covariance matrix.vi in labview. link .vi file , matrix data include 3 columns x1 ; x2 ; x3 https://www.dropbox.com/sh/du0oj32bwvn583s/aadz7fxoniikhazksqpduye2a?dl=0 could please tell me did wrong , why there difference? so formula used not correct. below correct formula mean , covariance matrix.

f# - How do I copy a discriminated union case value? -

how copy discriminated union case value? the following code has duplication: let move (direction:direction) (checker:checker) = match checker | red xy -> red { xy x=2; y=2 } | black xy -> black { xy x=2; y=2 } specifically, don't want specify type of checker set record value. hence, don't care if checker red or black. copy checker case value , update position. i rather this: let move (direction:direction) (checker:checker) = match checker | _ xy -> _ { xy x=2; y=2 } here's test: [<test>] let ``move checker``() = black { x=1; y=1 } |> move northeast |> should equal (black { x=2; y=2 }) appendix: module test3 open nunit.framework open fsunit type position = { x:int; y:int } type checker = | red of position | black of position type direction = | northeast | northwest | southeast | southwest (* functions *) let move (direction:direction) (checker:checker) = mat...

Comparing array obtained to data from database PHP -

i junior programmer still learning how write code. have array in php //data inside array days name $days = array(); for($date = $from_date; $date <= $to_date; $date->modify('+1 day')) { array_push($days,strtolower($date->format('l'))); } from array, there list days has been selected user (monday,tuesday,etc) then have table in database work_scheme the work_scheme consists of table //field_name => data monday => working day tuesday => working day wednesday => working day thursday => working day friday => working day saturday => half day sunday => off day this working_days array data retrieved database $working_days = array(); if(count($work_scheme) > 0){ foreach($work_scheme $r){ $working_days[0] = array( "monday" => $r['monday'] ); $working_days[1] = array( "tuesday" => $r['tuesday'] ...

c++ - Initialization of a static const variable -

i bit confused following c++ code: #include <iostream> using namespace std; void test(const string& str) { static const char * const c = str.c_str(); cout << c << endl; } int main(int argc, char* argv[]) { test("hello"); test("nooo"); return 0; } since variable c declared static , const , shouldn't initialized once , keep initial value until process completed? according reasoning, expecting following output: hello hello but got: hello nooo can clarify why value of variable c has been modified between 2 function calls though const variable? your program has undefined behavior . when pass "hello" test , temporary std::string object created, , string c constructed (which pointer data of string object). when function call ends, temporary std::string object destroyed, , c becomes dangling pointer. using again undefined behavior. in case, second temporary std::string object...

php - How to get variable value and pass it on to AJAX url -

here code: function download () { var val1 = $('#id').val(); var val2 = $('#user').val(); var url = "includes/downloads.php?id="; $.ajax({ url: url, type: "post", data: { id: val1, user: val2 }, error:function(){ alert('error!'); } }); } the issue want pass " val1 " value url can process on downloads.php page because have multiple items in loop, i'm trying figure out how pass id. reason, keeps passing first item in loop only. this inside loop: echo '<input type="hidden" id="id" value="'.$row['id'].'">'; echo '<input type="hidden" id="user" value="'.$user.'">'; echo '<div class="download" onclick="download()"><a href="'.$row['filename'].'.zip">download</a></div>'; how can that? edit: downloads...

php - By using tablesorter how to specify th td size? -

i using below code <table class="tablesorter custom-popup"><thead><tr> <th class="filter-false" data-sorter="false"></th> <th>host</th><th>status</th><th>place</th> <th>local content</th><th>user</th><th>drive</th> <th>capable</th><th>test</th><th>customer</th><th ">info</th> for columns th info , local conttent has 2 words of data.that time th displaying big.i need restrict specific columns th td size. any solutions appreciable.thanks in advance. to limit column widths, set column size using css do either adding class names each column: html <th class="filter-false narrow" data-sorter="false"></th> <th class="host">host</th> <th class="status">status</th> <!-- ... --> <th...

How to uninstall .NET Core 1.0.0 from mac? -

i installed .net core 1.0.0 on mac microsoft .net core installation site . want uninstall it. not find steps online. please help. there uninstall script mentioned in rc1/rc2 upgrade roadmap document (note haven't tried myself, i'd start): windows on windows, use add/remove programs in control panel remove previous versions of .net core bits. please note have changed name appears in add/remove programs ".net core cli" ".net core sdk"; please use latter search installed versions remove. ubuntu in order make life easier, have created script cleaning versions of .net core machine. can script https://github.com/dotnet/cli/blob/rel/1.0.0/scripts/obtain/uninstall/dotnet-uninstall-debian-packages.sh . please note remove , previous versions, means machine cleaned of .net core bits. script needs elevated privileges, needs run under sudo. os x in order make life easier, have created script cleaning ...

php - Many-To-Many Relationship within a table in Laravel 5.2 -

i'm working laravel first time. have scenario have products table contains details of product (corrugated box) length, breadth, height etc. few products have parent part , many child parts constitute become complete product. both parent , child parts have same properties (i.e. length, breadth, height etc) , every child part can , has treated individual product per requirement. and, have record how many child parts necessary every parent part finished product. ex: 1 parent part + 2 child parts_1 + 1 child parts_2 = 1 finished product. to more specific: 1 master carton + 2 pads + 3 partitions = 1 box. i have created model product , migration products this: php artisan make:model product -m migration looks this: schema::create('products', function (blueprint $table) { $table->increments('id'); $table->string('product_code'); $table->integer('part_type_id'); $table->integer('box_type_id...

multithreading - Priorities are not working in threads in java -

this code snippet. class thread1 extends thread { thread1(string s) { super(s); } public void run() { for(int i=0;i<5;i++) system.out.println(getname()); } } i have created 3 different classes 3 threads. class thread2 extends thread { thread2(string s) { super(s); } public void run() { for(int i=0;i<10;i++) system.out.println(getname()); } } class thread3 extends thread { thread3(string s) { super(s); } public void run() { for(int i=0;i<12;i++) system.out.println(getname()); } } simply trying print name of thread per priority set me. class runthread extends thread { public static void main(string... s) { thread1 t1= new thread1("t1"); thread2 t2= new thread2("t2"); thread3 t3= new thread3("t3"); but threads printing in same random way..as printed when no priority set. t1.setpriority(thread.norm_priority); t2.setpriority(thread.min_priority); t3.setpriority(thread.max_priority); } } ...

Publish and Run an ASP.NET Core 1.0 Application in Production -

on aspnetcore 1.0 application have following on startup: public startup(ihostingenvironment hostingenvironment) { configurationbuilder builder = new configurationbuilder(); builder .setbasepath(hostingenvironment.contentrootpath) .addjsonfile("settings.json", false, true) .addjsonfile($"settings.{hostingenvironment.environmentname}.json", false, true); builder.addenvironmentvariables(); configuration = builder.build(); } i have 2 settings files on project: settings.json settings.production.json i published project using command line: set aspnetcore_environment=production dotnet publish --configuration release the published files include settings.json not settings.production.json . , settings.json include properties in settings.production.json . shouldn't merged on publish? in top of how make sure application runs on production mode when copy files server? do need on web.config ? you need update project.json...

NZEC error in python code-codechef -

i'm new python.i have been getting nzec run time error code in codechef. changed input() raw_input().can explain me why code getting nzec error def function1(list1,sum): if len(list1)==1: return sum m=min(list1) i=list1.index(m) if list1.count(m)>1: sum+=list1.count(m) else: sum+=1 list1=list1[:i] return function1(list1,sum) t=int(raw_input()) global list1 global sum while t>0: n=int(raw_input()) sum=0 list1=list() list1[1:n]=raw_input().split() m=min(list1) i=list1.index(m) if i==0: if list1.count(m)>1: sum+=list1.count(m) else: sum+=1 print(sum) else: k=function1(list1,sum) k+=1 print(k) t-=1

json - How best to send complex data with FCM / GCM using Go -

both fcm , gcm documentation give structure of data payload map[string]string (although google's gcm package implements @ map[string]interface{}) however, there many cases simple flat key:value structure doesn't meet needs of application. examples when slice of values needed, or when non-trivial struct needs sent. what cleanest way of sending more complicated data structures map[string]string? conclusion: have marked answer fl0cke correct given provides solution sending complex data fcm / gcm using go. however, clear fcm documentation, intention data key:value string pairs moving forward, , sure nothing gets broken in future, sticking simple key:value string pairs. according this answer, possible send nested data fcm/gcm. that, can write own fcm client or fork google's implementation , change type definition of data from type data map[string]interface{} to type data interface{} and plug in type json serializable (e.g. nested structs). ...

MS Access 2010 Object Passing Value instead of Reference ... Sometimes -

i have small bit of code larger ms access database likes behave erratically. can't sure, seems change when compile or recompile database. here's code: private sub findctls() dim dattype string dim thisctl control dattype = right(activecontrol.name, len(activecontrol.name)-4) each thisctl in me.controls if instr(1, thisctl.name, dattype, 2) > 0 select case left(thisctl.name,4) case "sel_" set tgtctls(0) = thisctl ' buncha other cases end select end if next thisctl end sub the problem is, when step through code, reason thisctl being passed value of control, not control itself. i've looked everywhere answer, brought me using "set" command instead of putting tgtctls(0) = thisctl. worked until decompiled db , recompiled it. made 1 change (changed name of first variable), compiled again, , worked. got work today, told me no longer working. ideas appreciated. edit: forgot mention tgtctls form-wide ar...

c# - What is a NullReferenceException, and how do I fix it? -

i have code , when executes, throws nullreferenceexception , saying: object reference not set instance of object. what mean, , can fix error? what cause? bottom line you trying use null (or nothing in vb.net). means either set null , or never set @ all. like else, null gets passed around. if null in method "a", method "b" passed null to method "a". the rest of article goes more detail , shows mistakes many programmers make can lead nullreferenceexception . more specifically the runtime throwing nullreferenceexception always means same thing: trying use reference, , reference not initialized (or once initialized, no longer initialized). this means reference null , , cannot access members (such methods) through null reference. simplest case: string foo = null; foo.toupper(); this throw nullreferenceexception @ second line because can't call instance method toupper() on string reference pointing null ....

c# - ITrextSharp using multiple font styles together. ie Bold, Underlined, italic... etc -

Image
i attempting use itextsharp.dll (not sure version) write dynamic pdf. going great until needed write phrase bold , underlined. appears itextsharp's font class not allow this. allows bold/italic, not bold/underline, italic/ underline, or three. cannot combine underlined other style. seems rather silly not allow font both underlined , else. have looked everywhere , see nothing mentions it. know way around or missing obvious here? i build font so. itextsharp.text.font myfont = new font(itextsharp.text.font.fontfamily.times_roman, 9, itextsharp.text.font.bolditalic, basecolor.black); you can see 3rd parameter integer signifying fontstyle font, there no enums available make underlined , bold ,underlined , italic, or three. there has way this. find hard believe itextsharp not account underlined , bold text. ideas? if @ definition bolditalic you'll see: public const int bolditalic = bold | italic; this shows how combine these styles using bitwise | ...

css - HTML5 Meter Styling in Chrome -

i want style password strength meter implemented via . works fine in firefox, not in chrome. here relevant css, taken github project css file : meter { /* reset default appearance */ -webkit-appearance: none; -moz-appearance: none; appearance: none; margin: 0 auto 1em; width: 100%; height: .5em; /* applicable firefox */ background: none; background-color: rgba(0,0,0,0.1); } meter::-webkit-meter-bar { background: none; background-color: rgba(0,0,0,0.1); } meter[value="0"]::-webkit-meter-optimum-value, meter[value="1"]::-webkit-meter-optimum-value { background: red; } meter[value="2"]::-webkit-meter-optimum-value { background: yellow; } meter[value="3"]::-webkit-meter-optimum-value { background: orange; } meter[value="4"]::-webkit-meter-optimum-value { background: green; } meter[value="1"]::-moz-meter-bar, meter[value="1"]::-moz-meter-bar { backgro...

split - How to take comma as text in comma separated text in python -

hi i'm new python , wanted know how enter comma text in comma separated string in python for eg text=raw_input("enter symbols").split(",") input: a, b, c, d, e,",",f output: ["a","b","c","d",",","f"] the problem here split statement, literally matches delimiter ( , in case). doing takes proper parsing, e.g. using csv module import csv text = raw_input("enter symbols:") reader = csv.reader([text], delimiter=',') symbols = next(reader) print(symbols) update: when scanning symbols, doubles , "" not valid. for instance, a,a,b,,"," give ['a', 'a', 'b', '', ','] so extension cleans symbols well: import csv text = raw_input("enter symbols:") reader = csv.reader([text], delimiter=',') symbols = set(data data in next(reader) if data) print(symbols) note: outpu...

visual studio - Enabling realtime HTML validation in VS Code and Atom -

yes, there numerous guideline violations in question. having hard time finding out how in either. have expected built-in, in vs studio; if tag isn't closed, curly underscore appears warning. incidentally js , css code seems natively validated in both code , atom. why not html? let down-voting begin! ps: notepad++ complains when tag isn't closed.. for visual studio code, can use htmlhint extension, integrates htmlhint static analysis tool vscode.

How to split a String containing multiple groups of string into Sets of Set in Java -

i have string contains multiple groups of string, each group wrapped in brackets {}. each group separated comma , each string group separated comma. format like: {abc, def}, {006, xy, 036}, {......} what want put each group hashset, , hashset contains sets, like: set 1: abc def set 2: 006 xy 036 ..... set n: allsets --> set1, set2, set...., setn. what can think of iterate each char in original string , add set(s). wonder if there other ways it, or if java has apis can accomplish this. lot! string str="{abc, def}, {006, xy, 036}"; pattern p = pattern.compile("\\{(.*?)\\}"); matcher m = p.matcher(str); while (m.find()) { system.out.println(m.group(1)); } it give values abc, def 006, xy, 036 now can go ahead , add accordingly string array or map, hack around.

javascript - Getting logout after refresh of page -

i have asp.net application communicates api. i have problem authentication - works fine. logged in, when refresh page logged out. i not sure code loggin. have idea how better? need authorize against rest api. this login form: @using (ajax.beginform("loginuser", "api/user", new ajaxoptions { httpmethod = "get", oncomplete = "onlogincompleted", loadingelementid = "loadingimage" })) { <fieldset class="login-form-box"> <table> <tr> <td class="login-label-box">@html.label("username")</td> <td class="login-label-box">@html.label("password")</td> <td></td> </tr> <tr> <td >@html.textbox("username", null, new {@class = "login-inout"})</td> <td>@html.pas...

ios - Watch Networking Broken In Xcode 8 Beta 3 -

i'm receiving following error when sending kind of http request watchkit extension: watchkit extension[6128:479936] [wc] __33-[wcxpcmanager onqueue_reconnect]_block_invoke error reconnecting daemon due nsxpcconnectioninterrupted the message attempted sent if session reachable, @ point. when inspect session object can see while reachable true , activationstate 2 (wcsessionactivationstateactivated), other properties such paired , watchappinstalled false. in fact, error repeatedly sent multiple times second while i'm using app in simulator or device. i'm not sure what's going on started receiving error when using xcode 8 beta 3. app delegate: func session(_ session: wcsession, activationdidcompletewith activationstate: wcsessionactivationstate, error: nserror?) { if activationstate == wcsessionactivationstate.activated { nslog("activated") } if activationstate == wcsessionactivationstate.inactive { nslog("inactive...

ubuntu - Eclipse error 'UseStringDeduplication' -

i installed fresh ubuntu 16.04 vm, oracle jdk 7, , downloaded latest eclipse. getting error when try start eclipse: unrecognized vm option 'usestringdeduplication' error: not create java virtual machine. error: fatal exception has occurred. program exit. gtk-message: gtkdialog mapped without transient parent. discouraged. why getting error on fresh install? , bad idea remove vm option? latest version of eclipse (neon) requires java 8 runtime , , eclipse website obnoxiously neglects mention anywhere homepage download link eclipse, not version warning @ runtime eclipse.

ios - Performance issues while parsing dates -

i having performance issues in ios app while transforming dates come in 2013-12-19 00:00:00.000000 format medium style date (dec 25, 2014) , double value (epoch). according xcode profiler 2 functions process (bellow) taking approximately 60% of execution time i know how improve code or if there more efficient way need. static func getmediumdate(datestring: string) -> (nsstring)? { // the: yyyy-mm-dd let shordate = datestring[datestring.startindex..<datestring.startindex.advancedby(10)] let dateformatter = nsdateformatter() dateformatter.locale = nslocale(localeidentifier: "en_us") dateformatter.dateformat = "yyyy-mm-dd" let stringformatter = nsdateformatter() stringformatter.locale = nslocale(localeidentifier: "en_us") stringformatter.dateformat = "yyyy-mm-dd" stringformatter.datestyle = .mediumstyle let newdate = dateformatter.datefromstring(shordate) if (newdate != nil){ r...

python - Flatten nested pandas dataframe -

Image
i'm wondering how flatten nested pandas dataframe demonstrated in picture attached. the nested attribute given 'data' field. in short: have list of participants (denoted 'participant_id') , submitted responses ('data') @ different times. need create wide dataframe, each participant @ each time stamp there row of records of data ('q1', 'q2',...,'summary') many in advance! try this: pd.concat([df.data.apply(pd.series), df.drop('data', axis=1)], axis=1)

datastax - Cassandra performance issue -

we have table looks like: create table arc_dynamic.transit_map ( sal text, pfn text, transit_map_id text, create_program_id text, create_timestamp timestamp, cutoff_times map<text, text>, derived_priority int, effective_date text, modify_program_id text, modify_timestamp timestamp, relationship_type_id text, solr_query text, stop set<text>, transit_days map<text, int>, trigger_id text, primary key (sal, pfn, transit_map_id) ) clustering order (pfn asc, transit_map_id asc) , bloom_filter_fp_chance = 0.01 , caching = '{"keys":"all", "rows_per_partition":"none"}' , comment = '' , compaction = {'class': 'org.apache.cassandra.db.compaction.sizetieredcompactionstrategy'} , compression = {'sstable_compression': 'org.apache.cassandra.io.compress.lz4compressor'} , dclocal_read_repair_chance = 0.1 ...