Posts

Showing posts from July, 2015

javascript - How to show text overflow ellipsis in the middle of the text -

am using kendo grid fixed width. if text more showing ellipsis. can differentiate rows based on end of string. due effect unable find it. so, need ellipsis in middle of text. example: abcdefghijklm abcdefg... -> normal ellipse abcd...klm -> want need type of output one approach follows, though – of course – rely on javascript: function centralellipsis(opts) { // default settings, can overridden // user: var settings = { // number of original characters show: 'maxlength': 7, // character-sequence, or html character- // entity use replace missing characters: 'ellipsis': '…', // attribute you'd write // original text (this function write // text 'title' attribute though): 'writetoattribute': 'data-originaltext' }, // element upon we're working (cached // because we'll access more once): _this...

osx yosemite - django dev on mac having to explicitly name full path -

after long time away app wrote in django , didn't complete, i've come on new mac. i'm struggling code refer apps , files within them without explicit path. instance: from myproject.app.file import object whereas remember not having use myproject every time. is has changed? seem remember being add path in manage.py called every time run dev server, hasn't worked time. sys.path.append /path/to/myproject should fix issue i'm having? i started simple answer , grew more details on how add subdirectories of project python path. maybe bit off-topic, useful i'm pushing post button anyway. i have bunch of small re-usable apps of mine keep inside project tree, because don't want them grow independent modules. projet tree this: manage.py myproject/apps myproject/libs myproject/settings ... still, default, django adds project root python path. yet makes no sense in opinion have apps load modules full path: from myproject.apps.author.mo...

maven - NoClassDefFoundError: org/json/JSONObject - Hadoop MapReduce -

i'm trying mapreduce job using json input. imported json dependency in pom.xml , maven clean install run properly. when run jar in hadoop "noclassdeffounderror: org/json/jsonobject" error on mapper class. (i tried json java external jar, doesn't work. this test mapper class: package com.andrew.hadoopnba.nbajob1; import java.io.ioexception; import org.apache.hadoop.io.intwritable; import org.apache.hadoop.io.text; import org.apache.hadoop.mapreduce.mapper; import org.json.*; public class pointsrankingmapper extends mapper<object, text, text, intwritable> { public void map(object key, text value, context context) throws ioexception, interruptedexception { try { jsonobject jsn = new jsonobject(value.tostring()); system.out.println("printing json " + jsn); } catch (exception e) { // todo auto-generated catch block e.printstacktrace(); } } } and ma...

ios - How to download my object? (issue with optionals in old Xcode version) -

since developed app xcode 6.2, found problems, many solved, one, maybe requires rebuild app again. in code below, filterbyproximity function gives error. suppose matter of optionals (nils ziehn warned me here it). developer told me: "download position object using cache, , make query". well, possible? how can it? here code: import uikit import mapkit import corelocation class mapviewcontroller: uiviewcontroller, cllocationmanagerdelegate { @iboutlet weak var mapview: mkmapview! override func viewdidload() { super.viewdidload() // additional setup after loading view. var locationmanager = cllocationmanager() var lat = locationmanager.location.coordinate.latitude var lon = locationmanager.location.coordinate.longitude let location = cllocationcoordinate2d(latitude: lat, longitude: lon) let span = mkcoordinatespanmake(0.05, 0.05) let region = mkcoordinateregionmake(location, span) ...

spring boot - Accessing Twitter Data - Failed authentication with valid credentials -

i've downloaded code spring's started guide - accessing twitter data https://spring.io/guides/gs/accessing-twitter/ . i set credentials in application.properties , made no other changes. run app, , when attempts connect twitter, fails exception on connectcontroller line 240: resourceaccessexception: org.springframework.web.client.resourceaccessexception: i/o error on post request " https://api.twitter.com/oauth/request_token ":cannot retry due server authentication, in streaming mode; nested exception java.net.httpretryexception: cannot retry due server authentication, in streaming mode i have checked credentials being read app. valid - use them connect application i've written twitter4j, although in case use token , token secret in addition consumer key , consumer secret. any ideas? thanks i had same issue : happened because did not set callback url in twitter setting. just check in twitter app settings callback field se...

c# - DataBinding not working properly -

Image
i made code after deserialization populate datagrid there problem in population. code insert data in datagrid: var leaguetable_object = jsonconvert.deserializeobject<leaguetable.rootobject>(responsetext); foreach (var classifica in leaguetable_object.standing) { league_datagrid.items.add(new leaguetable.classifica(){ name = classifica.position + " " + classifica.teamname}); var name = new datagridtextcolumn(); name.binding = new binding("name"); league_datagrid.columns.add(name); league_datagrid.items.add(new leaguetable.classifica(){ points = classifica.points}); var points = new datagridtextcolumn(); points.binding = new binding("points"); league_datagrid.columns.add(points); league_datagrid.items.add(new leaguetable.classifica(){ playedgames = classifica.playedgames}); var playedgames = new datagridtextcolumn(); playedgames.binding = new binding(...

sorting - Basic Bubble Sort with ArrayList in Java -

i implementing comparator, , wasn't working, thought i'd write basic bubble sort. int[] numbers = { 5, 8, 14, 1, 5678 }; int tempvar; (int = 0; < numbers.length; i++) { for(int j = 0; j < numbers.length; j++) { if(numbers[i] > numbers[j + 1]) { tempvar = numbers [j + 1]; numbers [j + 1]= numbers [i]; numbers [i] = tempvar; } } } (int = 0; < numbers.length; i++) { system.out.println(numbers[i].tostring()); } is tutorial correct @ all? https://blog.udemy.com/bubble-sort-java/ i followed example , applied last names in arraylist, results bit wack. string a; string b; person c; person d; (int i=0; i< list.size(); i++){ for(int j=0; j< list.size()-1; j++){ = list.get(i).getlastname(); b = list.get(j+1).getlastname(); c = list.get(i); d = list.get(j+1); if ( a.compareto(b) < 0 ) { ...

swift - static protocol extensions generates Illegal Instruction compiler error -

i have read on extensions available in swift , wondering if static protocol extensions supported? know instance methods can used in protocol extension . i wanting create protocol repository, along implementation of repository: repository protocol public protocol noterepositoryprotocol { func getallnotes() -> [note] } repository implementation class noterepository : noterepositoryprotocol { func getallnotes() -> [note] { return [note]() } } then in order maintain loose coupling within application, wanted create repository through factory. trying clever , attach static method protocols so: public extension noterepositoryprotocol { public static func createinstance() -> noterepositoryprotocol { return noterepository() } } i know can done if drop static keyword here, wanted static this: func test_note_repository_returns_a_valid_note_repository() { let repository = noterepositoryprotocol.createinstance() } now when ...

excel - How can I embrace the content of all cells in a column with brackets? -

i need embrace cells content { } tool use. how can this? note content not number, string instead try: ="{" & a1 & "}" and dragging down perform formula on of cells need. you can copy values , paste special -> paste values actual text, rather formula.

kendo ui - How to sort alphabetically kendotabStrip after append -

this code var tabstrip = $("#createpackageroomtype ul").kendotabstrip().data("kendotabstrip"); tabstrip.append({ text: $(this).attr('label'), content: $('#createpackageroomtasklist').val() }); tabstrip.select((tabstrip.tabgroup.children("li").length - 1)); tabstrip.tabgroup.children("li.k-state-active").attr("id",$(this).attr('label')+"_"+$(this).attr('value')); tabstrip.tabgroup.children("li.k-state-active").attr("value",$(this).attr('value')); tabstrip.tabgroup.children("li.k-state-active").attr("label",$(this).attr('label'));"checkedcheckbox(\"'$(this).attr('value')'\")" tabstrip.tabgroup.children("li.k-state-active").attr("onclick",'checkedcheckbox(\"'+$(this).attr('value')+'\");'); use function: function sorttabs(tabstripid){ ...

states/regions not loading at checkout for guests or registration in opencart -

im having opencart 1.5.4 installed... there problem users/guests unable register @ checkout because states not being populated based on country... when user registers @ register page works not @ checkout.. below js think populates states in checkout/register.tpl.. <script type="text/javascript"><!-- $('#payment-address select[name=\'country_id\']').bind('change', function() { $.ajax({ url: 'index.php?route=checkout/checkout/country&country_id=' + this.value, datatype: 'json', beforesend: function() { $('#payment-address select[name=\'country_id\']').after('<span class="wait">&nbsp;<img src="catalog/view/theme/default/image/loading.gif" alt="" /></span>'); }, complete: function() { $('.wait').remove(); }, success: function(json) { ...

javascript - How to create subdomain for user in node.js -

i'd share user information @ username.domain.com @ application. subdomain should available after user create account. i have found nice module useful in case: express subdomain how can using module? maybe module isn't useful 1 should use? as mentioned in op comments, using nginx webserver in front of node option, since secure way listen 80 port. can serve static files (scripts, styles, images, fonts, etc.) more efficiently, have multiple sites within single server, nginx. as question, nginx, can listen both example.com , subdomains, , pass subdomain node custom request header ( x-subdomain ). example.com.conf: server { listen *:80; server_name example.com *.example.com; set $subdomain ""; if ($host ~ ^(.*)\.example\.com$) { set $subdomain $1; } location / { proxy_pass http://127.0.0.1:3000; proxy_set_header x-subdomain $subdomain; } } app.js: var express = ...

computer vision - Mapping RGB/hex color codes to general color categories -

is there dataset maps each of ~16m rgb or hex color values general color family/category - e.g. red, purple, orange, beige, brown, etc. - access programmatically or load database or json document cross-refence color codes against? use case classify results of pil color detection of swatch files small set of color pickers shopping site. work if mapping bit more granular, 100-200 categories, since easy enough map target 10-15 myself. have knowledge of knn classification , work if have to, easier use static mapping if 1 exists. you can use table such 1 in x11 http://www.astrouw.edu.pl/~jskowron/colors-x11/rgb.html in order find color proximity, it's best transform colors lab color space first, euclidean distances have more meaning, , nearest neighbor give results.

python 3.x - Uninstalling PyQt5 to install PyQt4 -

i use windows 7 , python 3.4 (32bit). installed pyqt5 , proceeded watching tutorials on how use module. however, tutorial used pyqt4 instead , faced problems. so, decided switch pyqt5 older, pyqt4. installed pyqt5 using windows installers. when proceeded install pyqt4, gives me error message: a copy of pyqt5 python v3.4 installed in c:\python34 , must uninstalled first. after checking documentation, said couldn't have both pyqt4 , pyqt5 installed @ same time, unless built source. i'm not sure how build source on windows after trying(extracting sip, running configure.py; extracting pyqt4, running configure-ng.py/configure.py) still bunch of errors namely: something qmake related import error: no module named sipconfig. i gave trying build source , instead wanted uninstall pyqt5 use pyqt4. deleted sip folder , pyqt4 botched installation first . then, deleted pyqt5 site-packages qt.conf in c:\python34. running binaries pyqt4 still gives me pyqt5 installed error me...

python 2.7 - Alternative to .replace() for replacing multiple substrings in a string -

are there alternatives similar .replace() allow pass more 1 old substring replaced? i have function pass video titles specific characters can removed (because api i'm passing videos has bugs don't allow characters): def videonameexists(vidname): vidname = vidname.encode("utf-8") bugfixvidname = vidname.replace(":", "") search_url ='https://api.brightcove.com/services/library?command=search_videos&video_fields=name&page_number=0&get_item_count=true&token=kwst2fkpmowoidooavkj&any=%22{}%22'.format(bugfixvidname) right now, it's eliminating ":" video titles vidname.replace(":", "") replace "|" when occurs in name string sorted in vidname variable. there alternative .replace() allow me replace more 1 substring @ time? >>> s = "a:b|c" >>> s.translate(none, ":|") 'abc'

regex - Converting tab-delimited text file into HTML/PDF/latex/knitr report -

this tab-delimited file: chr start end ref alt func.refgene gene.refgene genedetail.refgene exonicfunc.refgene aachange.refgene snp138 clinvar_20140929 sift_score sift_pred polyphen2_hdiv_score polyphen2_hdiv_pred polyphen2_hvar_score polyphen2_hvar_pred lrt_score lrt_pred mutationtaster_score mutationtaster_pred mutationassessor_score mutationassessor_pred fathmm_score fathmm_pred radialsvm_score radialsvm_pred lr_score lr_pred vest3_score cadd_raw cadd_phred gerp++_rs phylop46way_placental phylop100way_vertebrate siphy_29way_logodds chr13 52523808 52523808 c t exonic atp7b nonsynonymous snv atp7b:nm_000053:exon12:c.2855g>a:p.r952k,atp7b:nm_001243182:exon13:c.2522g>a:p.r841k rs732774 clinsig=non-pathogenic|non-pathogenic;clndbn=wilson's_disease|not_specified;clnrevstat=single|single;clnacc=rcv000029357.1|rcv000078044.1;clndsdb=genereviews:medgen:omim:orphanet:snomed_ct|.;clndsdbid=nbk1512:c...

php - why the program can't stop after downloaded all the emails? -

Image
there 2465 emails in gmail,why program can't stop after download emails? code1 , code2 run in command line mode. code1: <?php $mailbox = array( 'mailbox' => '{imap.gmail.com:993/imap/ssl}inbox', 'username' => 'xxxx@gmail.com', 'password' => 'yyyy' ); $stream = imap_open($mailbox['mailbox'], $mailbox['username'], $mailbox['password']) or die('cannot connect mailbox: ' . imap_last_error()); $emails = imap_search($stream,"all"); $nums=imap_num_msg($stream); echo $nums; foreach($emails $email_id) { $mime = imap_fetchbody($stream, $email_id, ""); file_put_contents("/tmp/" . "email_{$email_id}.eml", $mime); } imap_close($stream); echo "over"; ?> for code1 : 1.can download emails. 2.output 2465 on console 3.no over output on console. 4.the program can't stop ,it seems run fo...

security - Secure hash and salt for PHP passwords -

it said md5 partially unsafe. taking consideration, i'd know mechanism use password protection. this question, is “double hashing” password less secure hashing once? suggests hashing multiple times may idea, whereas how implement password protection individual files? suggests using salt. i'm using php. want safe , fast password encryption system. hashing password million times may safer, slower. how achieve balance between speed , safety? also, i'd prefer result have constant number of characters. the hashing mechanism must available in php it must safe it can use salt (in case, salts equally good? there way generate salts?) also, should store 2 fields in database (one using md5 , 1 using sha, example)? make safer or unsafer? in case wasn't clear enough, want know hashing function(s) use , how pick salt in order have safe , fast password protection mechanism. related questions don't quite cover question: what's difference between sha , m...

html - Flexbox tile layout with consistent margins and alignment -

Image
how might achieve following layout: with following conditions: the tiles of each row should equal in height highest element in row the last tile in row should flush parent container (no gap) the tiles can different width ratios (3 times one-third or one-third + two-thirds, etc) the ordering of tiles unknown no grid framework modern browsers only and following markup: <div class="tile-wrapper"> <div class="tile-container"> <div class="tile third">1/3</div> <div class="tile third">1/3</div> <div class="tile third">1/3</div> <div class="tile two-thirds">2/3</div> <div class="tile third">1/3</div> <div class="tile sixth">1/6</div> <div class="tile sixth">1/6</div> <div class="tile third">1/3</div> <div class="tile sixth...

Error w/declaration on else statement (C++) -

#include <iostream> using namespace std; // range of numbers, handles input in first number smaller second. int main() { int max = 10; int min = 0; while(cin >> min) { if(min<max) { ++min; cout << "the number inputted in range: " << min << endl; else { cout << "the number inputted not in range: " << max << endl; } } } // end of if. } what's going on? why isn't working? i'm new stack tried posting this, er help? you should end if before start else part : int main() { int max = 10; int min = 0; while(cin >> min){ if(min<max){ ++min; //dont understand why do ! cout << "the number inputted in range: " << min << endl; } // end of if. else{ cout << "the number inputted not in range: " << max << endl; ...

javascript - React Native Change State With Unexpected Logging -

Image
for context, working on react native tutorial the way logs confuses me. following console output when changed empty input field typing "a" "b". here's searchpage class. why console.log('searchstring = ' + this.state.searchstring); show previous value this.state.searchstring ? class searchpage extends component { constructor(props) { super(props); this.state = { searchstring: 'london' }; } onsearchtextchanged(event) { console.log('onsearchtextchanged'); console.log('searchstring = ' + this.state.searchstring + '; input text = ' + event.nativeevent.text ); this.setstate({ searchstring: event.nativeevent.text }); console.log('changed state'); console.log('searchstring = ' + this.state.searchstring); } render () { console.log('searchpage.render'); return ( <view style={styles.container}> <text style = { ...

javascript - How to load info of a function and save it in scope from resolve in a route using AngularJS -

how load info of function , save in scope resolve in route using angularjs? for example: .state('list.employee_list', { url: "/employee_list", templateurl: "views/list/employee_list.html", data: { pagetitle: 'employee list' }, resolve: { "employeescollection" : function(){ alert("load"); $scope.mydata = myfunction($scope); alert("finished load, load view"); } } }) the idea load info of table before loading view, table won't empty. function gets data parse.com edit: config.js .state('list.employee_list', { url: "/employee_list", templateurl: "views/list/employee_list.html", data: { pagetitle: 'employee list' }, controller: employeelistctrl, resolve: {...

database - Return the sum of the count of two seperate tables PL/SQL -

i'm trying search through 2 separate tables count of particular value , return function. function check_parts (p_partno in varchar2) return number out_exists number; sub_exists number; begin select count(*) out_exists outline_pn op op.outline_pn = p_partno union select count(*) sub_pn sp sp.sub_assy_pn = p_partno; -- select (select count(*) out_exists -- outline_pn op -- op.outline_pn = p_partno) out_exists, -- (select count(*) sub_exists -- sub_pn sp -- sp.sub_assy_pn = p_partno) sub_exists return (out_exists + sub_exists); end check_parts; at first naively thought 2 individual count(*) queries work...it didn't. how sum values of 2 separate count queries , return result? any appreciated. if still want have in 1 query, here option create function check_parts (p_partno in varchar2) return number...

javascript - Most suitable pushing technique for specific operation -

i have website in php , i'm trying implement push notification system handles following: 1) data array other website's api 2) check if data exists in own mysql database 3) if of them doesn't, send new notification client including these data 4) else go step 1 i've used ajax comet technique achieve this, wondering if it's going slow when dealing lets 500 users doing requests database. caching way 1 follow then? generally speaking, there better approach problem using comet technique? asking guidance, not specific implementations. thanks lot!

c# - For loop bug in label -

well, simple, creat window form, put in button , label, , give button click event. private void button1_click(object sender, eventargs e) { int xa; int ya; (xa = 647; xa < 982; xa++) (ya = 262; ya < 598; ya++) { label1.text = xa.tostring() + " " + ya.tostring(); } } and program stuck 20 seconds when click button. how can fix this? you've got off of ui thread. try this: private void button1_click(object sender, eventargs e) { threadpool.queueuserworkitem(p => doit()); } private void doit() { int xa; int ya; (xa = 647; xa < 982; xa++) (ya = 262; ya < 598; ya++) { this.invoke(new action(() => { label1.text = xa.tostring() + " " + ya.tostring(); })); } }

python - How can I use sumy.py on the command line? -

after successful installation of sumy.py, i'm trying use command line suggested in sumy 0.3.0 : $ sumy lex-rank --length=10 --url=http://en.wikipedia.org/wiki/automatic_summarization # what's summarisation but i'm getting error: 'sumy' not recognized internal or external command, operable program or batch file. what should exact syntax of command exactly?

iOS BLE Bluetooth - send/receive HEX data -

i creating ios application should connect custom ble device. need ios app send 2 hex commands, 1 enable part of device , request data. is there way in ios send/receive custom hex data, other working services & characteristics? no not possible, reason not ios 'services' , 'characteristics' part of how ble protocol defined. official spec: https://developer.bluetooth.org/technologyoverview/pages/ble.aspx generic attribute profile the latest bluetooth specification uses service-based architecture based on attribute protocol (att). communication in low energy takes place on generic attribute profile (gatt). application or profile uses gatt profile client , server can interact in structured way. the server contains number of attributes, , gatt profile defines how use attribute protocol discover, read, write , obtain indications. these features support service-based architecture. services used defined in profile specificati...

spring - Using static href with query string in Thymeleaf -

i have html prototype of application, prototype on apache server, used apache server side includes include different pages template layouts. now i'm adding labels thymeleaf prototype use in application spring. problem many of urls used need query string load content apache , generates error using thymeleaf. for example, link in static prototype looks this: <a href="index.html?seccion=asignaturas&area=materiales-editar"><i class="fa fa-plus-circle"></i> registrar material</a> adding thymeleaf should like: <a href="index.html?seccion=asignaturas&area=materiales-editar" th:href="@{/asignaturas/{idasignatura}/seccion/{idseccion}/materiales/registro.html(idasignatura=${asignatura.id},idseccion=${asignatura.idseccion},idfuncion=${param.idfuncion},idmodulo=${param.idmodulo})}"><i class="fa fa-plus-circle"></i> registrar material</a> but application crashes, error check...

css - Media queries don't work for Android -

i working phonegap build , cannot android media queries work. have working ios queries android ones not responding. when test in browser works on device after building not. my queries: /* <- 480*/ @media screen , (max-height: 507px){ } /*508 / 530*/ @media screen , (min-height: 508px) , (max-height: 530px){ } /*531 / 567*/ @media screen , (min-height: 531px) , (max-height: 567px){ } /*568 / 600*/ @media screen , (min-height: 568px) , (max-height: 600px){ } /*601 / 650*/ @media screen , (min-height: 601px){ } meta tag <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" /> @matt, not working mean? can describe supposed happen not? also, screen sizes not reported correctly. can check screen size screensize app. app includes links other places can check answers on media queries .

c# - Why is the MathNet.Numerics NuGet package so big? -

i added mathnet.numerics through nuget c# solution. package directory in solution folder ballooned 50 mb! yet can download mathnet dll , use that, takes 1.5 mb. if want documentation well, can include xml, 3.5 mb. am using nuget wrong or expected behavior? seems wasting lot of space. the reason package contains many editions of same version conflict of interests: we support wide range of platforms . we leverage advanced features if available on of platforms (usually on full .net framework, tpl or system.numerics), performance compatibility , usability reasons. avoid downstream dependency nightmares publishing single package per version, including platforms. if causing problems, consider bring point team in discuss.mathdotnet.com (new) or maybe open issue in github. ps: if nuget doesn't work you, provide zip archives can handle manually , pick need.

PHP: Putting a string in alphabetical order -

i'm making website list books, , want artists/authors names in alphabetical order. made php, breaks when there more 2 artists/author... can me? phpfiddle link: http://phpfiddle.org/main/code/se6p-wpw3 code: <?php $artist = "john doe, ami, lolll"; if (strpos($artist,',') !== false) { echo "multiple artists\n"; $artistchar = str_split($artist); $start = 0; $artistnum = 0; ($i = 0; $i < count($artistchar); $i = $i + 1) { //echo ($i)."\n"; //echo ($artistchar[$i])."\n"; if ($artistchar[$i] == ',') { echo "implode\n"; echo ($i)."\n"; echo ($start)."\n"; $stop = $i; echo ($stop)."\n"; $artistnum = $artistnum + 1; ${'artist'.$artistnum} = implode(array_slice($artistchar, $start, $stop)); echo (${'artist'.$artistnum})."\n...

oracle - How do a repeat a query for past 30 days without union 30 times? -

i have query returns value today (sysdate) best way repeat query past 30 days without creating 30 separate queries unioned together? for example here basic query: select sum(duration)/3600 ign_oee_events_d asset_id = 1978 , event_type = 1 , shift = 2 , trunc(event_dt)=trunc(sysdate) what avoid repeating query this: select sum(duration)/3600 ign_oee_events_d asset_id = 1978 , event_type = 1 , shift = 2 , trunc(event_dt)=trunc(sysdate) union select sum(duration)/3600 ign_oee_events_d asset_id = 1978 , event_type = 1 , shift = 2 , trunc(event_dt)=trunc(sysdate)-1 union select sum(duration)/3600 ign_oee_events_d asset_id = 1978 , event_type = 1 , shift = 2 , trunc(event_dt)=trunc(sysdate)-2 union select sum(duration)/3600 ign_oee_events_d asset_id = 1978 , event_type = 1 , shift = 2 , trunc(event_dt)=trunc(sysdate)-3 is there way this? repeat dates event_dt between sysdate , sysdate -30 select sum(duration)/3600 ign_oee_events_d asset_id = 1978 , event_type = 1 , shif...

osx - setting up git/github on a mac: error on reading usr/local/etc/gitconfig -

i set git with git config --global user.name myuser git config --global user.email my@email.com when try commit new repo through github mac error: fatal: unable access '/usr/local/etc/gitconfig': permission denied (128) i have read documentation on github , followed instractions, didn't anywhere. could fix it? git config --global supposed write in $home/gitconfig , global config. double-check $home when typing command, because if /usr/local/etc/gitconfig more of system config file, more owned root.

Why IDEA shows java files as invalid in my Android project? -

Image
i trying build apk this repository. i have problem: idea show .java files invalid, can see on pic: what doing? i download mentioned (git) sources , copy sources directory i open directory idea directory in project settings setting project sdk android 22 , create android module in modules section downloaded sources require android-support-v7-appcompat lib, getting many errors, idea can't find theme in xml to remove error, had added library android-support-v7 in project settings, added module \android-sdk\extras\android\support\v7\appcompat\ modules , set android-support-v7 module dependency main android module i invalidate cache , restart idea after steps got xml's without errors theme (because appcompat library added), java files not looking valid, showed on picture above. also, got red main activity in androidmanifest.xml file , can't go declaration of activity clicking ctrl + lmb on it. you need specify source dir. right click o...

php - MediaWiki footer viewcount -

i'm using mediawiki, wanna show view count on foot. my env: mediawiki 1.25.1 php 5.4.41 mysql 5.5.43 readed offical manual https://www.mediawiki.org/wiki/manual:footer dont know how do. it's say: $wghooks['skintemplateoutputpagebeforeexec'][] = 'lftoslink'; function lftoslink( $sk, &$tpl ) { $tpl->set( 'termsofservice', $sk->footerlink( 'termsofservice', 'termsofservicepage' ) ); $tpl->data['footerlinks']['places'][] = 'termsofservice'; return true; } how change code of lftoslink turn on viewcount? while hit counter removed in mediawiki 1.25, extension:hitcounters available replace core functionality, mark a. hershberger.

SWIFT iOS --- UIApplication.sharedApplication() functions reseting all labels/alphas/hidden properties etc -

i have application has 3 buttons represent various types of "contact me" options. 1 open url safari, 1 open mail application, , 1 call number phone. have multiple elements (labels, textfields, buttons) moved on , off screen @ various times while navigating through app. of these elements have fade in effects, , highly animated. strangely, when navigating through app , tap website button , mail button, of elements either faded out or off screen same view (alpha = 1.0 when should 0) once have either cancelled phone call or cancelled email composition leading me app. of elements on top of each other. more odd opening web page not have same affect , placed correctly on screen , has desired effect. i have no idea going on. uiapplication.sharedapplication().openurl(nsurl(string: "tel://xxxxxxxxxx")!) uiapplication.sharedapplication().openurl(url) var mailmessage:mfmailcomposeviewcontroller = mfmailcomposeviewcontroller() self.presentviewcontroller(mailmessage, ...

java - BasicTomcat authentication failed -

today set windows vm , tomcat server on windows azure. want authentificate on tomcat. open adress http://127.0.0.1:8080/ , internet explorer ask me authentification. in tomcat-user.xml file following user configured: <role rolename="manager-gui"/> <user username="tomcat" password="s3cret" roles="manager-gui"/> but cant authentificate me credentials. authentification dialog appears again. can me problem? have done somenthing wrong? i had restart server after changing .xml files, because tomcat reads files @ launch, not @ runtime.

ios - NSFetchedResultsController swift sections -

i have table view takes data coredata entity 3 fields. firstname: string, lastname: string , done:nsnumber (which uiswitch can turned on or off). i want populate table first , last names first section names having switch on, , second section names having switch off. here code saves data: class viewcontroller: uiviewcontroller { var context = (uiapplication.sharedapplication().delegate as! appdelegate).managedobjectcontext! var newitem: list? = nil @iboutlet weak var txtfirst: uitextfield! @iboutlet weak var txtlast: uitextfield! @iboutlet weak var switchdone: uiswitch! override func viewdidload() { super.viewdidload() } override func didreceivememorywarning() { super.didreceivememorywarning() } @ibaction func canceltapped(sender: anyobject) { dismissvc() } @ibaction func savetapped(sender: anyobject) { let context = self.context let ent = nsentitydescription.entityforname("list", inmanagedobjectcontext: context) let nitem = list(entity: en...