Posts

Showing posts from September, 2012

javascript - .min or src as "main"-file in package.json for node_module -

i'm writing library browser (js, css) dependency-free until now. have @ least 1 dependency , i'm thinking wether or not include deps build or not. let's user uses cdn - of course minified file of library should include dependency. module bundlers webpack? if require / import s lib, should package.json point src entry or minified file? wouldn't module bundler install , include dependency anyway, minified file duplicate code (of dependency)? what's best practice this? namely, build leaflet plugin depend on modules of turfjs. leaflet peerdependency whereas turf dependency.

mysql - CodeIgniter PHP Combing all rows in Database to display one value -

i'm looking help, i'm looking show numeric value combination of table looks this finplanincomeid (pk) financialplanid (fk) weekly (int) fortnightly (int) monthly (int) i want rows of weekly fortnightly , monthly add make master value have done far this. model.php public function getincome($data) { $condition = "debt.[debtid] = '".$data."' , "; $condition .= "fp.[financialplanid] = fpi.[financialplanid] , "; $condition .= "debt.[debtid] = fp.[debtid] , "; $condition .= "fp.[active] = 1 , "; $condition .= "debt.[clientid] in (select [client_id] [clientportal].[dbo].[ci_user_access] [user_id] = '".$this->session->userdata['logged_in']['id']."')"; $this->db->select ('fp.[debtid], fp.[active], fpi.[financialplanid], fpi.[weekly], fpi.[fortnightly], fpi.[monthly], fpi.[weekly]*4 totalweekly, fpi.[monthly] tota

json.net - c# Newtonsoft DateTimeZoneHandling.RoundtripKind not working -

i have code in webapiconfig file serialize data: public static void register(httpconfiguration config) { config.enablecors(); config.maphttpattributeroutes(); config.filters.add(new dbvalidationerrorattribute()); config.filters.add(new validationfailederrorattribute()); config.filters.add(new genericexceptionfilterattribute()); var jsonformatter = config.formatters.jsonformatter; var jsettings = new newtonsoft.json.jsonserializersettings() { dateformathandling = dateformathandling.isodateformat, dateparsehandling = dateparsehandling.datetimeoffset, datetimezonehandling = datetimezonehandling.roundtripkind }; jsonformatter.serializersettings = jsettings; config.services.replace(typeof(icontentnegotiator), new jsoncontentnegotiator(jsonformatter)); } it webapi. controller gets data frontend. problem dates. have different timezone server ti

Generate IAR code coverage when running C-Spy outside of the IDE -

i have large number of projects, each @ least 1 automated test suite. tests run in iar's c-spy simulator. (i using iar embedded workbench arm v6.60.) if run 1 of these test executable ide, can generate , view code coverage information. okay single project, gathering information of projects running each 1 manually far cumbersome. i'd able run build , have generate code coverage information test suites. based on found in ewarm_debuggingguide.pdf, should able generate code coverage executable passing c-spy code coverage plugin: --plugin c:\<iar path>/common/plugins/codecoverage/codecoverage.dll as file code coverage info should dumped to: --code_coverage_file c:\<test suite path>/codecoveragereport.log so actual command i'm invoking: c:\<iar path>/common/bin/cspybat.exe c:\<iar path>/arm/bin/armproc.dll c:\<iar path>/arm/bin/armsim2.dll c:\<test suite path>/test.out --plugin c:\<iar path>/arm/bin/armbat.dll --plug

ios - How to reload data in table view by tapping the cell of collection view in swift -

am developing app using swift in in 1 controller using both collection view , table view.collection view kept @ top of controller scrolls horizontally , contains near 10 cells , table view kept below collection view.i have passed json(api) data both collection , table view have call json data(another api) subcategory of before first json data , if tapp cell of collection view should call second api , reload table view again display second api data...how task?? func jsonparsingfromurl () { alamofire.request(.post, "http://something.com", parameters: nil, encoding: .url, headers: nil).response { (req, res, data, error) -> void in // print(res) // print(data) let datastring = nsstring(data: data!, encoding:nsutf8stringencoding) print(datastring) self.startparsing(data!) self.collecstartparsing(data!) } } func startparsing(data :nsdata) { let dict: nsdictionary!=(try! nsjsonserialization.jsonobjectwit

Arabic characters from html content to pdf using iText -

Image
i having trouble display arabic characters html content in pdf generation " ? " i able display arabic text string variable. @ same time not able generate arabic text html string. i want display pdf 2 column, left side english , right side arabic text. when use following program convert pdf. please me in regard. try { document document = new document(pagesize.a4, 50, 50, 50, 50); bytearrayoutputstream out = new bytearrayoutputstream(); pdfwriter writer = pdfwriter.getinstance(document, out); basefont bf = basefont.createfont("c:\\arial.ttf", basefont.identity_h, basefont.embedded); font font = new font(bf, 8); document.open(); bufferedreader br = new bufferedreader(new filereader("c:\\style.css")); stringbuffer filecontents = new stringbuffer(); string line = br.readline(); while (line != null) { filecontents.append(line); line = br.readline(); } br.close(); string styles

php - How to generate unique Voucher code in laravel 5.2? -

i want save unique voucher code , mix of characters , numerics , should 6 in length. using laravel framework 5.2 enter code here $data = $request->all(); unset($data['_token']); //echo "<pre>"; print_r($data); die; ($i=1; $i <=$data['countvoucher']; $i++) { $voucher = new voucher; $voucher->code = "123456";// should dynamic , unique $voucher->percentage = $data['percentage']; $voucher->usage = $data['usage']; $voucher->expirydate = $data['expirydate']; $voucher->save(); } $voucher->code want save in filed can me i using function may use bellow $voucher->code = $this->generaterandomstring(6);// should dynamic , unique public function generaterandomstring($length = 20) { $characters = '0123456789abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz';

cryptography - Cannot verify PDF esig/dss signature with iText -

i have pdf document signed esig/dss https://github.com/esig/dss library. can see singature in acrobat reader. when want verify itext , bouncycastle got exception: 2.16.840.1.101.3.4.2.1withrsa signature not available i work on fedora oracle jdk 1.8.0_112 unlimited cryptography, itext-2.0.8.jar , bouncycastle bcprov-jdk16-139.jar . when chcecked message digest available in environment using response from: complete list of messagedigest available in jdk i got: alias: "oid.2.16.840.1.101.3.4.2.1" -> "sha-256" so available in jdk. sho why 2.16.840.1.101.3.4.2.1withrsa signature not available ? you mention use "itext-2.0.8.jar" , "bcprov-jdk16-139.jar". those versions ancient, itext 2.0.8 in particular has been released 2008. pades specifications had first been published in 2009, , introduced numerous changes , additions pdf signing. esig/dss had been introduced first implementation of these changes , additions. thu

Facebook JS SDK CORS problems -

i'm working facebook js sdk "go live dialog" live streaming, every thing works fine until last step when want publish stream , can't publish because there cors error, is: xmlhttprequest cannot load https://graph2.facebook.com/v2.5/10154376393778843?access_token=eaaoapyi8mx....&suppress_http_code=1 . response preflight request doesn't pass access control check: 'access-control-allow-origin' header contains multiple values '*, https://www.facebook.com/ ', 1 allowed. origin ' https://www.facebook.com/ ' therefore not allowed access. the issue due graph2.facebook.com sending cors header twice: access-control-allow-origin: * access-control-allow-origin: https://facebook.com/ and google chrome accepts one. i opened bug on facebook until answers "disable cors security" on browsers, a bad solution if want make app public every one. the code app this: <script> window.fbasyncinit = function() { fb.

javascript - angular 1.5 jsonp code call is not hitting the success method -

my jsonp code not working using angular reason! i've read thousands of examples doesn't work. see code below. i've read question , hasn't resolved problem angularjs jsonp not working my example code shows http.jsonp call success , error methods defined. i'm using chrome develop , test moment , second , third images show ajax service call , jsonp response service. latest update after receiving @thesharpieone server response returning actual function (instead of string problem previously) success method not executed reason? $http.jsonp(url).then(function(response) { alert('success'); // not hit }, function onerror(response) { alert('error'); // displayed }); many thanks, angular js var url = serviceroot + "api/customer/get?callback=json_callback"; $http.jsonp(url).success(function (data) { alert('success'); // never called }) .error(function () { alert('error');

assembly - Dumping Registers in PPC -

i'm trying dump value of r5 can see var_a0 data is. trying dump in ppc since i'm using uart debugging on xbox 360 console, ex): i'm trying figure out value of var_a0 addi r5, r1, 0x110+var_a0 code im using :: printkey: lis %r29, -0x8000 ori %r29, %r29, 0x100 sldi %r3, %r29, 32 ori %r3, %r3, 0x247c # 0x800001000000247c li %r4, 0x80 bl printaddress printaddress: mr %r30, %r3 mr %r11, %r4 # text size mtctr %r11 but print physical code in hv not registers data there few things you'll need sort out here: the printaddress function looks takes address in r3 , , size in r4 , (presumably) prints contents of memory @ address. have no way of telling how printing done, code missing question. consequently, don't want use printaddress display value of r5 . adapt actual printing code (which missing) print contents of register, rather memory. however: actual thi

magento - vendor added Product details from products collection table -

i have created market place vendors , vendor added product stored in marketplace_product table.how can show complete product details image,description of these products in magento. have tried below code $showcaseproducts = mage::getmodel('marketplace/product')->getcollection() ->addfieldtoselect( '*' ) ->addfieldtofilter('userid','163') ->load(); but not getting products details you need used following code : $showcaseproducts = mage::getmodel('marketplace/product')->getcollection() ->addfieldtoselect( '*' ) ->addfieldtofilter('product_id',163); foreach($showcaseproducts $curproduct) { $curproduct->getid(); //here can access table field } in above code need replace "product_id" column table column name in store

javascript - Error with Changing Variable Value with if Statement -

i have radio buttons in accordion, , depending on radio buttons selected, alert different output. (there's ton of css) var acc = document.getelementsbyclassname("accordion"); var i; (i = 0; < acc.length; i++) { acc[i].onclick = function(){ if(!this.classlist.contains("active")) { closeaccordions(); } this.classlist.toggle("active"); this.nextelementsibling.classlist.toggle("show"); } } function closeaccordions() { (i = 0; < acc.length; i++) { acc[i].classlist.remove("active"); acc[i].nextelementsibling.classlist.remove("show"); } } var chanceoflive5 = 1; var user; function choose(choice){ user = choice; } function changechanceoflive2(){ if (user == 'bolts') { chanceoflive5 = 1; } else if (user == 'plates') { chanceoflive5 = 2; } } var chanc

properties - How can I create propirty file for sql queries in spring boot? -

i have sql queries in java code. want move property file. want create property file storing sql queries. have tried create: sample.properties and write in file: sql.getcalldetail = //sql query then in java class: propertysource(value = "sample.properties") public class imeibuilderdefault implements imeibuilder { @value("${sql.getcalldetail}") private string getcalldetail; but project not build. please go through below ** sql.properties ** queries.ex1="select * ex1" queries.ex2="select * ex2" @propertysource(value="classpath:sql.properties") @configuration @configurationproperties public class sqlqueries { private map<string,string> queries; //getters , setters } **test class ** @component public class testsqlqueries { @autowired private sqlqueries queries; @postconstruct public void init(){ queries.getqueries().entryset().stream().foreach(entry->{

applying a function with multiple arguments over multiple paired variables in R -

i have function im using clean data , works correctly. my_fun <- function (x, y){ y <- ifelse(str_detect(x, "-*\\d+\\.*\\d*"), as.numeric(str_extract(x, "-*\\d+\\.*\\d*")), as.numeric(y)) } it takes numbers have been entered in wrong column , reassigns them correct column. used follows clean y variable: df$y <- my_fun(x, y) i have many columns/variables (more 10) paired in same format x_vars <- c("x_1", "x_2", "x_3", "x_4", "x_5", "x_6") y_vars <- c("y_1", "y_2", "y_3", "y_4", "y_5", "y_6") my question is. there way apply function across variables in data set need cleaned in same way? can in other instances data cleaning function has 1 argument using lapply struggling in case. i have tried mapply not work, might because i'm still quite novice in r. advice appreciated. we can use m

jquery - Single page app url management -

usually in single page app(spa), have single page have have sidenav menu. in menu, there multiple anchor tags. those anchor tag's url handled angular/react/sammy js router, , main div refreshed based on returned html controller. pretty simple, right? but imagine scenario, user directly access anchor tag url via browser address bar. returned html segment loaded whole page. is there way handle kind of situation; mean whenever user directly access url, he/she addressed? edit: may i'm not clear problem statement. let me elaborate bit: suppose page url is: abc.com/dashboard this page got navigation menu , div section class name "main-container" user click link in nav menu , router moved url abc.com/view/listofxyz. so, our "main-container" div loaded response of url abc.com/view/listofxyz now user, directly go abc.com/view/listofxyz url , hit eneter. then, page contain response html of url i.e. nav menu , div gone. question is, can implement desig

sql - Can I modify below GroupBy clause into better one -

consider following cases case 1: tbl_a --------------- | cola | colb | --------------- expected o/p: 1 0 | 1 | 0 | --------------- case 2: tbl_a --------------- | cola | colb | --------------- expected o/p: 1 1 | 1 | 1 | --------------- case 3: tbl_a --------------- | cola | colb | --------------- expected o/p: 1 1 | 1 | 0 | | 1 | 1 | --------------- case 4: tbl_a --------------- | cola | colb | --------------- expected o/p: null null | null | null | --------------- the query simple, if there record cola = 1 , colb = 1 return it, if no such record exists return existing record cola = 1. have tried various ways. came groupby clause there simple way it. if use cola = 1 , colb = 1 fails case 1 returns no rows. select cola, max(colb) group (cola) is valid query? appreciated. please try following. provides desired results posted cases. select top 1 cola, colb tbl_a cola = 1 or cola null order cola

jquery - Issues with submitting edited form using ajax and PHP -

when tried make update first_name , last_name database, empty form passed database result no information updated. please need help? here work far.... index.php <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script> </head> <body> <div class="container"> <div id="disp_data"></div> </div> </body> </html> <script> $(document).ready(function(){ function fetch_data() { $.ajax({ url:"select.php", method:"post", success:function(data){ $('#disp_data').html(data); } }); } fetch_data(); //edit $(document).on('

C++: Can I put a child object into an array of parent objects? -

this question has answer here: store derived class objects in base class variables 4 answers say have class called 'tile' class tile { private: int x, y; }; and class called 'door' extends 'tile' class door : tile { private: bool open; }; can make array of tile objects, instance create room, , have door object in same array since extension of tile? if not there alternatives use accomplish this? can put child object array of parent objects? no. an object of type t of type t , never type, if type related. arrays contain objects of 1 single type. if not there alternatives use accomplish this? reference t& , pointer t* can refer object type derived t . cannot store references in array though. so, may use array of pointers. perhaps simplest , flexible choice array of shared pointers

linux - Inconsistent memory usage results -

Image
i have linux server running mongodb on can see in picture below. mongodb service using %65 of memory whole system memory usage 4375mb/16047mb. whole system memory usage , mongodb memory usage seems conflicting or i'm not interpreting results correctly. can please? seeing memory 3 running tasks adds ~88%, seeing percentage of memory that's in use. missing ~12% can found other tasks.

json - Angularjs: How to print data from object only once if repeated -

Image
my goal print object using ng-repeat knowing keys repeated. want printed once if case , want calculate average of similar values. this data. [ { "0":"1", "1":"creativity", "2":"5", "3":"1", "4":"2017-01-17 21:24:42", "5":"ratings", "6":null, "id":"1", "title":"creativity", "value":"5", "parent":"1", "timestamp":"2017-01-17 21:24:42", "category":"ratings", "author":null }, { "0":"2", "1":"courage", "2":"4", "3":"1", "4":"2017-01-17 21:24:42", "5":"ratings", "6&q

installshield 2014 - Unable to set custom path(user defined path) of merge module file path in Basic MSI Project in InstallShiled? -

Image
i have merge module (.msm) files. want add file in basic msi project. i found installshiled has fixed path of merge module folder. every time have move built merge module in fixed path of merge module folder. for example fixed path of merge module. c:\installshield 2014 projects\mergemodules,c:\program files (x86)\installshield\2014\modules\i386,c:\program files (x86)\installshield\2014\objects,c:\program files (x86)\installshield\2014\modules\i386\japanese,c:\program files (x86)\installshield\2014\modules\i386\german; please follow below step find path variable in installshield project. open basic msi project switch "installation designer" tab. go "media" , extract "media. click on "path variables". pfa: screenshots more info. "<isprojectfolder>" current directory path of installshield project. trying add "<isprojectfolder>" in merge module tab. installshiled throws error. pfa: screenshot m

xml - XSL for-each on space-separated attribute values -

for research project, have document in xml/tei <tei xmlns="http://www.tei-c.org/ns/1.0" > <body> <div> <p> <span target="#" type="passage" ana="tag957 tag874"> <span target="#" ana=""/> </span> <seg><date when="1980-01-01" type="date_seg"/>blabla blabla blabla blablablabla blablablabla blablablabla blablablabla bl </seg> <span target="#" type="passage" ana="tag1657 "> <span target="#" ana=""/> </span> <seg><date from="1980-01-03" to="1980-01-05" type="date_seg"/>blabla </seg> </p> </div> </body> </tei> i need extract each tag contained i

javascript - Node.js render json map from mongodb -

i want show data json map express this code var b = det.map(function(h) { var soalid = h.id_soal; var idarray = [ ]; (var = 0; < soalid.length; i++) { soal.findone({ _id: soalid[i] }, function (err, sol) { idarray.push(sol); console.log("ping:" + idarray); }); } res.render('ujian/viewdetail',{ujian: iduji, detail: det, soal: idarray, title: 'lihat form ujian'}); }); i have try run console data json not showing on express (web). and have json file : ping:{ _id: 58516fc32aeffd103cdda179, jurusan: 'ipa', matapelajaran: 'fisika', soal: 'agae', jawabana: 'hjg', jawabanb: 'h', jawabanc: 'hbh', jawaband: 'hbh', jawabane: 'h', kuncijawaban: 'hb', __v: 0 }, { _id: 585a95167467c5185e2f2ee9, jurusan: 'ipa', matapelajaran: 

php - Adding a Loop inside a loop -

please having issue loops, have loops of post content table, want add loop of content table previous loop after 2 post. succeeded in adding it, repeats first loop , add next loop. picture of got code bellow below code sample public function gettemplate() { $this->ci->load->library(['jobs']); if (! is_array($this->data)) { $this->getfeed(); } $storylist = ''; $count = 1; foreach ($this->data $storyid) { $count++; $this->ci->load->library('story'); $this->ci->story->setid($storyid); if ($this->profileid > 0) { $this->ci->story->setprofileid($this->profileid); } $storylist .= $this->ci->story->gettemplate(); //template content first loop if ($count % 3 == 0) { $this->ci->jobs->setlimit(2); foreach ($this->ci->jobs->getj

node.js - '$' is not recognized as an internal or external command -

i have search quite extensively answer question , have not found 1 address particular issue. involves command line in windows. trying follow tutorial on using npm. of commands in tutorial begins $ symbol, dollar sign. when type '$ npm config list' configuration not recognize message. other similar questions describe other symbols or commands not '$' dollar sign. if else has experienced particular problem , solved it. appreciate help. thank you. just write 'npm config list' ignore $

oop - How to Call Undefined Methods Sequentially in Python Class -

with getattr , can : myclass.method1() but i'm looking myclass.method1().method2() or myclass.method1.method2() . it means method1 , method2 not defined in class. is there way call undefined methods sequentially in python class? i not sure, seems calling undefined method normal method want call name (because can not call not defined). in case, can nest getattr many times need go deeper, here example: class test: def method_test(self): print('test') class another: def __init__(self): self._test = test() def method_another(self): print('another') return self._test = another() getattr( getattr(another, 'method_another')(), 'method_test' )() the last statement another.method_another().method_test() .

mysql - SQL Query with "feedback loop" -

currently, using mysql i have 2 tables: table objects: | id | desc | | 1 | 'a' | | 2 | 'b' | | 3 | 'c' | | 4 | 'd' | | 5 | 'e' | table implies: | id1 | id2 | | 1 | 2 | | 1 | 3 | | 2 | 4 | | 2 | 5 | | 3 | 5 | table implies columns id1 , id2 both foreign keys table objects id. which means: object 1 implies object 2 , object 3. object 2 implies object 4 , object 5 object 3 implies object 5 therefore, object 1, implies 2, 3, , 4 , 5 (since 2 implies 4 , 5) is there way create query behaviour? current solution consists on calling recursively java query until don't new info: sql query im calling: select o.id, i.id2 objects o inner join implies on o.id = i.id1 id = 1; i first call id = 1, id in (2, 3)... etc the kind of result want achieve: select ... id = 1 should return: | id | id2 | | 1 | 2 | | 1 | 3 | | 1 | 4 | | 1 | 5 |

angular - Angular2 - ts files don't live-recompile with npm start -

i've created new angular 2 project ng new test . when execute npm start or ng serve can see if change html file, browser page refreshes correctly. but if change ts file nothing happens. in browser's console see: [wds] app updated. recompiling... (two times) [wds] nothing changed. in server console see recompiles old sources. example if have error correct, after saving file still see same error. anyone can me? i found solution https://github.com/angular/angular-cli/issues/4338 installed webpack 1.2.4 , works now!

javascript - How can I invoke a class method in Swift if I only have the string? -

i writing cordova plugin healthkit , task make sure can dynamically read more or less data hk. im doing native part in swift. write javascript bit lost in swift part. i want able dynamically invoke methods having string. let store = hkhealthstore() { let bloodtype: hkbloodtypeobject = try store.bloodtype() ... that example read blood type. not swift developer, there way can dynamically, in javascript: ... // assuming function receives string paramater let param[0] = try store[param[0]]() // <-- how in swift? then can talk server , list of characteristics , load them dynamically healthkit without having update code , hardcode each possible characteristic. create mapping parameter strings api enumeration. enum api: string { case function1 = "function1" case function2 = "functiontwo" case function3 = "threethreethree" } create relay function maps api enumeration swift function. func callthecorrectfuncti

python - Starcluster python3 support by 2to3 okay? -

is okay use 2to3.py make starcluster work under environment of python3? it okay try 2to3 isn't fix-all magically make work, there's somethings can't fix automatically. in general approach should take if trying port is, after understanding code, run 2to3 , manually change cases doesn't catch. if doesn't work wait developers reply comment left on github issue this .

sql server pivot query - help required -

i need write sql server query pivot data source table. my source table looks - cust_id item1_desc_count item2_desc_count item3_desc_count ------- ---------------- ---------------- ------------ cust1 10 12 9 cust2 7 1 3 cust3 12 6 0 ... item master table looks - item_id item_desc ------- --------- 1 item1_desc 2 item2_desc 3 item3_desc please note item descriptions used in column names in source table. and need output - cust_id item_id count -------- --------- ------ cust1 1 10 cust1 2 12 cust1 3 9 cust2 1 7 cust2 2 1 cust2 3 3 cust3 1 12 ... can me achieve using sql query? this more dynamic approach. no need specify item count columns. the cross apply unpivot source table. i should add unpivot more performant, i'm assuming

sql - How to conditional update field in JSON in MySQL? -

we have student table contains json in 'jsondata' column(longtext). need change value of "ishandicapped" field in json. structure : { "data": { "schooldata": { "studentliste": [ { "student": { "studentid": 111749, "ishandicapped": false } } ], }, } } old data : "ishandicapped": false new value : "ishandicapped": "no" this should conditional update true need change value as old data : "ishandicapped": true new value : "ishandicapped": "ja" primary field of table id. i got following sql query same unable understand how add conditional update if value true put ja else no: update student set data = json_set(data, "'$."data"."schooldata"."studentliste"[*]."ishandicapped", "?") id = 2;

RTSP vs. HTTP for audio streaming -

i have installed icecast server simulate radio station. icecast use http protocol wonder if, audio only, provides enough sound quality. i've heard rtsp , seems more convenient audio streaming - can't find icecast equivalent using rtsp protocols. can have thoughts on it? thanks! the use of http protocols support adaptive bitrates. theoretically bad fit... however, http interoperable. has countless implementations both on server , client sides, great. rtsp isnt known interoperability... normal rtsp servers close inactive control connections. well-behaving servers still keep rtsp sessions while longer http...

python - Frequency of sequences in many files -

suppose have 50 files (in same folder), , each 1 contains character ">" @ beginning of search. examples: file1.txt >organism1 >organism2 >organism3 >organism4 >organism5 file2.txt >organism3 >organism4 >organism5 >organism6 my intention count frequency of each organism in each file , generate table. @ moment count each 1 file-by-file generate table: table 1. frequency organism1 1 organism2 1 organism3 2 organism4 2 organism5 2 organism6 1 until now, can list file in folder can't open them make want. import sys bio import seqio import glob, os os.chdir(sys.argv[1]) file_list = [] file in glob.glob("*.faa"): if file not in file_list: file_list.append(file) # until here, perfect f in file_list: infile = open(f, 'r') fasta = seqio.parse(infile, 'fasta') seq = fasta.description #.split("|")[2]

java.lang.IllegalArgumentException: class android.content.pm.ActivityInfo declares multiple JSON fields named isElasticEnabled -

when using gson serialise objects, encountered exception java.lang.illegalargumentexception: class android.content.pm.activityinfo declares multiple json fields named iselasticenabled how make gson work without application code changes, adding serializablename , stuff?

facebook - missing post from {page-id}/feed -

assume have post id xxx then, visit https://graph.facebook.com/v2.9/xxx?access_token=your_token , can see post but this post missing https://graph.facebook.com/v2.9/me/feed?access_token=your_token i pretty sure post published , not hidden (by checking field is_published , is_hidden ) i wondering why can not fetch post {page-id}/feed the post id talking 86398004596_10155126493894597 published @ 2017-07-01t07:22:36+0000 you can reproduce long have page access token: https://graph.facebook.com/v2.9/86398004596_10155126493894597?access_token=your_token https://graph.facebook.com/v2.9/86398004596/feed?access_token=your_token

c - Memory Barriers in Single Producer Single Consumer Queue -

i've spent last few weeks doing lot of reading on memory models, compiler reordering, cpu reordering, memory barriers, , lock-free programming , think i've driven myself confusion now. i've written single producer single consumer queue , trying figure out need memory barriers things work , if operations need atomic. single producer single consumer queue follows: typedef struct queue_node_t { int data; struct queue_node_t *next; } queue_node_t; // empty queue looks this: // head tail // | | // dummy_node // queue: insert @ tail, remove head // head tail // | | // dummy_node -> 1 -> 2 -> null typedef struct queue_t { queue_node_t *head; // consumer consumes head queue_node_t *tail; // producer adds @ tail } queue_t; queue_node_t *alloc_node(int data) { queue_node_t *new_node = (queue_node_t *)malloc(sizeof(queue_node_t)); new_node->data = data; new_node->next = null; return new_node; }

python - Angular Gulp with Nginx on AWS on Ubuntu -

i have been developing website has structure follows - django rest app backend serves json front-end according has been requested. angularjs app frontend requests apis. now both backend , frontend not coupled in way , locally used manage.py runserver backend , gulp serve frontend. i moving development , have set nginx aws run django , cater api requests, working fine. but frontend, confused as- what gulp serve is, injects scss , dependencies , starts app. how start app using nginx(basically gulp serve)? how django , angular runnung on nginx on same instance? nice if post examples too. what can make django serve base template through view. now base template should contain main angular app. contain angular dependencies such libraries , controllers/service/directives etc. <!doctype html> <html lang="en" ng-app="angularapp"> {% block head %} <head> {% block angular_requirements %} <