Posts

vb.net - Reparent controls from a .NET form to VB6 -

good morning. i've got interop .net form can create , show inside vb6 project. now, open form in "mdi mode". i've got control allows me achieve result. unfortunatly seems work standard vb6 forms. so, test try copy content of .net form inside vb6 one... have suggestion on how deal situation? thank you! the way doing asking trouble - it's bit hacky. better use supported mechanisms far possible. you better off if create .net usercontrol gui want display, , make com visible. can instantiate control in vb6 form, support way mdi supported in vb6.

entity framework - ASP.NET MVC - user authorize in controller -

i have table in database names of users (with domains, example: domain1\user1). project has windows authentication. have 2 controllers - 1 logged in users , second specific user. table has 3 columns: (id, name, extra), "extra" fill user, admin (it has varchar: "admin"). want create such authorization, admin have access site second controller. how write it? for suggestions appreciate. in advance help. ;) monic ====edit==== example: asp.net mvc 4 custom authorize attribute permission codes (without roles) in main controller: [authorizeuser(accesslevel = "extra")] public class securecontroller : controller { (...) } public class authorizeuserattribute : authorizeattribute { public string accesslevel { get; set; } private report_dbent ren = new report_dbent(); protected override bool authorizecore(httpcontextbase httpcontext) { var isauthorized = base.authorizecore(httpcontext); if (!isauthorize...

c# - Are interfaces data types? -

i viewing tuts+ video titled design patterns in c# . in it, instructor says: "interfaces contracts. they data types define properties , methods have implement within class." my question: correct, is, interfaces data types in c#? from the c# programming guide : c# strongly-typed language. every variable , constant has type, every expression evaluates value. every method signature specifies type each input parameter , return value. (...) you use struct, class, interface, , enum constructs create own custom types. so yes, interfaces considered first class types in .net world. anyway find term "data type" confusing in context, think saying "type" more correct.

.htaccess file is not getting post method in php -

i using simple .htaccess file rest service implementation options +followsymlinks rewriteengine on rewriterule ^([a-za-z_-]*)$ get_price.php?name=$1 [nc,qsa] currently working fine $_get method , returning { status: 200 status_message: "record found" data: "kashif@gmail.com" } but pass parameter using $_post returns { status: 200 status_message: "record found" data: "" } any idea doing mistake. not expert in .htaccess files. below simple testing class get_price.php. <?php header("content-type:application/json"); include 'header.php'; $name = $_request['name']; $friendresult = mysqli_query($con,"select id user name='$name'"); $row = mysqli_fetch_array($friendresult); $data = $row['id']; deliver_response(200,"record found",$data); function deliver_response($status,$status_message,$data){ header("http/1.1 $status $stat...

Can I read XML Attributes dynamically in WPF C# -

hi have 1 big concern reading xml attributes like <xmlnode attribute1="somevalue1" attribute2="somevalue2" attribute3="somevalue3"> can read attribiute1, attribute2 or attribute3 dynamically? know can read attribute values nd.attributes["attribiute1"].value . how read "attribute1" dynamically? var xml = xelement.parse(@"your xml"); foreach (var attr in xml.attributes()) { } this not specific wpf, works wherever have access linq xml provider

Configuration parameters in web application (Java+Spring+Hibernate+Tapestry) -

i'm developing web application , need save 100 configuration parameters. best solution?: make xml file , parse read configuration. make table in database, , consult read configuration. another better solution? thanks. what done in case configuration parameters stored in properties files loaded spring. in event have parameters can changed during execution of application, simple way approach problem save them in database

python - How to generate group based columns faster? -

i'd create column dataframe based on anther column. example, have dataframe this: content date id bob birthday 2010.03.01 bob school 2010.04.01 tom shopping 2010.02.01 tom work 2010.09.01 tom holiday 2010.10.01 i want generate column equals size of id , resulting dataframe looks this: content date size id bob birthday 2010.03.01 2 bob school 2010.04.01 2 tom shopping 2010.02.01 3 tom work 2010.09.01 3 tom holiday 2010.10.01 3 the standard way seems use groupby , transform . code work: df['size'] = df['date'].groupby(df.index).transform(np.size) the problem is, transform works slow. in dataframe 40k rows, above code takes more 10 sec on pc. regularly work on datasets larger 1 million rows , generating group-based variables frequent practice. the problem lies transform . example, if generate cumcount on same dataframe u...