Posts

Showing posts from February, 2010

Search and extract results from an array based on an entry keyword in ruby -

i compare array element , extract data in array here example of data i'm working with: array = [{:id=>3, :keyword=>"happy", :date=>"01/02/2016"}, {:id=>4, :keyword=>"happy", :date=>"01/02/2016"} ... ] for example want first keyword happy search same array ,extract if there's similar words , put them inside array here i'm looking end result: results = [{:keyword=>happy, :match =>{ {:id=>3, :keyword=>"happy", :date=>"01/02/2016"}... }] here first part of code : def relationship(file) data = open_data(file) parsed = json.parse(data) keywords = [] = 0 parsed.each |word| keywords << { id: += 1 , keyword: word['keyword'].downcase, date: word['date'] } end end def search_keyword(keyword) hash = [ {:id=>1, :keyword=>"happy", :date=>"01/02/2015"},...

python - Django doesn't load static files from S3 -

i made run 'python manage.py collectstatic' upload staticfiles s3 bucket. but after running 'sudo service apache2 restart', page doesn't load staticfiles although s3 bucket has 'static' directory including static files. how can solve problem? i include static files below : {% load compress %} {% load static staticfiles %} {% compress css %} <link rel="stylesheet type="text/css" href ="{% static 'bower_components/.../bootstrap.css' % /} ... {% endcompress %} my settings.py below: static_url = s3_url + '/static/' # path of static directory included in s3 bucket static_root = static_url staticfiles_dirs = ( os.path.join(base_dir, 'static/'), ) is there i'm missing now?

angular - ionic 2 - item slider - slide to trigger function -

i have ionic-item-sliding directives 3 buttons. 2 (a , b) appear when slide left , 1 (button c) on right. i want implement behavior function under button c triggered when drag item far right. the docs on ionic2 hompage give code snippet example ondrag(event, item) { let percent = event.getslidingpercent(); if (percent > 0) { // positive console.log('right side'); } else { // negative console.log('left side'); } if (math.abs(percent) > 1) { this.navctrl.push(nextpage,{param:item},{ animate: true, direction: 'forward' }) } } using on <ion-item-sliding *ngfor="let item of items "(iondrag)="ondrag($event, item)"></ion-item-sliding> i've getting behaviour when swipe far, call , push page multiple times (i guess many events i'm throwing) any suggestions on how implement correctly? thanks! you add flag sure push() method executed once. import { component } ...

android - How to prevent custom dialog from blinking cursor on first EditText inside of it -

i creating custom dialog window problem when dialog first launches automatically begins flashing cursor on first edittext in linearlayout defines structure of dialog. keyboard not appear, first edittext has blinking cursor on it. i attempted use requestfocus() function on textview within dialog cannot edited, blinking cursor remains on first edittext in dialog. if has advice or solutions solving problem, great. use either xml attribute or java function- xml: android:cursorvisible="false" java function: setcursorvisible(false)

Python custom 404 response error -

Image
i wrote hiscore checker game play, enter list of usernames .txt file & outputs results in found.txt. however if page responds 404 throws error instead of returning output " 0 " & continuing list. example of script, #!/usr/bin/python import urllib2 def get_total(username): try: req = urllib2.request('http://services.runescape.com/m=hiscore/index_lite.ws?player=' + username) res = urllib2.urlopen(req).read() parts = res.split(',') return parts[1] except urllib2.httperror, e: if e.code == 404: return "0" except: return "err" filename = "check.txt" accs = [] handler = open(filename) entry in handler.read().split('\n'): if "no displayname" not in entry: accs.append(entry) handler.close() account in accs: display_name = account.split(':')[len(account.split(':')) - 1] total = get_total(display_name) if "err" not in total: rstr = account + ' -...

java - use rest api written for angular js in android app -

i need know if write rest api in java using spring framework , using in angular js front end, possible use same api's andriod app later. use same api's both web , app, have no idea android development, please help. if api restful, , mean @ least stateless , resource based. yeah, doesn't matter program you're requesting data from. if able process response front end (reading format, etc). it'll fine. make sure api's endpoints work correctly , configured handle request programs using communicate api (most of times these http requests)

php - Hiding font names on a text/font previewer -

i coding online store customers able customise products text choosing few hand picked fonts. want use text/font preview box on website below: https://www.myfonts.com/fonts/cbx-jukebox/corner-store-jf/ creating font preview my question is, if create text/font previewer website possible mask true name of font using or still able find out looking code somehow or addon font? i thought give font files different names wasn't sure if work? i looked using cufon understanding download font file js. the reason because have gone lot of time select unique stylish fonts , don't want make easy competitors copy designs being able find out font is you cannot client side code (css, js). how hide when possibility there. maybe can done server-side code php gd. however, tiring work.

How to move tooltip position in Highchart? -

Image
i using highcharts.js build horizontal bar chart. working correctly default tooltip appears horizontally want tooltip position vertical instead of horizontal. is possible achieve that? appreciated! jsfiddle - example sample code: $(function () { var chart; $(document).ready(function() { chart = new highcharts.chart({ chart: { renderto: 'container', type: 'bar' }, title: { text: 'stacked bar chart' }, xaxis: { categories: ['apples', 'oranges', 'pears', 'grapes', 'bananas'] }, yaxis: { min: 0, title: { text: 'total fruit consumption' }, stacklabels: { enabled: true, style: { fontweight: 'bold...

windows - kivy button onstart info not working -

i'm beginning learn kivy on windows 10 machine. i've started small tutorials manly getting button display , event handler keep getting problems. currently have following code import kivy kivy.app import app kivy.uix.button import button kivy.uix.boxlayout import boxlayout kivy.logger import logger class myapp(app): def build(self): return button(text='hello') def on_start(self): logger.info('app: i\'m alive!') if __name__ == "__main__": myapp().run() when go run windows command window opens closes before can read going on , nothing happens. if remove def on_start method works ok , button displayed. is there wrong code or install wrong , need again.

python - Which one I have to use to read image in Django, StringIO or BytesIO? -

i'm trying compress image file before uploading in django application. i found nice code snippet site : https://djangosnippets.org/snippets/10460/ but doesn't work in python3 . think problem str or byte . someone advise use bytesio instead of stringio . so, edit code this. from django.db import models django.core.urlresolvers import reverse django.utils import timezone django.utils.text import slugify django.core.files.uploadedfile import inmemoryuploadedfile pil import image img io import stringio, bytesio def upload_location(instance, file_name): return "{}/{}/{}/{}".format( "album", instance.day, instance.week, file_name ) class album(models.model): days = ( ('sun', '일요일'), ('mon', '월요일'), ) name = models.charfield(max_length=50) description = models.charfield(max_length=100, blank=true) image = models.imagefield(upload_to=uplo...

amazon web services - AWS - Add identity provider for same Cognito Identity ID -

i using aws sdk, using federated identity providers cognito. right now, i'm doing this: private void setupcognitostuff() { _cognitocredentials = new cognitoawscredentials( my_identity id, // identity pool id _awsregion); // region if (_identityprovidername != null) _cognitocredentials.addlogin(_identityprovidername, _identityprovidertoken); _identityid = getidentityid(); } this works fine create or retrieve user's credentials, using facebook identity provider. cache cognito identity id in app's settings. so, let's next time user uses app, choose different login provider (let's google). i've cached cognito identity id last time logged in (via facebook). when instantiate cognitoawscredentials time, how tell want use existing cognito identity id, , google should added second identity provider, instead of creating whole new cognito identity? looking @ the documentation raw api , should possible: merging identiti...

linux - How do I Convert a QSetting::NativeFormat to QSetting::IniFormat? -

hello have mac os x plist file( qsetting::nativeformat ) generated application want take plist file on linux based os not support it. decided take file in ini format. easy read qsetting::iniformat . confuse how convert qsetting::nativeformat qsetting::iniformat . kindly me. the conversion must done on os x, because plist native format supported there. you'll need write code read settings in 1 format , dump them in another. can use qsettings::childgroups , childkeys enumerate settings. can have application it, can put helper application you'll manually invoke once.

javascript - Remove 'Duplicate this page and subpages' functionality in Silverstripe -

Image
in silverstripe if right click on page in sitetree have ability duplicate either single page or page , children. we have found users duplicate pages large numbers of children , prevent either removing 'this page , subpages' option or restricting admin users only. how can achieved? looking @ code in cms/javascript/cmsmain.tree.js in silverstripe 3.4 doesn't there way switch off. one option have add css cms hide menu item everybody: mysite/css/cms.css #vakata-contextmenu a[rel="duplicate"] + ul > li:last-child { display: none; } to enable cms.css file add following line our config.yml mysite/_config/config.yml leftandmain: extra_requirements_css: - 'mysite/css/cms.css'

c++ - I am not able to run this code on Code::blocks IDE but works fine online...!!can anyone tell me what modifications i should to get it working on IDE? -

by using typdef have defines stack, code blocks gives me error while call object. #include <iostream> using namespace std; struct stack { int data[20]; int top; }; in class, stack *s called , when run program gives error "s" maybe used uninitialised. whereas have initilaised using constructor. class stackop { public: stack *s; stackop() { s->top= -1; //constructor giving error. } bool stack_empty(); bool stack_full(); void push(); void pop(); void display(); }; bool stackop::stack_empty() { if(s->top == -1) { return 1; } else { return 0; } } bool stackop::stack_full() { if(s->top == 19) { return 1; } else { return 0; } } void stackop::push() { if(!stack_full()) { s->top=s->top + 1; cout<<"\n enter element: "; cin>>s->data[s->top]; } else ...

swift - Label automatically hide/show on scrolling in Header View -

i using expandable tableview , show/hide on click sectionheader . as want add label/button on headerview . @ time of scrolling label show/hide automatically. doesn't want label disappear on scroll of tableview . my code - func tableview(tableview: uitableview, willdisplayheaderview view: uiview, forsection section: int) { // background view @ index 0, content view @ index 1 if let bgview = view.subviews[0] as? uiview { if section == 0 { let labelvalue = uilabel(frame: cgrect(x: 5, y: 80, width: 40, height: 20)) labelvalue.backgroundcolor = uicolor.greencolor() bgview.addsubview(labelvalue) } if section == 1{ let labelvalue = uilabel(frame: cgrect(x: 5, y: 80, width: 40, height: 20)) labelvalue.backgroundcolor = uicolor.redcolor() bgview.addsubview(labelvalue) } if section == 2{ ...

java - source code of server that creates multiple servlet threads to handle concurrent requests -

folks, i have been trying understand how server creates multiple servlet threads handle each concurrent request appropriately , delegates these request details service() method of servlet instance. i want understand , analyze server's source-code or specific set of classes understand creation & maintenance of concurrent request processing through multi-threading. my understanding/assumption : there unanimous servlet instance per mapping , concurrent requests served individual servlet thread ( spawn server - multi-threading process want know in detail/source-code ) executed separately within own stack.

javascript - Make MediaElementJS work with Angularjs -

i'm making stream website , want play m3u8 in web embed player called mediaelement.js i should use angularjs doesn't work! here's code: html : <script src="/static/libs/jquery/jquery.js"></script> <script src="/static/libs/mediaelement/mediaelement-and-player.min.js"> </script> <link rel="stylesheet" href="/static/libs/mediaelement/mediaelementplayer.min.css" /> <script type="text/javascript" src="/static/libs/mediaelement/hls_streams.js"></script> <img ng-src="{{imagesbaseurl}}{{recipe.bg_image}}" alt="cover"> <video controls name="media" class="sticky to-left to-top" id="video-{{recipe.id}}"> <source ng-init="loadmediaelement()" type="application/x-mpegurl" src="http://st.vasapi.click:1935/vod/__default__/smil:20a57a4c-1377-4fb...

swift - "ios-charts" Do not draw empty or zero values. & Interpolate values on combined chart -

Image
my question 2 fold logic may similar. i have simple candlestick chart 2 different indicators. 1 @ bottom , other overlayed on top of candlestick data. (see screenshot) first: in lower chart not want draw values before calculated. in case 14 periods simple moving average. (see screenshot yellow box. not want draw these values) second: on overlay want "open", lowest value, highest value, , "close" of last bar. want draw line between these 4 points , ignore data in-between. (it should yellow line in screenshot). how can reformat set chart function ignore values before 14 periods on lower line chart? how can ignore other points , interpolate between 4 values on line chart combined view? currently have set values want "ignored" 0 (1950 in screenshot make readable , not squashed) around out of bounds errors. tried simplify code as possible make more readable here: // // viewcontroller.swift // import foundation import cocoa import charts v...

java - How do you Manage a CountdownTimer from within an IntentService? -

i implementing pomodoro timer using intentservice , seem struggling managing timer within intentservice . have @ moment following: the code: package com.nursson.pomodorotimer.service; import android.app.intentservice; import android.content.intent; import android.os.countdowntimer; import android.os.looper; import android.support.v4.content.localbroadcastmanager; import android.util.log; import com.nursson.pomodorotimer.model.pomodoro; /** * {@link intentservice} subclass handling asynchronous task requests in * service on separate handler thread. * <p/> * helper methods. */ public class pomodoroservice extends intentservice { public static final string action_cancelled = "com.nursson.pomodorotimer.service.pomodoro.action.cancelled"; public static final string action_complete = "com.nursson.pomodorotimer.service.pomodoro.action.complete"; public static final string action_start = "com.nursson.pomodorotimer.service.pomodoro.act...

Play Scala JSON Writes & Inheritance -

//item.scala package model trait item {val id: string} class mitem(override val id: string, val name: string) extends item class ditem(override val id: string, override val name: string, val name2: string) extends mitem(valid, name, name2) object itemwrites { implicit val mitemwrites = new writes[mitem] { def writes(ditem: mitem) = json.obj( "id" -> mitem.id, "name" -> mitem.name ) } implicit val ditemwrites = new writes[ditem] { def writes(ditem: ditem) = json.obj( "id" -> ditem.id, "name" -> ditem.name, "name2" -> ditem.name2 ) } } //response.scala package model import itemwrites.mitemwrites import itemwrites.ditemwrites trait response { val title : string, val items : seq[item], } case class mresponse(title: string, items: seq[mitem]) extends response case class dresponse(title: string, items: seq[ditem]) extends response object responsew...

Rewrite Map Apache -

we have db has , mappings of url redirect. whenever wants new redirect rule, instead of adding rule in apache add them db. function lookup db , redirect on each request. we want replace db , instead use new system have got in place. content management system , hence can host .txt files in it. ideally, want make call domain/rewrite.txt file in apache , read rules , if request matches of rules redirect. i looked @ documentation here , found way use external rewriting program this. still things aren't making sense. can how this?

react native - How can I get value of Text Component? -

<text>aircraft</text> i need aircraft in text, , change value of text dynamically. how do? you can access (example: https://rnplay.org/apps/achjeq ) <text ref={(elem) => this.textelem = elem}>hello world!</text> and then: console.log('textelem content', this.textelem.props.children); but can't set since it's (read-only) prop.

greensock timline does not work properly -

my greensock timeline executes second timeline instruction. if comment out second one, first tween works. wrong timing? tl.to($img, .3, {rotation: 0, ease:linear.easenone}, 0) .fromto($img, .3, {rotation: 0, ease:linear.easenone}, {rotation: 10, yoyo:true, repeat:-1, ease:linear.easenone}, 0); that last parameter on each of timeline calls called position parameter. setting parameter 0 on both method calls telling both animations tu run @ 0 seconds mark of timeline. being beginning. telling both animations execute @ same time why see second animation , when delete call see first. so, if want 1 animation run after should remove position parameter altogether second fromto call. you can define offset meaning can set second animation run before first ends or after. setting position parameter '-=0,5' start second animation 0.5 before first animation finishes or '+=0.5' start animation .5 seconds after.

java - Application not geting data from Ehcache for first request -

i trying fetch data cache stored in disk of local path. when first request sent browser not entering cache, instead overriding existing cache (although same data exists in cache) fetching data database. how can data cache if present not creating new every first request i invoking cache this public class servicelistener implements servletcontextlistener { private static final logger log = logger.getlogger(servicelistener.class); public static cachemanager cm; public void contextdestroyed(servletcontextevent arg0) { } public void contextinitialized(servletcontextevent arg0) { log.info("initialized"); // cachemanager c = cachemanager.newinstance(); cm = cachemanager.getinstance(); } } cache configuration <ehcache xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:nonamespaceschemalocation="ehcache.xsd" updatecheck="true" monitoring="autodetect" dynamicconfig="true"> <diskstore path=...

java - android ksoap2 invalid stream or encoding exception -

i having difficulty find solution problem. not able figure out or find real cause of problem. when call java web service having error saying " invalid stream or encoding exception: java.net.sockettimeoutexception caused : java.net.sockettimeoutexception " here how call service: try { final string method_name = "method_name"; final string soap_action = "namespace" + method_name; final string url = httpurl; soapobject request = new soapobject("namespace", method_name); soapserializationenvelope envelope = new soapserializationenvelope(soapenvelope.ver11); envelope.setoutputsoapobject(request); httptransportse httptransport = new httptransportse(url, (int) 10000); httptransport.call(soap_action, envelope); resultsobject = (soapobject) envelope.bodyin; httptransport.getserviceconnection().disconnect(); if (resultsobject != null) { serviceresult serviceresult = new serviceresult(); ...

java - Emoji android dont current display after save in data base -

i tried save emoji in mysql data base. in android displays fine, when save emoji in data base, "????". know commons-lang-2.5.jar library, can use encode , decode emoji stringescapeutils.escapejava(string text) , stringescapeutils.unescapejava(string text) . but android , ios clients use same server, , if use commons-lang-2.5.jar on android, ios not able decode. on related note, ios saves , displays emoji fine. if android , ios overwritten in online mode (across socket.io ), android , ios clients display emoji properly, if request history chat server, emoji stored on server displayed ??? , on android. update simple example: comment = etxtcomment.gettext().tostring().trim(); new submitcommentsonlychat(comment).execute(); class submitcommentsonlychat extends asynctask<void, string, boolean> { string message; submitcommentsonlychat(string message) { this.message = message; } @override protected bo...

exchangewebservices - Email to group using EWS C# -

i'm using exchangewebservices c#. i'm trying send email distributio list, i'm created group follow: private void creategroup(exchangeservice service) { // create new contact group object. contactgroup mycontactgroup = new contactgroup(service); // give group name. mycontactgroup.displayname = "testcontactgroup"; // add members group. mycontactgroup.members.add(new groupmember("euser@mydomain.com")); mycontactgroup.members.add(new groupmember("euser1@mydomain.com")); mycontactgroup.members.add(new groupmember("euser2@mydomain.com")); // save group. mycontactgroup.save(); } now i'm trying send email group, how can that? i'm tried: emailmessage email = new emailmessage(service); email.torecipients.add("testcontactgroup");//throw exception "at least 1 recipient isn't valid." //email.torecipients.add("testcontactgroup@mydomain.com");//"r...

python - Django display data in a table -- Sort of a table within a table (nested forloop?). Data needs to link as well -

Image
i'm not sure best way explain created example picture , made data: i looked @ post , know need use forloop template stuff: displaying table in django database the parts throwing me off how have table within table. example, doctor 'bob" has 3 different patients. bob has 1 row bob's patient column has 3 rows within it. <table class="table table-striped table-bordered"> <thead> <th>name</th> <th>total patient meetings</th> <th>patient</th> <th>meetings patient</th> </thread> <tbody> {% doctor in query_results %} <tr> <td> {{ doctor.name }} </td> <td> {{ doctor.total_meetings }}</td> //*would have nested forloop in here?*// {% patient in query_results2 %} <td> {...

hadoop - GC overhead limit exceeded container killed in Pig -

i executing 13 table map join on our development environment in hadoop 2 cluster using yarn.all table join left outer main table .total number of there 15 join join. since of small table less 200-300 mbs,so used using 'replicated' execute script code.it executes quite fast stuck past 95-99% .when check application url ,2 reducers failed throwing error " gc overhead limit exceeded container killed applicationmaster.container killed on request.exit code 143 container exited non-zero exit code 143". other reducer failed error timed out after 300 secs container killed applicationmaster.container killed on request.exit code 143.. you can tweak values directly within pig. in application url, check job properties, , see current values of mapreduce.map.memory.mb mapreduce.reduce.memory.mb mapreduce.map.java.opts mapreduce.reduce.java.opts mapreduce.task.io.sort.mb you can begin tweaking raising values of properties 512 @ time. however, not raise valu...

R: cant get a lme{nlme} to fit when using self-constructed interaction variables -

i'm trying lme self constructed interaction variables fit. need post-hoc analysis. library(nlme) # construct fake dataset obsr <- 100 dist <- rep(rnorm(36), times=obsr) meth <- dist+rnorm(length(dist), mean=0, sd=0.5); rm(dist) meth <- meth/dist(range(meth)); meth <- meth-min(meth) main <- data.frame(meth = meth, cpgl = as.factor(rep(1:36, times=obsr)), pbid = as.factor(rep(1:obsr, each=36)), agem = rep(rnorm(obsr, mean=30, sd=10), each=36), trma = as.factor(rep(sample(c(true, false), size=obsr, replace=true), each=36)), depr = as.factor(rep(sample(c(true, false), size=obsr, replace=true), each=36))) # check if factor combinations present # true real dataset; naturally true fake dataset with(main, all(table(depr, trma, cpgl) >= 1)) # construct interaction variables main$depr_trma <- interaction(main$depr, main$trma, sep=":", drop=true) main$depr_...

Can app use android security mechanism (pin code, pattern, password...)? -

screen lock have security mechanism. (like pin, password, pattern...) ap have similar security mechanism. possible invoke screen lock security mechanism? (so ap need know result , not need handle security itself) i found way that, reference //put below source code in want launch password ui km = (keyguardmanager) getsystemservice(context.keyguard_service); if(km.iskeyguardsecure()) { intent = km.createconfirmdevicecredentialintent(null, null); activity.startactivityforresult(i, 1234); } // call when password correct @override protected void onactivityresult(int requestcode, int resultcode, intent data) { if (requestcode == 1234) { if (resultcode == result_ok) { //do want when pass security } } }

www.parse.com how to implement OR query -

hi guys working on parse php sdk ,where need run or query not working .i have read of article did not succcess ( https://www.parse.com/questions/parsequeryequalto-or-parsequeryequalto ) this code $query1 = new parsequery("chat"); $query1->equalto("sender", "emraanhashmi000"); $query2 = new parsequery("chat"); $query2->equalto("receiver", "emraanhashmi000"); $query3 = parsequery.orqueries($query1,$query2); $result = $query3->find(); please suggest me how can run or query in php given $query1 , $query2 gives result expect, should use following syntax or them together. $query3 = parsequery::orqueries([$query1, $query2]); $result = $query3->find(); also, remember parse.com closing down , should migrate open-source " parse-server " asap.

serial port - displaying empty results C# -

guys using following code displaying no output , not showing error. please help. private void button1_click(object sender, eventargs e) { string[] ports = serialport.getportnames(); //display each port name console. foreach (string port in ports) { listbox1.items.add(port); //_serialport.open(); } } using system; namespace listserial { class program { public static void main(string[] args) { string[] names = null; try { names = system.io.ports.serialport.getportnames(); } catch(exception ex) { console.writeline(ex.message); } if(names!=null) { int portnum = names.length; if (portnum != 0) { (int = 0; < names.length; i++) console.writeline(names[i]); } ...

php - Add Image to Woocommerce catalog randomly -

my clients want have images (up 2 different) appear on woocommerce catalogue page example: http://www.wildfox.com/whats-new/ they should link , have fixed gap between products. i googled web , stackoverflow (also looked plugins) didn't find solutions. can me on this?

vb.net wpf popup no focus -

i have several popups in wpf application, work fine. however, last 1 not accepting focus or input in textboxes. , don't see why. <label x:name="lblsearch" grid.row="0" grid.column="0" grid.columnspan="1" horizontalalignment="center" verticalalignment="top" margin="0,5" height="30" width="auto">search</label> <textbox name="txtsearch" grid.r...

c# - Unable to apply paging in mvc4 when using viewmodel and actionlink -

hi have 1 link button. when clicked on link button number of records displayed. want apply paging that. have tried below. index.cshtml @foreach (var group in model.records) { <tr> <td>@html.actionlink(@group.clientid.tostring(), "detailsbyclientid", "documentverification", new { clientid = @group.clientid.tostring()},null)</td> <td>@group.clientname</td> <td>@group.count</td> </tr> } this controller code. public actionresult detailsbyclientid(int? clientid, int currentfilter, int? page) { if (clientid != null) { page = 1; } else { clientid = currentfilter; } viewbag.currentfilter = clientid; int pagesize = 8; int pagenumber = (page ?? 1); documentverificationbal objbal = new documentverificationbal(); int cid = convert.toint32(clientid); list<detailsbyclientid> detailsbyclient = objbal.d...

c# - Pass parameters to WebClient.DownloadFileCompleted event -

i using webclient.downloadfileasync() method, , wanted know how can pass parameter webclient.downloadfilecompleted event (or other event matter), , use in invoked method. my code: public class myclass { string downloadpath = "some_path"; void downloadfile() { int filenameid = 10; webclient webclient = new webclient(); webclient.downloadfilecompleted += dosomethingonfinish; uri uri = new uri(downloadpath + "\" + filenameid ); webclient.downloadfileasync(uri,applicationsettings.getbasefilespath +"\" + filenameid); } void dosomethingonfinish(object sender, asynccompletedeventargs e) { //how can use filenameid's value here? } } how can pass parameter dosomethingonfinish() ? you can use webclient.querystring.add("filename", yourfilenameid); add information. then access in dosomethingonfinish function, use string myfilenameid = ((system.net.web...

oracle - ORA-01722: invalid number on Entity Framework -

i'm executing stored procedure oracle db is: procedure get_tim_user_custo(p_anomes in varchar, user_custo out sys_refcursor) begin open user_custo select id, cod_utilizador,ano_mes, to_number(desencriptar_dado(custo, (select valor tim_config parametro='cript_key'))) custo, to_number(desencriptar_dado(custo_extra, (select valor tim_config parametro='cript_key'))) custo_extra tim_user_custo substr(p_anomes, 1, 4)=substr(ano_mes, 1, 4); end get_tim_user_custo; if execute on oracle directly returns result set well. if call stored procedure in webservice using entity framework ora-01722: invalid number calling: objectresult<user_custo> aux = context.tim_functions_get_tim_user_custo(sanomes); then throws exception, doesn't give result. using stored procedure e...

Add entity to layer sketchup ruby api -

i've been searching while on internet how add entity layer in ruby api can't seem find how this. there can me? thanks in advance arne try drawingelement.layer= method. sample code there should help.

ios - CoreGraphics - Gap visible between two Quadrilaterals shaped path -

Image
i have drawn 2 quadrilaterals(4 sides) shaped paths using coregraphics. there 6 points totally, path1 uses first 4 points , path2 uses last 4 points both sharing 2 points. the code follows - (void)drawrect:(cgrect)rect { cgpoint topleft = cgpointmake(121, 116); cgpoint topright = cgpointmake(221, 216); cgpoint middleleft = cgpointmake(121, 180); cgpoint middleright = cgpointmake(221, 280); cgpoint bottomleft = cgpointmake(121, 244); cgpoint bottomright = cgpointmake(221, 344); cgmutablepathref subpath1 = cgpathcreatemutable(); cgpathmovetopoint(subpath1, null, topleft.x, topleft.y); cgpathaddlinetopoint(subpath1, null, topright.x, topright.y); cgpathaddlinetopoint(subpath1, null, middleright.x, middleright.y); cgpathaddlinetopoint(subpath1, null, middleleft.x, middleleft.y); cgpathaddlinetopoint(subpath1, null, topleft.x, topleft.y); cgmutablepathref subpath2 = cgpathcreatemutable(); cgpathmovetopoint(subpath2, null, ...

html - Navbar elements collapse to the row below after effects are added -

my navbar looked fine: link <ul> <li><a class="active" href="#home">home</a></li> <li><a href="#news">news</a></li> <li><a href="#contact">contact</a></li> <li><a href="#about">about</a></li> </ul> after adding hover effect, however, elements seem have gained invisible px right so: link <ul> <li><a class="active her-buzz-out" href=" #home">home</a></li> <li><a class="her-buzz-out" href="#news">news</a></li> <li><a class="her-buzz-out" href="#contact">contact</a></li> <li><a class="her-buzz-out" href="#about">about</a></li> </ul> they not fit anymore , attempt @ moving them right results in...