Posts

Showing posts from September, 2011

javascript - Rollup.js how import a js file (not es6 module) without any change (myvar$extrastring) -

first of all, understand why rollup.js need append string @ end of variable avoid collision but... don't understand how "concat/import" simple javascript file not amd/commonjs/es6, simple revealing module ! i have following file structure: foo.js var foo = (function () { var somemethod = function () {}; return { somemethod: somemethod }; })(); bar.js (function(module) { module.bar = "bar"; })(foo); main.js import "foo.js" import "bar.js" after building, got: build.js var foo$1 = (function () { // here problem var somemethod = function () {}; return { somemethod: somemethod }; })(); (function(module) { module.bar = "bar"; })(foo); // ouupss ! so how can got foo instead of foo$1 ? or foo$1 instead of foo bar.js ? edit: in case, in main.js, use default import in view override default name: import foo "foo.js" i got error (normal !): ...

java - Android AsyncTask cannot pass values to database -

this class contains recyclerview. want when leftswipe on object of list, should make post call local host php page adds values swiped object entry table in mysql database. however, servicehandler class not able pass variables php page add entry. public class productadapter extends recyclerview.adapter<productadapter.viewholder> { private arraylist<productinfo> inf; productadapter selfref=this; string url_add_product = "http://10.0.2.2/finalproject/add_basket_product.php"; private progressdialog pdialog; private static final string tag_success = "success"; public string nm,pr,dis,st; //helper method productinfo object private productinfo getinfo(string name){ productinfo pinfo=null; for(productinfo x:inf){ if(x.getname().equalsignorecase(name)) pinfo=x; } return pinfo; } public class viewholder extends recyclerview.viewholder { textview pname; textview pprice; textview adistance; textview asto...

voice recognition - How can I remove words from the dictionary on cmusphinx? -

i trying cmusphinx spanish language. downloaded spanish model , dict, accuracy poor... i tried remove words "es.dict" less needed words. , accuracy changes 100% (removing 99% of words...). but changes generated problem performance, think system trying read each word in file "es-20k.lm". my output shown each removed word: "nov 12, 2016 11:05:14 pm edu.cmu.sphinx.linguist.dictionary.textdictionary getword informaciÓn: dictionary missing phonetic transcription word 'argumento'" how can remove unused words in spanish model? possible? want modify dictionary of model, removing unused words. (i want 50 words @ moment..). i trying suggested tools in documentation don't understand it, or don't how it. thanks. you should keep dictionary same. need write grammar in text editor or build language model srilm advised language model tutorial . overall, reducing language vocabulary not way improve accuracy, bad accuracy caused n...

android - Invalid argument: NodeDef mentions attr 'Tshape' not in Op -

i getting error invalid argument: nodedef mentions attr 'tshape' not in op<name=reshape; signature=tensor:t, shape:int32 -> output:t; attr=t:type>; nodedef: y_groundtruth = reshape[t=dt_float, tshape=dt_int32](lout_add, y_groundtruth/shape) when attempting load file on android using tensorflow::status s = session->create(graph_def); . people similar problems have mentioned upgrading tensorflow 0.9.0rc0 fixed problems. however, using current tensorflow build in jni-build. could problem variables declared when generating protobuf file? snippet def reg_perceptron(t, weights, biases): t = tf.nn.relu(tf.add(tf.matmul(t, weights['h1']), biases['b1']), name = "layer_1") t = tf.nn.sigmoid(tf.add(tf.matmul(t, weights['h2']), biases['b2']), name = "layer_2") t = tf.add(tf.matmul(t, weights['hout'], name="lout_matmul"), biases['bout'], name="lout_add") return t...

c - Pointers, Arrays and Functions -

i programmed function can rotate 4 x 4 arrays, , want output it... bunch warnings, compiles , works, guess did "minor/formal" mistakes. #include <stdio.h> //----------------------------------------------------------------------------- /// /// function prints 4 4x4 matrix /// /// @param m1, m2, m3, m4 input matrix want print. /// /// @return 0 //----------------------------------------------------------------------------- void *print_matrix(char m1[4][4], char m2[4][4], char m3[4][4], char m4[4][4]) { for(int = 0; < 4; i++) { for(int j = 0; j < 4; j++) { printf("%c ", m1[i][j]); } printf(" "); for(int j = 0; j < 4; j++) { printf("%c ", m2[i][j]); } printf(" "); for(int j = 0; j < 4; j++) { printf("%c ", m3[i][j]); ...

android studio - Gradle sync failed: Unable to load class 'org.gradle.model.internal.manage.schema.ModelSchemaStore' -

i have android 2.2.1 running on windows 10 , error showed after installed xubuntu on mi laptop. first ide didn't load uninstalled , installed again , when tried build project got error. can't build project. view of files on left side quite different. doesn't shows androidmanifest.xml looks this some great!

node.js - generating an ID field in mongo -

have question on designing id fields (customized id fields smartcoding needs). e.g mongodb model { projectid : string, projectname : string } requirement: projectid should start string "proj1000" , increment each record. //creation of new project var post = function (req, res) { logger.info('entering project post method'); mw.verifytoken(req, function(request,response){ if(response){ var newproject = new project(req.body); if (!req.body.name){ logger.warn('name of project empty'); res.status(400); res.send('name required'); } else { //project id should start 'ads' , start automatic numbering 1000. example: 'ads1000'. project.find({}).sort({projectid : -1}).limit(1).exec(function(err, maxresult){ if (err) {return err;} //gettin...

angularjs - Intellij constantly compiles TypeScript (very slow) - How to stop this behavior? -

Image
i in process of migrating angular 1.x project vanilla js typescript. however, experiencing extremely slow response times ide. if uncheck "track changes" in settings > languages & frameworks > typescript, compilation stops--but in position ts doesn't compile! of course, configure gulp file , set watcher recompiles files on change. but, if possible, avoid need run gulp each project. also, more importantly , unchecking "track changes" removes ts specific advice , appears break references. track changes: checked - help + references track changes: unchecked - no + references broken question #1: is possible configure intellij such compiles changed files? question #2: why intellij compiling so many files? here copy of tsconfig.json: { "compileroptions": { "module": "system", "noimplicitany": false, "removecomments": true, "preserveconstenums": true, ...

ios - Using UpdateChildValues to delete from Firebase -

i trying delete data several locations in firebase database simultaneously. the firebase docs state: "the simplest way delete data call removevalue on reference location of data. can delete specifying nil value write operation such setvalue or updatechildvalues. can use technique updatechildvalues delete multiple children in single api call." my code is let childupdates = [path1 : nil, path2 : nil, path3 : nil, path4 : nil] ref.updatechildvalues(childupdates) all 4 paths strings, error: "type of expression ambiguous without more context." i'd assume occurs because of nil values, since if replace nil else (such int) error disappears. what correct way use updatechildvalues delete data firebase? want work in similar way removevalue() function in firebase. reason prefer because can remove multiple places in 1 call. so issue here that ref.updatechildvalues(child...

python - matplotlib equivalent for Ubuntu servers with no GUI? -

i have gui-less cloud server running bitnami-django ubuntu 14.04 lts meant retrieve , graph data users, cannot produce graphs. clear, care graph image produced , saved, not user has option click button save image. such functionality meaningless such server. on normal ubuntu linux (mate) 14.04 lts, scripts work perfectly, producing matplotlib.pyplot relevant data in gui window save, zoom, rotate , other functionality; on cloud server error, if don't try invoke show() function: bitnami@stockpredix:/opt/bitnami/apps/django/django_projects/project$ python api-test_volume.py traceback (most recent call last): file "api-test_volume.py", line 8, in <module> import matplotlib.pyplot plt file "/opt/bitnami/python/lib/python2.7/site-packages/matplotlib/pyplot.py", line 114, in <module> _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup() file "/opt/bitnami/python/lib/python2.7/site-packages/matplotlib/backend...

oop - Describing a function parameter that takes a class as an argument in TypeScript -

i want write function parse class type (the class, not instance) function instantiate instance based on parameter. this best explained example: //all possible paramter types must inherit base class class base { public name : string = ''; } //these possible classes parsed function class foo extends base { constructor() { super(); console.log("foo instance created"); } } class bar extends base { constructor() { super(); console.log("bar instance created"); } } //this function should take class inherits 'base' paramter - create instance function example(param : ?????????) : base //i don't know type 'param' should { return new param(); //create instance?? how do } //this should output - if worked (but doesn't) example(foo); //logs "foo instance created"" example(bar); //logs "foo instance created"" //so if worked, become possible this: let b : foo = example(foo); let c : bar = example(bar); ...

c# - Changing text truncation behavior -

i want display path in textblock. standard truncation ends removing relevant parts of information want show, since truncates rightmost part of line first. is there way specify, in xaml, text should truncated left first rather right? setting flowdirection , textreadingorder doesn't seem have effect on direction of truncation, seen below: <textblock text="{binding path}" fontsize="18" flowdirection="righttoleft" textreadingorder="useflowdirection" texttrimming="characterellipsis" /> is possible in pure xaml, or solution need more complex (examining size of textblock on page resize , modifying text compensate)? i think want trim text left when text long? if so, there no such property can set work in uwp, need trim yourself. here demo: <textblock text="left-abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz abcdefghijklmn...

"Virtual users" with Solaris 11 and ZFS share -

is there way create virtual user (e.g. user not have solaris user) can set permissions on zfs samba share , connect credentials? i don't know of way. the file(s) , directories need stored way identify user owns them, or user(s) need permission access them. zfs file system running on solaris server, that's uid , either directly or indirectly, means user account has exist in order map samba credential. note entire solaris vfs structure relies upon each element having uid : typedef struct vattr { uint_t va_mask; /* bit-mask of attributes */ vtype_t va_type; /* vnode type (for create) */ mode_t va_mode; /* file access mode */ uid_t va_uid; /* owner user id */ gid_t va_gid; /* owner group id */ dev_t va_fsid; /* file system id (dev now) */ u_longlong_t va_nodeid; /* node id */ nlink_t va_nlink; /* number of references file */ u_offset_t va_size; /* file size in ...

Parallel read of a nxn matrix stored in a file -

i'm developing program, solve equation ax = b using gaussian elimination. i've got file, in i've stored matrix of type double (row major order since using c). i'm trying read file in parallel, using parallel file i/o functions provided mpi. i've gained understanding of mpi_file_set_view , how logically partitions shared file each process has different view of file. i've understood view must consist of etype , filetype , displacement. in case, i've got have cyclic row distribution , i've got following code: int count, blksize, stride,lb,extent; mpi_file fh; mpi_offset of; /* define types etype, ftype etype: type of data stored in file. ftype: description of how data stored in file. */ mpi_datatype etype, ftype,mpi_vect; /* etype: */ count = (n + (size -1))/size; blksize = n; stride = size; lb = 0; extent = n*sizeof(double); mpi_type_vector(count,blksize,stride,mpi_double,&mpi_vect...

Issue with parsing a function in Python (optionally with pyparsing) -

i'm using pyparsing library parse python-like programming language. seem having trouble figuring out how translate bnf grammar executable code. my script more complex this, i've distilled problem few lines: arg_or_func_name = word(alphanums + '_') expr = forward() func = expr + literal('(') + literal(')') expr << (arg_or_func_name | func) statement = expr + literal(';') parsed = statement.parsestring('func_a();') i want parse [('expr', [('func', ['func_a', '(', ')')])]), ';'] . instead, causes error pyparsing.parseexception: expected ";" , assume because greedily considers func_a arg_or_func_name, , disregards parentheses. however, when reverse order of expr statement , change to expr << (func | arg_or_func_name) or when expr << (func ^ arg_or_func_name) i maximum recursion depth exceeded error; apparently searching in order results in infi...

polygon - Drawing hexagon in vb.net -

i want build hexagon-shaped button. here's code i've got. dim p(5) point dim v integer = cint(me.width / 2 * math.sin(30 * math.pi / 180)) p(0) = new point(me.width \ 2, 0) p(1) = new point(me.width, v) p(2) = new point(me.width, me.height - v) p(3) = new point(me.width \ 2, me.height) p(4) = new point(0, me.height - v) p(5) = new point(0, v) unfortunately, appears hexagon point @ top. want hexagon horizontal line @ top. thanks! you can swap x , y coordinates, mirrors shape @ system's diagonal. , adapt scaling width , height accordingly: dim v integer = cint(me.height/ 2 * math.sin(30 * math.pi / 180)) p(0) = new point(0, me.height\ 2) p(1) = new point(v, me.height) p(2) = new point(me.width- v, me.height) p(3) = new point(me.width, me.height\ 2) p(4) = new point(me.width - v, 0) p(5) = new point(v, 0) be aware reverses point order. if processing method relies on tha...

ruby on rails - bundle exec rake db:create error -

keep getting when run bundle exec rake db:create : could not connect server: connection refused server running on host "localhost" (::1) , accepting tcp/ip connections on port 5432? not connect server: connection refused server running on host "localhost" (127.0.0.1) , accepting tcp/ip connections on port 5432? any ideas how fix this? thats because of permission issue. navigate /etc/postgresql/<your version of pg>/main/ , open pg_hba.conf. there search line that'd local postgres peer , replace local trust . run sudo service postgresql restart in terminal.

Calculate from 3 inputfield in dynamic form yii2 -

in dynamic form need calculate data from 3 fields(qty,rate,discount) , pass unitdiscount. formula - unitdiscount = ((qty*rate*discount)/100) . have onchange event( getvalue ) on inputfield qty , rate pass (qty*rate) value . when i'm adding new onchange( getunitdiscount ), calcluted field value not passed. in stead, unitdiscount . also, not sure how can calculate 3 inputdields. i calculated value of pass calculated data in texbox not model in dynamic form yii2 my present code looks - _form <div class="col-xs-1 col-sm-1 col-lg-1 nopadding"> <?= $form->field($modelsproductsales, "[{$i}]rate")->label(false)->textinput(['maxlength' => true,'onchange' => 'getvalue($(this))', 'onkeyup' => 'getvalue($(this))','onchange' => 'getunitdiscount($(this))', 'onkeyup' => 'getunitdiscount($(this))','placeholder' =...

algorithm - Average Case Time Complexity Analysis of Binary Counter Increment -

i attempting find average case time complexity, not amortized analysis, of binary counter. not entirely confident in time complexity analyzing skills, confirm average case analysis of pseudocode provided below correct. let k length of array. increment(array) = 0 while < k , array[i] == 1 array[i] = o = + 1 if < k array[i] = 1 in order find average time taken, find average amount of bits flipped per run. result, found o(2+k/(2^k)) , equals o(1) large k . is correct average case running time? if not, how begin approach problem? i assuming each input has same probability occur this means each bit independently on or off probability 1/2. the geometric distribution relevant distribution complexity: flip coins, , end experiment on first tail outcome (there nothing further carry). the mean of geometric distribution here 2 (see above link, or derive basic principles), average complexity indeed o(1) .

Xamarin Android Designer Not Working -

Image
my android designer isn't working in vs2015. have installed latest updates isn't working still. i'm getting error message in following picture: can me? sdk manager can ran manually from: "c:\program files (x86)\android\android-sdk\sdk manager.exe" please check have installed proper sdk - you'll need 1 of latest - 25 , 1 of need (like 17 or so)

c++ - Windows 8.1 Custom Credential Provider working for one user -

i have customized windows 8/8.1 credential provider sample downloaded , directed following link: https://code.msdn.microsoft.com/windowsapps/v2-credential-provider-7549a730/view/discussions the credential provider works fine no problem. when boot windows, shows sign-in options under password field. when click sign-in options shows me icon custom provider. when created user account, doesn't give me additional sign-in options on new account , asks password (default credential provider). how can use custom provider user accounts available on system? these sign-in options appear every user? best regards

c++ - How to build Qt 5.7.0 for cross compilation? -

how build qt 5.7.0 on ubuntu cross compile windows? i have error: in file included qt-everywhere-opensource-src-5.7.0/qtbase/include/qtcore/qt_windows.h:1:0, main.cpp:33: qt-everywhere-opensource-src-5.7.0/qtbase/include/qtcore/../../src/corelib/global/qt_windows.h:61:21: fatal error: windows.h: no such file or directory my configure options: ./configure -opensource -c++std c++11 -xplatform win32-g++ -device-option cross_compile=i686-w64-mingw32- -device-option pkg_config=i686-w64-mingw32-pkg-config -force-pkg-config -prefix /opt/qt/qt-5.7.0-win32 -nomake examples windows.h has path: /usr/i686-w64-mingw32/include/windows.h note: don't want use mxe. not sure if proper fix, seems qt tries build 1 of tools under activeqt (which windows-only) native. here edited file: qtactiveqt/src/tools/idc/idc.pro and commented out 2 first lines, seemed fix issue. (i have binfmt configured run .exe files through wine, may influence if tries run idc tool ...

forms - Get selected radio button value in view in Django -

i have case want use radio buttons query option can correct query set according selected radio button. can not find way selected radio button value in form. there lot of info using form class. simple html form. part of form is: <label for="house-all-id">all</label> <input type="radio" id="house-all-id" name="h-type" value="0"/> <label for="house-orp-id">just case one</label> <input type="radio" id="house-orp-id" name="h-type" value="1"/> <label for="house-inm-id">just case two</label> <input type="radio" id="house-inm-id" name="h-type" value="2"/> these radio-buttons part of widgets correct queryset. in view: h_type = request.post.get('h_type') this returns none-type object. how can value of selected radio button? your fields named "h-type" yo...

Python TypeError: 'list' object is not callable -

# -*- coding:utf-8 -*- import codecs import numpy np import csv import pandas pd* nons_file=pd.read_csv(r'c:\users\roy\desktop\bighomework\new\non_subscibe\session.csv') s_file=pd.read_csv(r'c:\users\roy\desktop\bighomework\new\subscribe\session1.csv') s_file['subscribe'] = 1 nons_file['subscribe'] = 0 file=s_file.append(nons_file, ignore_index=false, verify_integrity=false) id_dict={} count=0 in range(len(file.index)): if file[i].id not in id_dict: count+=1 file[i].id id_dict[id]=count else: file[i].id=id_dict[id] id_dict={} count=0 typeerror traceback (most recent call last) “for in range(len(file.index)):” typeerror: 'list' object not callable

How to detect if a double array (2D) has duplicates In Visual Basic -

just trying detect if double array has in each row consecutive duplicates in it. im not sure why code isnt working, highly appreciated r integer = 0 num - 1 dim rowclashes integer = 0 c1 integer = 0 num - 2 c2 integer = c1 + 1 num - 1 if myteacherarray(r, c1) = myteacherarray(r, c2) rowclashes += 1 end if next next messagebox.show("period " & r & ":" & rowclashes) next thanks your code looks if loop through rows, , in each row check if there more 1 cell given value (i.e. 2 or more cells equal). if correct, note 3 loops run same limit, meaning num - 1 . table of same number of rows , columns? if not, there have 1 error. since not explaining why does not work , can't elaborate further.

relational database - alternative to intersect operation in mysql -

when try below code got error "error 1064 (42000): have error in sql syntax; check manual corresponds mysql server version right syntax use near 'intersect select sc1.section_identifier,sc2." and searched in internet , found new fact mysql doesn't support intersect operation. how can fix code having same function 'intersect'. please me!! select g1.section_identifier, g2.section_identifier grade_report g1, grade_report g2 g1.student_number=g2.student_number , g1.section_identifier<g2.section_identifier intersect select sc1.section_identifier,sc2.section_identifier section sc1, section sc2 sc1.course_number=sc2.course_number , sc1.section_identifier<sc2.section_identifier;

html - Javascript will not redirect the form to the specified file path (or URL), with the dual option of pressing return key, or clicking submit button -

i beginner, , have researched week on roadblock. have tried many options make simple code work. the goal enter password, press enter or click submit button , redirect page specified url or file path. else have tried seems blank out function pressing enter won't work anymore, or next option redirect when password wrong, or next idea doesn't pop alert wrong password; examples: tried using input type="button" onclick="2ndfunction" , having 2nd function trigger onsubmit() function.. tried using both input type="button" , input type="submit" separate form beneath input type="password" form. both, tried doing onclick or onsubmit functions check password. form action="url.blah" redirect page url.blah if password wrong; password check, wronggg, redirect. form action="#" pretty obsolete or not necessary, , same thing well. form method="post" or "get" doesnt function, besides send typed-in...

sql server - ExecuteNonQuery always returns -1 -

i have created stored procedure deleting record. in stored procedure first checking usage of data going delete. if being used, stored procedure return -2 otherwise deletes record. but problem record exists return -1 instead of -2. have set nocount off don't know problem. i know question answered setting nocount off not working me alter procedure [dbo].[spdeletepidnumber] @id int begin set nocount off; -- insert statements procedure here if(exists(select * tblbills pid = @id)) begin return -2 end else begin delete helperpidnumber id = @id end end public int deletepidnumber(int id) { try { int result = 0; using (sqlconnection conn = new sqlconnection(properties.settings.default.connection)) { var cmd = new sqlcommand("spdeletepidnumber", conn); cmd.commandtype = system.data.commandtype.storedprocedure; ...

jquery - How to get input value with no id using JavaScript? -

i have editable datatabe , when edit mode, generated html shown below: <td><form><input autocomplete="off" name="value" ></form></td> there s textbox input , need t value of input. however, cannot give id there no configuration of datatable , decided value using javaascipt. have tried many different methods closest() shown below, cannot value. possible grab it? var $row = $(this).closest("tr"); $tds = $row.find("td"); you might use document.queryselector : var input = document.queryselector('[name="value"]`); or, using jquery, use same selector: var input = $('[name="value"]');

Image in bootstrap popover is not contained in a frame -

Image
i use bootstrap popover. <script> $(document).ready(function(){ $('a[rel=popover]').popover({ html: true, trigger: 'hover', placement: 'right', content: function(){return '<img src="'+$(this).data('img') + '" />';} }); }); </script> but big images not contained in frame can see in image below. how can fix problem? ok, found need change max-width. .popover{ max-width: 500px; }

javascript - alert box shows up N times after clicking N times on submit button -

given function: function validate() { var elements = ["firstname", "lastname", "password", "favfood", "favsport"]; document.getelementbyid('register').novalidate = true; document.getelementbyid('register').addeventlistener('submit', function(event) { (var = 0; < elements.length; i++) { if(document.getelementbyid(elements[i]).hasattribute("required")) { if(!document.getelementbyid(elements[i]).checkvalidity()) { event.preventdefault(); alert('please, fill in every required field of form.'); break; } } } }, false); } and form: <form name="register" id="register" method="post" action="this-file.php"> [html elements validate] <input type="submit" value="register" onclick="validate()"> </...

PHP/MYSQL Transaction generating two same primary key -

Image
i have function used web services. code below. public function create_order() { try{ $this->db->trans_begin(); $this->form_validation->set_rules($this->form_validation_array->get_app_rules('authenticate')); $this->form_validation->set_rules("table_id","table_id","required"); // $this->form_validation->set_rules("item[]","items","required"); if ($this->form_validation->run() == true) { $credential = array( "restaurant_id" => $this->input->post("restaurant_id"), "app_user_id" => $this->input->post("app_user_id"), "app_id" => $this->input->post("app_id"), "app_secret_id" => $this->input->post("app_secret") ...

Android type mismatch error in Json -

**i think facing problem on passing request youtube json list **public class getyoutubeuservideostask implements runnable { public static final string library = "library"; private final handler replyto; private final string username; public httpurirequest request; public getyoutubeuservideostask(handler replyto, string username) { this.replyto = replyto; this.username = username; } @override public void run() { try { httpclient client = new defaulthttpclient(); httpurirequest request = new httpget("https://gdata.youtube.com/feeds/api/videos?author=" +username+"pl25zd6tonofvkhbbrcaufkgs00d1it2h9"); httpresponse response = null; response = client.execute(request); string jsonstring = streamutils.converttostring(response.getentity().getcontent()); jsonobject json = new jsonobject(jsonstring); jsonobject response1 = json.getjsonobject("response"); jsonarray jsonarra...

How do I compare strings in Java? -

i've been using == operator in program compare strings far. however, ran bug, changed 1 of them .equals() instead, , fixed bug. is == bad? when should , should not used? what's difference? == tests reference equality (whether same object). .equals() tests value equality (whether logically "equal"). objects.equals() checks nulls before calling .equals() don't have (available of jdk7, available in guava ). consequently, if want test whether 2 strings have same value want use objects.equals() . // these 2 have same value new string("test").equals("test") // --> true // ... not same object new string("test") == "test" // --> false // ... neither these new string("test") == new string("test") // --> false // ... these because literals interned // compiler , refer same object "test" == "test" // --> true // ... should call objects.equals() o...

How to append characters between two strings in existing .txt file using python -

i trying add "," between lot of data in .txt file , want delete second rows. this example of txt file 1 1 139 178 128 83 140 140 87 87 2 1 199 204 130 111 198 198 89 89 3 1 188 182 107 120 183 183 109 109 ...... '....' here means thousand of data. and want print result in new .txt file this results wanted. 1, 139, 178, 128, 83, 140, 140, 87, 87 2, 199, 204, 130, 111, 198, 198, 89, 89 3, 188, 182, 107, 120, 183, 183, 109, 109 ..... i hope 1 here can me problem , appreciate much! thanks! first, iterate on lines: with open(filename) f: line in f: # can process line here now lets see can each line: words = line.split() # split on whitespace del words[1] # remove word @ i...