Posts

google spreadsheet - Remove characters from a string after a certain word - excel -

Image
ive got list of imported data formatted following in excel / google spreadsheet. in column have full data , in b im trying strip out data left of word on . full data | stripped data nnk gov on 31 aug cde | nnk gov giffgaff.com on 30 aug cde | giffgaff.com tmrco stores on 12 aug cde | tmrco stores i using following forumal, falls down there non uniform white space there on last entry. =left(a1, len(a1)-14) is there more robust way can write this, dosnt fall on when there non uniform whitespace or additional wording after "cde" ? ive created shared google spreadsheet here scratch pad : https://docs.google.com/spreadsheets/d/1iier_hak8qjpy8w6qq7ww9-640o-hzmflnnjecps6m4/edit#gid=0 im using google spreadsheets, although ive marked question excel ive found there many shared functions. in excel: =trim(left(a1,find(" on",a1))) this work in google sheets there may easier way in google...

python - Django view - exclude in queryset? -

i have problem: after creating new world, (all countries automatically assigned every new world) user choose 1 country showed on top of site , can't delete country. how this? class country(models.model): name = models.charfield(verbose_name="name of country", max_length=100, default="australia") number = models.integerfield(verbose_name="number of country", default="1") def __unicode__(self): return self.name class world(models.model): country = models.manytomanyfield(country) name = models.charfield(verbose_name="new map", max_length=100) def __unicode__(self): return self.name now have this: after creating world user redirecting new_my_world, there should choose country , redirected site my_world view can delete countires expect one. how this? views.py def new_my_world(request, pk): world = get_object_or_404(world, pk=pk) return render(request, 'game/new_my_world.htm...

python - Change Pandas index datatype on MultiIndex -

i have pandas dataframe 2 indexes column1 indexa indexb 1001 aaa 1 bbb 1 ccc 1 ddd 1 created by pd.read_sql(sql=sql, index_col=['indexa', 'indexb']) mysql reading in indexb unicode , convert string. goal pivot table , have entries in indexb column names. when unicode values following column names: � � � � � � � � � when running pd.read_sql(sql=sql, index_col=['indexa', 'indexb']).unstack().fillna(0) edit: comment suggested following: df = pd.read_sql(sql) df['indexb'] = df['indexb'].astype(str) df = df.set_index(('indexa', 'indexb'), drop=true) which nice work around problem (thank you). still nice know if can done during initialization.

java - SQL Password Decrypt -

i having trouble finding out how decrypt sql passwords. many questions similar, none same. sql syntax: insert `a2166327_db`.`users` ( `id` , `username` , `password` , `bio` ) values ( '2', 'waffles', password( 'waffles' ) , 'waffles' ); i entry: |2|waffles|*a734e3e66d51b5043a297ec66ee24d3bc26ae328|waffles| how decrypt *a734e3e66d51b5043a297ec66ee24d3bc26ae328 "waffles?" can in java? this example: hash('admin') return 'd033e22ae348aeb5660fc2140aec35850c4da997' but can't decrypt result !!! why encryption existing, secure data. hash functions yoused in 1 way but can compare data in backend programming. if(hash('admin') == 'sql_password'){...} and example of java hash class. java hash class encrypt secret password

mysql - Navicat add fields to existing table -

using navicat application. have set of additional data want add , existing mysql table. new data has column key existing table, plus 35 additional fields of data. how can navicat used add in these new fields of data via interface? import tools don't see add new fields. run alter table table_name add column_name column_characteristics; described @ following url in navicat query window. http://www.tech-recipes.com/rx/378/add-a-column-to-an-existing-mysql-table/ make sure add ";" @ end of each line. this allow add multiple columns/fields @ once, easier adding them one-by-one navicat's design table tool. once columns/fields in import usual

php - MySQL join on data from two tables -

i trying make mysql query joins multiple tables have problems 1 join part. here query: select cs.survey_id, csq.question_id, csq.text question_text, cso.option_id, cso.text option_text, cstr.text text_question_result, count(csr.option_id) votes customer_survey cs inner join customer_survey_questions csq on cs.survey_id=csq.survey_id inner join customer_survey_options cso on cso.question_id=csq.question_id inner join customer_survey_results csr on cso.option_id=csr.option_id inner join customer_survey_text_results cstr on csq.question_id=cstr.question_id inner join customers c on c.customer_id= ??? cs.survey_id='$this->survey_id' group csr.option_id order csq.ord, cso.ord the problem this: the last join supposed join previous tables "customers" table on field customer_id. problem there 2 tables may include records in field - "customer_survey_results" table, , "customer_survey_text_results" table....

r - Compiling ipopt for ipoptr on Mac -

how compile ipopt on mac os x natively tuned accelerate blas/lapack in order able use r ipoptr ? there several configure options need specified: option enable necessary dynamic loading r add: --with-pic in order enable native blas/lapack add both: --with-blas="-framework accelerate" --with-lapack="" resulting configure command: ../configure --disable-shared \ f77=gfortran fflags="-fexceptions -m64 -fbackslash" \ cflags="-fno-common -no-cpp-precomp -fexceptions -arch x86_64 -m64" \ cxxflags="-fno-common -no-cpp-precomp -fexceptions -arch x86_64 -m64" \ --with-blas="-framework accelerate" --with-lapack="" --with-pic