Posts

python - How does readline() work behind the scenes when reading a text file? -

i understand how readline() takes in single line text file. specific details know about, respect how compiler interprets python language , how handled cpu, are: how readline() know line of text read, given successive calls readline() read text line line? is there way start reading line of text middle of text? how work respect cpu? i "beginner" (i have 4 years of "simpler" programming experience), wouldn't able understand technical details, feel free expand if others understand! example using file file.txt : fake file text in few lines question 1: how readline() know line of text read, given successive calls readline() read text line line? when open file in python, creates file object. file objects act file descriptors, means @ 1 point in time, point specific place in file. when first open file, pointer @ beginning of file. when call readline() , moves pointer forward character after next newline reads. calling tell() function o...

sqlite3 - Linker error with CMake -

i'm using jetbrains clion pure c (c ansi) development, know it's target c++, company works c , clion uses cmake build system. my system debian jessie system , sqlite3 , libsqlite3-dev installed. i'm trying build simple sqlite3 project this: #include <sqlite3.h> #include <stdio.h> int main() { sqlite3 *sqlconnection; int ret; ret = sqlite3_open("database/path.db, &sqlconnection); if (ret) { printf("ups ... can't open %d", ret); } do_some_queries(sqlconnection); return 0; } the automatic generated cmakelists.txt follwing. cmake_minimum_required(version 3.3) project(project) set(cmake_cxx_flags "${cmake_cxx_flags} -std=c++11") set(source_files main.cpp ) add_executable(project ${source_files}) when build, either through clion, either through command line, linker errors: ... undefined reference `sqlite3_prepare_v2' undefined reference `sqlite3_column_int' undefine...

python 3.x - Pypyodbc: return field description of specific field in specific MS Access table? -

i'm trying retrieve description (or other property) of field in ms access database. something in recordset of vba: for each field in recordset.fields debug.print "name: " & field.name debug.print "type: " & field.type debug.print "size: " & field.actualsize debug.print "value: " & field.value next is there way how pypyodbc (or other odbc module)? the cursor.description attribute give following information each column in cursor: name type_code display_size internal_size precision scale null_ok for other information on fields in access table need use com create access dao object , pull information fields collection of table's tabledef object. see accessing microsoft automation objects python for more information on using com python on windows.

python - Pandas: expand list in column to distinct rows -

Image
i have dataset big number of columns contain several values (imported google forms, columns allowing multiple selection). i've imported lists initially. now want analyse data based on values columns, i.e. given df = pd.dataframe(dict(a=[(1,2),(2,3),(1,)], b=[(1,3),(2,5),], c=['a','b','c'])) b c 0 (1, 2) (1, 3) 1 (2, 3) (2, 5) b 2 (1) () c i want plot bar chart x distinct values columns , b (they share same set of options), , y total count of rows having option: you can summing columns (basically concatenating contents) , calling pd.value_counts on them. example (modifying dataframe definition not raise error): df = pd.dataframe(dict(a=[(1,2),(2,3),(1,)], b=[(1,3),(2,5),()], c=['a','b','c'])) counts = pd.dataframe({col: pd.value_counts(df[col].sum()) col in ['a', 'b']}) counts.plot(kind='bar...

botframework - MS BotBuilder on Azure -

deploying botbuilder on azure fine. but when invoked botframework internal server error. log files show error in stack trace of application log. builder.chatconnector not constructor. anything done solve this? redeoploying application new azure site did trick.

c# - Images disappear in SliderView and ListView while scrolling -

i have sliderview (of appstudio.uwp.controls). images appear load page disappear when scroll through list. tested listview too. same thing happening there too. <controls:sliderview x:name="sliderview" itemssource="{x:bind listforotherpicturesthumbnails}" itemtemplate="{staticresource hero}" relativepanel.below="mainimage" relativepanel.alignleftwithpanel="true" relativepanel.alignrightwithpanel="true" arrowsvisibility="visible" /> the itemtemplate used follows- <datatemplate x:key="hero" x:datatype="local:storageitemthumbnailclass"> <grid margin="6" padding="12" background="white" borderthickness="1" borderbrush="lightgray"> <image source="{x:bind thumbnail, converter={staticres...

css - Why does my html page fail to render the same after making it standalone? -

Image
i have web page (web api/asp.net) looks pretty want to: this code produces it: @model webapprptscheduler.models.homemodel @using system.data @{ viewbag.title = "pro*act eservices reporting"; datatable dtunits = model.units; var units = x in dtunits.asenumerable() select new { unit = x.field<string>("unit") }; datatable dtreports = model.reports; var reports = x in dtreports.asenumerable() select new { report = x.field<string>("reportname").toupper() }; list<string> daysofmonth = model.daysofmonth; list<string> ordinalweeksofmonth = model.ordinalweek; list<string> daysofweek = model.daysofweek; list<string> patternfrequency = model.patternfrequency; int maxmonthsbackbegin = model.maxmonthsbackforreportbegin; int maxmonthsba...