Posts

c# - Why would this code be placed in a *.Designer.cs file? -

in project i'm maintaining, original developer put code @ top of main form's designer.cs file: private void memberlistbox_load() { datatable dtmembers = null; sqlserver sqldal = null; sqldal = new sqlserver(properties.settings.default.bidataconnection); sqldal.commandtimeout = 120; dataset dsmember = sqldal.runsqldataset("select poisontoe platypusdata..members abs(activeflg)=1 order poisontoe", "members"); dtmembers = dsmember.tables[0]; memberlistbox.datasource = dtmembers; memberlistbox.displaymember = "poisontoe"; foreach (datarow unitdprow in dtmembers.rows) { string x = unitdprow[0].tostring(); memberlistbox.setitemchecked(memberlistbox.findstring(x), true); } } wouldn't mainform.cs more usual location such code? purpose of having in mainform.designer.cs? should move out mainform.cs?

linux - Ptrace parent process -

i'm trying monitor/redirect syscalls in own process. ld_preload doesn't work when fwrite calls write inside libc, , got/plt hooks seem have same problem. i'm looking solution based on ptrace, can't fork() , run main app child because app communicates parent via signals. there thread 2006 suggests tracer can on thread group that's different tracee, doesn't seem work in practice: http://yarchive.net/comp/linux/ptrace_self_attach.html pid = fork(); if (pid == 0) { prctl(pr_set_ptracer, getppid()); raise(sigstop); } else { sleep(1); ptrace(ptrace_seize, pid, null, null); (;;) { int status; int ret = waitpid(pid, &status, 0); warn("wait=%d:", ret); ret = ptrace(ptrace_syscall, pid, null, null); warn("ptrace=%d:", ret); } } the problem i'm facing ptrace(ptrace_syscall) expects tracee in ptrace-wait state, i.e. must have raised sigstop , tracer needs wait() i...

node.js - Gulp: Wait for express server to start before running tests -

i'm pretty new node. built sample express app , wrote bdd tests using cucumber.js. automate tests using gulp when run tests first start express app and, once server up, run through tests. however, tests run before server , therefore fail. there way wait (using gulp) server start , run tests? i'm using gulp-cucumber , gulp-express here (somewhat hidden gulp-load-plugins). my gulpfile (partial): var gulp = require('gulp'), plugins = require('gulp-load-plugins')(); gulp.task('server', function () { plugins.express.run(['bin/www']); }); gulp.task('cucumber', ['server'], function() { return gulp.src('features/*').pipe(plugins.cucumber({ 'steps': 'features/steps/*.steps.js', 'support': 'features/support/*.js' })); }); gulp.task('test', ['server', 'cucumber']); i have use solution - https://www.npmjs.com/package/run-sequence var gulp =...

html - Make container div expand to size of inner contents using table-cell display -

seems pretty standard problem: need container div element expand horizontally according width property of inner fieldset . i've found far offers 2 solutions. first solution use display:inline-block . however, i'm using display:table-cell position container won't work. the second add min-width container div. solve issue, width of inner fieldset not static, while looks fine when there's lot of content in fieldset looks awkward otherwise (there huge gap between particular div , 1 it's right). is there way force container div automatically resize, based on inner content, without using 2 solutions above? fiddle: http://jsfiddle.net/mj3h1682/ edit added following script page. method using css , if knows of one. <script type="text/javascript"> $(document).ready(function() { var width = $('#profile').outerwidth() + 20; $('#partialcolumn1').css('min-width', width); }); </script> ...

android - Retrofit 500 Internal server error getting data -

i'm starting out retrofit, i'm trying data server via @post request keep returning 500 internal server error. my aim send user name through request , server should return json string containing list of data given user. i'm sure simple i'm fresh using retrofit, code below: my servicegenerator(uses authentication): private static final string url = "http://ip address/projectzws/projectzwebservice.asmx"; private static restadapter.builder builder = new restadapter.builder() .setendpoint(url) .setclient(new okclient(new okhttpclient())); public static <s> s createservice(class<s> serviceclass, string username, string password) { if (username != null && password != null) { // concatenate username , password colon authentication string credentials = username + ":" + password; // create base64 encodet string final string basic = "basic " + base64....

java - Android app:dex:Debug error - cannot seem to solve -

please see link attached exact error. can run other android projects, 1 trying run refuses work: https://gyazo.com/bc05c903dddc7dd3b79f9979d6bc42aa build.gradle buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:1.3.0' // note: not place application dependencies here; belong // in individual module build.gradle files } } allprojects { repositories { jcenter() } } build.gradle (app) apply plugin: 'com.android.application' android { compilesdkversion 23 buildtoolsversion '23.0.1' defaultconfig { applicationid "com.tapthatstudios.fingersoffury" minsdkversion 21 targetsdkversion 23 versioncode 1 versionname "1.0" } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile 'com.android.supp...

Custom sorting in PowerBI chart -

Image
recently came across 1 issue in need show column order per defined way in powerbi report. thing is, powerbi sorts columns in either ascending(a->z) or descending(z->a) order, if 1 has apply custom order how should achieve this? here , example here can see order on x-axis ascending or can show descending, if sort order respect need; may below : 1.2 wheel preview --> 1.2 gtr --> 1.2 ultra --> 1.2 rtr , possible in powerbi desktop while creating report, if yes, guidelines followed appreciated. :) thanks. add column source data , populate values desired sort order. select column want custom sort , click modeling > sort column. select new column sortby column existing column, in screenshot: sortcategory column used sort order category column. now create chart , categories on axis sorted according values of sortcategory column.