Posts

Showing posts from July, 2015

c# - CompileAssemblyFromSource + Obfuscation = don't work -

i have working compileassemblyfromsource code. when use code protector redgate smartassembly or themida it's stop working , error "could not load file or assembly or 1 of dependencies". can please me that? using system; using system.codedom.compiler; using system.reflection; using microsoft.csharp; namespace stringtocode { public class program { public static int q = 0; static void main(string[] args) { try { string source = "namespace stringtocode { public class fooclass { public void execute() { program.q = 1; } } }"; console.writeline("q=" + q); using (var foo = new csharpcodeprovider()) { var parameters = new compilerparameters(); parameters.generateinmemory = true; foreach (assembly assembly in appdomain.currentdomain.getassemblies()) { ...

javascript - How to synchronize two scrollbars for divs with different style overflow -

Image
i have problem trying sync scroll in divs, have 2 divs, first div has style overflow: hidden , second div has style overflow:scroll,then found several answers sync scroll in divs using jquery example : $("#div2").scroll(function () { $("#div1").scrolltop($(this).scrolltop()); }); http://jsfiddle.net/gqhyw/43/ but have problem solution because @ bottom of scroll divs desynchronized , see image . someone has idea how solve error. thank in advance your horizontal scroll showing despite not needing there. can target horizontal scroll , hide it, while keeping vertical scroll: .bottom { left : 50%; overflow-y : scroll; overflow-x : hidden; }

vb.net - Declare New without using With or From -

Image
i know if possible write multiple lines, equivalent of line bellow, instead of using , use multiple lines declare data. dim price = new pricestruc() { _ .bids = new list(of prices)() {new prices() {.price = 1101, .size = 1}}, .offers = new list(of prices)() {new prices() {.price = 1102, .size = 1}}} you can add parameters constructor set properties when create instance. helpful object should exist when or property known. use in designer serialization, among others. warning: taking far requested doesnt make code easier read i dont know these are, made own , fixed of nomenclature (it looks prices has data 1 item, yet plural). friend class price public property value integer public property size integer public sub new() end sub public sub new(v integer, s integer) value = v size = s end sub end class the simple constructor (no params) there because many serializers require one. depending on serializer, can set friend...

RegEx to prohibit some special characters -

what proper regular expression exclude or prohibit < > * % : & \ i trying ^[^<>*%:&\\]$ but not seem work. please help, thanks. it correct single characters. if want validate longer strings, ^[^<>*%:&\\]*$ if empty strings okay, or if not, ^[^<>*%:&\\]+$

asp.net - WCF Services - Configuration web service binding exception -

all, env: asp.net 4.0 iis 7 (or greater) wcf service consumed sl component authentication: anonymous/forms when attempt browse wcf web service (using browser) following exception on web service, need rid of error: the authentication schemes configured on host ('integratedwindowsauthentication') not allow configured on binding 'basichttpbinding' ('anonymous'). please ensure securitymode set transport or transportcredentialonly. additionally, may resolved changing authentication schemes application through iis management tool, through servicehost.authentication.authenticationschemes property, in application configuration file @ element, updating clientcredentialtype property on binding, or adjusting authenticationscheme property on httptransportbindingelement. i looked @ related posts , none of them me. not using authentication or user/pwd transmission service. service need working consumed silverlight component , has name in web.config f...

php - Access lastInsertId variable outside a function -

Image
so have simple code here insert data , return last inserted id . here code: function newuser($fname, $age) { global $newuserlastid; $conn = new pdo('mysql:host=localhost;dbname=mydb', 'root', ''); $conn->setattribute(pdo::attr_errmode, pdo::errmode_exception); $data = $conn->prepare("insert accounts (fname, age) values (?, ?)"); $data->execute(array($fname, $age)); $newuserlastid = $conn->lastinsertid('accounts'); } and wanted run function , global variable like: newuser('johndoe', '22'); $somevar = $newuserlastid; my problem whenever run code, cli crashes. there way fix this? on production server. i'm not getting error besides this. (by running function, cli crashes) why not return new id instead of using global variable? so, last line of function be: return $newuserlastid then, when call function, you'd instead assign variable, this: $mynewid = newuser('john...

Reverse proxy via Passenger/Nginx on Heroku -

i have rails app on heroku , need create reverse proxy our blog, hosted on dreamhost. hosted @ blog.ourdomain.com want ourdomain.com/blog point it. research seems best reverse proxy via nginx component of our passenger application server. so, i've created location in our nginx.conf.erb : location ^~ /blog { proxy_pass https://blog.ourdomain.com; } this works fine our purposes, except when /blog visited. ( /blog/ , /blog/whatever/... fine). when /blog used, nginx instead redirects ourdomain.com:12345/blog/ port assume our heroku dyno's port. how can slash-less uri go reverse proxy correctly? i've run same problem well. still haven't gotten our proxy functioning - running weird redirect loops on wordpress / apache side - did solve manually setting port: location ^~ /blog { proxy_pass https://blog.ourdomain.com:80; } i'm not confident enough in nginx knowledge work sure, seems working us.

Best Way to Archive R files for Thesis -

i close finish master thesis. , during time got lot of .r files. trial , error , more serious. archive stuff graders can access them if want , can use them in future if needed. best format in r achieve goal, please? r project worth trying? thank you! it's great question , wish more academics plan this. recommend putting on github common way share code in numerical computing community these days. including in thesis good, easier people use if on github. sharing whatever have better sharing nothing , because people can see did. if have more time make nicer , suggest: documenting clarity removing extraneous code , keeping pertains thesis for each specific result in thesis, provide specific script generates result. if have figures, provide script generates exact figure. this did python code used analyze data in paper published in academic journal. way, reads paper , unclear findings or how generated them, can take @ code , see how analysis performed. here githu...

android - SlidingTabLayout covering the first View -

my slidingtablayout covering first view of fragment images: what want: http://i.stack.imgur.com/w4pcd.png what get: http://i.stack.imgur.com/wd4dp.png helpactivity: <mytab.tools.slidingtablayout android:id="@+id/tabs" android:layout_width="match_parent" android:layout_height="wrap_content" android:elevation="2dp" android:fitssystemwindows="true" android:background="@android:color/holo_green_dark"/> <android.support.v4.view.viewpager android:id="@+id/pager" android:layout_height="match_parent" android:layout_width="match_parent" android:layout_weight="1" ></android.support.v4.view.viewpager> my fragmentxml: <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/help1_layout" ...

python - PyQt4 User Input Validation - QlineEdit -

i'm having little trouble understanding input validation pyqt4. first gui application , first time working pyqt4 framework. i've been reading through class reference , looks preferred way text validation through qregularexpression class seems excessive simple input validation. i have method in register user class adds user sqlite database. created signal qlineedits connects method validates text. sql input works fine reason input validation not. not pull error. messageboxes not pop up. understand created 1 signal testing. def newuser(self): #this method adds new user login database , displays pop window confirming entry c.execute("insert logins(usernames, passwords)values(?,?)", (self.useredit.text(), self.passedit.text())) #sql query inserts entries line edit , pass edit database c.commit() #save database changes self.connect(self.useredit, qtcore.signal("textchanged()"), self.validtext) def validtext(self): if len(...

asp.net - How to change the ID of a complex type property in entity framework without first selecting the object? -

if have object property of complex type object b, how can change a.b b object without first selecting new b object? for example, know can this a.b = (from b in db.bs b.id = newid select b).first() but rather this a.b.id = newid and assume can't because overwrite properties of existing b object empty values b = new b { .id = newid } db.bs.attach(b) a.b = b you have a.b property call constructor on demand when b not yet initialized. i converted c# vb.net without testing it, same pattern works everywhere. make sure initialize property nothing or null first, , in property accessor call constructor if private member variable not initialized. return value usual. public class b public property id() [string] return m_id end set m_id = value end set end property private m_id [string] end class public class private _b b public sub new() _b = nothing end sub public prop...

How to make excel linked to another excel file in Sharepoint 2010 -

i have 3 excel files uploaded in sharepoint 2010. in 1 theme every cell links 1 of 3 excel files. in sharepoint without opening in excel on desktop, there way update linked data? there way run vba? sorry bad english. vba , external data ranges (also quoted query tables) not supported sharepoint 2010 , neither sharepoint 2013 while using excel services view these files online. these features supported if open them within excel itself. here complete answer microsoft: https://msdn.microsoft.com/en-us/library/office/ff595319.aspx

Python Subtract Arrays Based on Same Time -

is there way can subtract 2 arrays, making sure subtracting elements have same day, hour, year, , or minute values? list1 = [[10, '2013-06-18'],[20, '2013-06-19'], [50, '2013-06-23'], [15, '2013-06-30']] list2 = [[5, '2013-06-18'], [5, '2013-06-23'] [20, '2013-06-25'], [20, '2013-06-30']] looking for: list1-list2 = [[5, '2013-06-18'], [45, '2013-06-23'] [10, '2013-06-30']] how using defaultdict of lists? import itertools operator import sub collections import defaultdict def subtract_lists(l1, l2): data = defaultdict(list) sublist in itertools.chain(l1, l2): value, date = sublist data[date].append(value) return [(reduce(sub, v), k) k, v in data.items() if len(v) > 1] list1 = [[10, '2013-06-18'],[20, '2013-06-19'], [50, '2013-06-23'], [15, '2013-06-30']] list2 = [[5, '2013-06-18'], [5, '2013-06-23'...

C: Typedef structure and pointers anomaly -

i on data structures classes , confused me. it's related pointers properties guess, on research didn't find real explanation, idea why c allows this? run-able code: http://ideone.com/kgh3lf #include <stdio.h> #include <stdlib.h> /* declaring typedef struct */ typedef struct{ int a; char b[10]; }struct_one; /* declaring structure, intentional wrong calling of first structure */ struct struct_two{ int p; char q[10]; /* doesn't work expected... should be: struct_one var; */ // struct struct_one var; /* 1 work!!, , i'm not sure why */ struct struct_one *ptr; }; int main(void) { /* code */ return 0; } you incorrectly assumed second structure "calls" first one. doesn't. in reality first struct declaration declares untagged struct type typedef alias struct_one . way refer type struct_one . struct_one , not struct struct_one . the second struct declaration declares struct struct_two ...

android - PercentSupportLibrary : Set percentage values in xml? -

i want use different layout width ratios larger tablet screens. there way set percentage based (fraction-type) values such layout_widthpercent , layout_marginstartpercent in dimens.xml ? i solved it. values in dimens.xml : <resources> <item name="width_percent" type="dimen">60%</item> </resources>

json - Zend error Connection -

i have problem code, first code <?php require_once('zend/json.php'); require_once('zend/db.php'); //require_once 'zend/db/adapter/pdo/pgsql.php'; class jsonvi { protected $_db; public function _koneksi () { try { $this->_db = zend_db::factory('pdo_pgsql',array( 'host'=>'localhost', 'username'=>'stet', 'password'=>'test', 'dbname'=>'test' )); return $this->_db; } catch(zend_db_exception $e) { return $e->getmessage(); } } public function getdata() { $db = $this->_koneksi(); try { $sql = "select * info "; ...

php - Doctrine add columns from a subquery -

i have following code in sql: select id, sum(horas) horas , sum(custo) custo from( select mr.name, mr.id id, sum(hour(timediff(m.end, m.start))) horas, sum(hour(timediff(m.end, m.start))) * u.cost_hour custo meeting m inner join meeting_join_rooms on m.id = meeting_join_rooms.meeting_id inner join meeting_rooms mr on meeting_join_rooms.meeting_room_id = mr.id inner join meeting_attendee ma on ma.meeting_id = m.id inner join users u on u.id = ma.user_id m.cancel = false , m.ismaster = false group mr.name, u.id ) subquery group name i've converted code doctrine using following query builder: $subquery = $this->getentitymanager() ->createquerybuilder() ->select(' mr.name name, sum(hour(timediff(m.end, m.start))) hours, sum(hour(timediff(m.end, m.start))) * users.costhour cost') ->from('appbundle:meeting','m') ->join('m.meetingrooms', 'mr...

Printing Cross Compiled libraries(C/C++) Log (printf) in Android (Logcat) -

i cross compiled c/c++ libraries using netbeans android. libraries have log information, want see while application run on phone. there way, log information present in c/c++ cross compiled static libs can displayed on logcat or anywhere else in android studio.

javascript - after closing popup with window.close() and the unload event not firing in IE 11 -

from parent page, have opened popup using window.open. then in popup, trying close popup window.close , on unload, trigger click in parent page. code in popup.aspx.cs: clientscript.registerstartupscript(typeof(page), "closepage", "<script type='text/javascript'>window.close();</script>"); code in popup.aspx <script type="text/javascript"> window.onunload = triggerclick; function triggerclick() { var b = window.opener.document.getelementbyid('ctl00_pagecontent_updatebutton1'); b.click(); return false; } </script> it works fine in ff , chrome, not in ie 11. suggestions on how tackle issue? in advance. try window.onbeforeunload , not window.onunload .

java - Jackson seemingly not persisting bidirectional relationship managed by Hibernate -

i'm having trouble figuring out why owning side of relationship isn't getting persisted on other side when post json object rest api (using spring , hibernate). mapped superclass id field: @mappedsuperclass public class baseentity implements serializable { private static final long serialversionuid = 11538918560302121l; @id @generatedvalue(strategy = generationtype.identity) private int id; .... } owning class (extends namedentity in turn extends baseentity ): @entity @dynamicupdate @selectbeforeupdate @namedquery(name = "chain.byid", query = "from chain id=:id") @jsonidentityinfo(generator = objectidgenerators.propertygenerator.class, property = "id", scope=chain.class) public class chain extends namedentity { private static final long serialversionuid = 4727994683438452454l; @onetomany(mappedby = "chain", fetch = fetchtype.eager, cascade = cascadetype.all) private list<campaign> ca...

ivalueconverter - Issue in chaining IValueConvertes in WPF becauase of target type -

i trying chain converters town's answer in is there way chain multiple value converters in xaml? ? i make individual converters more strict having targettype check :- if (targettype != typeof(bool)) throw new invalidoperationexception("the target must boolean"); but chain fails end target type different target @ each stage. i can remove type check make less strict given in of examples on so, prefer chaining respects each converter's type check well. e.g. better unit testing etc. also interface ivalueconverter doesn't expose target type, find difficult add check myself. public class inversebooleanconverter : ivalueconverter { public object convert(object value, type targettype, object parameter, cultureinfo culture) { if (targettype != typeof(bool)) throw new invalidoperationexception("the target must boolean"); if (!(value bool)) throw new argumentexception("argum...

javascript - google apps script doGet -

i'm having problems code. google deprecated several pieces working. when making new sheet , trying use old code, errors , can't find way make changes documentation @ google. function doget(e) { //this not working? if (typeof e.parameter.id == 'undefined'){ return no_id(e) // url doesn't have ?id=345 on end! } var id = parseint( e.parameter.id ) // id of row in spreadsheet. //script properties changed , think now: propertyservice.getscriptproperties() // data spreadsheet , row matches id var this_spreadsheet_id = scriptproperties.getproperty('this_spreadsheet_id') var ss = spreadsheetapp.openbyid(this_spreadsheet_id) var sheet = ss.getsheetbyname("sheet1") var range = sheet.getdatarange() var last_row = range.getlastrow() var last_column = range.getlastcolumn() for(i = 2; <= last_row ; i++){ var this_row = sheet.getrange(i,1 , 1, last_column) var values = ...

Space not working in android -

i have android app accept various inputs user problem not able use space in of edittext fields dont know problem , frustrating...any appriciated. <edittext android:id="@+id/edt_frm_place" style="@style/normal_customfontstyle" android:layout_width="fill_parent" android:layout_height="40dp" android:background="@drawable/border" android:paddingleft="3dp" android:maxlength="50" android:paddingtop="3dp" android:digits="abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz1234567890" android:hint="enter place" /> this edittext xml representation change android:digits="abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz1234567890" to android:digits="abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz1234567890 " which include space

gps - LocationListener Android -

i following guide on android developer retrieve location , trying speed it. have written code following guide log doesnt print , text doesnt update. final button button = (button) findviewbyid(r.id.button3); final textview speed = (textview) findviewbyid(r.id.textview5); // acquire reference system location manager final locationmanager locationmanager = (locationmanager) this.getsystemservice(context.location_service); final string locationprovider = locationmanager.gps_provider; // define listener responds location updates final locationlistener locationlistener = new locationlistener() { public void onlocationchanged(location location) { // called when new location found network location provider. float gets=(location.getspeed()); speed.settext("speed: "+gets); } public void onstatuschanged(string provider, int status, bundle extras) { ...

php - How can I use a simple Dropdown list with filtering in the search box of GridView::widget, Yii2? -

i have 2 tables "attendance" attributes id , status , date , "staff". staff_id used foreign key in attendance table. in _form.php of attendance used <?= $form->field($model, 'status')->dropdownlist([ 'present' => 'present', 'absent' => 'absent', 'leave' => 'leave',], ['prompt' => 'select status']) ?> for dropdown. want dropdown in gridview search columns property of filtering , searching. gridview filtered dropdown list have. when choose value dropdown list, should search on base of choosed value. highly appriciated. i think question status field <?= gridview::widget([ 'dataprovider' => $dataprovider, 'filtermodel' => $searchmodel, 'columns' => [ ['class' => 'yii\grid\serialcolumn'], ........ [ 'attribute' => 'status', ...

linux - Regex getting dot files except the current and parent dictionaries -

i'm reading book "how linux works". author gave following regular expressions can dot files except current , parent directories. (page 21) .??* .[^.]* if dot files exist in directory both work. when no dot files exist first 1 work. i can't understand them. can describe me? $ ls -a . .. .hiding $ ls -a | grep .??* .hiding $ ls -a | grep .[^.]* .hiding $ mv .hiding hiding $ ls -a | grep .??* $ ls -a | grep .[^.]* . .. hiding the first not make sense, not work me, , cannot find documentation ?? either. regardless, there 2 problems both of these regexes: the . here matches char. in order match single dot is, have put \ in front of it, \. . the whole expression can match anywhere in line. have assert matching starts @ beginning. start ^ . try: ls -a | grep '^\.[^.]' means: starting @ beginning of line, find single dot. char not listed (negation done second ^ here) between brackets, not literal dot. in brackets don't hav...

java - Servlet seems to handle multiple concurrent browser requests synchronously -

as far know java servlets handling multiple requests concurrently , i've searched through stackoverflow google, , confirmed thought. quite confused right now, wrote simple servlets seem show blocking behaviour. so have simple servlet: public class myservlet extends httpservlet { private static final long serialversionuid = 2628320200587071622l; private static final logger logger = logger.getlogger(myservlet.class); @override protected void doget(httpservletrequest req, httpservletresponse resp) throws servletexception, ioexception { logger.info("[doget] test before"); try { thread.sleep(60000); } catch (interruptedexception e) { // todo auto-generated catch block e.printstacktrace(); } logger.info("[doget] test after"); resp.setcontenttype("text/plain"); resp.getwriter().write("ok"); } } then have 2 browser windows, ope...

ios - Update in realtime -

i want create app have real time update. it's kind of game. here's i'm trying do: players playing, , gets highest score, (while he's playing,) should show on devices, , score should changing high score user playing. i know kind of difficult understand, i'm trying leaderboard agars game , names changing. you can start angularjs , firebase database. firebase

doctrine2 - Symfony - Get Entity from within another entity -

i retrieve record entity (or record db) within entity. they there no relationship between 2 entities. i using @orm\haslifecyclecallbacks() , @orm\prepersist when main entity created create entity (save record table) the above working fine, there no issues this. what having issue link entity table need retrieve object based on value of first entity. usually write function in entity repository not calling entity manager within entity. an entity in doctrine object representation of concept, attributes , methods. meant lightweight, popo (plain old php object). must not know persistence. therefore if see reference entitymanager in model, stinks. solutions? use entity listener called on entity creation , use service dedicated compose object(s), maybe factory . in way, entity stays lightweight, lifecycle management satisfied , entity composing responsibility of service.

ios - How to send push notification to purticular group members using parse? -

i developing social messaging app using parse backend. need send push notification group members when texted in group. my code : pfquery* getmembers = [pfquery querywithclassname:@"group"]; [getmembers wherekey:@"objectid" equalto:groupid]; [getmembers includekey:pf_recent_user]; [getmembers findobjectsinbackgroundwithblock:^(nsarray *objects, nserror *error) { if (!error) { nsarray *ar = [[nsarray alloc]init]; ar=[[objects objectatindex:0]objectforkey:@"members"]; nslog(@"members %@",ar); pfquery *queryinstallation = [pfinstallation query]; [queryinstallation wherekey:pf_installation_user matcheskey:pf_recent_user inquery:getmembers]; pfpush *push = [[pfpush alloc] init]; [push setquery:queryinstallation]; //[push setmessage:text]; nsdictionary *data = [nsdictionary dictionarywithobjectsandkeys: text, @"alert", ...

angularjs - Angular Coffeescript to Javascript conversion - next function is considered as the body of the previous function -

i having strange issue @ times when using coffeescript. example below: coffeescript: $scope.function1 = () -> console.log("function 1") $scope.function2 = () -> console.log("function 2") javascript: $scope.function1 = function() { console.log("function 1"); return $scope.function2 = function () { console.log("function 1"); } why second function goes inside first one? highly appreciated. not happening time though. in coffeescript, indentation meaningful. code posted in question translates want. if second function indented relative first: $scope.function1 = () -> console.log("function 1") $scope.function2 = () -> console.log("function 2") ...it translates incorrectly in way you've shown. be sure consistent in use of spaces or tabs. but again, quoted in question, it's fine: $scope.function1 = () -> console.log("function 1...

Turn off notification of chrome -

i'm developing chrome extension , want install extension silently . know how install silently chrome notifications like: disable developer mode extensions! my path of installing extension chrome silent add string: --load-extension="c:\program files\..\ --no-first-run target of chrome shortcut. how can turn off notification silently? is there alternate way of installing chrome extension silently? what you're asking shady , if have best of intentions. chrome developers have hardened chrome against malware, , see results of work. 1) developer extension popup cannot disabled . quote chrome bug tracker on feature request make setting: "sorry, know annoying, malware writers..." 2) silently installing extension bypassing chrome security mechanisms blocked securely signed preference files of chrome. if add extension extensions are, not enabled. 3) interacting chrome install extension out-of-band possible, it's not going silent. extens...

Sip Servlet setAttribute mobicent -

i'm facing on problem set attribute of sip servlet. i'm trying send 200 ok , when receive 200 ok different source. i've thought in way: protected void doinvite(sipservletrequest req) throws servletexception, ioexception { //... sipsession session = req.getsession(); sipservletresponse response = req.createresponse(200); session.setattribute("reqresponse", response); /... } and so, when receive 200 ok other side: protected void dosuccessresponse(sipservletresponse resp) //... throws servletexception, ioexception { sipservletresponse response = (sipservletresponse) session.getattribute("reqresponse"); response.send(); //.... } but when try response.send() have error: [0m[31m09:25:15,956 error [org.mobicents.servlet.sip.core.dispatchers.dispatchtask] (mobicents-sip-servlets-udpmessagechannelthread-10) unexpected exception while processing message sip/2.0 200 ok via: sip/2.0/udp localhost:5080...

javascript - How to get push notification in Top (status bar) in IBM MobileFirst -

Image
everything working fine in android app push notification. i'm getting notification in alert form. need notification @ top instead of alert, see image below: did @ @ code of sample application running? you alert because specified in onnotificationreceived function notifications displayed in notification area when app in background closed. notifications not displayed in notification area when application in foreground.

c# - How to go back multiple Pages? -

in universal app, want use frame navigate through app. have breadcrumb, per designs. don't know how handle things when user wants go multiple pages. my breadcrumb items simple strings display using xaml listview . find index of breadcrumb user clicked on , try go many times. i tried using loop: private void breadcrumb_item_tapped(object sender, tappedroutedeventargs e) { var breadcrumb = ((sender grid).datacontext string); for(int = 1; < breadcrumbs.count - breadcrumbs.indexof(breadcrumb); i++) { frame.goback(); } } but frame.goback() doesn't work, i'm guessing because going fast after goback() call before. don't want use sleep method, because should instant. what can go multiple pages? i suggest using frame.backstack.removeat(frame.backstackdepth-1) this way remove entries stack without navigating. use loop decide when should stop removing , execute final frame.goback()

vb.net - How to import the data from excel to the .mdb access file? -

here m have problem export data in excel format of .mdb . m trying code showing below, shows messagebox import failed, correct column name in sheet! error message: the 'microsoft.jet.oledb.4.0' provider not registered on local machine is there can me. best regards, thanes private sub button1_click(byval sender system.object, byval e system.eventargs) handles button1.click ' delete file same , create new access file if file.exists("c:\users\admin\desktop\test\ca\book.mdb") file.delete("c:\users\admin\desktop\test\ca\book.mdb") end if dim _accessdata access.application _accessdata = new access.application() _accessdata.visible = false _accessdata.newcurrentdatabase("c:\users\admin\desktop\test\ca\book.mdb", access.acnewdatabaseformat.acnewdatabaseformataccess2000, , , ) _accessdata.closecurrentdatabase() _accessdata.quit(microsoft.office.interop.access.acquitoption.acquitsave...

sonarqube - sonar 4.5.4-- Debt definition of rule is invalid exception -

i have own customized plugins of csharp of version 2.1 when deployed stylecope plugin in sonar 4.5.4 server, rules getting exception below after removing rule working fine. exception getting in sonar 4.5.4 not facing issues in sonar 4.2 , lesser version. need know why issue occuring , mean say? please explain. thanks java.lang.illegalargumentexception: debt definition on rule 'stylecopcsharp:constfieldnamesmustbeginwithuppercaseletter' invalid @ org.sonar.server.rule.deprecatedrulesdefinitionloader.remediationfunction(deprecatedrulesdefinitionloader.java:135) ~[sonar-server-4.5.4.jar:na] @ org.sonar.server.rule.deprecatedrulesdefinitionloader.updateruledebtdefinitions(deprecatedrulesdefinitionloader.java:117) ~[sonar-server-4.5.4.jar:na] @ org.sonar.server.rule.deprecatedrulesdefinitionloader.complete(deprecatedrulesdefinitionloader.java:107) ~[sonar-server-4.5.4.jar:na] @ org.sonar.server.rule.ruledefinitionsloader.load(ruledefinitionsloader.java:53) ~[s...

Java 8 create map a list of a complex type to list of one of its fields -

i have list complex type , want figure neat way construct list 1 of fields using java 8's streams. let's take example: public static class test { public test(string name) { this.name = name; } public string getname() { return name; } private string name; // other fields } and imagine have list<test> l; . want create new list contains values of name of elements in l . 1 possible solution found following: list<string> names = l.stream().map(u ->u.getname()). collect(collectors.<string> tolist()); but wondering if there better way - map list of given type list of different type. using method references shorter : list<string> names = l.stream().map(test::getname). collect(collectors.tolist()); you can't avoid @ least 2 stream methods, since must first convert each test instance string instance (using map() ) , must run terminal operation on stream in order process stream pi...

php - Laravel validator 'in' issue for numbers in input -

i need in fixing issue in using laravel 'in' validator match given input against multiple comma separated string of values. issue when there number in input , not matches of comma separated values gives exception: preg_match() expects parameter 2 string, array given however should give error message in validator object input field not match. instead gives above mentioned exception. following code: if (!empty($program)) { $institution_id = $program->institutionid; $roster_users = $program->usersrosters()->where('profiletype', 'student')->get(); if (!empty($roster_users)) { $rostered_users_ids = implode(',', $roster_users->lists('id')); } if (!empty($roster_users)) { $rostered_users_usernames = implode(',', $roster_users->lists('username')); } $teacher_roster_users = $program->usersroste...

java - Opening OrientDB Database in Eclipse Maven project throws errors -

the error getting follows: " aug 25, 2015 1:47:41 pm com.orientechnologies.common.log.ologmanager log info: orientdb auto-config diskcache=4,161mb (heap=1,776mb os=7,985mb disk=416,444mb) aug 25, 2015 1:47:41 pm com.orientechnologies.common.log.ologmanager log warning: segment file 'database.ocf' not closed correctly last time exception in thread "main" com.orientechnologies.common.exception.oexception: error on creation of shared resource @ com.orientechnologies.common.concur.resource.osharedcontainerimpl.getresource(osharedcontainerimpl.java:55) @ com.orientechnologies.orient.core.metadata.ometadatadefault.init(ometadatadefault.java:175) @ com.orientechnologies.orient.core.metadata.ometadatadefault.load(ometadatadefault.java:77) @ com.orientechnologies.orient.core.db.document.odatabasedocumenttx.initatfirstopen(odatabasedocumenttx.java:2633) @ com.orientechnologies.orient.core.db.document.odatabasedocumen...

google docs - How to retrieve last string of a cell delimited by a special string -

how can value 1 , value 2 , value 3 following rows (cells) in google docs? xyz1 --> xyz2 --> value 1 xyz3 --> xyz4 --> xyz5 --> value 2 xyz6 --> value 3 does formula work want if example values in column a: =arrayformula(iferror(right(a:a,len(a:a)-search("|",substitute(a:a,"-->","|",(len(a:a)-len(substitute(a:a,"-->","")))/len("-->")))-len("-->"))))

Nginx excluding directory from redirect rules -

i have following .conf in nginx location / { if ($uri !~ ^/front/? ){ include ez_params.d/ez_rewrite_params last; } include common_auth.conf.inc; location ~ ^/(index|index_(rest|cluster|treemenu_tags))\.php(/|$) { #bunch of rules here } } what trying here here excluding /front/ folder ezpublish rewrite rules. however, not not work, gives me error while trying load file: "nginx: [emerg] "include" directive not allowed here in /etc/nginx/conf.d/staging-preview.conf:51 nginx: configuration file /etc/nginx/nginx.conf test failed" i found out using "if" pretty not done, see http://wiki.nginx.org/ifisevil , don't understand should instead. just create individual location blocks , include/exclude whatever want. can repeat "includes" in each needed for example: location ~ ^/front/? { # here include common_auth file include common_auth.conf.inc; } location ~ ^/(index|index_(rest|clus...

javascript - how does meteor handle async calls -

starting working on new meteor app, have done node.js projects callbacks or promises handle async code going through meteor tutorials; async methods have no callbacks or promises. how handled? example code tutorial: var party = parties.findone(partyid); if (!party) throw new meteor.error(404, "no such party"); if (party.owner !== this.userid) throw new meteor.error(404, "no such party"); if (party.public) throw new meteor.error(400, "that party public. no need invite people."); how can fetch db , perform operations on party meteor uses magical abstraction coroutines called fiber. works same async/await in many other languages. desribe possible: there callbacks underneath, don't need handle them hand. https://github.com/laverdet/node-fibers /edit there great article on meteorhacks describing how fibers work: https://meteorhacks.com/fibers-eventloop-and-meteor