Posts

Showing posts from April, 2015

Selenium webdriver (Double click on a search result displayed as label) -

i new selenium , need double click on label(appears after successful search result). please help. enter image description here attached page like. you should use actions() class includes 'double-click' action. actions action = new actions(driver); action.movetoelement(driver.findelement(by.xpath("//select[@id='groupselect']/@option[@value='942711']"))).doubleclick().build().perform(); or actions action = new actions(driver); webelement element=by.xpath("//select[@id='groupselect']/@option[@value='942711']")); //double click action.doubleclick(element).perform(); //mouse on action.movetoelement(element).perform(); //right click action.contextclick(element).perform(); hope :)

javascript - Best practice with caching. Avoid redundant caching? -

ok question might seem bit basic wonder if should cache variables in functions these: function foobar(target) { var elem = target.children[0].children[1]; if(n == 1) { elem.style.color = "red"; } else { elem.style.color = "blue"; } } vs function foobar(target) { if(n == 1) { target.children[0].children[1].style.color = "red"; } else { target.children[0].children[1].style.color = "blue"; } } there no real performance gain there? assume apart type safety latter better since need less lines. considered best practice in cases these? should still cache object eventhough not needed? so unless if statements included: if(elem.classname == "something") i personaly wouldnt bother caching. at other hand brain in conflict coding style / consistency. assuming have this: function foobar(target) { if(n == 1) { target.children[0].children[1].style.color = "red"; } if e...

java - Expressing Audit functionality with JPA annotations -

i'm in middle of fumbling around jpa. i've far created entity representing user data , stateless bean access user data. the data users can work on ( sqlfiddle link ): create table data ( email character varying(128) not null, data character varying(128) not null, lastchange timestamp not null, constraint email_data primary key (email,data) ); the idea save unaltered, current version users empty email key. then, when user alters data , creates auditable version, email field filled users email. way, each user can alter copy of data. merging problem later date , not part of question. now, have entities in place. created stateless bean load/save/find data records using entitymanager. logic load user specific version first, load unaltered version if user has no user specific version still eludes me. consider part of bean: @stateless public class databean { @persistencecontext(unitname = "authpu") private entitymanager em; public list...

c++ - why is `std::initializer_list` often passed by value? -

in every post see on so, involving std::initializer_list , people tend pass std::initializer_list value. according article: http://cpp-next.com/archive/2009/08/want-speed-pass-by-value/ one should pass value, if 1 wants make copy of passed object. copying std::initializer_list not idea, as copying std::initializer_list not copy underlying objects. underlying array not guaranteed exist after lifetime of original initializer list object has ended. so why instance of passed value , not by, const& , guaranteed not make needless copy? it’s passed value because it’s cheap. std::initializer_list , being thin wrapper, implemented pair of pointers, copying (almost) cheap passing reference. in addition, we’re not performing copy, we’re (usually) performing move since in cases argument constructed temporary anyway. however, won’t make difference performance – moving 2 pointers expensive copying them. on other hand, accessing elements of copy may faster sin...

android - Visual Studio 2015 cross platform addition dependencies doesn't work? -

Image
i'm try include shared library (.so) in android cross platform dynamic library, put name of "so" dll in project configuration under "addition dependencies" but when compile "linker" doesn't found library. i tested add "path" in "additional library directories" , "shared library path" nothing, same error. works if put entire path name library on "additional dependencies" compiled "so" (opened text reader) reports entire path dll , in runtime call c:.. in android device!?!. someone have same issue ?

How can my app change the network to another WiFi in android 6.0 mobilephone? -

process below (test on platform android api level =23 android 6.0 mobilephone): in app : mwifimanager.addnetwork(wcg); boolean b = mwifimanager.enablenetwork(wcgid, true); but b return false; log print: not authorized remove network ...... not authorized update network then try method in wifimanager(marked @hide): connect(int networkid, actionlistener listener) by reflectmethod , result failed . print as: java.lang.reflect.invocationtargetexception in lollipop should try checking active ssid same otherwise disable network. int netid = mwifimanager.addnetwork(conf); if (netid == -1) { librelogger.d(this, "failed set settings " + mnetworkssidtoconnect); final list<wificonfiguration> mwificonfiguration = mwifimanager.getconfigurednetworks(); (int = 0; < mwificonfiguration.size(); i++) { string configssid = mwificonfiguration.get(i).ssid; ...

How to get Eclipse show class hierarchy across multiple PHP projects? -

i have downloaded , tried eclipse able browse class/interface hierarchy easily. noted "open type hierarchy" feature , works nice when ascendants , descendants of class within same project. however, complication is: classes extend classes other projects. have 2 projects: mysite , myframework. class mysite project called mysite_controller extends myframework_web_controller located in myframework project. when code run, php can see both codebases because autoload configured. however, don't know how eclipse know classes particular prefixes. may have guessed, 2 projects can't joined because myframework used other projects well. so question is: how eclipse correctly show "foreign" parent class mysite_controller in type hierarchy view? view won't show classes files cannot found within current project. p. s. should goal not achievable eclipse, i'd hear names of other php ides can nice , easy. you can achieve adding myframework project...

visual studio lightswitch - Ligthswitch 2015 screen navigation order on html client -

Image
i´m starting explore ligthswitch on visual studio 2015 update 2 , office developer tools visual studio 2015 update 2 installed lightswith template. the question cannot found "edit screen navigation" on html.client , have no idea search (i need set default startup screen). on desktop.client found on html.client there not. somebody can give me tip ? thank you piercarlo for html client, edit navigation screen exists, it's second option once right click on html client. however, allows set screens appear links in top left menu. to set home screen (default startup screen), should right click on screen want, , select "set home screen".

xamarin - JsonConvert.DeserializeObjects does not work after Linking SDK and User Assemblies -

the method jsonconvert.deserializeobjects works when linking set sdk assemblies when build project using link sdk , user assemblies option in linker properties, not work, returns null in fields of deserialized object. you need put [preserve(allmembers = true)] attribute on classes dynamically generated. prevent them being stripped out. you can read more on ios linker here . so lets have list of users want deserialize like. var user = jsonconvert.deserializeobject<user>(json); in user class want place attribute on class. [preserve(allmembers = true)] public class user{ public string email { get; set; } public string firstname { get; set; } public string lastname { get; set; } }

Android SmsManager Why I get the Sms From destination number -

i used smsmanager send sms destination phone. problem somehow 2 sms sent: 1 sms destination phone, fine, exact sms destination number in phone. the code: smsmanager smsmanager = smsmanager.getdefault(); smsmanager.sendtextmessage(destphonenumber, null, "message", null, null); how possible phone message send destination number destination number itself?

node.js - browser sync with ejs, the proxy just loads -

i'm trying mean application work browser sync. i'm using .ejs file template, whenever click open index.ejs file downloads it. i tried 2 settings in gulpfile, none of them works. //this downloads ejs file gulp.task('serve', function () { browsersync.init({ server: { basedir: [''], directory: true } }); }); //this loads , can't access localhost gulp.task('serve', function () { browsersync.init({ proxy: 'http://localhost:3000' }); }); there npm package called browser-sync-ejs , documentation non existent , have no idea how use it.

analytics - Analyzing Excel Data -

i'm stuck in project need analyze data out of excel sheet. data supposed sorted datetime, because rows datetime close eachother (e.g. within minute 5 minutes) read multi of same instance , preferably copied second sheet. concretely, sheet 1 looks this: id - datetime - ad.inf.1 - ad.inf.2 - ad.inf.3 1 - 16:06:04 2 - 18:04:34 3 - 18:04:56 4 - 18:05:06 5 - 18:16:59 somehow, i'd have identify row 2-3-4 trifold of 1 instance (as ad.inf.2-3 same, ad.inf.1 may vary) , list on sheet 2 as id - instanceamount - ad.inf.2 - ad.inf.3 1 - 3 what best way try , realize this?

ruby - Rails app returning 401 Unauthorized while logging in only in production -

i can't login in app deployed on heroku, 1 in production . on local machine 1 runs development work without problem. both databases same dump copies of each other. i verified user exist in remote database , password given in correctly, both local , remote version same branch , synced. i've tried this solution, config/initializers/session_store.rb looks this: # sure restart server when modify file. filteredweb::application.config.session_store :cookie_store, key: '_filtered-web_session', domain: :all someone suggested changing encryption key in config/initializers/devise.rb don't see , neither understand logic behind it. versions devise (2.2.3) rails (3.2.13) i had same exact error... removing domain: :all fixed me. see a similar issue on github

sql - H2 cluster weird behavior : fake referential Integrity violation on foreign key -

i run h2 in cluster mode 2 nodes. i have 2 tables. parent, , child. child contains foreign key id of row of parent table. i'm experiencing weird issue can not understand : working ok until violate unique constraint. steps: - working normally - violate (by purpose here) unique constraint - when adding child rows, referential integrity violation on foreign key (parent.id), child row added. script: create table child(id int auto_increment, name varchar(255), fkey int); create table parent(id int auto_increment, name varchar(255) unique); alter table `child` add foreign key (fkey) references `parent` (`id`) on delete cascade; -- insert first parent, id '1'. insert child, works. insert parent(name) values('parent1'); insert child(name, fkey) values('child1', 1); -- purpose, violate unique constraint violation on parent.name : unique index or primary key violation: "constraint_index_8 on public.parent(name) values ( /* 2 */ 'parent1...

node.js - NodeJS Web Scraper for region-specific content -

i'm building scraper in nodejs , , i've come across issue can't figure out. certain websites use location-specific content , i'd find way trigger/manipulate this. off bat, know complicated issue. sites might use different methods determining user's location. there general way achieve this? i'm using node's request module, , have headers set so: 'headers': { 'user-agent': 'mozilla/4.0 (compatible; msie 7.0; windows nt 6.0)' } is there way of manipulating headers spoof location website? there multiple methods used companies determine kind of content serve you. big media organisations, bbc, use database mapping ip ranges geographical locations maintained private company. way defeat access protections use virtual server proxy in country wish appear visiting from. other companies (many european ones) may interested in knowing language serve content in. may @ headers in web request.

php - Importing data from TXT file with while loop -

my problem don´t know how finish while loop when rows imported. drupal 7. if set while condition: while ($row = $regs->fetchassoc()) never inside of loop. if use condition break loop: $cadena = array(); while (1) { $row = $regs->fetchassoc(); $cadena[] = $row; if (count($cadena)<0){ break;} i error: fatal error: allowed memory size of 1073741824 bytes exhausted (tried allocate 64 bytes) the full code is: $operations = array(); $items = array(); $limit = 25; $i = 0; $regs = db_query("select * {table_import_apunte} field_processed = :processed", array(':processed' => 0)); while ($row = $regs->fetchassoc()) { if ($i < $limit) { $items[] = $row; $i += 1; } else { $operations[] = array('csvimporter_create_nodes', array($items, 'apunte')); $items = array(); $items[] = $row; ...

angularjs custom form and field directive: ngModelController is not found in FormController -

i have 2 directives, 1 my-form, 1 my-field. i need use mode of dynamically creating html content both of these 2 directives. works except can not ngmodelcontroller of input fields. can not $dirty, $valid properties of these fields. example, when submitting, want ngmodelcontroller of input name "field1", can not it. form.field1 undefined. in formcontroller "form1", there no field, 1 can on this? many thanks the code in fiddle is: https://jsfiddle.net/0td5hlur/3/ main codes listed below: angular.module('myapp', []) .controller('mycontroller', ['$scope', function ($scope) { $scope.config = { name: 'form1', fields: [ {type: 'text', name: 'field1', model: 'obj.field1'}, {type: 'text', name: 'field2', model: 'obj.field2'} ...

Swift String literal for unicode character is wrong -

i trying pass unicode character swift uiwebpage. string coming in server "\\2020" escaped version should "\2020" (the dagger symbol). when passed in however, becoming "2020" . breaking in javascript or before gets there? to represent character in swift must use kind of interpolation: let dagger = "\u{2020}"

ios - Localization not working on ipad but working on iphone -

Image
i have 2 storyboards each 2 storyboardname.string (english , french) , separate localize.string contains string view controllers. when run app on iphone it's picking localization files correctly, on ipad keeps declared values in storyboard without useing values fron files. i have tried delete , install app multiple time, have tried set parameter scheme configuration, checked id's localization file in storyboard (and are). nothing work... i modified localization files ipad it's not picking changes. how can force ipad chose/use localization file? see target set or not on right side window

scala - How to create future unit? -

i have code: def updatedocsetting(data: seq[modeldocumentsetting])= { (a <- data){ documentsettingtable .filter(_.doc_proc_list_id === a.doc_proc_list_id) .map(doc => (doc.is_mandatory,doc.is_display,doc.is_deleted)) .update(a.is_mandatory,a.is_display,a.is_deleted) } } i have problem future slick result on service code service code def updatedocsetting(data: list[modeldocumentsetting]): future[unit] = { db.run(daldocumentsetting.updatedocsetting(data)) } error:type mismatch; found : unit required: slick.dbio.dbioaction[unit,slick.dbio.nostream,nothing] you can convert sequence of dbioaction s single dbioaction using dbio.sequence . use yield sequence of dbio actions: (a <- data) yield { documentsettingtable .filter(_.doc_proc_list_id === a.doc_proc_list_id) .map(doc => (doc.is_mandatory,doc.is_display,doc.is_deleted)) .update(a.is_mandatory,a.is_display,a.is...

android - Xamarin ZXing QR Code inside tab -

Image
i integrate zxing qr code scanner app. using fragment tabs. example in tab2, how can add window show scanner view? tried use customoverlay view unfortunately did not work. tried use zxingscannerfragment,but requires android.support.v4.app not ideal other 2 tabs uses android.app namespace. @ right that, when tab 2 selected, jumps straight scanner, , action bar , tabs becomes invisible. can please shed light on this? thank much. _fragments = new fragment[] { new fragment1(), new fragment2(), new fragment3() }; addtabtoactionbar(resource.string.whatson_tab_label, resource.drawable.ic_action_whats_on);

sql - MySQL Iterate over column names -

i need in sql. :) i have table : column1 column2 column3 ... null null x x x null x null null x null x ... i select count foreach column , have result order count: column1 1034 column24 876 column3 567 ... for now, known how select column name : select column_name information_schema.columns table_name = 'my_table'; and know how count in sql: count(my_column); i know if possible in sql because need create view in phpmyadmin. by way, forgive bad english! ;) thanks lot take time me! you want use union combine number of count queries, follows: (select 'column1' `column_name`, count(column1) count my_table) union (select 'column2' `column_name`, count(column2) count my_table) -- ... order count desc if need build such query dynamically (e.g. because not know column names in advance 1 ) can in language of choice, using result of query on informatio...

c++ - libclang: add compiler system include path (Python in Windows) -

following question , andrew's suggestions, trying have liblang add compiler system include paths (in windows) in order python code import clang.cindex def parse_decl(node): reference_node = node.get_definition() if node.kind.is_declaration(): print(node.kind, node.kind.name, node.location.line, ',', node.location.column, reference_node.displayname) ch in node.get_children(): parse_decl(ch) # configure path clang.cindex.config.set_library_file('c:/program files (x86)/llvm/bin/libclang.dll') index = clang.cindex.index.create() trans_unit = index.parse(r'c:\path\to\sourcefile\test.cpp', args=['-std=c++11']) parse_decl(trans_unit.cursor) to completely parse c++ source files one /* test.cpp */ #include <iostream> #include <vector> #include <fstream> #include <cmath> #include <algorithm> #include <iomanip> using namespace std; void readfunct...

Clear Shared Preference after Active Android onUpgrade -

how detect if database version has changed , perform actions in activeandroid. similar onupgrade in sqlitedatabasehelper? the databasehelper of activeandroid doesn't seem support you're looking for. it's on github, can modify library needs. @override public void onupgrade(sqlitedatabase db, int oldversion, int newversion) { executepragmas(db); executecreate(db); executemigrations(db, oldversion, newversion); }

c# - How to apply different DataTemplate to a Listview -

in uwp app, have scenario in there multiple pages, constains listview display data, , each page have there own datatemplate base on content display, styling/colors of listview , datatemplate on each page same, problem whenever need change style inside datatemplate, setting border need go on each page that, how can make common ui data template different data display , assign listview, tried create usercontrol listview don't know how can pass datatemplate listview. here's tried @ first level: create user control , dependency property datatemplate: usercontrol cs file: public datatemplate displayitemtemplate { { return (datatemplate)getvalue(displayitemtemplateproperty); } set { setvalue(displayitemtemplateproperty, value); } } public static readonly dependencyproperty displayitemtemplateproperty = dependencyproperty.register("displayitemtemplate", typeof(datatemplate), typeof(listviewcontrol), new propertymetadata(nul...

jQuery Mobile checkbox refresh slow -

i trying refresh 500+ checkboxes jquery mobile, on desktop performance alright on mobile slow. checkboxes being generated dynamically through ajax. if don't refresh them performance fine. i using $(".selector").checkboxradio().checkboxradio("refresh"); any idea how optimize runs faster? thanks.

ios - Change UIScrollView Content size -

i have viewcontroller uiscrollview, uiimages , uibuttons. in storyboard set size of uiscrollview to: width: 320, height: 570 i want change contentsize of uiscrollview when viewcontroller loaded. i added side in viewdidload: scrlmain.contentsize = cgsize(width: 320,height: 790) and added code in viewdidlayoutsubviews: self.scrlmain.translatesautoresizingmaskintoconstraints = true but uiscrollview still last size = 570. can't use viewdidappear because, when press button, need change color. when has changed color, uiscrollview moves up. what did wrong? all code: override func viewdidload() { super.viewdidload() scrlmain.delegate = self scrlmain.contentsize = cgsizemake(320, 790) } override func viewdidlayoutsubviews() { self.scrlmain.translatesautoresizingmaskintoconstraints = true self.scrlmain.contentsize = cgsize(width: self.scrlmain.frame.width, height: 60.0 + 5 * (self.scrlmain.frame.width / 16.0 * 5.0)); } ...

css3 - Bootstrap: how to stack divs of different heights? -

Image
this question bit similar this one , want know if there pure css solution compatible bootstrap. basically, have following layout: this html of page: <div class="menu row"> <div class="menu-category list-group col-lg-3 col-md-4 col-sm-6 col-xs-12"> <div class="menu-category-name list-group-item active">category</div><a href="#" class="menu-item list-group-item">lorem ipsum.<span class="badge">€ 0.00</span></a> <a href="#" class="menu-item list-group-item">lorem ipsum.<span class="badge">€ 0.00</span></a> <a href="#" class="menu-item list-group-item">lorem ipsum.<span class="badge">€ 0.00</span></a> <a href="#" class="menu-item list-group-item">lorem ipsum.<span class="badge">€ 0.00</...

java - Advantages of using a (flat)map over a simple null check? -

i reading below source, , wondering why on earth i'd use flatmap way. see lot more objects instantiated, code executed in simple null check via if statement, terminate on first null , not bother check others , fits nice , neatly in wrapper. as see if check faster + more memory safe(the speed crucial me have 2-3 milliseconds lot of code execute, if @ all) what advantages of using "(flat)map" optional way? why should consider switching it? from http://winterbe.com/posts/2014/07/31/java8-stream-tutorial-examples/ class outer { nested nested; } class nested { inner inner; } class inner { string foo; } in order resolve inner string foo of outer instance have add multiple null checks prevent possible nullpointerexceptions: outer outer = new outer(); if (outer != null && outer.nested != null && outer.nested.inner != null) { system.out.println(outer.nested.inner.foo); } the same behavior can obtained utilizing optionals f...

php - How to use multiple style in PHPWord? -

actually using following code in phpword $table->addcell(10500, $stylecell)->addtext('<span style="background-color:#003300;">test</span><span style="background-color:#00000;">dinesh</span>'); $table->addrow(); please solve problem... you can achieve altering cell content coloring creating textrun , adding different colored parts separately: $textrun = $table->addcell(10500, $stylecell)->addtextrun() $textrun->addtext(htmlspecialchars("test", ent_compat, 'utf-8'), array('color' => '003300')); $textrun->addtext(htmlspecialchars("dinesh", ent_compat, 'utf-8'), array('color' => '000000')); $table->addrow();

javax.imageio - Sending buffered image over socket from client to server -

i trying send images captured client server,images captured using robot class , writing client socket. in server reading buffered image , writing server local storage area.i want client capture screenshots @ regular interval , send server.server reads images , stores in repository. public class serverdemo { public static void main(string[] args) { try { serversocket serversocket=new serversocket(6666); system.out.println("server listening.........."); while(true) { thread ts=new thread( new serverthread(serversocket.accept())); ts.start(); system.out.println("server thread started........."); } } catch (ioexception e) { // todo auto-generated catch block e.printstacktrace(); } } } serverthread.java public class serverthread implements runnable { socket s; bufferedimage img = null; string savelocation="d:\\screenshot\\"; public serverth...

c++ - "Bad promise" error after throwing an exception from the thread -

i have function should put in thread may through exception. after throwing exception thread function error. terminate called after throwing instance of 'std::future_error' what(): broken promise function worked fine until thought exception. tried not use future , make promise didn't help. here simplified code: ... using namespace std; void myfunc(struct forthread_struct for_thread, promise<const char *> && s_promise); main(){ promise<const char *> v_promise[5]; future<const char *> v_future[5]; thread a_threads[5]; (int_fast8_t k = 0; k < 5; k++ ) { v_future[k] = v_promise[k].get_future(); a_threads[k] = thread(myfunc, for_thread[k], move(v_promise[k])); } (int_fast8_t k = 0; k < 5; ++k) { try { const char * res = v_future[k].get(); } catch(exception & e) { cout<<e.what()<<endl; } } voi...

php - My select query is not working in ajax -

here code use fetch medicines name database in dropdown list <?php $selmed = mysql_query("select mnam med"); echo '<select onchange="getqty();" id="pf5" name="recmed">'; while ($row = mysql_fetch_array($selmed)) {echo '<option value="'.$row['mnam'].'">'.$row['mnam'].'</option>';} ?> now want fetch quantity against specific medicine database use ajax follow var medn = $('#pf5').val(); $.ajax({ type: "post", url: "getqty.php", data: { mednam: medn }, success: function(data) { $("#val").html(data); } }); } and here getqty.php file think making mistake in query <?php include('connection.php'); $recm = $_post['mednam']; $rmq = mysql_query("select mqty med mnam ='$recm'"); echo $rmq; ?> and area want result on changing value shows "...

swing - Disable button on click before actionPerformed is completed java -

i have button doing long function, want disable button after user once click on in order prevent him clicking again many times the button gets disabled problem after function finished button gets enabled again tried put button.setenabled(false); in new thread didn't work either for testing sample of code button.addactionlistener(new actionlistener() { @override public void actionperformed(actionevent ae) { button.setenabled(false); (int = 0; < integer.max_value; i++) { (int j = 0; j < integer.max_value; j++) { (int ii = 0; ii < integer.max_value; ii++) { } } } } }); use swingworker long running background tasks. in example , startbutton action setenabled(false) , , worker's done() implementation setenabled(true) .

java - overload and override which throws exception -

public class { public float foo(float a, float b) throws ioexception { } } public class b extends { ...... } which functions can placed in b class, , why? float foo(float a, float b){...} public int foo (int a, int b) throws exception {...} public float foo(float a, float b) throws exception {...} public float foo(float p, float q) {...} my opinion: 1. wrong, doesn't start public 2. correct, overloading 3. wrong, overriding can't throw broader exception 4. wrong, overriding can't throw broader exception the general principle governing allowed or not in override can't break java's ability use instance of subclass in context declared type supertype. float foo(float a, float b){...} incorrect because cannot reduce visibility of method in subclass. (if allowed, happen @ runtime if called foo on a declared a = new b(); ?) public int foo (int a, int b) throws exception {...} correct. i...

java - Remove one blank cell before every filled cell in a string array -

i using code : arraylist<string> getques = db.getsolutiondata(levelno, level); string str = getques.get(0); stringarr = str.split(""); system.out.println(arrays.tostring(stringarr)); this result output: 07-23 16:10:37.031: i/system.out(2548): [, c, , , d, , , f, , i, , , , a, , f, , a, , , , , , , , , , , b, , c, , d, , , h, , , , , , c, , i, , g, , , a, , , e, , , b, , i, , , , , f, , g, , , h, , , a, , , e, , d, , i, , , , , , f, , , i, , g, , e, , , , , , , , , , , d, , b, , a, , , , h, , b, , , g, , , f] now want remove 1 blank cell before every cell filled. eg : before second cell there blank cell want remove, before ,d, there 2 blank cells remove 1 those, before i 1 blank cell, before a , 3 blank cells remove 1 of them, etc. came conclusion remove 1 blank cell before every filled cell. i have used : arraylist<string> list = new arraylist<s...

sql server - Select query produces SqlDateTime overflow on valid dates -

i have problem: on simple select select * table sqldatetime overflow error randomly returned (few times works ok after error returned; after again works few times , after error returned again) - error occurs on same row (while using same connection) - if open , close mgmt studio, error occurs on different row. exact error message is: an error occured while executing batch. error message is: sqldatetime overflow. must between 1/1/1753 12:00:00 , 12/31/9999 11:59:59 pm. table has 3 datetime columns: dtcolumn1 - can null, without default value dtcolumn2 - must not null, default value ('1800-01-01') dtcolumn3 - can null, without default value values in 3 datetime columns fine (null or inside of allowed interval). table has other columns of varchar , other types. more select query fail more if add order 1 of 3 datetime columns (empiricaly tested). collation of database slovenian_ci_ai . what causing error (as said - datetime values seem ok)? thank ...

HTML5 video player is blank and GET error appears in output console -

i'm trying play video in tag on plain html page. have video in premiere have tried export both webm , mp4 (h264) located in same directory on ftp server html file. no matter codec render in, player stays blank (white) , errors appear in output console: get errors as can see video files in same directory on ftp server: files on ftp server the error has been replaced 404 error when using different presets both webm , h264. far know webm , h264 suited html5 web-players, adobe has tons of different presets, don't why has such tricky problem solve. impossible find else same problem , irritates me more. we use azure web hosting, if there default setting prohibiting video display or similar, tell me! [edit]: here's html code video_presentation.html : <video width="100%" height="100%" controls> <source src="course_introduction.webm" type="video/webm"> <source src="course_introduction.mp4" type=...

Polymer update object outside of component and reflect changes to UI -

is possible reflect changes polymer component property without update value via .set(path, value) . for example have object overrided setter based on value apply new value other field. polymer({ is: 'x-element', properties: { form: {type: object, value: { set name(v) { this._name = v; this.additional = v; // change different property }, name() { return this.name; }, set additional(v) { // process v this._additional = v; // field not reflect }, additional() { return this._additional; } }, reflecttoattribute: true } })

sql - Parse Decimal Second by PostgreSQL -

i parse string '16:25:20.6598412z' as timestamp without time zone the function use is: to_timestamp('16:25:20.6598412z', 'hh24:mi:ss.msus') but result is: 16:25:21.5002+01 this have not same time: 16:25:20.6598412 you cannot use ms , us both in 1 to_timezone call - microseconds miliseconds (and little more) how engine know how parse string? instead should use to_timestamp('16:25:20.6598412z', 'hh24:mi:ss.us') also notice microseconds due reference value in range of (000000-999999) can pass 6 digits us to_timestamp('16:25:20.659841z', 'hh24:mi:ss.us') to loose timezone add ::timestamp without time zone; @ end of to_timestamp call to_timestamp('16:25:20.6598412z', 'hh24:mi:ss.msus')::timestamp without time zone;

PHP - Check if email and username already exists in MySQL Database -

i tried lot making code work registration.php page, want check whether email , username registered on database. tried checking username , worked fine want check whether email registered or not. regarding highly appreciated. below code registration.php, hoping help! thanks! <?php /* our "config.inc.php" file connects database every time include or require within php script. since want script add new user our db, talking our database, , therefore, let's require connection happen: */ require("config.inc.php"); //if posted data not empty if (!empty($_post)) { //if username or password empty when user submits //the form, page die. //using die isn't practice, may want //displaying error message within form instead. //we front-end form validation within our android app, //but have have back-end code double check. if (empty($_post['username']) || empty($_post['password']) || empty($_post['fullname']) || empty($_post['emailad...

PHP Codeigniter - Undefined property on controller -

i new codeigniter , version using latest codeigniter v2.1.4 . i doing simple crud start making own web blog it's getting error message on controller following. message: undefined property: site::$site_model controller function blog() { $data = array(); $query = $this->site_model->get_records(); if (isset($query)) { $data['records'] = $query; } $data['main_content'] = 'blog'; $this->load->view('includes/template', $data); } it's complaining on line $query = $this->site_model->get_records(); model function get_records() { $query = $this->db->get('data'); return $query->result(); } db library loaded well.. $autoload['libraries'] = array('database'); what doing wrong? before need load model like $data = array(); $this->load->model('site_model'); //here $query =...

java - Lexer rule -> Get only content of string -

i've lexer rule on grammar: string_literal : '\'' ( ~'\'' | '\'\'' )* '\'' ; when visit rule, want "content" of string_literal . so, that's between first ' , last ' . example: string s = node.gettext(); s -> "'sample string'" is possible touch bit lexer rule in order "content" of string? why not strip quotes when read out text in listener/walker/whatever-consume-code? ibre5041 right, don't put processing in grammar. semantic phase better place that.

mysqli send query but dont bother with result? php mysql -

ive searched , there similar questions havent found answer exactly. im sure trivial need help so want php make column all of mysqli ive done far has followed pattern of $query = "abc"; $result = mysqli_query($connection, $query); $row = mysqli_fetch_array($result) - or similar obviously dont want array or maybe true or false really, if works should create column , thats end of it. not sure , mysqli seems bit finicky idk any appreciated mysqli_query need. mysqli_query performs query on database providing have no mysql syntax errors you'll fine. you need use $row = mysqli_fetch_array($result) when want return results of select.

Ambient TypeScript functions with specific THIS type -

how can declare function in ambient typescript that's called this set specific type? you can use this: type first arugument on function: class myclass { constructor(public mytext: string) { } } // enforce context of type myclass function function myfunction(this: myclass) { alert(this.mytext); } var myobject = new myclass("hello"); myfunction.call(myobject); // myfunction(); // bad

bash - Either grep or AWK are ereasing the content of processed stream -

lets have file this: asi bek bkg coe 0.00112000003 0.00003000000 -0.00001000000 0.00000000000 0.00170999998 -0.00009000000 -0.00008000000 0.00052000000 0.00089000002 -0.00003000000 -0.00028000001 0.00068000000 0.00031000000 0.00003000000 -0.00026000000 0.00057999999 0.00239000004 -0.00003000000 0.00004000000 0.00076999998 0.00000000000 0.00002000000 -0.00039000000 0.00050000002 0.00401999988 -0.00014000000 -0.00029000000 0.00046000001 0.00179999997 -0.00011000000 -0.00025000001 0.00044000000 0.00025000001 -0.00008000000 0.00004000000 0.00063000002 (obviously larger, longer records - sample quite enough understand structure) i want use digit-starting records (omit title). grep ^[0-9] . ! output nothing. because need use file in general columns use awk. , here next odd thing. when tried cat file | grep ^[0-9] | awk '{ print }' gaves me nothing. when set explicit column number in awk (like awk '{ print $1,$2...<and_so_on>}' works. i'd avoid using expl...

ASP.NET/VB.NET Generating RDLC gives Useless Error of just the Dataset Name -

i've tried every different code example of programmatically generating pdf rdlc report. every single 1 gives me generic "an error occurred during local report processing" on render step. when check inner exception, useless error ever, name of dataset: "dataset1". that's it. i'm running web app locally , using connection string website report. report uses single table source. it's vanilla can be. here's 1 example of code generates error, i've tried many other similar examples same resulting error. dim rv new reportviewer dim warnings warning() dim streamids string() dim mimetype string dim encoding string dim filenameextension string try rv.localreport.reportpath = "reports/myreport.rdlc" dim bytes byte() = rv.localreport.render("pdf", nothing, mimetype, encoding, filenameextension, streamids, warnings) using fs new filestream("output.pdf", filemode.crea...

javascript - AngularJs updating view in controller's event listener -

in app fetch list of objects server. render them @ left sidebar list , @ map (leaflet) markers on same page . render markers/map via service , sidebar list via controller , simple view. when user clicks on item list or on marker map broadcast event $rootscope . user clicks on sidebar item -> code triggered: // in view <div ng-click="markerclicked(object)">...</div> // in controller $scope.markerclicked = function(object) { $rootscope.$broadcast('markerclicked', object); }; user clicks on marker -> code triggered: angular.foreach(markers, function(object) { var _marker = l.marker([object.longitude, object.latitude],{ clickable: true }); _marker.on('click', function(e) { $rootscope.$broadcast('markerclicked', object) }); _marker.addto(service.map); service.layer.addlayer(_marker); }); i catch event in 1 controller: // tried $rootscope.$on() $scope.$on('markerclicked...

java - How to create a scrollbar for my JTextArea using JScrollPane? -

the program compiles properly, scroll pane text area not created. don't know why happening. defined jscrollpane , implemented scrollpane = new jscrollpane this code: import java.awt.*; import javax.swing.*; import java.awt.event.*; import javax.swing.table.*; public class guiproject5 extends jframe { private static final int width = 400; private static final int height = 300; private jpanel lowerpanel; private jlabel widthl, areal; private jtextarea areata; private jtextarea ta; private jscrollpane scrollpane; private jtextfield lengthtf; private jcheckbox gergsc; private jbutton exitb; //button handlers: private exitbuttonhandler ebhandler; public guiproject5() { areal = new jlabel("label: ", swingconstants.right); lengthtf = new jtextfield("textfield"); lowerpanel = new jpanel(); areata = new jtextarea("textarea", 6, 8); ta = new jtextarea("stuff", 6, 8); scrollpane = new jscrollpane(); gergsc = ...

vba - Excel userform - not reading or writing to the spreadsheet -

i have created new userform writes data spreadsheet , using drop down load data form edit , re-save. when click save not write spreadsheet , when pre-populate spreadsheet not load userform. have below code works similar userform not work new 1 compiling. no error messages when running. missing? dim notnow boolean dim dropbuttonclicked boolean private sub cmd_submit_click() 'submit dim emptyrow long 'make sheet1 active sheet1.activate 'determine emptyrow emptyrow = worksheetfunction.counta(range("a:a")) + 1 dim rowcount long dim ctl control ' inputs new project if no ref selected if me.cbosearch.value = "" application.screenupdating = false on error goto withref activesheet if .autofiltermode .showalldata end if end else ' if search selected edit line of data notnow = true application.screenupdating = false ' unprotects report on error goto withre...

linux - Connect to MySQL from remote machine -

i have problem connecting mysql server running on linux machine. works fine local network (any computer in same network). anyway, no connection can established other networks. i have no idea why.. in my.cnf i've set port=3306 , bind-address=0.0.0.0 . netstat -an | grep 3306 returns tcp 0 0 0.0.0.0:3306 0.0.0.0:* listen the mysql user created this create user 'user'@'%' identified 'pass'; create user 'user'@'localhost' identified 'pass'; grant select on *.* 'user'@'%'; grant select on *.* 'user'@'localhost'; a portforwarding port 3306 configured in router. the file hosts.deny empty. as far can tell server listening on 3306 , nobody between , client blocks, still nobody local clients can connect. i've tried many solutions found on stackoverflow none of them helped.. i have admit i'm not used linux, please give "noob-...