Posts

Showing posts from July, 2011

MS-Access VBA Date() works on one PC but not others -

i designing first database ground , have learned lot in last few weeks. 1 thing has been eating @ me though on login page have simple unbound text box control source =date() . this works on computer use days, other computer in facility working out of displays #name? instead of date. i have tried changing =now() , works fine on computers. apparently =date() has issues. if fields control source changed =date() informed the function entered can't used in expression . i have checked ms-access versions , tried on machines , without access. i need date() work because used elsewhere in more vital areas of code , may not able use now() in place. ideas why may not work on pc besides own? date() controlled visual basic applications x.xx reference. make sure reference installed , competing references removed. to this, open vba window , go tools --> references , ensure proper 1 checked.

c# - How to get the decorator objects from inside the decorated method -

in asp.net mvc 4 controller class have actions decorate customauthorize attribute access restricted roles. i roles inside action methods , need customauthorize attribute method decorated with. how do this? sample code of trying below: public class testcontroller : controller { // users in viewer , admin roles should [customauthorize("viewer", "admin")] public actionresult index() { //need customauthorizeattribute associated roles } } customauthorizeattribute subclass of system.web.mvc.authorizeattribute . if want attribute method can this, example reflection: var atrb = typeof(testcontroller).getmethod("index") .getcustomattributes(typeof(customauthorizeattribute), true) .firstordefault() customauthorizeattribute; or current method; var atrbcurrentmethod = system.reflection.methodbase.getcurrentmethod() .getcustomattributes(typeof(customauthorizeattribute)...

asp.net mvc - ?: and ?? Operators with Entity Framework -

why these operators not work within these examples? person.cityname = personinfo.cities.cityname ?? "-"; or person.cityname = personinfo.cities.cityname == null ? "-" : personinfo.cities.cityname; view generates system.nullreferenceexception. if not allowed advice? if cityname column nullable, should check hasvalue property follows. , if like, can check if either personinfo or personinfo.cities null. person.cityname = personinfo != null && personinfo.cities != null && personinfo.cities.cityname.hasvalue ? personinfo.cities.cityname.value : "-";

java - Get back to the default Tomcat error page on a redirected error page -

i building java web app using tomcat. using this: <error-page> <error-code>500</error-code> <location>/error.jsp</location> </error-page> in web.xml , redirect user-friendly error page, if server respond error. i want put link on user-friendly error.jsp page (name technical spec), when user clicks it, he/she gets original tomcat error page. is possible achieve ? if yes, how go doing that? i don't know if it's possible can still access error/exception's tech details on redirected page check post you'll find details on below: if declare <%@page iserrorpage="true" %> in top of error.jsp, have access thrown exception (and of getters) ${exception} in el.

c# - Casting Error on FileQueryConnection in Infopath 2013 Code -

i've been working on infopath form migrate infopath 2007 infopath 2013. bind data dropdownlist controls filequeryconnection has been used. // retrieve data connection bound manager drop-down list box filequeryconnection institutionconnection =(filequeryconnection)dataconnections[externalusersdc]; // returned owssvr.dll filter on external users of institution institutionconnection.filelocation = getfilelocation(currentsite, externalusersguid, externaluserinstitution, institution); // query data connection fill manager drop-down list box items institutionconnection.execute(); here externalusersdc name of infopath connection file. getfilelocation method gets list physical location works fine expected. casting error occurs while trying dataconnection filequeryconnection. error message follows; unable cast object of type 'microsoft.office.infopath.internal.sharepointlistadapterrwqueryadapterhost' type 'microsoft.office.infopath.filequeryconnection i...

python - how to display uploaded image with FileField in django template -

i'm learning django , i'm trying create simple upload site. figured out should use django filefield purpose want know how display images uploaded using field on index page using django template . know can use imagefield in case i'm trying know if possible filefield ? <img src="{{fileobj.url}}"/>

angularjs - Use angular in laravel views -

this firs question here i ve been trying find solution these days. i m building multi-page website , i d use angular front-end. i ve seen of people have issue of combining angular syntax laravel s i d know if it s possible include angular 1 of laravel s views without having re-route angular.html page angular directory. want know if there s way use angular directly "route::get('test', 'controller@gettest')" problem when set response on controller page( return view('pages.test')->with(array('1' => $1, '2' => $2)); ) angular scope method gets data whole , it s hard target array 1 example use in angularcontroller hope makes sense.... in advance!

tsql - Sql Server sysjobsteps step_uid column nullability -

i working on project creating log table of sorts failed jobs. since step_id can change depending on step order, wanted use step_uid unique identifier step. in mind, seems step_uid in msdb's sysjobsteps table nullable column, , relying on column not being null of yet. does know why or when column ever null. no examples exist on current server. by looking @ source code of sp_add_jobstep_internal stored procedure, can realize step_uid allways filled-in procedure. moreover, sp_write_sysjobstep_log stored procedure assumes step_uid cannot null (it copies value sysjobstepslogs table, step_uid defined not null). i think step_uid column defined nullable because did not exist in sql server 2000. however, since sql server 2005 seems filled-in.

javascript - Adding JS File with HTML Code -

is possible create .js file , add html code it. i'm interested in putting client-side scripting coding .js file. can put file in location call upon load html code. it's on desktop computer no server type of support. <script type="text/javascript" src="file.js"></script> i add head section 1 think need. wondered if possible. thanks! well, there's few ways of doing you're aiming for. raw javascript index.html: <html> <body> <script src="content.js"></script> </body> </html> content.js: document.write('<h1>hello world</h1>'); but should note isn't comfortable large html you're mixing html js. template engines a better option template engine, handlebars.js . allows keep html clean , apart javascript. see sample: index.html: <html> <body> <script src="handlebars.js"></script> ...

C# SetAttribute Value to ElementID isn't working? -

webbrowser1.document.getelementbyid("firstname").setattribute("value", firstname); webbrowser1.document.getelementbyid("lastname").setattribute("value", lastname); webbrowser1.document.getelementbyid("username").setattribute("value", email); webbrowser1.document.getelementbyid("password").setattribute("value", "psu123"); webbrowser1.document.getelementbyid("passwordconfirmation").setattribute("value", "psu123"); everything filled except line: webbrowser1.document.getelementbyid("password").setattribute("value", "psu123"); language using c# inspect element link below. http://gyazo.com/964291abb825eac4ea8aae002d7ce382 how come filled except "password" possible duplicate of webbrowser setattribute not working (password field) as equalsk mentioned, ensure you're setting values in webbrowser documentc...

Create a folder on desktop via Vbscript -

i have 2 scripts not combine them create folder script option explicit dim objnetwork, objcomputer dim objfso, objfsotext, objfolder, objfile dim strdirectory, strfile, makeobject strdirectory = "folder" set objfso = createobject("scripting.filesystemobject") if objfso.folderexists(strdirectory) wscript.echo strdirectory & " exists" else 'below added line set objfolder = objfso.createfolder(strdirectory) wscript.echo "the folder " & strdirectory & " has been created" end if wscript.quit desktop path script set wshshell = wscript.createobject("wscript.shell") strdesktop = wshshell.specialfolders("desktop") wscript.echo(strdesktop) con 1 me please ? use .buildpath combine desktop folder path , intended (sub)folder(name): >> set objfso = createobject("scripting.filesystemobject") >> set wshshell = wscript.createobject("wscript.shell") >> ...

javascript - Convert recursive array object to flat array object -

i'm looking way convert array of recursive objects flat array of objects make easier work with. [ { "name": "bill", "car": "jaguar", "age": 30, "profiles": [ { "name": "stacey", "car": "lambo", "age": 23, "profiles": [ { "name": "martin", "car": "lexus", "age": 34, "profiles": [] } ] } ] } ] this expected output. [ { "name": "bill", "car": "jaguar", "age": 30, },{ "name": "stacey", "car": "lambo", "age": 23, },{ "name": "martin", "car": "lexus", "age": 34, } ] e...

ios - Swift: Missing Strange Parameter -

i made method in viewcontroller class called refresh . i call refresh view controller of view presented modally on default view. however, although method refresh takes in no parameters, xcode telling me missing argument parameter #1 in call during call method. call method this: viewcontroller.refresh() if press esc in between parantheses of method call, xcode tells me put in viewcontroller . however, if run that, xcode gives me 2 errors: expression resolves unused function editor placeholder in source file is because secondary view controller in folder doesn't contain primary view controller? update: here refresh method: self.getsortedsectionlist() self.tableview.reloaddata() self.getsortedsectionlist() this: //first, clear events sectionlist sectionlist = [int: [event]]() //loop through eventlist array , seperate different event starting times index in 0..<viewcontroller.eventlist.count { let event = viewcontroller.eventlist[index] ...

php - How to insert array into crate? -

how insert array crate? i'm using latest crate-pdo, keep receiving notice notice: array string conversion in .../crate/pdo/pdostatement.php on line 610 and array string conversion in .../mypdoclass.php on line 118 i'm using code: $myarray = ['1', '2', '3', '4', '5']; $db = new database; $db->query("insert tbl (id, arraycol) values (?,?)"); $db->bind(1, '1'); $db->bind(2, $myarray); $db->execute(); any great, thanks to bind non-string parameter must use pdo bindvalue() method passing in wanted type 3rd parameter. example: $statement->bindvalue(2, [1, 2], pdo::param_array)

cython works fine on winpython but not on anaconda - linking issue -

i have cython code runs , works fine under winpython giving me issues when switch winpython anaconda3. using python 3.4 the test code : # cython: boundscheck=false # cython: wraparound=false # cython: cdivision=true cimport cython cimport numpy np import numpy np numpy cimport ndarray ar libc.math cimport * cpdef ar[double, ndim=1, mode='c'] test(ar[double, ndim=1, mode='c'] x): cdef: int n = x.shape[0] py_ssize_t ar[double, ndim=1, mode='c'] y = np.zeros(n)*np.nan nogil: in range(0, n): y[i] = x[i]+1 return y the compilation code is: from distutils.core import setup distutils.extension import extension cython.distutils import build_ext import numpy np ext_modules = [extension('test', ['tech/test.pyx'], include_dirs=[np.get_include()], define_macros=[('npy_no_deprecated_api', none)], extra_compile_args=['-o3', ...

php - Capturing Pre-execute Event in Symfony/Doctrine DBAL -

i looking way interject , modify/wrap queries before sent doctrine/symfony postgres. i've been looking around @ symfony's , doctrine's standard events ( here , here found), there doesn't seem generic "before execute query" event. is lost cause/even possible? thanks have tried use wrapper class wrapper_class parameter when configuring connections ? see here more info doctrine dbal's configuration basically, permits implement custom connection class. create custom connection class inheriting original 1 ( \doctrine\dbal\connection ) , override executequery() method. there, use own event management implementation throw event or use built-in eventmanager .

networking - Sniffing Android web traffic (not on WiFi)? -

i've been analyzing malicious android applications recently, using fiddler proxy monitor network traffic on device. it's been great, i've found app want monitor doesn't send traffic while connected wifi, when mobile internet activated. i've set separate server open ports, running fiddler, , attempted route mobile traffic through fiddler's proxy on remote server (by setting proxy in apn section of device's settings). i'm not seeing traffic @ all, , while proxy set i'm not receiving traffic device either (which implies proxy server isn't working). thought may have been server configuration issue, seems fine. tl;dr there easier way sniff android network traffic isn't on wifi? the solution think feasible connect device vpn through mobile connection: can analyze traffic on vpn server. otherwise can take @ app tpacketcapture : sometime works, sometime doesn't.

php - array_diff_assoc() is considering 1 === "1" -

i running code php.net example <?php $array1 = array(0, 1, 2); $array2 = array("00", "01", "2"); $result = array_diff_assoc($array1, $array2); print_r($result); ?> output of getting : array ( [0] => 0 [1] => 1 ) php.net says : 2 values key => value pairs considered equal only if (string) $elem1 === (string) $elem2 . whereas in example considers 2 === "2". how happening ? please explain ? might case if $ele1 casting integer string i.e. 2 "2", why comparing === operator. there might 2 == "2" better option , don't need cast string. please correct me, if wrong ? if $ele1 casting integer string i.e. 2 "2", why comparing === operator. there might 2 == "2" better option , don't need cast string. please correct me, if wrong ? it's way implemented. if want comparision function use array_diff_uassoc()

user interface - Alloy-ui diagram-builder method overwriting -

my question quite simple, how can overwrite method connectend aui-diagram-builder-impl.js ? there no problem overwrite methods aui-diagram-builder.js. importing aui-diagram-builder-impl.js file in index.html still not working. i overwrite methods that: y.diagrambuilder.editconnector = function (connector) { //some code }; and works, not... y.diagrambuilder.connectend = function (connector) { //some code }; some ideas, ? diagrambuilder has no connectend() function. perhaps looking diagramnodecondition.connectend() ?

android - Default App chooser with "always" option -

Image
in 1 of apps want ask user choose web browser, , want options "once" , "always" available them. right using: intent webintent = new intent(intent.action_view); webintent.setdata(uri.parse("http://www.google.com")); webintent.setcomponent(new componentname("android","com.android.internal.app.resolveractivity")); startactivity(webintent); and following result: while allows choose app , has options need, set chrome default, user first have click on chrome, , dialog again set chrome default (it appear in place of firefox). but want achieve is: i tried different approaches find on no luck. suggestions appreciated. as mimmo noted, cannot change behavior of system chooser, , stock android 5.0+ chooser allows user make last-visited app default via "always". also, have no way of setting default app yourself, obvious security reasons. i recommend rid of setcomponent() call, unlikely work across androi...

warnings - Magento issue after patch update - product not getting added to cart and admin login not allowed -

i running magento ce 1.9. the issue : products not getting added cart admin login not allowed , show error : [ warning: include(mage.php): failed open stream: no such file or directory in /var/www/<path web...>/lib/varien/autoload.php on line 93 warning: include(): failed opening 'mage.php' inclusion (include_path='/var/www/...path web.../app/code/local:/var/www/...path web.../app/code/community:/var/www/...path web.../app/code/core:/var/www/...path web.../lib:.:/usr/share/pear:/usr/share/php') in /var/www/...path web.../lib/varien/autoload.php on line 93 fatal error: class 'mage' not found in /var/www/...path web.../app/code/core/mage/core/functions.php on line 244 ] when clear cache folder, these issues solved, again reappears after few hours ! i remember did patch update 1533,5344,5994 , after few days got issue, earlier never happened. doubt on patch may not fact. can solve running cron every hour clear cache, not permanent soluti...

Sorting a list with a checkbox column in android -

i have listview in android contains 4 columns in row. can sorted 2 columns (id, group) other 2 color status value , checkbox. rows being sorted using comparators id, group when called notify these values sorted color , checkbox not. there way sort list based on row? added code id comparator: public static class idcomparator implements comparator<myobject> { @override public int compare(myobject lhs, myobject rhs) { if (lhs.getid() == null) { if (rhs.getid() == null) { //equal return 0; } else { //lhs < return -1; } } if (rhs.getid() == null) { //lhs > return 1; } //neither null if (lhs.getid() < rhs.getid()) { return -1; } else if (lhs.getid() > rhs.getid()) { return 1; ...

vb.net - How can I make a base class method access one of its derived class's shadowed properties? -

given example: imports system public module module1 public sub main() console.writeline("expect 'wheelvalue' here.") dim car new car() car.dosomething() console.writeline("expect 'fordwheelvalue' here.") dim ford new ford() ford.dosomething() end sub public class car public sub dosomething() console.writeline("car.dosomething()") console.writeline("wheel=" + wheel.value) console.writeline(environment.newline) end sub public property wheel new wheel() end class public class ford inherits car public shadows property wheel new fordwheel() end class public class wheel public value string = "wheelvalue" end class public class fordwheel public value string = "fordwheelvalue" end class end module calls ford.dosomething() use base class's property wheel.value . in interest of not duplicating code, there way using vb w...

java - Class or interface expected - Provider name -

i'm trying declare content provider class in manifest shows me error when type name of qualified name of provider class: the error class or interface expected, mean? the error @ line: android:name="com.sns.awesomecharactercreator.characterprovider" there red line underit , when hover on says class or interface expected here code: <?xml version="1.0" encoding="utf-8"?> <!--suppress --> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.sns.awesomecharactercreator" > <application android:allowbackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:theme="@style/apptheme" > <activity android:name=".welcome" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.m...

php - How to update exsiting row in database in laravel5 -

i new in laravel , want update existing row in database,but when click on send button in view (for example 127.0.0.1/laravel/public/article/update/3 ) encounter following error: methodnotallowedhttpexception in routecollection.php line 201: here code route route::get('article/edit/{id}','articlecontroller@edit'); route::get('article/update/{id}','articlecontroller@update'); articlecontroller public function edit($id) { $change = article::find($id); return view('edit',compact('change')); } public function update($id, request $request) { article::update($request->all()); return redirect('article'); } model public $table = 'article'; protected $fillable = ['title' , 'body']; edit.blade.php <h1>ویرایش بست {{$change->title}}</h1> {!! form::model($change ,['method'=>'patch' , 'url'=>['article/update...

HTML not linking to CSS -

Image
just curious why not working: html: css: but when launch in chrome, html doesn't seem affected css. text black , hasn't been changed. know how fix? they're in different directories: c:\....\html files\firsthtmlfiles.html c:\....\scss , css\firstcsstest.css your <link> tag writen assume .css file in same directory .html file. try <link ... href="../scss , css/firstcsstest.css" /> instead. and speaking, pictures of "broken" code useless here, since forces re-type relevant bits. in case, code have been useless, since directory information wouldn't have been included. next time... actual code please, not pictures of code.

java - Check if number is too large or not a number -

i trying parse string safely, public <t> long safeparselong(t s){ try { return long.parselong(s.tostring()); }catch (numberformatexception e){ return 0; } } this work , if string not parsable, return 0. however, there way know reason unparsable? specifically, want know if not number @ ( "foo" ) or number large (≥ 9223372036854775808). the long.parselong method throw numberformatexception if string isn't number or if number wouldn't fit in long . if exception thrown, test whether string fits regular expression number, "[+-]?[0-9]+" . if matches, it's number couldn't fit in long . if doesn't match, wasn't number @ all, e.g. "foo" . boolean isnumber = s.tostring().matches("[+-]?[0-9]+"); but returning 0 if there error. indistinguishable if content of string "0" . perhaps better let exception thrown method. instead of numberformatexception , create , ...

Import PyCharm Settings From Command Line -

i trying setup script gets of packages use , setup basic environment new employees , going quickly. wondering if there way import pycharm settings command line? the settings jar .zip archive containing of files pycharm settings directory. import settings command line, unpack .jar file settings directory. (the path directory depends on os you're using, , didn't specify 1 is.)

node.js - Google Cloud Pub/Sub API - Push E-mail -

i'm using node.js create app gets push gmail each time email received, checks against third party database in crm , creates new field in crm if e-mail contained there. i'm having trouble using google's new cloud pub/sub, seems way push gmail without constant polling. i've gone through instructions here: https://cloud.google.com/pubsub/prereqs don't understand how supposed work app on desktop. seems pub/sub can connect verified domain, can't connect directly toto .js script have on computer. i've saved api key in json file , use following: var gcloud = require('gcloud'); var pubsub; // google compute engine: pubsub = gcloud.pubsub({ projectid: 'my-project', }); // or elsewhere: pubsub = gcloud.pubsub({ projectid: 'my-project', keyfilename: '/path/to/keyfile.json' }); // create new topic. pubsub.createtopic('my-new-topic', function(err, topic) {}); // reference existing topic. var topic = pubsub.topic(...

javascript - Multi page webform validation -

problem: i have created webform in business catalyst have customized have multiple instances of on static page. first created several divs contain parts of form: <form name="catwebformform23079" method="post" onsubmit="return checkwholeform23079(this)" enctype="multipart/form-data" action="/formprocessv2.aspx?webformid=446040&oid={module_oid}&otype={module_otype}&eid={module_eid}&cid={module_cid}"> <span class="req">*</span> required {module_ccsecurity} <div class="web1"><label for="cat_custom_1433316">arrival <span class="req">*</span> </label> <br /> <input type="text" name="cat_custom_1433316" id="dpd1" class="cat_textbox" readonly="readonly" onfocus="displaydatepicker('cat_custom_1433316');retur...

apache2 - Unable to install using chef-apply -

system - info linux chef-virtualbox 3.13.0-32-generic #57~precise1-ubuntu smp tue jul 15 03:50:54 utc 2014 i686 i686 i386 gnu/linux chef version chef: 12.4.1 vi webserver.rb package 'apache2' locale lang=en_in language=en_in:en lc_ctype="en_in" lc_numeric="en_in" lc_time="en_in" lc_collate="en_in" lc_monetary="en_in" lc_messages="en_in" lc_paper="en_in" lc_name="en_in" lc_address="en_in" lc_telephone="en_in" lc_measurement="en_in" lc_identification="en_in" lc_all= note: lc_all= blank sudo chef-apply webserver.rb recipe: (chef-apply cookbook)::(chef-apply recipe) * apt_package[apache2] action install ================================================================================ error executing action `install` on resource 'apt_package[apache2]' ================================================================================ ...

python - scrapy unable to extract some data from website -

i using scrapy crawl page, able simple things visible text. there texts not visible crawler , end showing spaces. for instance seeing page sources allow me see these fields: https://www.dropbox.com/s/f056mffmuah6uu4/screenshot%202015-07-23%2018.23.32.png?dl=0 i've tried numerous times access field through xpath , css , not able these fields after each attempt. when try like: response.xpath('//text()').extract() i not able see these fields in text dump @ all. would have idea why these fields not visible scrapy? website is: https://www.buzzbuzzhome.com/uc/units/houses/sapphire in spider, need make additional xhr post request https://www.buzzbuzzhome.com/bbhajax/development/unitpricehistory endpoint price history providing necessary headers , post parameters: import json import scrapy class buzzspider(scrapy.spider): name = 'buzzbuzzhome' allowed_domains = ['buzzbuzzhome.com'] start_urls = ['https://www.buzzbuzzh...

javascript - angularjs ngRoute dont redirect -

<!doctype html> <html ng-app="routeapp"> <head> <script src= "http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script> <script src="http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.3/angular-route.min.js"></script> <script src="controlles.js"></script> <meta charset="utf-8"> <title>route mapping application</title> </head> <body> salut <div ng-view></div> <br> <nav> <a href="#/home">page d'accueil</a> <a href="#/contact">page de contact</a> </nav> </body> </html> and controllers: 'use strict' /** * déclaration de l'application routeapp */ var routeapp = angular.module('routeapp', [ // dépendances du "module" 'ngroute' ]); ro...

c# - Show records processed to user while fetching records from DB and writing to a text file -

i trying fetch records sql db , writing them text file when user clicks on button. want is, no. of records shown user during process. if there 10000 records (say), when user clicks on button, there should progress showing "no. of records written: 1,2,3.... " , on. means user must able see how many records have been written. here code, plz edit desired thing. <form id="form1" runat="server"> <div> <asp:scriptmanager id="scriptmanager" runat="server" enablepartialrendering="true"> </asp:scriptmanager> <asp:timer runat="server" id="timer1" interval="1000" enabled="false" ontick="timer1_tick" /> <asp:updatepanel id="updatepanell" runat="server" updatemode="always"> <triggers> <asp:asyncpostbacktrigger controlid="timer1" eventname="tick" /> ...

.net - Referenced dll - Does the dll filename matter? -

Image
i want include versioning of dll names distribution purposes in own referenced assemblies. example mygreat.dll becomes mygreat.v2.dll . the namespace in mygreat.dll versions (including mygreat.v.x.x.dll) mygreat. in visual studio can add reference either of file names , builds without problem. using filename mygreat.dll referenced dll, vs works in debug mode. when run vs in debug mode using mygreat.v.2.dll referenced dll error cannot find mygreat.dll or 1 of dependencies etc. i can browse dll in visual studio object browser window using either named dll. i have tried many combinations , possibilities can think of including "or 1 of dependencies" , clean project. any ideas? edit: fuslogvw results are: *** assembly binder log entry (24/07/2015 @ 6:20:12 pm) *** operation failed. bind result: hr = 0x80070002. system cannot find file specified. assembly manager loaded from: c:\windows\microsoft.net\framework64\v4.0.30319\clr.dll running under executable e...

powershell - Comparing 2 arrays of objects properties, adding property to 1 object -

my first question here. have script 2 arrays of objects 1 property object1 match 1 property object 2. when properties match, object1 gets new property based on property in object2. range of properties can around 5-20 different ones , array holding object1 can contain 100+ objects if there better way other double loops great, still new handling/comparing objects in way. so far have doesn't seem work. foreach ($vm in $vms) { foreach ($csv in $csvs) { if ($vm.location -eq $csv.ownernode) {$vm = $vm | add-member -membertype noteproperty -name csv -value $csv.name} } } edit more background, posted further down reason chose use objects need add more , more properties scrip runs, @ end use them (around 4-5 properties per object) sort them , different actions based on different properties. if properties need objects in $csvs ownernode , name properties, might speed process (and limit memory footprint) creating hashtable use ownernode key , name val...

ios - UIWebView ignoring disk cache? -

in hybrid app name web resource instance main.css?{timestamp-file-was-modified} , give them year-long max-age cache header clients should keep more or less forever. what seems happen in ios app is, however, uiwebview honors cache header during app's lifetime, i.e. when load new page includes main.css?{same-timestamp} won't try revalidate knows has right file in cache. but , upon fresh launch of app (after being killed or device switched off) uiwebview fetches resources again, ignoring cache. i've run through charles proxy verify case. i've looked inside sqlite cache.db , see main.css?{same-timestamp} there, still uiwebview won't load cache, causing initial page load slower be. i've tried on iphone ios 8.4 , ipad ios 8.2. same result. any ideas? if control cache, can register custom nsurlprotocol subclass in delegate , using - (void)startloading can load local storage.

configuration - Sublime Text 3 Default File Type on new file -

i looking around , questions , answers did not seem match looking ( sublime text 3 ). anytime open new file defaults plain text file. work php files wondering if there setting changed when open new file default php. i tried find directory path " packages/text/plain_text.tmlanguage " here: c:\program files\sublime text 3\packages c:\users\user\appdata\roaming\sublime text 3\packages but did not find " tmlanguage " files. reference: sublime text 2 - default document type the .tmlanguage files within .sublime-package files secretly simple archives holding files necessary package work. add .zip extension .sublime-package file contains php settings , can extract .tmlanguage file want new default. once have file, follow instructions question linked , should go. set default file type in sublime text

java - How to integrate Spring project with Jersey? -

what i'm trying integrate simple spring project jersey. web part on spring works fine. problem jersey. endpoint not work. when send request via rest client http 200 no error , in response body html login form, , returns me 404 not found if send request rest end poind via browser. after debugging have found jersey's endpoint method not invoke. here security configuration: <security:http auto-config="true" use-expressions="true"> <security:access-denied-handler error-page="/login"/> <security:intercept-url pattern="/j_spring_security_check" access="isanonymous()"/> <security:intercept-url pattern="/login" access="isanonymous()"/> <security:intercept-url pattern="/**" access="hasrole('role_user')"/> <security:form-login login-page='/login' default-target-url="/" auth...

r - How to iterate across two different margins of dataframe/matrix/array? -

i have 2 dimensional object (numeric), , trying create following output, use in table (format markdown). current object 7x7, ive done manually, anticipate larger objects in future , want figure out correct way of doing it. i iterate columns while keeping row constant, iterate row object 1 , continue process. i tried writing various functions , passing multiple arguments, in conjunction apply unable figure out margins/patterns. paste(dalym[1,1], "|", dalym[1,2], " (", dalym[1,3], ")|", dalym[1,4], " (", dalym[1,5], ")|", dalym[1,6], " (", dalym[1,7], ")|", dalyp[1,],"%", sep="") paste(dalym[2,1], "|", dalym[2,2], " (", dalym[2,3], ")|", dalym[2,4], " (", dalym[2,5], ")|", dalym[2,6], " (", dalym[2,7], ")|", dalyp[2,],"%", sep="") paste(dalym[3,1], "|", dalym[3,2], " (", dalym[3,...

xml - xpath of two attributes -

i have following xml file here i'm trying out xpath: //skos:concept[@rdf:about="http://aims.fao.org/aos/agrovoc/c_7776"]/skos:preflabel[@xml:lang='en'] in order value timber trees, however, don't value. if omit xml:lang='en', i'm getting values that's not wanted data. wrong xpath?

c++ - User is entering 10 numbers, find max negative value and its index/position -

user entering 10 numbers, find max negative value , index/position. ps: must use "for". plz -_-" this code: #include <iostream> using namespace std; int main() { double value, maxvalue, index; cin >> value; maxvalue = value; index = 1; (int = 2; <= 10; i++) { cin >> value; if (value > maxvalue&&value<0) { maxvalue = value; index = i; } } cout << "max value = " << maxvalue << " index = " << index << endl; } change line if (value < maxvalue && value<0)

sql server - Best Practice to Combine both DB and Lucene Search -

i developing advanced search engine using .net users can build query based on several fields: title content of document date from, date to from modified date, modified date owner location other metadata i using lucene index document content , corresponding ids. however, other metadata resides in ms sql db (to avoid enlarging index, , keep updating index on modification of metadata). how can perform search? when user search term: narrow down search results according criteria selected user looking in sql db. return matching ids lucene searcher web service, search keyword entered in documnentids returned adv search web service. then relevant metadata document ids (returned lucence) looking again in db. as notice here, there 1 lookup in db, lucene, , db values displayed in grid. questions: how can overcome situation? thought begin searching lucene has drawback if documents indexed reached 2 million. (i think narrowing down results using db first have large ...

IntelliJ IDEA terminal java version issue -

Image
i facing issue in intellij idea compiler settings. have jdk 8 installed , 1 of project in idea works on jdk 6. i have changed compiler version in idea in preferences -> java compiler page , restarted idea. the problem facing on idea terminal version not getting updated. there way other setting java_home in .profile within idea solve this? i works expected. have changed compiler version intellij idea only, affects compilation process in intellij idea. setting not (and should not) affect terminal session environment. can change shell launch arguments in file -> settings -> tools -> terminal -> shell path . since setting can set per project (but not per module, far understand), can specify project-specific settings there. i'm not sure if it's possible pass project-specific variables there , have hard-code arguments, in simple case can changed like, let's say, cmd.exe /k echo welcome (on windows machine) or similar bash .

c# - Executing SQL queries in a Controller Action -

Image
i have 5 separate sql queries executing in order in controller action. method using execute them: var entity = new testentities(); entity.database.executesqlcommand("//sql query"); so, have 5 executesqlcommand in row different queries must execute in order , code must continue execute below them. there better way execute queries inside controller action? not sure best way error handling current method. thanks! to start @ creating abstraction layer in between controller , database. example of repository, when come testing. can create mock repositories can use in unit tests rather testing against actual database. you mention have 5 different database commands fire. @ unit of work pattern can use track have changed , apply of these changes database. there article on microsoft's asp.net website implementing repository , unit of work .

c# - How to inject null for unregistered services -

i have decorator , associated service looks this: public interface iadditionaldataservice<tresult, tmodel> { tresult populateadditionaldata(tresult model, params expression<func<tmodel, object>>[] properties); } public class additionaldatadecorator<tquery, tresult, tmodel> : iqueryhandler<tquery, tresult> tquery : querybase<tresult, tmodel>, iquery<tresult> tmodel : modelbase { private readonly iqueryhandler<tquery, tresult> _decorated; private readonly iadditionaldataservice<tresult, tmodel> _additionaldataservice; public additionaldatadecorator(iqueryhandler<tquery, tresult> decorated, iadditionaldataservice<tresult, tmodel> additionaldataservice) { _decorated = decorated; _additionaldataservice = additionaldataservice; } public tresult handle(tquery query) { var result = _decorated.handle(query); if (query.relatedd...

ASP.Net C# AssemblyInfo Version Not Working -

here help file using. states still applies version 4.6. yet, when try use built-in calculations, following code: [assembly: assemblyversion("2015.7.*.*")] [assembly: assemblyfileversion("2015.7.*.*")] i syntax errors on asterisk, , solution won't compile. not sure going on. according file, should working. edit: reason code block not working me. keeps scrambling code, can't show it. edit fixed code block. you don't need 2 * 1 enough. [assembly: assemblyversion("2015.7.*")] from link examples of valid version strings include: 1 1.1 1.1.* 1.1.1 1.1.1.* 1.1.1.1 remove assemblyfileversion. if assemblyfileversionattribute not supplied, assemblyversionattribute used win32 file version displayed on version tab of windows file properties dialog.

java - What class should I use for Date's in Android? -

i'm making app android, i'm unsure class best use. what need dates i'm working things such comparing dates, getting difference between them, , date calculations (such adding/subtracting small period of time such 2 weeks or month given date). i know standard date class in java api horrible, i'm wondering classes recommended? i've seen gregoriancalendar class, , joda time library. however, read on post due size of joda time library, wasn't recommended apps. any appreciated. ^^ edit: upon comment 404notfound, decided go calendar interface. due calendar interface automatically using best implementation of based on locale , time zone of user's device. make more flexible on implementation of gregoriancalendar (or other specific implementations) in terms of places can roll out to. hope helpful else same conundrum! edit #2: after further link provided nguyễn hoài nam, i've went threetenabp library, it's wrapper new time class featured in ...