Posts

Showing posts from February, 2014

c++ - Using Cmake, how do I prevent library sources from being included in my IDE? -

Image
using bunch of different libraries in project (from github sources, not precompiled), add them target in root cmakelists.txt file: add_subdirectory(lib/glew-1.13.0/build/cmake) include_directories(system ${project_source_dir}/lib/glew-1.13.0/include/) ... target_link_libraries(myapp glew ${glew_libraries} ... ) however, can see screenshot below xcode includes of sources libraries in project, makes insanely long list have scroll through find my code. i have tried exclude_from_all flag in add_subdirectory command, removes library sources xcode project, cannot compile project because xcode doesn't compile library @ all. additionally, xcode gives me tons of warnings libraries don't care about. using system flag include_directories command doesn't fix it. what's best way solve this? should compiling libraries separate part of build process rather compiling them executable? i'm not sure how work, try this: turn on use_folders in root cm...

iis - Enable cross site access in OK Hosting? -

i'm trying download bootsrap fonts container have in site hosted ok hosting. can download font manually when using in css on page hosted in server, fails because cross site access disabled. i know ok hosting uses iis give web based control panel. how enable cross site access? ok, have add file called web.config @ root of site following: <?xml version="1.0" encoding="utf-8"?> <configuration> <system.webserver> <httpprotocol> <customheaders> <add name="access-control-allow-origin" value="*" /> </customheaders> </httpprotocol> </system.webserver> </configuration>

javascript - Why my numbers are not updating by themselves? -

so, using jquery-calx calculate price of items. have different price depending on base choise , quantity. if user chooses 100 peaces of full color base price different 100 pieces of 1 side monochromatic pattern. working in code, there thing; if choose 1 side monochromatic , them 100 pieces, price in total area ok, if change base full color, example, price doesn't update. in case, if click again in quantity price update. know if possible make update smoothly. maybe create button update, don't know. appreciate help! below follows code: <form class="form-horizontal" id="meishi" data-calx-identifier="calx1452836013763"> <div class="form-group"> <label class="col-lg-1 topic text-left">base</label> <div class="col-lg-2"> <label class="radio-inline"> <input type="radio" name="design" data-cell="a1" value="10800...

c++ - QT - No default version found Visual Studio 2015 -

Image
this question has answer here: how fix qt vs add-in qt 5.6 beta , vs2015? 1 answer i have problem qt in visual studio 2015. open qt project, when press on file.ui, recive following error:no default qt version found, if have path setted correctly. can me, please? since working in visual environment, kindly download qt installer: http://caesar.ftp.acc.umu.se/mirror/qt.io/qtproject/archive/qt/5.9/5.9.0/qt- moreover, must have installed qt visual studio extension. environment visual studio 2015, vstoolqt extension located on menu navigated directory qt installed, navigate c:\qt\qt5.9.0\5.9\msvc2015_64. it solve issue.

xml - Android - DataBinding with Preference activity -

i set data binding in xml when go preference activity set binding cant. file data binding xml in called preference.xml assume there should generated class called preferencesbinding instead there not. should not auto generated ? code in preferenceactivity.java wont compile following: override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); preferencesbinding binding = databindingutil..... //what put here ??? preferenceactivity not activity admin user = new admin(true); binding.setuser(user);//this want addpreferencesfromresource(r.xml.preferences);//this not necessary if can databinding work //..rest of code not important } i starting think data binding not work preference screens, can ? the preferences.xml file if neseccary looks this: <?xml version="1.0" encoding="utf-8"?> <layout xmlns:android="http://schemas.android.com/apk/res/andr...

hadoop - how to set spark RDD StorageLevel in hive on spark? -

in hive on spark job , error : org.apache.spark.shuffle.metadatafetchfailedexception: missing output location shuffle 0 thanks answer ( why spark jobs fail org.apache.spark.shuffle.metadatafetchfailedexception: missing output location shuffle 0 in speculation mode? ) , know may hiveonspark job has same problem since hive translates sql hiveonspark job, don't how set in hive make hiveonspark job change storagelevel.memory_only storagelevel.memory_and_disk ? thanks help~~~~ you can use cache/uncache [lazy] table <table_name> manage caching. more details . if using dataframe's can use persist(...) specify storagelevel. @ api here. . in addition setting storage level, can optimize other things well. sparksql uses different caching mechanism called columnar storage more efficient way of caching data (as sparksql schema aware). there different set of config properties can tuned manage caching described in detail here (this latest version documentation....

php - Trying to setup LAMPy -

i new using (ubuntu) linux platform web design, , attempting install lamp allow me view work locally. have installed - running few problems , not know route take since newish linux well. i trying access phpmyadmin via http://localhost first of problems popped up. don't know login , password should - didn't setup during installation of lamp server. after testing few different probable account/password combinations see gives me error message saying "#1045 can't log in mysql server" so, opened terminal see if mysql running, , error 1045 (28000) access denied user 'root'@'localhost' (bla bla bla) you should try username root , no password. by default mysql installed username root , blank password the password set password in versions. if still not able login please share installation procedure lamp stack.

ios - How to set AutoLayout constraint of UIimageView with UIButton? -

Image
this tree include cicle uiimageview's image, text in circle uibutton. when device changed, iphone5 change iphone6 plus, image scale big. button move circle's outside. how solve problem? autolayout has feature called propotion. means selecting 2 ui objects can set propotion between them constraint such width, height, etc.. in tour case select imageview , button move constraints view, double click on objects width constraint i.e either button width or image width. there can find option called propotion. per requirement want have button inside image view, means buttom propotion should less imageview propotion. can set 2:3, means button width 2/3rd part of imageview. button part of imageview irrespective of device run.

database - MapReduce: How to join 2 tables: R(a,b) x S(c,d) where b<c -

given in each record, have table_name(r/s) | attribute_1(a/c) | attribute_2(b/d) . . . for example can content of input file: r|$a_1$|$b_1$ r|$a_2$|$b_2$ s|$c_1$|$d_1$ r|$a_3$|$b_3$ s|$c_2$|$d_2$ an output lines of: $a_i$|$b_i$|$c_j$|$d_j$ ,where $b_i < c_j$ (this exercise in book "mining of massive datasets". on page 22 of link: http://infolab.stanford.edu/~ullman/mmds/ch2.pdf (exercise 2.3.5). book freely available) i've spend half day , on internet , still have no clue how solve it...

java - how to sort String array Number and bind in array list in android -

list<string> list2 =new arraylist<string>(); int iarr[] = new int[ja.length()];//{"846001","846005","846000","846002","846009"} arrays.sort(iarr); (int = 0; < ja.length(); i++) { _jobject = ja.getjsonobject(i); iarr[i] = integer.parseint(_jobject.getstring("pincode")); } for(int k=0;k<iarr.length;k++) { list2.add(string.valueof(iarr[k])); } i want sort , bind in array list. want {"846000", "846001", "846002" ,"846005", "846009"} but not sorting according given logic please suggest me doing wrong. i think issue sorting array before manipulating it. should move arrays.sort(iarr) after for loop. list<string> list2 =new arraylist<string>(); int iarr[] = new int[ja.length()];//{"846001","846005","846000","846002","846009"} (int = 0; < ja.length(); ...

unix - Moving all matching files containing spaces and appended different text with wildcards in bash -

i have directory generates report daily , i'm writing script move old report trash , rename before generating next report. e.g. directory file report - sat 16-01-2016.txt as files generated same constant 'file\ report - ' e.g. file report - tue 12-01-2016.txt file report - wed 13-01-2016.txt file report - thur 14-01-2016.txt file report - fri 15-01-2016.txt i thought use bash code e.g. mv -f ~/desktop/file\ report\*.txt ~/.trash/"old file report".txt however add word "old" front of file whilst keeping whatever day , date comes after. e.g. file report - tue 12-01-2016.txt would become old file report - tue 12-01-2016.txt i thought use variable , store file name in it. i'm not sure how code this. old=$(echo ~/desktop/'file report - '*.txt) mv -f ~/desktop/file\ report\*.txt ~/.trash/"old "$old.txt i know wrong syntax. i'm reading few of man pages including find see if better grabbing file name store ...

Python splinter. How to select dropdown list which doesn't have name in option section -

i try select "local host" dropdown list has following html code: <select id="server_select"> <option></option> <option> local host </option> <option> ah005 </option> </select> here python code use splinter module select ah005 dropdown list failed. server_list = browser.find_by_xpath('//select[@id="server_select"]//option[@selected="local host"]').first server_list.click() and got error: traceback (most recent call last): file "splinter_test.py", line 22, in <module> server_list = browser.find_by_xpath('//select[@id="server_select"]//option[@selected="local host"]').first file "/users/bibo_mbpr/anaconda/lib/python2.7/site-packages/splinter/element_list.py", line 53, in first return self[0] file "/users/bibo_mbpr/anaconda/lib/python2.7/site-packages/splinter/element_list...

css - html on tumblr div height not behaving -

Image
i've got html css, in fact: <html> <head> <title>{title}</title> </head> <style> html { background-image: url('http://i.imgur.com/9svrabs.jpg'); -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; } header { width: 100%; height: 100%; position: relative; background-image: url('http://i.imgur.com/5rvc2sw.png'); } h1 { font-family: 'montserrat', 'helvetica neue', "arial", sans-serif; } #title { margin: auto; display: inline-block; width: 100%; text-align: center; } #navigation { display: inline-block; } </style> <body> <header> <div id='navigation'> <a href='/art'>art</a><br><br> <a href='/music'>music</a> ...

c - Visual Studio 2015 shows Debug Assertion Failed -

i have made simple file reading program runs in dev c gcc compiler, shows error debug assertion failed . searched , has asked same question 12 days ago, answer shows error on statement if (file = fopen (name, "w+") == null) { ... } and says separate 2 statements as file = fopen(name, "w+"); if (fp == null) { ...} my code #include<stdio.h> #include<conio.h> #include<stdlib.h> int main() { int nos = 0, noc = 0, nol = 0; char ch; file *fp; fp = fopen("sarju.txt", "r"); while (1) { ch = fgetc(fp); if (ch == null) { printf("the file didn't opened\n"); break; } if (ch == eof) break; noc++; if (ch == ' ') nos++; if (ch == '\n') nol++; } if (ch != null) fclose(fp); printf("number of space : %d\nnumber of charact...

javascript - How to replace undefined values with empty string in an array object? -

array object: var jsonlist= { "list": [{ "column_name": "control_master_id", "referenced_column_name": "control_master_id", "referenced_table_name": "tbi_controls_master", "table_name": "tbi_widget_controls" }, { "column_name": "authorization_id", "referenced_column_name": "authorization_id", "referenced_table_name": "tbi_authorization_master", "table_name": "tbi_controls_master" }, { "column_name": undefined, "referenced_column_name": undefined, "referenced_table_name": undefined, "table_name": "tbi_widget_controls " }] } expected solution: var jsonlist={ "list": [{ ...

swift - how to fix this dictionaryValue -

alamofire.request(.get, "https://maps.googleapis.com/maps/api/place/details/json", parameters:["placeid": x , "key":"aizasyaasdaxw-j8diggjy58_hdrasdaqqa"]) .responsejson { (responsedata) -> void in //debugprint(responsedata) switch responsedata.result{ case .success(let req): let response = json(req) let items = response["result"]["geometry"]["location"].dictionaryvalue let lat: double = double(items["lat"]!.doublevalue) let lng: double = double(items["lng"]!.doublevalue) print(lat,lng) item in items{ self.mapresult.append(mapmodel(json:item)) // *this error cannot convert value of type '(string:json)' expected argument type 'j...

c++ - Stream while serializing with Cap'n'Proto -

consider cap'n'proto schema this: struct document { header @0 : header; records @1 :list(record); // large number of records. footer @2 :footer; } struct header { numberofrecords : uint32; /* fields */ }; struct footer { /* fields */ }; struct record { type : uint32; desc : text; /* more fields, relatively large in total */ } now want serialize (i.e. build) document instance , stream remote destination. since document large don't want build in memory before sending it. instead looking builder directly sends struct struct on wire. such additional needed memory buffer constant (i.e. o(max(sizeof(header), sizeof(record), sizeof(footer))). looking @ tutorial material don't find such builder. mallocmessagebuilder seems create in memory first (then call writemessagetofd on it). does cap'n'proto api support such use-case? or cap'n'proto more meant used messages fit memory before sending? in example, document struct omitted , 1...

c++ - How to link an unreferenced variable in a separate cpp file in a static lib? -

here class definition below in "init. cpp ": //-------------------init.cpp----------------- // ... class cnetinit { public: cnetinit(){::wsastartup();} ~cnetinit() {...} }; static cnetinit s_initor; // ... //--------------------------------------------- i added cpp static library , , reference lib project, cnetinit's constructor can never executed because no there no reference cpp. how can make work without adding useless reference cpp importing unit? comment: infact sample, code compiled in xcode , gcc, there standard or non-standard way(like compiler options) this? you must compile file , link output other object files. way adding variable defined in application.

Is there an Windows 8 API that we can leverage to read barcodes? -

i looking html/javascript sample can use on windows 8 app read barcodes. there couple apps can read barcodes in store. however, must using c# because not able find sample uses html/javascript able read barcodes. know barcodes have specific requirements, looking sample here. does know can find simple sample? thank reading. yes - zxing open source library reading 1d , 2d barcodes. there few ports including 1 winrt can found here: http://zxingnet.codeplex.com/ . should able reference in application component , call winjs.

cmake - cmake_current_source_dir used as avariable -

please check below scenerio : cmakelists_1.txt set( variable_name ${cmake_current_source_dir}/sub_folder1 ${cmake_current_source_dir}/sub_folder2 ) cmakelists_2.txt include_directories( ${variable_name} ) now when cmakelists_2 executes doesn't include files present in sub_folders. works if give absolute path sub_folders in cmakelists_1. please point me if missing something. cmake_current_source_dir current source directory cmakelists.txt mentions lives. expands different depending on directory used from. expanding you, , how different hard-coded path works? once see difference you'll know how fix it, in both files this: message(${variable_name}) then re-run cmake , see prints.

magento - mysql drop statement with -- -

what difference between drop table , --drop table in mysql for example: i'm getting error if use -- in other places of magento using -- before drop. --drop table if exists {$this->gettable('faq/dinkchika')}; create table if not exists {$this->gettable('faq/dinkchika')} ( `faq_id` int(11) not null auto_increment, `faq_question` varchar(255) default null, `faq_answer` varchar(255) default null, primary key (`faq_id`) ) engine=innodb default charset=utf8; "); use white space after -- ,if not using whitespace after -- not count comment.after whitespace query this. -- drop table if exists {$this->gettable('faq/dinkchika')}; create table if not exists {$this->gettable('faq/dinkchika')} ( `faq_id` int(11) not null auto_increment, `faq_question` varchar(255) default null, `faq_answer` varchar(255) default null, primary key (`faq_id`) ) engine=innodb default charset=utf8; "); or may use #(hash) , tr...

java - How to create my own custom Dropwizard bundle? -

in documentation there short note bundles : a dropwizard bundle reusable group of functionality, used define blocks of application’s behavior. and that's all. know there's interface called bundle, configuredbundle , managedbundle, there's neither example nor tutorial how use these interfaces. can show example? possible duplicate of looking dropwizard bundles addons dropwizard make easy add small pieces of functionality. example, if use assets bundle, can attach ui api testing purposes , run on same port , easy use. example migrations bundle ties liquibase dropwizard can run database migrations same jar. works since api accessing sql database has connection parameters defined in yml file, migrations able run on same database. i highly suggest looking this git repository, there 2 or 3 examples there might give better idea on dropwizard bundles are.

c++ - llvm function pass ReplaceInstWithInst malloc -

#include "llvm/pass.h" #include "llvm/ir/module.h" #include "llvm/ir/function.h" #include "llvm/support/raw_ostream.h" #include "llvm/ir/legacypassmanager.h" #include "llvm/ir/instrtypes.h" #include "llvm/transforms/ipo/passmanagerbuilder.h" #include "llvm/ir/irbuilder.h" #include "llvm/transforms/utils/basicblockutils.h" using namespace llvm; namespace { struct replacepass : public functionpass { static char id; replacepass() : functionpass(id) {} virtual bool runonfunction(function &f) { allocainst* insttoreplace = ??? basicblock::iterator ii(insttoreplace); replaceinstwithinst(insttoreplace->getparent()->getinstlist(), ii, new allocainst(type::int32ty, 0, insttoreplace)); return true; } }; } char replacepass::id = 0; static void registerreplacepass(const passmanagerbuilder &, legacy::passmanagerbase &pm) { pm.add(new re...

Concatenating strings in HAProxy -

i'd have throttling rule in haproxy limits rate @ user can load particular path, don't know of way concatenate strings in haproxy (at least, in context of generating key stick table). i'd is tcp-request content track-sc1 concat(req.cook(user), path) tcp-request content reject if {sc1_http_req_rate gt 10} haproxy manipulate string prior map lookup suggests using regsub similar, think can constant manipulations that. the best i've come far track path , req.cook(user) separately, , reject if each of them high, isn't actual behavior i'm looking for.

java - ComboBox cannot be cast to TextField? -

i have arraylist of javafx.scene.control.control (arraylist) 2 different underclasses of control(combobox, textfield). so want update list new input (example) in both of them. but when try it, eclipse makes error this: exception in thread "javafx application thread" java.lang.classcastexception: javafx.scene.control.combobox cannot cast javafx.scene.control.textfield @ application.documentbuildup.aktualisiereliste(documentbuildup.java:34) @ application.mainstage$2.handle(mainstage.java:99) @ application.mainstage$2.handle(mainstage.java:1) @ com.sun.javafx.event.compositeeventhandler.dispatchbubblingevent(unknown source) @ com.sun.javafx.event.eventhandlermanager.dispatchbubblingevent(unknown source) @ com.sun.javafx.event.eventhandlermanager.dispatchbubblingevent(unknown source) @ com.sun.javafx.event.compositeeventdispatcher.dispatchbubblingevent(unknown source) @ com.sun.javafx.event.basiceventdispatcher.dispatchevent(unknown sour...

android - Can't get search function to list out serach result -

this database store information display on the list. public class databasehandler extends sqliteopenhelper { // static variables // database version private static final int database_version = 1; // database name private static final string database_name = "imagedb"; private static final string tag = "databasehandler"; // contacts table name private static final string table_contacts = "contacts"; // contacts table columns names public static final string key_id = "id"; public static final string key_name = "name"; public static final string key_price = "price"; public static final string key_image = "image"; public static final string key_search = "searchdata"; public databasehandler(context context) { super(context, database_name, null, database_version); } // creating tables @override public void oncreate(sqlitedatabase db) { string create_contacts_table = "create table "...

javascript - How to reference one <td> from another <td> within the same <tr> in JQuery? -

i have html table following structure: <tr> <td>123</td> <td ondblclick="makeeditable(this);">this text</td> <td><span ondblclick="makeeditable(this);">this more text</span><span>flag</span></td> </tr> i writing jquery snippet make second <td> , first <span> in third <td> user-editable double-click (for it's worth, table being generated dynamically): function makeeditable(cell){ var originalcontent = $(cell).text(); $(cell).html("<input id='editcell' class='input' type='text' value='" + originalcontent + "' />"); $(cell).children().first().focus(); $(cell).children().first().keypress(function (e) { if (e.which == 13) { var newcontent = $(this).val(); $(this).parent().text(newcontent); } }); $(cell).children().first().blur(function()...

python - why gui made with glade not showing persian words properly? -

i want show data sqlite3 db python gui made pygtk , glade. the problem persian words glade , sqlite db both in irregular form. idea? app gui (all words in persian) solved.i solved problem uninstalling python27 , modules, restarting windows , installing them again.

python-3.5, timestamp to YYYYmmDDHHMMSS -

hello every saturday workers! need convert timestamp yyyymmddhhmmss. following works well timestamp=now_var[27:38] # timestamp string dth_now=( # string date heure datetime.datetime.fromtimestamp( int(timestamp) ).strftime('%y%m%d_%h%m%s') ) # string but gives alert file "c:\_python\kwh_compare.py", line 35, in <module> ).strftime('%y%m%d_%h%m%s') valueerror: invalid literal int() base 10: '' where problem ? thanks don't know api, "fromtimestamp" needs string instead of int? otherwise try splitting in several operations timestamp=now_var[27:38] inttimestamp=int(timestamp) datetimestamp=datetime.datetime.fromtimestamp(inttimestamp) dth_now=datetimestamp.strftime('%y%m%d_%h%m%s')

How to use $firebaseArray in firebase return data in AngularJS -

i want retrieve data firbase condition this ref.orderbychild('users').equalto(userid).on('value', function(snapshot) { // need return data firebasearray here }); $firebasearray useful when want show data on view. don't know how return snapshot there. please me ! (bow) a $firebasearray can take in ref or query. var query = ref.orderbychild('users').equalto(userid); var syncarray = $firebasearray(query); the array function handles child events , keeps array in sync remote server changes.

python - How to plot multiple data usind add_axes without over writing existing -

Image
i try create figure zoomed inset graphs, data entire figure (all subplots , insets) plotted @ different positions of code. to mimic plotting @ different positions in code, minimum (not working) example loops on plotting routine. the subplots work, insets overwritten each time. inset axes created using add_axes. i have tried, not create subaxes (add_axes) each time, create them, if not present by: try: subax1 except nameerror: subax1 = fig666.add_axes([0.5,0.71,0.35,0.16]) this didn't help! how can fix problem/ conceptual misunderstanding? thanks help!!! import matplotlib.pyplot plt import numpy x_data=numpy.array([0, 1, 1.85, 1.9, 1.95, 2, 2.1, 2.5, 5, 10, 25]) y_data=numpy.array([0, 2.5, 1.8, 0.5, 0.2, 11, 1.2, 0.5, 0.15, 10, 25]) y_data_err=y_data*0.1 number_of_runs=3 iterator in range(number_of_runs): fig666=plt.figure(666,figsize=(22.0/2.54,18.0/2.54)) ############################# # subplot ax = plt.subplot(3,1,1...

Retrieve value from nested functions javascript -

this question has answer here: how return response asynchronous call? 21 answers why variable unaltered after modify inside of function? - asynchronous code reference 6 answers i have had look, , see great examples of nesting functions, reading them, cannot see why getting undefined when call function: function readbttndetec() { var devid = localstorage.getitem('vbttn'); var bd = 0; bd = ble.read(devid, 'fffffff0-00f7-4000-b000-000000000000', 'fffffff2-00f7-4000-b000-000000000000', function(t) { var data = new uint8array(t) console.log('returns: ' + data[0]); // returns 6 return data[0]; }, function(f) { console.log(f); ...

serialization - java.io.InvalidClassException while deserializing object after some modification in a java class -

why failed deserialized have serialized container class using serialversionuid = 75264711556228l; public class container implements serializable { private static final long serialversionuid = 75264711556228l; public boolean isfromlocalcollect=false; public boolean isfromlocalcollect=false; public void setfromlocalcollect(boolean isfromlocalcollect) { this.isfromlocalcollect=isfromlocalcollect; } public boolean getfromlocalcollect() { return this.isfromlocalcollect; } } now have added 1 more setter , getter method in container class after serialized name container.ser like: public class container implements serializable { private static final long serialversionuid = 75264711556228l; public boolean isfromlocalcollect=false; public boolean isfromlocalcollect=false; public void setfromlocalcollect(boolean isfromlocalcollect) { this.isfromlocalcollect=isfromlocalcollect; } public boolean getfromlocalcolle...

android - Why do I not need to use Adapter.notifyDataSetChanged()? -

the contactslist empty until readcontacts() method executed, in other words, when contactsview.setadapter(adapter) executed, contactslist empty, why code still can show contacts' info correctly? public class mainactivity extends appcompatactivity { listview contactsview; arrayadapter<string> adapter; list<string> contactslist = new arraylist<string>(); @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); contactsview = (listview) findviewbyid(r.id.contacts_list); adapter = new arrayadapter<string>(this, android.r.layout.simple_list_item_1, contactslist); contactsview.setadapter(adapter); readcontacts(); } private void readcontacts() { cursor cursor = null; try { cursor = getcontentresolver().query( contactscontract.commondatakinds.phone.content_uri, null, null, null, null); while (cu...

oracle - SUM using 3 tables and OUTER join -

having issues sum based on joins between 3 tables. in example below, ref contains 11 entries per month. errors aggregate columns besides error_count. items aggregate columns besides item_count. key between errors , items id , month year. key between ref , errors error_code , month_year. key between ref , items month_year. i'd see entry in result builds on each original entry in ref i.e. 11 entries per month_year, per id. running below, no entry created when match between ref , errors not found, total_error_count output 0 in case, output actual sum in total_item_count based on join items. i have 10 rows missing id = 1 , 27 missing id = 2. please advise, everyone. sql fiddle oracle 11g r2 schema setup : create table ref( month_year varchar2(6), error_code number(2) ) / create table errors( id number(18), month_year varchar2(6), error_code number(2), include_ind varchar2(1), exclude_ind varchar2(1), error_count number ) / create table items( id numb...

java - org.apache.hadoop.security.UserGroupInformation security exception error -

hi trying create file in hdfs java program.but getting security exception java.lang.noclassdeffounderror: not initialize class org.apache.hadoop.security.usergroupinformation @ org.apache.hadoop.fs.filesystem$cache$key.<init>(filesystem.java:2806) @ org.apache.hadoop.fs.filesystem$cache$key.<init>(filesystem.java:2798) @ org.apache.hadoop.fs.filesystem$cache.get(filesystem.java:2661) my java code. configuration conf = new configuration(); conf.set("fs.hdfs.impl", org.apache.hadoop.hdfs.distributedfilesystem.class.getname()); conf.set("fs.file.impl", org.apache.hadoop.fs.localfilesystem.class.getname()); conf.addresource(new path("/etc/hadoop/conf/core-site.xml")); conf.addresource(new path("/etc/hadoop/conf/hdfs-site.xml")); bufferedwriter br = null; filesystem hdfs = null; try { java.util.date date = new java.util.date(); hdfs = filesystem.get(new uri("hdfs://aserver:8020"), conf); path file = new path( "hd...

python - How do I scrape the favorite_count of a tweet on someone's timeline? -

if run code without final line: getval(tweet['retweeted_status']['favorite_count']), scrape works when add line error message keyerror: 'retweeted_status' does know i'm doing wrong? q = "david_cameron" results = twitter_user_timeline(twitter_api, q) print len(results) # show 1 sample search result slicing list... # print json.dumps(results[0], indent=1) csvfile = open(q + '_timeline.csv', 'w') csvwriter = csv.writer(csvfile) csvwriter.writerow(['created_at', 'user-screen_name', 'text', 'coordinates lng', 'coordinates lat', 'place', 'user-location', 'user-geo_enabled', 'user-lang', 'user-time_zone', 'user-statuses_count', 'user-followers_count', ...