Posts

android - Update recycle view -

i have trouble recycleview. want update recycleview using diffutil. can't understand why not work. diffutil public class consumablediffcallback extends diffutil.callback { private list<consumablebytask> oldlistofconsumablebytask; private list<consumablebytask> newlistofconsumablebytask; @override public boolean areitemsthesame(int olditemposition, int newitemposition) { return oldlistofconsumablebytask.get(olditemposition).getquantity() != newlistofconsumablebytask.get(newitemposition).getquantity(); } @override public boolean arecontentsthesame(int olditemposition, int newitemposition) { return oldlistofconsumablebytask.get(olditemposition).equals(newlistofconsumablebytask.get(newitemposition)); }} my adapter holder public class consumeholder extends recyclerview.viewholder { private button addconsumebtn; public consumeholder(view itemview) { /** * add/change data , send server. * after close consumablesbytas...

python 2.7 - pandas shape issues when applying function returning multiple new columns -

i need return multiple calculated columns each row of pandas dataframe. this error: valueerror: shape of passed values (4, 2), indices imply (4, 3) raised when apply function executed in following code snippet: import pandas pd my_df = pd.dataframe({ 'datetime_stuff': ['2012-01-20', '2012-02-16', '2012-06-19', '2012-12-15'], 'url': ['http://www.something', 'http://www.somethingelse', 'http://www.foo', 'http://www.bar' ], 'categories': [['foo', 'bar'], ['x', 'y', 'z'], ['xxx'], ['a123', 'a456']], }) my_df['datetime_stuff'] = pd.to_datetime(my_df['datetime_stuff']) my_df.sort_values(['datetime_stuff'], inplace=true) print(my_df.head()) def calculate_stuff(row): if row['url'].startswith('http'): categories = row['categories'] if type(row['categories']) == ...

hash - .NET Core 2 Password Hashing -

i looking hash password in core 2. use bcrypt, however, struggling find core implementations. try nuget package: https://www.nuget.org/packages/bcrypt-core/ install-package bcrypt-core -version 2.0.0

python - SqueezeNet on Tensorflow using my own image data -

i learning squeezenets right now, here paper interested: https://arxiv.org/pdf/1602.07360.pdf i interested in implementing squeezenets scratch own image data opposed imagenet implementations online, using tensorflow. is there implementation can follow learn more? thank you.

javascript - How do I access different iframes? -

Image
this question has answer here: how pick element inside iframe using document.getelementbyid 2 answers i working website uses different iframes on same webpage. wondering how can access , manipulate iframe not focused in on. the website has body allows users type in, , want use method innerhtml (javascript) set value of text in box. however, i'm having trouble accessing iframe. here javascript trying use, wasn't working intended.. getelementbyid not function of getelementsbytagname("iframe") document.getelementsbytagname("iframe")[1].getelementbyid("tinymce").innerhtml="hello, world!" here 2 iframes working with: cannot inspect page , change iframe hand, not answer looking for. thank clearing things me! edit: suggested, try document.getelementsbytagname("iframe")[1].document.getelementbyid("ti...

python - Issues with implementing TensorFlow's MNIST example without feed_dict using a queue -

i came across tensorflow's deep mnist experts , wanted adapt more efficient use on gpus. since feed_dict seems incredibly slow, implemented input pipeline using tf.train.shuffle_batch , fifoqueue feed data model. here's gist stock implementation of tensorflow guide , here's gist attempt @ optimized implementation. now in example on tensorflow page, accuracy pretty approaches 1 after few thousand iterations. in code, aside queue implementation same model, accuracy seems oscillate between ~0.05 , ~0.15. further, loss reaches 2.3 after couple hundred iterations , doesn't decrease farther that. another noteworthy point: when make comparison original batch created , batch used in subsequent iterations, appear equivalent. perhaps issue lies in queuing/dequeuing i'm not sure how fix it. if sees issues implementation pointers appreciated! found solution. turns out tf.train.shuffle_batch implicitly implements randomshufflequeue . loading results of tf...

EF Core 2.0 Migrations Not Recognized by Package Manager Console -

i'm trying add migration .net core 2.0 web app through package manager console in visual studio 2017. receive error: "the entityframework package not installed on project ". however, entityframeworkcore 2.0 installed. i've tried: the enable-migrations command (although don't believe necessary anymore) the add-migration command "install-package microsoft.entityframeworkcore.sqlserver -version 2.0.0" through pmc re-installing entityframeworkcore 2.0 through nuget package manager is there other configuration needs done somewhere else? since ef core migrations work on .net core 1.1 project issue related .net core 2.0? cheers! the ef tools command-line interface (cli) provided in microsoft.entityframeworkcore.tools.dotnet. from https://docs.microsoft.com/en-us/aspnet/core/data/ef-mvc/migrations