Posts

Python: Dynamically call function within abstract class -

i have class instance needs call analyse method. constructor receives request object kind of message { "message":{ "attributes":{ "message_id":"2aj78h98-2112-4637-76h1-09ec727933bb", "topic":"mytopic", "version":1 }, "data":"{"id": 123541234}" } } my_model = mymodel(request) my_model.analyse(data) the structure of class mymodel is: import importlib class mymodel(object): def __init__(self, req): """ request, extract topic , dynamically create instance """ try: self.req = req classname = self.req.topic # in example: mytopic classpath = 'foo.bar' module = importlib.import_module(classpath) self.some_object = getattr(module, classname) except exception e: ...

reverse engineering - Binwalk - Compressed data is corrupt / Compressed data is corrupt -

root@kali:~/router# binwalk new-firmware.bin decimal hexadecimal description -------------------------------------------------------------------------------- 84 0x54 uimage header, header size: 64 bytes, header crc: 0xe52a7f50, created: 2012-02-10 07:27:12, image size: 819799 bytes, data address: 0x80002000, entry point: 0x801ac9f0, data crc: 0x6a10d412, os: linux, cpu: mips, image type: os kernel image, compression type: lzma, image name: "linux kernel image" 148 0x94 lzma compressed data, properties: 0x5d, dictionary size: 8388608 bytes, uncompressed size: 2386252 bytes 917588 0xe0054 squashfs filesystem, little endian, version 4.0, compression:lzma, size: 2588426 bytes, 375 inodes, blocksize: 16384 bytes, created: 2016-02-05 02:05:56 root@kali:~/router# dd if=new-firmware.bin of=uboot.lzma skip=148 bs=1 3735488+0 records in 3735488+0 records out 3735488 bytes (3.7 mb, 3.6 mib) copied, 4.16712 s, 896...

amazon web services - Kinesis timing out when invoked via Lambda but code hasn't changed -

so encountering weird situation kinesis timing out on me when invoke putrecord lambda function. weird part worked me earlier morning, doesn't work me now. code has not changed , it's same zip file before. has encountered situation before?

python - Create List from List of Key-Values -

given json structure below, want grab data item, pull 1 of values link out randomly. using random - familiar grabbing random value list. i'm stuck how make list list. see code below json. item0: 0 caption: "caption 0" link: "www.item0.com" type: "type0" 1 caption: "caption 1" link: "www.item1.com" type: "type1" python: chosen_item = "item0" firebase = firebase.firebaseapplication('https://app.firebaseio.com') result = firebase.get(chosen_item, none) if result: in result: result_link = (i['link']) print result_link the if-statement loops through , returns link 's in item unicode type. how make list this? ( result_link ) chosen_item = "item0" firebase = firebase.firebaseapplication('https://app.firebaseio.com') result = firebase.get(chosen_item, none) if result: links = [] in result: links.appe...

sql server 2008 - SQL Merge matching rows in SQL table -

here table schema table1 { column1 nvarchar(max), column2 nvarchar(max) } here sample data column1 column2 tom blue tom gary green gary yellow sam sam red i update column2 if column1 value duplcated , either 1 of rows in column2 empty , empty cell replaced non empty cell. for example desired output above sample data column1 column2 tom blue tom blue gary green gary yellow sam red sam red the below update maximum value, ignoring nulls or empty strings. if there 1 distinct possibility of course 1 chosen. ;with t ( select *, max(nullif(column2,'')) on (partition column1) c2 yourtable ) update t set column2 = c2 column2 null or column2 = '';

c# - How to bind Gridview update with Object Datasource parameters -

i have gridview shopping cart columns id | productname | productprice | productquantity | totalprice quantity editable column in gridview. need pass id , quantity datasource , how can that? beginner , have been working on hour , appreciated .aspx file <asp:objectdatasource id="objectdatasource1" runat="server" selectmethod="getlistfromcart" typename="getfromcart" deletemethod="deletelistfromcart" updatemethod="updatelistfromcart" > <deleteparameters> <asp:parameter name="id" type="int32" /> </deleteparameters> <updateparameters> <asp:parameter name="id" type="int32" /> <asp:parameter name="quantity" type="int32" /> </updateparameters> </asp:objectdatasource> <asp:gridview id="gridview1" runat="serve...

mingw32 - How do I use CMake to build a package using MinGW? -

i'm trying build software ecmwf called eccodes . it builds fine on gnu/linux. it builds fine on mac os x. it builds fine on windows/cygwin. unfortunately (ugh!!), must use windows , can't use cygwin. i have use mingw. the build instructions use cmake. no expert @ cmake. windows system on has: cygwin64 mingw64 a bare-bones visual studio 14 i've tried every incantation , override of cmake variables/options: -dcmake_c_compiler=... \ -dcmake_cxx_compiler=... \ -dcmake_fortran_compiler=... \ -dcmake_make_program=... \ -g ... to eccodes build using mingw, no luck. know ask, "why not contact ecmwf?" short answer is, response time long (months/years). faq page empty, , can't post questions on jira site (it's locked). would possible knows cmake , mingw download .tar.gz , build eccodes using mingw, , tell how did it? http://www.ecmwf.int/ https://software.ecmwf.int/wiki/display/ecc/eccodes+home https://software.ecmwf.int/wiki/...