Posts

Showing posts from August, 2011

vb.net - Accessing Location on Windows 10 in .net desktop application -

the company work has application used our field staff registers gps location periodically, wrote application windows 8 x86 using system.device.location geocoordinatewatcher class. in windows 10 same code ceases function properly, geocoordinatewatcher.permission returns granted, yet continue receive unknown position each call. windows 8 , windows 10 tablets both have lte. public function getlocation() geocoordinate dim geocoordinate geocoordinate dim watcher geocoordinatewatcher watcher = new geocoordinatewatcher(geopositionaccuracy.high) watcher.trystart(false, timespan.frommilliseconds(15000)) logtofile("position permission: " & watcher.permission.tostring) logtofile("watcher status: " & watcher.status.tostring) geocoordinate = watcher.position.location if geocoordinate.isunknown logtofile("unknown") else logtofile(string.form...

html5 - How can I animate a line drawing using SVG? -

i'm trying run https://jsfiddle.net/kfbzhy9p/ 1 continuous line breaks 2 , doesn't seem connect. if stop animation it's partly drawn. i'm saving path using illustrator , object >> compound path >> make stroke-miterlimit attribute? your path approximately 1908 units long, that's why treating 1000 units long makes things odd.

c# - Kinect 2.0 polling frames -

i'm working on c# .net project using kinect device , official sdk 2.0. right i'm processing frames via events i'd try via polling method i've read in documentation of 1.0 version of sdk i've found nothing specific 2.0 version has microsoft dropped support polling frames or missing something? polling restricted kinect sdk 1.5 1.8 check - https://msdn.microsoft.com/en-us/library/hh973076.aspx for kinect sdk 2.0 should use multisourceframeready check - https://msdn.microsoft.com/en-us/library/microsoft.kinect.multisourceframereader.aspx and - http://kinect.github.io/tutorial/

imagemagick - Is this GIF a still image or an animation? (in Ruby) -

Image
how can use rmagick determine how many frames remote gif has? you can use magick::imagelist#length : returns number of images in imagelist. for example, remote gif: has 12 frames: require 'rmagick' magick::imagelist.new('https://i.giphy.com/zllydol7ndm7c.gif').length #=> 12

python - How can I change the orientation of a buttons in a stack layout in Kivy -

from kivy.app import app kivy.uix.button import button kivy.uix.stacklayout import stacklayout class mylayout(stacklayout): def __init__(self, **kwargs): super(mylayout, self).__init__(**kwargs) in range(10): btn = button(text=str(i), width=40, size_hint=(none, 0.15), orientation= 'lr-bt') self.add_widget(btn) class nameapp(app): def build(self): ml = mylayout() return ml if __name__ == "__main__": nameapp().run() i have attempted change orientation here, orientation displayed on app still if default orientation property of layout, not of widgets contains. can use self.orientation = "lr-bt" in __init__ function assign property layout. assign in appropriate .kv file if use that.

operating system - Polling vs. Interrupts with slow/fast I/O devices -

i'm learning differences between polling , interrupts i/o in os class , 1 of things teacher mentioned speed of i/o device can make difference in method better. didn't follow on i've been wracking brain , can't figure out why. feel using interrupts better , don't see how speed of i/o device has it. the advantage of polling comes when don't care every change occurs. assume have real-time system measures temperature of vat of molten plastic used molding. let's device can measure resolution of 1/1000 of degree , can take new temperature every 1/10,000 of second. however, need temperature every second , need know temperature within 1/10 of degree. in kind of environment, polling device might preferable. make 1 polling request every second. if used interrupts, 10,000 interrupts second temperature moved +/- 1/1000 of degree. polling used common i/o devices, such joysticks , pointing devices. that said, there little need polling , has pretty g...

objective c - How do I check if an object is being @synchronized -

sometimes wrote following code synchronized routine: @synchronized(objtobesync){ .... } when 2 threads try access sync block @ same time, 1 block others, until 1 exits sync block. however, don't want 1 blocks other, others check if object being synchronized, , other thing have sth this: @synchronized(objtobesync){ _isbeingsync = yes; ... _isbeingsync = no; } _isbeingsync additional var on checking if objtobesync being sync. other threads check _isbeingsync before continue work. , question objc provide sth check objtobesync directly not introduce additional var mark down status. the compiler translates @synchronized(objtobesync) { ... } into callq _objc_sync_enter ... callq _objc_sync_exit and objective-c runtime source code (objc-sync.mm, objc-os.mm, objc-lockdebug.mm, objc-os.h) 1 can see these functions pthread_mutex_lock(m->mutex); ... pthread_mutex_unlock(m->mutex); where m->mutex pthread_mutex_t pthread_mutex_recur...

c# - Validating property value, based on another model property -

i have question regarding property validation, however, haven't yet been able find appropriate answer. i have following classes public class indexviewmodel { public film film { get; set; } public reviewmodel review { get; set; } } public class reviewmodel { [requiredif // fire if 'genre' equal genre.horror] public string text { get; set; } } public class film { public string title { get; set; } public director director { get; set; } public genre genre { get; set; } } public class director { public string name { get; set; } } public enum genre { horror, thriller, scifi, drama } is possible add [requiredif] attribute on text property in reviewmodel fires validation based on value of genre in film model. appreciated. i wouldn't recommend using validation attributes when properties need validated aren't in class it's associated with. haven't seen requiredifattribute implementation cuts...

nightwatch.js - Hovering with moveTo or moveToElement -

i'm having trouble getting background color of link using following code , selenium stand-alone 2.53.0 , firefox 50.0.2661.75 m or chrome latest: although during test don't see mouse moving, @ bottom of browser's window in status bar, see url change href of link. i cannot seem trigger hover event elements, background color default color , not hovered stated color. ideas around this? browser.movetoelement('a[href="http://www.foo.com"]',2,2, function() { browser.pause(2000) .getcssproperty('a[href="http://www.foo.com"]', "background-color", function(results){ console.log('color: ' + results); }); }); if remove getcssproperty callback, i'm still not getting right background color hover , not seeing mouse pointer move: browser.movetoelement('a[href="http://www.foo.com"]',2,2) .pause(2000) .getcssproperty('a[href="http://ww...

When should I apply demorgans law in programming? -

i think programmer has taken intro programming class had memorize demorgan's law. in case don't know is, here gist !(a && b) = !a || !b !(a || b) = !a && !b i under assumption if had memorize it, find applicable in programming situation. haven't had use @ all. is there reason why should use in programming? make program faster, or make conditions easier read? keeping code readable big reason, , i'm sure whoever works on code after agree it's important one. , you'll save cpu cycle or 2 if invert (!) 1 value instead of two. another reason bypass short-circuiting. when many languages see !a || !b stop evaluating if !a true because doesn't matter if !b true or not. !a enough or true. if , b functions instead of variables, , want both execute, you're gonna have problem: if( !save_record() || !save_another_record() ) { echo 'something bad happened'; } demorgan's laws let replace or and. both sides ...

python 3.x - Recursive function doesn't return created string -

i new @ python, maybe can silly question. i've implemented simple recursive knapsack solution returns bit sequence eventually. not return sequence generated. here code , results different inputs. def knapsackrecursive(items, maxnum, bestresponse): print('items=' + str(items) + ', maxnum=' + str(maxnum)) referenceindex = 0 editablemaxnum = maxnum if editablemaxnum == 0: bestresponse = '0' else: in reversed(items): item = int(i) if editablemaxnum >= item: if referenceindex == 0: referenceindex = items.index(str(item)) editablemaxnum -= item bestresponse = '1' + bestresponse else: bestresponse = '0' + bestresponse if editablemaxnum != 0: bestresponse = '' if referenceindex != 0: k in range(0, len(items) - referenceindex): ...

c# - Is Clearing ObservableCollection Recommended before Adding Items to it? -

i need filter observablecollection have items in it. approach better? // assigning filtered result directly filteredobservablecol = filteredcollectioncopy.where(i=> i.age > 25).toobservablecollection(); or // clearing collection first filteredobservablecol.clear(); filteredobservablecol = filteredcollectioncopy.where(i=> i.age > 25).toobservablecollection(); you use collectionviewsources instead of observablecollection bind to. there can apply filtering. icollectionview mycollection { get; private set; } public void loaddata() { var myobservable = //... load/create list mycollection = collectionviewsource.getdefaultview(myobservable); mycollection.filter = item => ((typeofitem)item).name = "bob"; }

html - Hover on mouse over rather than show transition on mouse out -

i trying make images on webpage show different colour when hover on them. instead happening images have transparent colour , showing original picture when hover on them. please can this: .service-style-1 .service-perview figcaption { position: absolute; width: 100%; height: 100%; -webkit-border-radius: 50%; -moz-border-radius: 50%; -o-border-radius: 50%; -ms-border-radius: 50%; -khtml-border-radius: 50%; border-radius: 50%; -webkit-transition: 0.2s linear; -moz-transition: 0.2s linear; -o-transition: 0.2s linear; -ms-transition: 0.2s linear; -khtml-transition: 0.2s linear; transition: 0.2s linear; top: 0; right: 0; z-index: 1; border: 104px solid rgba(255, 109, 132, 0.5); } .service-style-1:hover .service-perview figcaption { border-width: 8px; } html: <div class="row"> <div class="carousel-services carousel-col-3 carousel"> <div class="service-wrapper carousel-item"> <di...

java - Spring MVC in conjunction with angular vanishing view -

i try connect springmvc, apache tiles, angular , boostrap. after typing: http://localhost:8080/testrest menu appears bootstrap, table in appear videos , not pass second gets white screen. check video here: https://youtu.be/v9fvl0yuwxu rest returns data, it's ok. code angularjs: https://github.com/giecmarcin/[...]/main/webapp/web-inf/static/js view file: https://github.com/giecmarcin/[...]b-inf/pages/moviemanagment.jsp restcontroller: package com.springapp.mvc.controller; import com.springapp.mvc.entities.movie; import com.springapp.mvc.services.movieservice; import org.springframework.beans.factory.annotation.autowired; import org.springframework.http.httpstatus; import org.springframework.http.responseentity; import org.springframework.stereotype.controller; import org.springframework.web.bind.annotation.requestmapping; import org.springframework.web.bind.annotation.requestmethod; import org.springframework.web.bind.annotation.restcontroller; import java.util.li...

Oracle SQL Developer Query - Select most recent record and count by another column -

i novice sql , sure more simple can think of. looking recent record on table , count recent record status. ability return count status , month/year would bonus. table following: id status timestamp 1 active 04/19/2016 1 pending 04/18/2016 2 active 04/08/2016 2 pending 04/01/2016 3 pending 04/07/2016 4 pending 12/01/2015 5 cancelled 12/30/2015 when run query wanting following: active 04/2016 2 pending 04/2016 1 cancelled 12/2015 1 i able recent record using following: select id, status, date ( select table_a, status, date, row_number() on (partition id order date desc) col table_a) ps ps.col = 1; thank patience in advance. you of way there. rest aggregation: select status, to_char(date, 'yyyy-mm') yyyymm, count(*) (select table_a, status, date, row_number() on (partition id order date desc) seqnum table_a ) ps seqnum = 1 group select...

javascript - Use a method in a callback -

question being edited. sorry changes. please don't provide answers @ moment :) if declare object in javascript: var myobject = { function myfunction() { console.log('hi!'); } } why errors? wouldn't rather be: var myobject = { myfunction : function(){ console.log('hi!'); } } how call method: myobject.myfunction()

node.js - Node Request Library: Setting the Read timeout -

i have server responds quickly, has grab data external source. believe causing read timeout. getsubdevicestatus(){ var parent = this; let fullurl = this.baseurl + this.getsubdevicestatusendpoint; console.log(fullurl); console.log(this.authheaders); console.log(this.classname+ ": getsubdevicestatus called on device: "+this.deviceguid); request.get({ headers: this.authheaders, url: fullurl, timeout: 300000, }, function(error, response, body){ console.log(response.statuscode); if (!error && response.statuscode == 200) { console.log("response "+fullurl); console.log(response.headers) console.log(body.length); //parent.subdevices = []; let json_response = json.parse(body); //iterate through our updates } }else{ console.log(this.classname +": getsubdevicestatus failed."...

c# - How to deserialize jsonconvert newtonsoft? -

hello guys me? have class below public class emptraining { public int codcolig { get; set; } public string empid { get; set; } public string employee { get; set; } public string costcenter { get; set; } public string department { get; set; } public string workstationid { get; set; } public string workstation { get; set; } public string training { get; set; } public string createdt { get; set; } public string duedt { get; set; } } and need deserialize json below. { "employeestrainings": [ { "codcoligada": 1, "chapa": "sample string 2", "nome": "sample string 3", "ccusto": "sample string 4", "departamento": "sample string 5", "codposto": "sample string 6", "posto": "sample string 7", "treinamento": "sample string 8", ...

PowerPoint VBA code fails on second run without restarting ppt -

i'm using powerpoint 2013 on surface run slideshow. during slideshow, there code tracks time every slide changes , records in separate excel file. it works how on first time run through powerpoint. however, if don't close powerpoint , restart program, second time through not anything. code works until first instance of "activesheet" or "activecell". gets line of code, code stops running. doesn't stop slideshow, doesn't record data. it seems somehow powerpoint loses link excel. what cause fail on "activesheet" or "activecell"? code timer dim intslide integer dim oexcel excel.application dim owb workbook dim ws worksheet dim strpart string dim strcond string dim introw integer public declare ptrsafe sub getsystemtime lib "kernel32" (lpsystemtime systemtime) public declare ptrsafe sub sleep lib "kernel32" (byval dwmilliseconds long) public type systemtime year integer month integer day...

opengraph - Facebook Open Graph Debugger response code 0 -

i have problems domain , facebook open graph debugger. returns response code 0 link accesible. my html source code valid, tried hosting same page in domain , facebook open graph debugger can read content fine. any ideas problem? using cloudflare in domain, disabled 30 hours ago , problem still there. if scroll down bottom of page , click "see our scraper sees url" you'll empty page. suggest yes, facebook scrapper not able view page reason you've observed. heart of problem, , can safely ignore other erroneous , inaccurate messages facebook debugger displays, including: inferred property 'og:image' property should explicitly provided, if value can inferred other tags. inferred property 'og:url' property should explicitly provided, if value can inferred other tags. inferred property 'og:title' property should explicitly provided, if value can inferred other tags. share app id missing 'fb:app_id' property should e...

android - Alarm Manager to schedule an event to fire every day in different times -

i'm trying develop ramadan emsakia ,and want alarm run ever day in different intent = new intent(this, oneshotalarm.class); i.addflags(intent.flag_activity_new_task); alarmmanager alarmmgr0 = (alarmmanager)getsystemservice(context.alarm_service); pendingintent pi = pendingintent.getbroadcast(this, 0, i, pendingintent.flag_update_current); calendar timeoff0 = calendar.getinstance(); timeoff0.set(calendar.year, 2013); timeoff0.set(calendar.month, 6); timeoff0.set(calendar.day_of_month,1 ); timeoff0.set(calendar.hour_of_day, 8); timeoff0.set(calendar.minute, 51); timeoff0.set(calendar.second, 00); //set timer rtc wakeup alarm manager object alarmmgr0.set(alarmmanager.rtc_wakeup, timeoff0.gettimeinmillis(), pi); pendingintent pi1 = pendingintent.getbroadcast(this, 0, i, pendingintent.flag_update_current); calendar timeoff1 = calendar.getinstance(); timeoff1.set(calendar.year, 2013); timeoff1.set(calendar.month, 6); timeoff1.set(...

java - Add native dll file to intelliJ -

so have dll need implement in java project in intellij tried in dependecies tab. got error in console: can't load ia 32-bit .dll on amd 64-bit platform btw, have intel processor. it sounds you're running 64 bit version of intellij and/or jdk , library compiled 32 bit. you either need new version of library 64 bit or contact jetbrains see if there 32 bit version of intellij on windows. and side note - "amd 64" 64 bit variation on x86 chips. 32 bit chips done intel. both intel , amd came out 64 bit chips @ same time. intel made 64 bit chip incompatible 32 bit chips. amd made them compatible. why don't hear itanium chips anymore. intel chips use amd64 architecture error referring to.

html - Buttons not dependent on content, all same size -

Image
i have struggle getting button same size when there placed different content inside button. looking tips , trick can me understand better. here picture of situasjon: here css code have used button part: .but { background-color: white; color: black; border: 2px solid #c8c8c8; height: 1.5em; text-decoration: none; display: inline-block; font-size: 1.2em; cursor: pointer; margin: -2px; } .symbox { width: 20em; height: 5.2em; overflow-y: auto; overflow-x: hidden; border: 1px solid black; margin: 1px 0px; } .but buttons , .symbox border around buttons you can use flexbox , this: .container { width: 4em; display:flex; flex-wrap:wrap; } .but { border: 2px solid #ccc; padding: 2px; text-align: center; flex-grow: 1; } <div class="container"> <div class="but">a</div> <div class="but">b</div> <div class="but">c</div> <div class="but...

amazon web services - Digital Audio AWS Add To Cart Form Returns Empty Cart -

when using aws add cart form purchase digital audio, after continuing on amazons "add shopping cart" page returned empty shopping cart. example url: http://www.amazon.com/gp/aws/cart/add.html?awsaccesskeyid=akiaj5d6u3yo5xir6zyq&associatetag=scrip04b-20&asin.1=b01bzralvo&quantity.1=1 the digital album visable on page when click continue returns empty shopping cart. bug? edit: i've tried while being logged in , while being logged out. i've checked "mp3 cart" after clicking continue , empty too.

user interface - what if i use html 5 for one webpage when total project created in html4? -

i built website in html4 , add new tab(which link opens in new window). include videos in , want make page in html5. can make this? constraints? sorry bad english , need help. yes, since want opened on new window, should on new page. the constraints html5 page should have @ top: <!doctype html> and html4 page should have this: <!doctype html public "-//w3c//dtd html 4.01//en" "http://www.w3.org/tr/html4/strict.dtd"> more info on declarations here

java - How do I use button to switch pages in android studio? -

i trying use btn2 switch page mainactivity calcpage.class. cant seem figure out doing wrong. i have error lines underneath btn2, onclicklistener, override, , view v here mainactivity.java package edu.khershockolivetcollege.ballistic_calculator; import android.app.activity; import android.os.bundle; import android.view.view; import android.view.view.onclicklistener; import android.widget.button; import android.widget.edittext; import android.widget.textview; import android.content.intent; import java.text.decimalformat; public class mainactivity extends activity { @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.content_main); button btn1 = (button)findviewbyid(r.id.calculate); button btn2 = (button)findviewbyid(r.id.calculate); final edittext et1 = (edittext)findviewbyid(r.id.muzzletext); final edittext et2 = (edittext)findviewbyid(r.id.rangetext); final textview time = (te...

genetic algorithm - Fitness Sharing in multi objective optimization -

Image
i'm writing genetic algorithm uses fitness sharing in tournament selection. in relevant literature found ( sareni example ) mentioned solution's own fitness (fi) should divided sum of niche distances (mi). what don't understand is, optimizing multiple objectives each solution has more 1 fitness. 'fitness' fi? should see multiplication of fitness's ? for example, in code i'm writing (processing): float sharedfitnessa = (a.f2*a.f3) / nichecounta; thanks n for multi objective optimization goal of fitness sharing ( to distribute population on number of different peaks in search space each peak receiving fraction of population in proportion height of peak ) pursued in different manner. when 2 candidates either both dominated or both non-dominated (so it's they're in same equivalence class) niche count mi used choose "best fit" candidate. e.g. (here maximizing along x-axis , minimizing on y-axis) candidates aren...

sorting - Slicing neo4j Cypher results in chunks -

i want slice cypher results in chunks of 100 rows, , able retrieve specific chunk. at moment, way ensure rows not mixed-up user order makes query inefficient ( 3sec. me much) match (p:person) return p.id order p.id skip {chunk}*100 limit 100 where {chunk} external parameter identify specific chunk. any suggestions? ps: property p.id indexed. you may try adding label person before extracting chunks , using query like match (p:chunk:person) p limit 100 match (p) remove p:chunk return *

Dynamics CRM: How do I make a javascript function trigger every time a field/control on the form gains focus? -

i'm on version 2016, if matters. i have javascript function need called every time field on form gains focus. my end goal make if lookup field gains focus, text auto-highlighted there's no need click again before editing. i need know how function called each time field gains focus on form , can take there. thanks.

android - How to use onitemClickListener with Fragments? -

i trying implement onitemclicklistener in fragment class unfortunately not working properly... here source code.. please let me know error?? networkdetailsfragment.java(my fragment class) public class networkdetailsfragment extends fragment implements adapterview.onitemclicklistener{ private listview listview; private view networkdetailsview; private qosnetworkdetailsadapter qosnetworkdetailsadapter; private qosnetworkdetailsdatabasehelper qosnetworkdetailsdatabasehelper; private simplecursoradapter simplecursoradapter; private string log_tag = networkdetailsfragment.class.getsimplename(); @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { log.i(log_tag, "inside oncreateview() method"); networkdetailsview = inflater.inflate(r.layout.network_details, container, false); listview = (listvi...

java - Using object from other module in aspect -

i have 1 aspect using aspectj below: public aspect testaspect { pointcut classicpointcut(persistencemanagerimpl object) : execution(manager.persistencemanagerimpl.new(..)) && target(object); after(persistencemanagerimpl object) : classicpointcut(object){ system.err.println(object.getclass().getsimplename()); } } this aspect in module aspect. module packaking jar. persistencemanagerimpl in other module need use in module aspect. dependency management use maven. here of course problem cyclic reference. exists way how can resolve problem ? ----------edit---------- i error: java.lang.nosuchmethoderror:testaspect.ajc$after$testaspect$1$cc149106(ljava/lang/object;)v when move aspect same module, when persistencemanagerimpl obtain correct solution(of course). not, wanted. could put error result of compiling code? try put module dependency first later put dependency on aspectj maven plugin @ weavedependency in pom.xml follow: .... <d...

linux - Rename script in android (no-root) -

i trying run script in android phone (no-root) below task. get camera directory , copy *.mp4 files camera backups , backups directory , rename *.mp4 *.nomedia , exit shell. code cd / cd /storage/emulated/0/dcim/camera/ cp *.mp4 /storage/emulated/0/backups/ cd / cd /storage/emulated/0/backups/ mv *.mp4 *.nomedia exit output with file video-12-03-2015.mp4 in camera directory, script rename file *.nomedia looking video-12-03-2015.nomedia name , happening 1 file. not working multiple files if in camera directory. please help. copy mp4's /storage/emulated/0/dcim/camera/ /storage/emulated/0/backups/ cp /storage/emulated/0/dcim/camera/*.mp4 /storage/emulated/0/backups/ trim "mp4" extension , replace "nomedia": for f in /storage/emulated/0/backups/*.mp4; mv -- "$f" "${f%.mp4}.nomedia" done

Selenium "Element is not clickable at point" error in Firefox -

in regards webdriver error element not clickable @ point (x, y). element recieve click instead. for chromedriver, addressed @ debugging "element not clickable @ point" error , issue can occur in firefox well. what best ways resolve when occurs in firefoxdriver? this happens in below cases- when element loaded dom, position not fixed on ui. there can other div or images not loaded completely. the page getting refreshed before clicking element. workaround use thread.sleep before actions on each web element in ui, not idea. use webdriverwait expectedconditions. i facing same issue, page load time more , loading icon overlapping on entire web page. to fix it, have implemented webdriverwait expectedconditions, waits loading icon disappear before performing click action on element call function before performing action (i using data driven framework) public void waitforloader () throws exception { try { string objectarray[]=objectreader....

cobol - goback and GO TO paragraph -

is there way can let me cancel effect of "go to" in cobol example: perform procedure1 thru e--procedure1 display "perform procedure2 thru e--procedure2" perform procedure2 thru e--procedure2 goback. procedure1 section. display "begin============proc procedure1" perform lecture thru e--lecture perform endd thru e--endd display " endd============proc procedure1" continue. exit. e--procedure1. exit. lecture. display "i label lecture" go endd continue. e--lecture. exit. endd. display "i label endd" continue. e--endd. exit. procedure2 section. display "begin============proc procedure2" display "i label procedure2" display " endd============proc procedure2" continue. e--procedure2. exit. when code execute...

html - Javascript - Get the average colours of pixels in a square -

Image
so have transparent web page (all elements visible background transparent - using software , background transparent , can clicked through). what need able move box select specific part of web page , box detect colour behind window (as background transparent)? this picture should make little more sense of it; red is, example, desktop background. window opened , box moved able detect colour. the idea this: http://lokeshdhakar.com/projects/color-thief/ need work on transparent window , not image unsure possible html , js? i understand possible use image need continuously check colour , when there change, update quickly. thanks help!

How To Create A COM Object Using .NET To Use It From A Classic ASP Page -

i have classic asp web site uses vb6 com object. i want create new version of com object using .net instead of vb6. [01] start visual studio 2015 (run admin). create new "class library" project. name it: "dotnetcom" [02] add new "com class" item. name it: "hellocom.vb" [03] add public function "hellocom.vb". for example: public function hello() string return "hello there!" end function [04] open "myproject". go "compile". select "target cpu: x86". [05] build "dotnetcom.dll". [06] start component services. add new com+ application. name it: "dotnetcom". [07] open "dotnetcom" properties. go "security tab". uncheck "enforce access checks application". [08] add new component. select "dotnetcomtest.tlb" (do not select "dotnetcomtest.dll"). [09] use com objec...

How to insert a list of values into SQL Server 2008 from asp.net using C# -

i want store multiple rows @ once in sql server. have taken 1 list datatype storing multiple row content. want pass list directly sql server. don't want use loop insert value 1 one. how can pass whole list parameter stored procedure? you can use comma-separated string, , parse on sql side. fastest solution, not have open connection wile doing loop on c# side.

javascript - toDataURL throws dom exception 18 only from button click -

im building mobile web/native app using knockout , phonegap. have js code: self.endcanvas=function(id){ var canvas; var data; switch(id){ case 1: canvas=$("#canvas1")[0]; data=canvas.todataurl("image/png"); console.log(data); } }; and html <canvas id="canvas1" width=300 height=250 data-bind="context: triggerredraw, contextcallback:redrawcanvas"></canvas> <a class="whitebutton" data-bind="click: endcanvas.bind($data,1)">המשך</a> apperantly, todataurl() function works fine when written outside self.endcanvas function, throws security error when called button click above code. knows why?

android - Drawing transparent area not updating with drag listener -

Image
i've seen many questions transparent background on child views custom viewgroup on so, no 1 seems have problem. background: created custom framelayout ; container has views added dynamically. children should have transparent background, other surface of container must have background color. children views can drag'n'dropped anywhere container. what do: override dispatchdraw() , create bitmap , new canvas , fill new canvas white background. make loop on children views, create new paint , rect child's dimensions , use porterduff.mode.dst_out clear child's area. each child, add paint , rect new canvas. finally, use drawbitmap on main canvas given dispatchdraw() , passing created bitmap. problem: works well: children have transparent background , rest filled white background. however, when add draglistener children, "cutting" area not updated (while dispatchdraw correctly recalled): in other words, when drag child view, it's dro...

angularjs - Angular directive from array element in ngRepeat -

i working on project have number of html cards, , format , positioning of cards same, content of them differ. my plan implement content of each card angular directive, , using ngrepeat, loop through array of directives can in order, displaying each directive in card. this: inside controller: $scope.cards = [ 'directice-one', 'directive-two', //etc.. ] my directive: .directive('directiveone', function () { return { restrict: "c", template: '<h1>one!!</h1>' }; }) .directive('directivetwo', function () { return { restrict: "c", template: '<h1>two!!</h1>' }; }) //etc.. my html: <div class="card" ng-repeat="item in cards"> <div class="{{item}}"></div> </div> but.. directives don't render. div class="directive-one" . this might design flaw on part,...

html - My title is hiding on some screens? -

trying figure out why title hiding on screens, have responsive design? here link: http://aswanson.net/kiloart/visions.html css line 14 .title, negative margin in there.. that's why.. margin-top: -9%; dirty fix layout: set marging of header1 > p zero add this: .title { position: absolute; width: 100%; } and again, dirty solution. if have time work on improving layout. btw, don't add negative margin top on header, adjust margin of <p> inside header title won't having same issue again... can set 0 or little more that.

javascript - Compiling libgc with emscripten -

i have file called foo.c contains line #include <gc.h> , referencing boehm garbage collector library. the emscripten documentation says external libraries must compiled bitcode first. compiled both 12.c , gc.c bitcode using clang , ran command: emcc 12.c gc.c this compiles warnings: warning: incorrect target triple 'x86_64-apple-macosx10.11.0' (did use emcc/em++ on source files , not clang directly?) warning: unresolved symbol: llvm_objectsize_i64_p0i8 running a.out.js gives me missing function: llvm_objectsize_i64_p0i8 . i'm assuming related warning regarding not using clang directly. however, when try compile bitcode via emcc gives me runaround , says warning:root:emcc: cannot find library "gc" fatal error: 'gc/gc.h' file not found what doing wrong? emscripten seems telling me must use emcc compile libgc documentation says must compile bitcode first.

oop - Is it possible in Python to declare that method must be overridden? -

i have "abstract" class, such as: class a: def do_some_cool_stuff(): ''' override ''' pass def do_some_boring_stuff(): return 2 + 2 and class b, subclassing a: class b(a): def do_stuff() return 4 is there way declare, method a.do_some_cool_stuff must overriden, and, possibly warning should raised while trying create b-class object, when b had not implemented a.do_some_cool_stuff ? yes, defining a abc (abstract base class) : from abc import abcmeta, abstractmethod class a(object): __metaclass__ = abcmeta @abstractmethod def do_some_cool_stuff(): ''' override ''' pass def do_some_boring_stuff(): return 2 + 2 you can subclass a , can create instances of such subclass if do_some_cool_stuff() method has concrete implementation: >>> abc import abcmeta, abstractmethod >>> class a(object): ... __me...

oracle - When may it make sense to not have an index on a table and why? -

for oracle , being relative application tuning, when may make sense not have index on table , why? there cost associated having index: it takes disk space it slows down updates (index needs updated well) it makes query planning more complex (slightly slower, more importantly increased potential bad decisions) these costs supposed offset benefit of more efficient query processing (faster, fewer i/o). if index not used enough justify cost, having index negative.

c# - How Can I count Html cell' in code behind? -

i'm using method bind data database fill in pdfptable , use method add data cell dfptable table = new pdfptable(3); pdfpcell cell = new pdfpcell(new paragraph("header colspan 3")); cell.backgroundcolor = color.gray; cell.colspan = 3; cell.horizontalalignment = element.align_center; cell.border = pdfborderarray.boolean; cell.bordercolor = color.red; table.addcell(cell); how can count html cell's in code behind pdfptable using asp.net try this: var noofcells = table.rows.select(r => r.getcells()).count();

ios - Both iPhone cameras on the same view? -

i've had around online, , had play around myself have been unable find literally on topic, assume it's never been played around before. let devices = avcapturedevice.devices().filter{ $0.hasmediatype(avmediatypevideo) && $0.position == avcapturedeviceposition.back } if let capturedevice = devices.first as? avcapturedevice { { try sessioncap.addinput(avcapturedeviceinput(device: capturedevice)) } catch { } sessioncap.sessionpreset = avcapturesessionpresetphoto sessioncap.startrunning() stillimageoutput.outputsettings = [avvideocodeckey:avvideocodecjpeg] if sessioncap.canaddoutput(stillimageoutput) { sessioncap.addoutput(stillimageoutput) } if let previewlayer = avcapturevideopreviewlayer(session: sessioncap) { previewlayer.bounds = view.bounds previewlayer.position = cgpointmake(view.bounds.midx, view.bounds.midy) previewl...

java - Why does Eclipse not come with a compiler? -

i'm new c++ programming. literally started , know nothing programming. watched tutorial online downloaded eclipse c/c++ , installed compiler equation.com , installed jdk. 1.) why eclipse not come compiler default? 2.) how know compiler download, there different types advantages on others? 3.) why jdk need installed? thanks! 1.) why eclipse not come compiler default? i sorry if missed don't think need install jdk c++ compiler installation in ide. sure why eclipse doesn't come inbuilt c++ compiler 1 of reason might eclipse ide java/j2ee components overloading ide c++ compiler or other popular compiler/interpreter doesn't makes sense.also might user configure these utilities themselves. 2.) how know compiler download, there different types advantages on others? you can search online repositories installing c++ compiler (just tool button , search c++ or repositories, think allows english keywords searching). 3.) why jdk need installed? as tol...

javascript - Adding an ID to Mapbox Marker -

i trying add id each marker can trigger modal window when marker clicked using jquery instead of built in popup functionality. want populate id property "id". i know need recursively go through , add ids i'm not how achieve this. how go doing this? var geojson = [{ "type": "feature", "geometry": { "coordinates": [-86.781602, 36.162664], "type": "point" }, "properties": { "id": 001, "title": "poi #1", "image": "http://lorempixel.com/image_output/city-h-c-524-822-2.jpg", "filter-1": true, "filter-2": false, "filter-3": false, "filter-4": true, "filter-5": false, "marker-color": "#1087bf", "marker-size": "medium", "marker-symbol": "" } }]; jsfiddle you need for loop....

javascript - CSS transition not working properly in this case -

i'm trying figure out why css transitions aren't working properly. have class called visible i'm using attempt fade in , fade element toggling. css is ul.feature-points { list-style: none; width: 36%; position: absolute; top: 19%; left: 2.4em; padding-left: 0; opacity: 0; -webkit-transition: opacity 2s ease; transition: opacity 2s ease; } ul.feature-points.visible { opacity: 1; } and lines of jquery attempt invoke transition are retobj.$layer.show(); retobj.$layer.find('.feature-points').addclass('visible'); for reason, transition doesn't work when happens , i'm wondering if might have fact before i'm making 1 of it's ancestors show. maybe events conflicting in browser or something? tried in multiple browsers , same thing. what's strange if think type in $('.feature-points').toggleclass('visible'); repeatedly console can see these elements transitioning properly. any ideas might going wrong? ...

c++ - QWidget on Mac OS X not focusing in Qt 5.x -

i have qsystemtrayicon qaction opens new window of type qwebview. when window loses focus , select qaction again, window should regain focus. on linux, doesn't on mac os x. problem is, when have window open , active, let's google chrome, when call show() on window i'm trying open, gets opened under google chrome, don't see it. same goes focusing, when have multiple windows open, , qwebview might last 1 in order, when click qaction focus window, under google chrome window. guess is, when click qaction, part of application's process, try open/focus window, in middle of operation, google chrome window gets scheduled , gains focus, since qsystemtrayicon cannot hold focus. because of that, when window gets opened/focused, not steal focus google chrome, because operating system not allow it, placed under focused window. here how create/focus window: // ... qpointer<qwebview> view; // ... void trayicon::webview() { if (!this->view) { this->view =...

jquery - Horizontal Menu with toggle on the right side -

Image
i browsing thenextweb , saw social icons horizontal menu on right side have toggle button does knows how it's done? i have made text version (without graphics) reference can start there. $('#menu').click(function(){ $('.nav-wrapper').toggleclass('active'); }); .nav-wrapper { list-style: none; float: right; } .nav-wrapper > li { float: left; overflow: hidden; } .nav { list-style: none; margin-right: -115px; transition: 0.3s; } .nav-wrapper.active .nav { margin-right: 0; transition: 0.3s; } .nav > li { float: left; width: 18px; margin: 0 5px; border: 1px solid red; } #menu::after { display: block; content: "open"; width: 60px; height: 20px; cursor: pointer; } .nav-wrapper.active > #menu::after { content: "clos" } <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>...

bioinformatics - How to use linux command to extract sequencing data -

i extract lines , following sequencing data. there ecoli.ffn file follows: $head ecoli.ffn >ecoli16:g027092:gcf_000460315:gi|545267691|ref|nz_ke701669.1|:551259-572036 atgagcctgattattgatgttatttcgcgt aaaacatccgtcaaacaaacgctgattaat >ecoli16:g000011:55989:gi|218693476|ref|nc_011748.1|:1128430-1131042 gtgtacgctatggcgggtaattttgccgat >ecoli16:g000012:55989:gi|218693476|ref|nc_011748.1|:1128430-1131042 gtgtacgctatggcgggtaattttgccgat ctgacagctgttcttacactggattcaacc ctgacagctgttcttacactggattcaacc and index.txt following $head index.txt g000011 g000012 what want "extract index.txt ecoli.ffn", ideal output is: >ecoli16:g000011:55989:gi|218693476|ref|nc_011748.1|:1128430-1131042 gtgtacgctatggcgggtaattttgccgat >ecoli16:g000012:55989:gi|218693476|ref|nc_011748.1|:1128430-1131042 gtgtacgctatggcgggtaattttgccgat ctgacagctgttcttacactggattcaacc ctgacagctgttcttacactggattcaacc how can this? write simple script ecoli.sh using awk: #!/bin/bash a=`cat inde...

entity framework - Auto running EF migrations on Azure app service -

our app runs on azure read/write permission on db. not nuts enabling ef's automatic migrations production application, , because db user account isn't owner, doesn't have permission run migrations anyway. i have used script run migrate.exe apply migrations in past, , happy result. there way accomplish on azure app service? currently running migrations right visual studio. one option use web job run migration script on schedule, or on-demand: web job overview you'd want set ci deployment current ef migration script available job: web jobs + ci and more info have backup strategy in place database, can smoke test completed migrations in staging environment (preferably in automated fashion) before flipping production. good luck!

javascript - Are arrow functions optimized like named functions? -

i watching nodejs interactive talk , guy speaking saying how anonymous functions bad 1 of reasons being if have no name, vm cannot optimize function based on how it's used because nameless. so if function name called random.async('blah', function randomfunc() {}); randomfunc can optimized function like: random.async('blah', function(cb) {}); this not optimized because it's anonymous, nameless. so wondering if arrow functions same thing because don't think can name arrow functions. will random.async('blah', (cb) => {}); optimized? edit: looking link talk guy mentions this, report back. (this talk while ago , remembered it) edit found video: https://youtu.be/_0w_822dijg?t=299 note, not entirely these pattern comparisons discussed @ linked video presentation. at 10000 iterations, named function appears complete fastest @ v8 implementation @ chromium. arrow function appeared return results in less time anonymous ...