Posts

c# - How to manage User Control in List Box using MVVM? -

Image
i know there many question of this, don't find correct answer, or don't understand correct way solve. have list box in mainwindows, populated custom object (fooobjclass). <listbox x:name="foolistbox"> <listbox.itemtemplate> <datatemplate> <foonamespace:fooobjview/> </datatemplate> </listbox.itemtemplate> </listbox> the fooobjview user control <usercontrol x:class="plcs7_test.smartobjrecognize.smartobjview" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:test.fooobjrecognize" mc:ignorable="d...

c# - Dataset not found in my namespace -

i creating visual c# forms application in visual studio, , trying use data set. have imported data set using wizard, , used in data grid, yet when debug program, gives me these errors: 1>c:\users\danie\documents\visual studio 2015\projects\viadmin\viadmin\home.designer.cs(219,25,219,37): error cs0426: type name 'staffdataset' not exist in type 'viadmin' 1>c:\users\danie\documents\visual studio 2015\projects\viadmin\viadmin\home.designer.cs(221,25,221,50): error cs0426: type name 'staffdatasettableadapters' not exist in type 'viadmin' i not sure why doing this, able see of columns in designer when not running it. have tried declaring like private dataset staffdataset; but vs tells me defined? if help, using vs 2015 community

encryption - Break MD5 hashed string exact format by knowing part of it -

is possible break/guess/detect format of md5 hashed string when know parts of (in case 1 login can changed, second supplied in opentext along hash) , can change of them , recalculate hash? length extension attack not usable in case because data can in middle of hashed text. bruteforce not possible. no it's not possible. the best can bruteforce missing parts.

ruby on rails - How can I cleanly broadcast to multiple channels at once with ActionCable? -

i have code: actioncable.server.broadcast "posts_#{self.post_id}", { object: some_object } i'd send same payload multiple broadcastings. obvious way pass array of broadcastings: actioncable.server.broadcast ["posts_#{self.post_id}", "all_posts"], \ { object: some_object } but seems treat entire array being identifier: [actioncable] broadcasting ["posts_30453", "all_posts"]: ... and neither broadcasting recieves message. it seems there should cleaner way calling actioncable.server.broadcast multiple times. there? i build tiny helper gem ( multicable ) this. adds broadcast_multiple method actioncable::server: > actioncable.server.broadcast_multiple ["broadcasting1", "broadcasting2"], { payload: "whatever" } [actioncable] broadcasting broadcasting1: {:payload=>"whatever"} [actioncable] broadcasting broadcasting2: {:payload=>"whatever"} eith...

python - Scrape webpage after form fill -

im trying scrape response website using pre-filled zip: zip who (i.e. zip code filled in.) tried using scrapy shell follows scrapy shell http://zipwho.com/?zip=77098&mode=zip but response not contain form-filled page, content main zipwho.com page , without details specific zip code. tried filling in form information using requests , lxml, doing wrong. import requests import lxml.html lh url = 'http://zipwho.com' form_data = { 'zip': '77098' } response = requests.post(url, data=form_data) tree = lh.document_fromstring(response.content) tree.xpath('//td[@class="keysplit"]') and table element data (td class = 'keysplit') still not exist. if have ideas working (hopefully simple in requests & lxml) best. the reason can't find data in html it's generated dynamically script. if @ first script in html, you'll see function called getdata contains data want. script later uses function bui...

algorithm - What is the most compact way in JavaScript to sort an array of objects by a particular key, where the sorting order is defined in an array? -

this question has answer here: sort array containing objects based on array [duplicate] 2 answers here's mean. suppose have array of objects var objs = [ { foo: 5, bar: "something"}, { foo: 4912, bar: "blah" }, { foo: -12, bar: "hehe" } ]; and array defines ordering on bar values, var arr = ["blah", "something", "hehe"] does javascript have way of getting version of objs to [ { foo: 4912, bar: "blah" }, { foo: 5, bar: "something"} { foo: -12, bar: "hehe" } ]; ??? the best way know like objs.sort(function(x,y){ var ix = arr.indexof(x), iy = arr.indexof(y); if(ix<iy) return -1; else if(ix==iy) return 0; else return 1; }); but i'm wondering if there's way more compact. you can refa...

redhat - Apache 403 Forbidden error when configuring a directory outside of root directory -

Image
i'm trying config server use directory /home/imagenesdbd , can't work, have googled lot, , made every sample found, nothing working, add following httpd.conf file alias "/imagenesdbd" "/home/imagenesdbd" <directory "/home/imagenesdbd"> options followsymlinks allowoverride none order allow,deny allow </directory> the directory has 0777 permission setting the context of directories are i expecting url working http://mydomain/imagenesdbd and got following error 403 - don't have permission access /imagenesdbd/ on server. thanks help the type context of /home/imagenesdbd home_root_t . selinux allow type context httpd_sys_content_t . you should change type of security context , can done running $ sudo chcon -r -t httpd_sys_content_t /home/imagenesdbd here can found chcon manual chcon