Posts

Showing posts from July, 2015

Installing Powerbuilder IDE 8 in win 7 -

has had success in installing powerbuilder 8 ide in win 7 without issues? steps follow can install in win 7. right can install not debug or build. resolved : installed xp mode in win7 , in installed pb related stuff , works fine.

indexing - Solr won't add my fields : schema.xml -

i working solr 5.2.1 , got working fine can't add field index. here schema.xml <schema name="example" version="1.5"> <fields> <field name="cotid" type="string" indexed="true" stored="true" required="true"/> <field name="cotref" type="string" indexed="true" stored="true" required="true" multivalued="false"/> <field name="cottyperef" type="string" indexed="true" stored="true" required="true" multivalued="false"/> <field name="cottype" type="string" indexed="true" stored="true" required="true" multivalued="false"/> <field name="cottexte" type="string" indexed="true" stored="true" required="false" multivalued="tr

perl - Memory leak in program that uses LWP::UserAgent to download a file -

i trying revive perl script using long time ago. downloading files cloud storage local client. i'm pretty sure worked fine then, having issue lwp::useragent downloads file entirely memory before writing disk. expected , former behaviour should write chunks of received file target during download. i'm trying on osx perl 5.16.3 , 5.18 , tried on windows not know perl version more. pretty confident related perl version, not know used , want know changed. sub downloadfile { $url = shift; $filename = shift; $temp_filename = shift; $expected_size = shift; ( $download_size, $received_size, $avg_speed, $avg_speed_s, $avg_speed_q, $speed_count, $speed, $byte_offset, $http_status ) = ( 0, 0, 0, 0, 0, 0, 0, 0, 0 ); if ( -e $temp_filename , !$options{'no-resume'} ) { @stat = stat($temp_filename); if ( $expected_size > $stat[7] ) { $byte_offset = $stat[7]; $rec

sql - Accessing multidimensional array in the WHERE clause -

i have function pass in multidimensional array used in clause. think may have use loop not sure. how access passed in parameter inside query? create or replace function public.select_locations(coordinates text[][]) returns setof public.locations $body$ declare item public.locations; begin select * item public.locations latitude, longitude not in coordinates; return item; end $body$ language plpgsql volatile cost 100; test call: select * public.select_locations (array[array['42.449630','-123.758012'],array['42.456591','-123.844708']]); to return every row in locations isn't in coordinates arg (if understand want), can following: create or replace function public.select_locations(coordinates text[][]) returns setof public.locations $body$ declare item public.locations; begin item in select * public.locations array[latitude,longitude] not in (select array[coordinates[i][1], coordinates[i][2]] generate_se

javascript - Push text to array then append to div - displaying text in div twice in IE8 -

using mouseup, i'm appending multiple values array. var myarray = []; $("#button").mouseup(function() { myarray.push("&nbsp;play contact sports"); ]); then appending div using button $("#button2").mouseup(function() { $('#output').append(myarray+''); ]); it works fine in browsers apart ie8 text push after 1 click display twice. play contact sports play contact sports there no comma. know cause might be? or alternative might work? i'm not clear on want do, i'd wrap each text node you're appending element , more explicit array-to-string conversion. in click handler ensure event stopped: $("#button2").mouseup( function(event) { event.stoppropagation(); event.preventdefault(); $('<p></p>').html( myarray.join(',') ).appendto('#output'); return false; } );

ios - How could I launch non-hosted test in Xcode 7.3? -

i have unit test (not ui tests) , launching app along tests undesirable. read so-called non-hosted tests , sounds suitable here. however, trying launch non-hosted test on xcode 7.3 faced 1 serious problem - complains classes in app being tested couldn't found linker. what have read , tried: app delegate substitution based on launch arguments - undesirable since forces app know tests (tight coupling, broken encapsulation etc...) , launch app along test (even though doing nothing) xcode 5 unit testing: starts app - tried every answer here , don't work except changing classes target membership not option since changing target membership manually error-proned , becomes difficult when project grows apple's outdated guide - nope xcode test target host application forces wrong target build section of scheme - nope https://stackoverflow.com/a/22024428/2305175 - nope manually creating unit test target explicitly setting target tested none - nope how run

c# - How do I use SuperAgent in a simple MVC 5 app? -

okay, know should able figure out, can't. trying use superagent.js in simple html page in mvc 5 app building. project standard vs 2015 project mvc , blank html page more or less. i able create bower.json , reference superagent package. get: javascript runtime error: module name "emitter" has not been loaded yet context: _. use require([]) i have code, think wrong: <script src="~/wwwroot/lib/requirejs/require.js"></script> <script src="~/wwwroot/lib/superagent/lib/client.js"></script> <script> var superagent = require('superagent'); var data = superagent .get('/api/v1/actualhourlyvalues') .end(function (err, res) { // calling end function send request }); alert(data); </script> i guess don't know steps involved in using bower or npm bring in package superagent can use make ajax calls. i need steps creation of html! :)

Using pandas dataframe function .mul in Python 3.x -

i'm trying multiply 2 dataframes mul() function, it's not working. i created 2 dataframes: x = np.arange(0.,5.,0.2) m = len(x) ones = np.ones(m) theta = {'1':np.zeros(2)} x = {'1':pd.series(ones), '2':pd.series(x)} thetadf = pd.dataframe(theta) xdf = pd.dataframe(x) and tried this: mult = xdf.mul(thetadf) print (mult) the result is: 1 2 0 0.0 nan 1 0.0 nan 2 nan nan 3 nan nan 4 nan nan 5 nan nan 6 nan nan 7 nan nan 8 nan nan 9 nan nan 10 nan nan 11 nan nan 12 nan nan 13 nan nan 14 nan nan 15 nan nan 16 nan nan 17 nan nan 18 nan nan 19 nan nan 20 nan nan 21 nan nan 22 nan nan 23 nan nan 24 nan nan should use way multiply? head line solution thetadf.index = xdf.columns mult = xdf.dot(thetadf)

javascript - How to find an element attribute through searching for another attribute of that element -

i'm trying access element's attribute value, finding different attribute, name, of same element. here's code: <option data-img-src="http://example.com/pic.jpg" value="pool party 21" pdf-data="http://example.com/mypdf.pdf"></option> <img class="image_picker_image" src="http://example.com/pic.jpg"> here's php try src of image, store variable. then, try find element src of image (the stored variable) attribute called data-img-src holds value. finally, try store found-elements attribute called "pdf-data" string in variable. pdfbgimage = $('.tab-pane.active div.thumbnail.selected').children('img').attr('src'); pdfurl = $("[data-img-src=pdfbgimage]").attr('pdf-data'); i don't believe code right. can help? you have concatenate first variable second selector var pdfbgimage = $('.tab-pane.active div.thumbnail.selected').c

Garbage collection in a C compiled language -

let's have garbage collected language compiled c , through assembly. then, how garbage collection works when compiled down c? become deterministic? or contained in resulting program program runs periodically , collects garbage? easy, if not silly, question wanted clarifications. even though it's compiling c, such implementations typically link in runtime library original language. library contains garbage collector higher-level language data. , data structures used represent original language's data in c includes additional fields needed garbage collector. another technique may use conservative garbage collection .

How can I synchronize DOM element width in AngularJS? -

i synchronize width of dom elements such width smallest width can accommodate content. can increase size $watching increase (based on ref1 & ref2 ), can't figure out how shrink element after it's been enlarged. angular directive: app.directive('syncwidth', function () { //declaration; identifier master return { restrict: 'a', link: function (scope, element) { var linkelement = element[0]; scope.$watch( function () { return (linkelement.scrollwidth); }, function (newvalue, oldvalue) { if (newvalue > oldvalue) { scope.testwidth = { 'min-width': newvalue + 'px' } } }, true ); } }; }); html: <input type="text" ng-model="mytext"> <input type="text" ng-model="mytext2"> <div sync-width="test" style="background-color: lightb

php - Softlayer API to pull all invoices -

i successful in pulling excel sheet softlayer's api using php via $client = \softlayer\soapclient::getclient('softlayer_account', null, $apiusername, $apikey); $invoice = $client->getnextinvoiceexcel(); i write location goes on webserver , executes crontab. i trying find out if can pull excel sheet previous months. through softlayer web portal, able pull information via manually selecting invoice , downloading excel. problem manage several accounts , we'd automate using id , api key pull previous month's invoices. right can list them using: $client = \softlayer\soapclient::getclient('softlayer_account', null, $apiusername, $apikey); $user_bill = $client->getopenrecurringinvoices(); print_r($user_bill); thank help. using slapi methods, may you: softlayer_billing_invoice/getexcel . first, can invoices with: softlayer_account::getopenrecurringinvoices and then, invoice_ids displayed in last request, can execute (rest examp

How to configure jTDS logging when imported via Maven? -

i'd know how can configure jtds logging when it's imported via maven dependency. thanks in advance. add dependency in pom.xml, shown below <dependency> <groupid>net.sourceforge.jtds</groupid> <artifactid>jtds</artifactid> <version>1.2.8</version> </dependency>

javascript - onsen notification undefined ios -

i displaying ons.notification like: ons.notification.alert({ message: 'test', buttonlabel: 'ok' }); this method works in browser, fails in ios. error: error: error: dialogelement.show not function. (in 'dialogelement.show', 'dialogelement.show' undefined) anyone know how fix this? this fixed updated onsen. migrated 1.3.5 1.3.15.... might stay updated guess

android - Make FloatingActionButton Disappear Behind Toolbar -

so have got floatingactionbutton anchored imageview. when scroll down, want fab hide behind toolbar, not hovering on it. is there way can achieve this? can't seem work. tried use layout_weight didn't work sadly. current xml layout: <android.support.design.widget.appbarlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/apptheme.appbaroverlay"> <android.support.v7.widget.toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionbarsize" android:background="?attr/colorprimary" app:popuptheme="@style/apptheme.popupoverlay" android:layout_weight="1000" /> </android.support.design.widget.appbarlayout> <android.support.v4.widget.nestedscrollview xmlns:android="http://schemas.android.com/apk/res/and

python - Complete scan of dynamoDb with boto3 -

my table around 220mb 250k records within it. i'm trying pull of data python. realize needs chunked batch process , looped through, i'm not sure how can set batches start previous left off. is there way filter scan? read filtering occurs after loading , loading stops @ 1mb wouldn't able scan in new objects. any assistance appreciated. import boto3 dynamodb = boto3.resource('dynamodb', aws_session_token = aws_session_token, aws_access_key_id = aws_access_key_id, aws_secret_access_key = aws_secret_access_key, region_name = region ) table = dynamodb.table('widgetstablename') data = table.scan() boto3 offers paginators handle pagination details you. here doc page scan paginator. basically, use so: import boto3 client = boto3.client('dynamodb') paginator = client.get_paginator('scan') page in paginator.paginate(): #

c# - Uwp get holders phone number as ContactInformation -

we have windows.applicationmodel.contacts.contactpicker pick contact our contact list. var contactpicker = new contactpicker(); contactpicker.desiredfieldswithcontactfieldtype.add(contactfieldtype.phonenumber); contact contact = await contactpicker.pickcontactasync(); if (contact?.phones[0] contactphone) { foreach (contactphone phone in contact.phones) { var result = phone.number; // ... } } else { // ... } but posible holders mobile phone? need retrieve phone number of current phone holder. yes, possible. can use smsdevice2.accountphonenumber phone number. article,pay attention of this functionality available mobile operator apps , windows store apps given privileged access mobile network operators, mobile broadband adapter ihv, or oem. hence requires cellularmessaging capability, special-use capability, declared in package manifest, kind of app can’t published in windows store normal developer a relative sample of sms can r

javascript - Unable to select data with d3.defer -

i'm stuck stupid problem in d3 map. load 2 files, , fine, colors here, etc. however, i'm not able adjust opacity, because takes data in json, not in csv, if/else. here sample of code: queue() .defer(d3.json, "data/countries.json") .defer(d3.csv, "data/data.csv") .await(ready); function ready(error, map, data) { if (error) throw error; var ratebyid = d3.map(); var paths = g.append("g") .attr("class", "countries") .selectall("path") .data(topojson.feature(map, map.objects.countries).features) .enter() .append("path") .attr("opacity", function(d) { var value = data.id; if (value) { return ".8"; } else { return ".1"; } }) // ... }); any idea how aim correctly "id" column in data.csv? thank you.

javascript - What is the id of easysearch.input? -

i trying make if statement in js goes off of html input field, not normal input field. implemented easy search, meteor package. means there no declaration of id value, cannot call input .getelementbyid() or @ least not know how. can me? here link easy search: https://github.com/matteodem/easy-search-leaderboard

html - Text outside of table data -

Image
how can add text outside of td in table red lines have draw in photo ? table markup is: <table> <thead> <tr><th class="span2"><div class="outside"></div></th> <th class="span2"></th> <th class="span2"></th> <th class="span2"></th> <th class="span2"></th> <th class="span2"></th> </tr> </thead> <tbody> <tr> <td class="span2"></td> <td class="span2"></td> <td class="span2"></td> <td class="span2"></td> <td class="span2"></td> <td class="span2"></td> </tr> </tbody> how can position absolutely outside ".outside" div inside td. working in google chrome not in firefox. using twitter

machine learning - Does training tensorflow model automatically save parameters? -

i ran demo tensorflow mnist model (in models/image/mnist) by python -m tensorflow.models.image.mnist.convolutional does mean after model completes training, parameters/weights automatically stored on secondary storage? or have edit code include "saver" functions parameters stored? no not automatically saved. in memory. have explicitly add saver function store model secondary storage. first create saver operation saver = tf.train.saver(tf.all_variables()) then want save model progresses in train process, after n steps. intermediate steps commonly named "checkpoints". # save model checkpoint periodically. if step % 1000 == 0: checkpoint_path = os.path.join('.train_dir', 'model.ckpt') saver.save(sess, checkpoint_path) then can restore model checkpoint: saver.restore(sess, model_checkpoint_path) take @ tensorflow.models.image.cifar10 concrete example

mouseevent - Catch mouse event on tree widget item in QTreeWidget -

in tree widget have following signal connected: connect(mtreewidget, signal(itemclicked(qtreewidgetitem*, int)), slot(onitemclicked(qtreewidgetitem*, int))); where onitemclicked() slot following: void widgetbox::onitemclicked(qtreewidgetitem *item, int ) { int index = getpageindex(item); setcurrentindex(index); } int widgetbox::getpageindex(qtreewidgetitem *item) { if (!item) return -1; qtreewidgetitem *parent = item->parent(); if(parent) // parent top level item { return mtreewidget->indexoftoplevelitem(parent); } else // current item top level { return item->treewidget()->indexoftoplevelitem(item); } } void widgetbox::setcurrentindex(int index) { if (index != currentindex() && checkindex(index)) { mtreewidget->setcurrentitem(mtreewidget->toplevelitem(index)); emit currentindexchanged(index); } } however can't catch itemclicked() signal , onitemclicked() never executed because

asp.net mvc - Passing array to MVC controller via jQuery -

trying pass list of objects mvc controller jquery script. controller ain't getting list. ideas? script function refreshxerodata(obj, planid, date, list) { // list comes in serialized array // list = "[{"id":245225,"xerofromdate":"4/22/2015 12:00:00 am","xerotodate":""},{"id":245226,"xerofromdate":"4/1/2016 12:00:00 am","xerotodate":"4/30/2016 12:00:00 am"}]" var model = { planid: planid, date: date, list: list }; $.ajax({ type: 'post', url: url, data: model, success: function (data) { // code removed clarity }, }); } controller public jsonresult refresh(int planid, datetime date, list<xeroscenariomodel> list) { // list null // code removed clarity } model public class xeroscenariomodel { public int id { get; set; } public string xerofromdate { get; set;

html - CSS animation - How to fill in "starting from border"? -

quite simple question, really, not find online. basically, how animate fill-in specific color of element starting @ border ? e.g border gets bigger , bigger until shape filled. if understand question want animate border-width of element, maybe border-top-width, don't think create effect looking for, increasing border push element as border width gets set to, won't if element being filled, can animate nested element cover outer element, can check example see i'm saying the html: <style> #theborderdiv, #thetwodivs { display: inline-block; background-color: #ccc; height: 0px; width: 300px; border-top-color: red; border-top-style: solid; border-top-width: 1px; height: 200px; vertical-align: top; } #thetwodivs{ margin-top: 200px; position: relative; } #theinnerdiv { position: absolute; top:0px; height: 0px; width: 300px; background-color: red; } </style> <div id="theborderdiv"></div> <div id="t

reactive programming - RxJS Does Observable empty the data array after onCompleted is called? -

i struggling rxjs. questions observable does observable empty data array after oncompleted called? when chain 2 subscribe() method got error "subscribe not exist in type subscription". why that? someobs.map(...).subscribe(...).subscribe(...) is there way check observable data array count without subscribing? if observable clears data items after emitting them there way refill new data items same observable instance without creating new one? if yes, how? no. rxjs close cousin of functional programming, means mutation big no-no. whole point of streaming data avoid state mutation, in many ways source of many troubles in today's applications. all observables wrap various data source types emit events through common interface. hence rx.observable.fromarray , rx.observable.frompromise both produce observables same semantics, difference being number of events , when events produced. observables lazy, fancy method chaining doesn't until observa

css - creating custom scss file -

i'm install bootstrap gem , follow direction change application.css, when create custom .scss file, customizations custom file werent included in application.css.scss . have tried import boot strap , bootstrap-sprockets custom file well, no changes made on website. how can make customizations on newly created custom.scss file show on website. the application.css.scss file contains 2 lines @import "bootstrap-sprockets"; @import "bootstrap"; if i've read question correctly, have application. scss , contains @import "bootstrap-sprockets"; @import "bootstrap"; and custom. scss file, contents of want end in application. css . need add application. scss file, ie - @import "bootstrap-sprockets"; @import "bootstrap"; @import "custom"; it's recommended begin name of . scss files importing (also known partials) underscore, in case custom.scss becomes _custom. scss . and make sure rec

Css margin top issue -

i have layout: <div id="wrapper"> <div class="player-wrapper"> <div class="player-holder"> <div class="player-thumb"></div> </div> </div> </div> https://jsfiddle.net/y2yjtnoz/1/ the problem when add margin-top:50px; to player-thumb the whole player-holder div goes down 50px. i want behave add top:50px; to player-thumb (instead of margin-top:50px), want margin. i dont know how solve this. thank you. edit: actually doesnt quite solve issue, have created new fiddle new elements (playlist @ right , media queries): https://jsfiddle.net/y2yjtnoz/4/ i have applied overflow:auto player-holder (its same overflow:hidden) 'auto' better shows problem. when media queries applied , playlist drops below player, can see playlist doesnt quite clear player player gets scroll, or overflow hidden player gets cut off @ bottom. just add overflow:hidden;

c# - Querying Linq to xml with an incomplete value -

i have question querying linq. for example have xml : <output> <meta> <generated_at>2009-06-19t16:18:40+00:00</generated_at> <total_entries>1234</total_entries> </meta> <entries> <entry> <url><![cdata[http://www.example.com/]]></url> <phish_id>123456</phish_id> <phish_detail_url>http://www.phishtank.com/phish_detail.php?phish_id=123456</phish_detail_url> <details> <detail> <ip_address>1.2.3.4</ip_address> <cidr_block>1.2.3.0/24</ip_address> <announcing_network>1234</announcing_network> <rir>arin</rir> <detail_time>2009-06-20t15:37:31+00:00</detail_time> </detail> </details>

hash - Using PasswordHasher in Asp.net Mvc6, Identity 3.0 -

i've working on learning asp.net, i'm having troubles password hasher. i want use non-modified version of thing, i'm severely lacking on instructions. googling has failed me. so it's very general question. 1 kind provide small tutorial on password hashing during user registration , login. i appreciate it.

php - Laravel query with max and group by -

i need create select query in laravel 5.1 have no problems creating via regular sql , wondering if me write in laravel. i created query gets users have truck, trailer , delivery_date equals particular date (comes $week_array). working, missing components $rs = $this->instance->user() ->with(['driver.delivery' => function($query) use ($week_array) { $query->where('delivery_date', [carbon\carbon::parse($week_array['date'])->todatetimestring()]); }]) ->with(['driver.trailer', 'driver.truck', 'driver.trailer.trailertype'])->get(); i need exclude drivers have max delivery date equals or greater selected delivery date in query above. normal query need plug-in laravel. in other words, need convert following query (simplified) laravel: select * users inner join drivers on drivers.user_id = users.id inner join deliveries on deliveries.dri

php - limit subdirectories to logged in users -

how can below .htaccess ? /sp/sitea => /check.php?page=sitea #no trailing forward slash /sp/sitea/ => /check.php?page=sitea #trailing forward slash /sp/sitea/index.php => /check.php?page=sitea/index.php #includes file /sp/siteb => /check.php?page=siteb /sp/index.php , /sp/login.php => no redirect i want check db using php sitea see if user logged in , redirect /sp/sitea if not logged in site redirect /login.php i tried .htaccess below , in sp folder, doesnt redirect, im not .htaccess master rewriteengine on rewritecond %{request_uri} / rewriterule ^\/(.*)$ sp/check.php?path=$1 [l] i solved modified .htaccess file rewriteengine on rewriteoptions maxredirects=2 rewritebase / #dont check non pages rewritecond %{request_uri} !\.(gif|jpe?g|png|css|js)$ rewriterule ^(.*)/(.*)$ /sp/check.php?path=$1&path2=$2 [l,p] #p keeps address in bar after redirect check.php <?php //htaccess redirects here sitepreview subdomains, authentication check ,

sql - Slow PostgreSQL query with (incorrect?) indexes -

i have events table 30 million rows. following query returns in 25 seconds select distinct "events"."id", "calendars"."user_id" "events" left join "calendars" on "events"."calendar_id" = "calendars"."id" "events"."deleted_at" null , tstzrange('2016-04-21t12:12:36-07:00', '2016-04-21t12:22:36-07:00') @> lower(time_range) , ("status" null or (status->>'pre_processed') null) status jsonb column index on status->>'pre_processed' . here other indexes created on events table. time_range of type tstzrange . create index events_time_range_idx on events using gist (time_range); create index events_lower_time_range_index on events(lower(time_range)); create index events_upper_time_range_index on events(upper(time_range)); create index events_calendar_id_index on events (calendar_id) i'm out of com

c - GTK non blocking pause -

i have gtk+-3.0 application written in c, (gcc) compiled , run under windows 7 / msys64, communicates bespoke device via serial interface. it needs pause briefly (fraction of second) between writing device , reading reply device, allow time device return data, otherwise there's no data available in serial input buffer. the application works in fashion if use sleep(1), unresponsive user events due repeated sleeps. using g_timeout_add or g_timeout_add_seconds doesn't appear help, because first call function occurs @ end of first interval, time serial read attempt has executed, finding no data. thanks in anticipation of suggestions. // p o l l c o n t r o l l e r f o r t s s e t t n g s network->poll_event_source_id = gdk_threads_add_timeout(poll_interval, zf_controller_poll, network); // use g_priority_default ... gint zf_controller_poll(gpointer data) // thread obtain controller settings @ regular intervals { gboolean res = false; t_net

html - jQuery ID+ Class selecter -

currently script below shows console.log(inputname) first variable in code no matter button clicked. how can alter script can input name foreach row have use id + class selector? jquery: $(function(){ $.fn.editable.defaults.mode = 'inline'; $.fn.editable.defaults.params = function (params) { params._token = $("#_token").data("token"); return params; }; var dataurl = $('.updatefield').data('url'); var inputname = $('.updatefield').attr("name"); $('.updatefield').editable({ type: 'text', url: dataurl, name: inputname, placement: 'top', title: 'enter public name', toggle:'manual', send:'always', ajaxoptions:{ datatype: 'json' } }); $('.edit').click(function(e){ console.log(inputname); e.stoppropagation(); $('.updatefield').editable('toggle');

Android Studio - Gradle builds all flavors of library instead of only current one -

my app consists of main module mobile , library module core . each of them has 2 build flavors: flavor1 , flavor2 . library build.gradle: apply plugin: 'com.android.library' android { .... publishnondefault true productflavors { flavor1 {} flavor2 {} } } project build.gradle: apply plugin: 'com.android.application' android { .... productflavors { flavor1 {} flavor2 {} } } configurations { flavor1debugcompile flavor2debugcompile flavor1releasecompile flavor2releasecompile } dependencies { .... flavor1debugcompile project(path: ':core', configuration: 'flavor1debug') flavor2debugcompile project(path: ':core', configuration: 'flavor2debug') flavor1releasecompile project(path: ':core', configuration: 'flavor1release') flavor2releasecompile project(path: ':core', configuration: 'flavor2release

node.js - Log system for NodeJS Framework -

i've created little pretty framework use when building nodejs web service i'm facing little problem hope you'll me resolve. being java dev years, i'm used slf4j ( http://www.slf4j.org/ ) i can use interface define error/info/warning logs. users of frameworks can decide implementation want use , level of logs framework needed. going node, have absolutely no idea how it. is there way define logs , let framework users choose implementation , levels want logs? you can use bunyan have log leveling, log.info log.error log.warning

jquery - Bootstrap modal does show correctly -

Image
i trying show modal window on demand click of button. in <head>...</head> tags, have following: <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0msbjdehialfmubbqp6a4qrprq5ovfw37prr3j5elqxss1yvqotnepnhvp9aj7xs" crossorigin="anonymous"></script> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mtjoasx8j1au+a5wdvnpi2lkffwweaa8hdddjzlplegxhjvme1fgjwpgmkzs7" crossorigin="anonymous"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-flw2n01lmqjakbkx3l/m9eahuwpsfenvv63j5ezn3uzzapt0u7eysxmjqv+0en5r" crossorigin="anonymous"> in <body>...</body> have following definition of modal markup: <div id="slideinfomodal" class=&

php - How to change the PHPSESSID cookie domain? -

i have 2 subdomains sub1.domain.com , sub2.domain.com sub1 1 set login session session not shared because have different cookie domain sub1's cookie domain => .sub1.domain.com sub2's cookie domain => .sub2.domain.com option 1: change sub2's .sub2.domain.com .sub1.domain.com can share session option 2: change sub1's .sub1.domain.com .domain.com i want option 1 because we're trying avoid changes on sub1.domain.com , domain.com possible. i have tried codes on sub2's end no luck ini_set('session.cookie_domain', '.sub1.domain.com'); session_set_cookie_params (0,'/','.sub1.domain.com'); you cannot set session.cookie_domain different subdomain, can set .domain.com , visible on subdomains: ini_set('session.cookie_domain', '.domain.com');

How to echo query result using PHP mysql (PDO) -

this may seem silly, can't figure out how simple thing in spite of googling. i have functional php script queries mysql database check boolean value. script contains code: $sql = "select truefalse mydb bilbobaggins=:bilbobaggins"; $query = $db->prepare($sql); try { $query->execute(array( ':bilbobaggins' => $bilbobaggins )); } catch (exception $e) { echo "query failed. " . ($e->getmessage()); $db = null; die; } all i'm trying have result of query echo script, such example, if put http://www.myurl.com/myscript.php?bilbobaggins=user32984329842 into browser, return either 1 or 0 in text format. i suspect need change line: $query->execute(array( to like: print $query->execute(array( but not work. any appreciated. thanks. try like... <?php $sql = "select truefalse mydb `key`=:key"; $stmt = $db->prepare($sql); $stmt->execute(array('key' => $key)); header(&

c# - 404 error Localhost:8000 asp.Net -

if un-comment app.run(async (context) => ... part of code can run html within code without issues. trying use index.html in wwwroot default. 404 error. how fix this? using system; using system.collections.generic; using system.linq; using system.threading.tasks; using microsoft.aspnet.builder; using microsoft.aspnet.hosting; using microsoft.aspnet.http; using microsoft.extensions.dependencyinjection; namespace theworld { public class startup { public void configureservices(iservicecollection services) { } // method gets called runtime. use method configure http request pipeline. public void configure(iapplicationbuilder app) { // app.run(async (context) => //{ // var link = @"<!doctype html> // <html> // <head> // <title>test</title> // </head> // <body>

excel - Macro Do Until Loop Copy from list of values paste into single cell (e.g. b1) -

this first post here, in advance help. great community! i trying write macro loop through list of values of undetermined number of rows , 1 one copy , paste values single cell, each time through loop replacing value pasted single cell, referenced report template , auto-populates data based on id of number here example of table like: __|__a__|__b__ 1 | 231 | 234 2 | 232 | 3 | 233 | 4 | 234 | 5 | 235 | 6 | 236 | 231 copied , pasted b1, 232 copied , pasted b1, 233 copied , pasted b1, 234 copied , pasted b1.....and on , forth. in between copy , past steps there other steps add images worksheet , save pdf. i wrote script accomplish goal: sub report() ' ' report macro ' ' keyboard shortcut: ctrl+shift+g ' ' section copies selection of cells on worksheet , moves worksheet filters , copies filtered list yet worksheet. application.screenupdating = false selection.copy sheets("master sheet").select range("a6").select selection.pastespec

c# - How do I combine these two linq queries into a single query? -

how can in 1 query? want person company matches name of person i'm searching for. currently company , run same search. var existingcompany = bidinfo.companies .firstordefault( c=> c.companydomain != null && c.companydomain.people.firstordefault( p => p.name == bidinfo.architectperson.name ) != null); person existingperson=null; if (existingcompany !=null) { existingperson = existingcompany.companydomain.people.firstordefault(p => p.name == bidinfo.architectperson.name); } assuming understand you're trying do, this: var person = bidinfo.companies .where(c=>c.companydomain != null) .selectmany(c=>c.companydomain.people) .singleordefault(p=>p.name == bidinfo.architectperson.name); note you're not filtering on company (you're getting first company has name, if there multiples?

elixir - How can I rename a pathname for the default resources generated by Phoenix.Router? -

i've got userscontroller i'm using authentication not viewing users profiles , not, got /users/new // /users/new // post /users/login // /users/login // post i want rename to /auth/register /auth/register /auth/login /auth/login is possible accomplish right through router? right have this: resources "/users", usercontroller, only: [:create, :new] is there way like resources "/auth", usercontroller, only: [create: "register", new: "register"] or that. information great thanks. this isn't possible right using resources paths hardcoded in route generators in phoenix.router : https://github.com/phoenixframework/phoenix/blob/6350e7052548c939b572dbf6d5556c88bed4212d/lib/phoenix/router.ex#l208-l233 you'll have create routes manually: get "/users/register", usercontroller, :new post "/users/register", usercontroller, :create

java - No matching bean of type found for dependency: Spring MVC -

i getting error when trying use @autowire, @configuration, @bean, @repository in spring mvc project could not autowire field: private com.sachin.dao.stockdaoimpl com.sachin.myapp.homecontroller.stockdao; nested exception org.springframework.beans.factory.nosuchbeandefinitionexception: no matching bean of type [com.sachin.dao.stockdaoimpl] found dependency: please let me know mistake making. new spring mvc , dependency injection. here controller code. trying inject stockdaoimpl in controller. @controller public class homecontroller { @autowired private stockdaoimpl stockdao; @requestmapping(value = "/stockgoogle/", method = requestmethod.get) public @responsebody stock stockgoogle(locale locale, model model) { //stockdaoimpl stockdao = new stockdaoimpl(); stock s=stockdao.listgoogle(); model.addattribute("s", s ); return s; } } my service implementation below. have used @repos

VB.net manage opened excel file on the fly -

in current project, need modify excel file opened. mean, need see change in excel file whenever modify it. since opened file locked , vb cannot access file, solution open excel file, modify content , copy original file using excel vba, excel vba can used copy data between opening sheets. here vb code in other excel file (called ttht.xlsm): private sub worksheet_change(byval target range) application.screenupdating = false if sheet1.[b5].value = "#" application.displayalerts = false workbooks.open(thisworkbook.path & "\pcn.xlsm") thisworkbook.sheets("ttht").[b5] .parent.range("b4").copy sheets("pcn").[b4].pastespecial 7 end end application.displayalerts = true end if end sub runs fine between 2 opening excel file ( ttht 1 , pcn.xlsm ). now need do, fill data ttht, , put "#" b5 code. think work, it's not.. private sub btnupdate_click(sender system.object, e system.