Posts

Showing posts from March, 2013

php - Populate table data from databse table on selecting a particuar item from drop down list? -

i want populate table data database table "onchange" event dropdown list. dropdown list contains data table contains 1 column value. when user selects of item drop down list columns , values should displayed belong particular value of selected item drop down list. below code display dropdown list. <?php include_once("session.php"); include_once("functions.php"); include_once("connection.php"); $employername=$_session["username"]; $sql = "select job_name job_info username=$employername"; $result = $conn->query($sql); ?> <div> <select name="ddljobname"> <?php while($row=$result->fetch_assoc()){ ?> <option value="<?= $row['job_name'] ?>"><?= $row['job_name'] ?> </option> <?php }?> </select> </div> <select name="ddljobname" id="get

javascript - Passing variables betweencontrollers in angular js -

i new angular js , services please bear basic question. please read comment inside code understand need. .controller('ctrlr1', function($scope, myservice) { var = "abc"; }) .controller('ctrl2', function ($scope, myservice) { // how value of }) .service('myservice', function() { //what goes here? }); thanks in advance basic sharing angular services .controller('ctrlr1', function($scope, myservice) { var = "abc"; var b = 123; myservice.mydata = a; myservice.mydatab = b; }) .controller('ctrl2', function ($scope, myservice) { // how value of console.log(myservice.mydata); console.log(myservice.mydatab); }) .service('myservice', function() { //what goes here? this.mydata = ''; this.mydatab = 0; });

javascript - Intermittent Axios Get Request Failure -

i have laravel , vue js application, i'm having intermittent issues request vue js & axios, can hit route directly in browser , works fine data returned. load view calls data via axios vue js , works , doesn't.. find if open debugger on right of chrome call fires , works fine. close , fails. error being returned: failed load resource: server responded status of 500 (internal server error) uncaught (in promise) error: request failed status code 500 my laravel route follows: route::get('/orders/today','orderscontroller@today'); my vuejs file has following: axios.defaults.headers.common['x-csrf-token'] = document.queryselector('#_token').getattribute('value'); var vue = new vue({ el: '#app', data: { orders: [], estimates: [] }, mounted : function() { this.getorders(); }, methods: { getorders: function() { axios.

c# - It shows more items in array than expected -

it shows more times expected , when add 1 item , stackable adds stack....but not once 2 times. using microsoft.xna.framework; using microsoft.xna.framework.graphics; using microsoft.xna.framework.input; using system; using system.collections.generic; using system.linq; using system.text; namespace arenarpg { public class inventory { int slotwight; int slotheight; int itemsperpage = 1; int currentpage; int columns, rows; b_item[,] items; backpack backpack; vector2 pos; public inventory(backpack bpack,int itemsperpage,int columns,int rows, int slotwidth, int slotheight, vector2 pos) { this.backpack = bpack; this.slotheight = slotheight; this.slotwight = slotwidth; this.pos = pos; this.columns = columns; this.itemsperpage = itemsperpage; this.rows = rows; items = new b_item[columns, rows];

node.js - npm failing to encode %5C -

i trying connect npm behind proxy uses domain. trying implement solution this question. npm config set proxy "http://domain%5cusername:password@servername:port/" however, when try this, ends turning string into: http://domain/%5cusername:password@servername:port/ note "/" between "domain" , "%5c", doesn't encode. i have tried in both git bash , windows command-line. i've tried , without quotations. same result. why isn't npm, or whoever, encoding %5c properly?

content management system - How can I export the Broken Links report from Sitecore out ? I am on Sitecore version 7.0 -

i can generate reports in sitecore, results come big report. how can export them out xcel email them or filter them ? i recommend install advanced system reporter module available on marketplace - https://marketplace.sitecore.net/en/modules/advanced_system_reporter.aspx . this module comes few reports , 1 of them "broken links" report.

git - How to rollback changes done by one developer keeping all other changes alive? -

all changes pushed repository, got bug , need roll changes done developerx specific commit(commitx -done before 15 days). but need preserve changes done other developers after commitx. option 1 - checkout files of commitx , commit older version of files. --but there new files added , removed developerx in later commits, happen ? need manually remote/add ? is there other better way ? if undesirable changes merged in via pull request (or @ least non-fast-forwarded merge commit), can reference commits hash create new revert commit: assuming you're on primary branch (likely master ): git checkout -b revert-bad-changes git revert <hashofmergecommit> # push branch, merge master, whatever process if changes fast-forwarded or otherwise done right in master branch, you'll need reference numerous commits in revert command, eg: git revert <badcommithash1> <badcommithash2> <badcommithash3>...

php - WordPress meta_query syntax issue -

can work out why following syntax work: $results_args = array( 'post_type' => 'event', 'meta_key' => 'start_date', 'meta_value' => '20161227', 'posts_per_page' => 30 ); $results = new wp_query($results_args); but following syntax not? $results_args = array( 'post_type' => 'event', 'meta_query' => array( array( 'key' => 'start_date', 'value' => '20161227', 'compare' => '=', ), ), ); $results = new wp_query($results_args); the latter code returns posts post_type = 'event' . docs @ https://codex.wordpress.org/class_reference/wp_query#custom_field_parameters . i'm looking add multiple meta queries in, need latter syntax work. any appreciated. thanks, jamie

android - Firebase username email and password registration -

this registration code , not know how separate 2 functions. when run code, following error: *operation=validateauthserviceoperation java.lang.nullpointerexception: onpostinitcomplete can called once per call getremoteservice private void registeruser() { //getting email , password edit texts final string email = edittextemail.gettext().tostring().trim(); string password = edittextpassword.gettext().tostring().trim(); //checking if email , passwords empty if (textutils.isempty(email)) { toast.maketext(this, "please enter email", toast.length_long).show(); return; } if (textutils.isempty(password)) { toast.maketext(this, "please enter password", toast.length_long).show(); return; } //if email , password not empty //displaying progress dialog registerprogressdig.setmessage("registering please wait..."); registerprogressdig.show(); // register user firebaseauth.getinstance().createuserwithemailandpassword(email, password)

sql - Update Date Field in MS Access Using Java -

i creating java application ms access database in windows 7. fine when doing select query. however, when update date field of ms access db java application, throws sql exception. below ms access table structure , java code. in advance. [![this ms access table date field structure][1]][1] my java source code here: string qry1="select isometric_number tbl_weld_details line_number='0470-52-adb-17034001-01' , sheet_number='1/2'"; try{ connection con=database.get_connection(); preparedstatement ps = con.preparestatement(qry1); resultset rs = ps.executequery(); if(rs.next()) { string iso_no = rs.getstring(1); string qry2="update tbl_weld_register set weld_date=?,welders_root1=?,welders_cap1=? isometric_number=? , spool_no=? , weld_number=?"; preparedstatement ps1 = con.pr

sql - Oracle Regexp_replace -

i want replace 'spaces' ' & ' excluding ' | ' in regexp_replace for ex: 'create | delete account' -> expect output 'create | delete & account'. i m trying sql select regexp_replace('create | delete account','\s [^\s\|\s]',' & ') dual but m doing wrong here. please on it. i think want: select regexp_replace('create | delete account', '([^\|]) ([^\|])', '\1 & \2') dual the logic here make replacement whenever space should occur between 2 non pipe characters. capture these characters using parentheses, , use them in replacement via \1 , \2 .

c++ - My length function in class -

i showed code you(c++), , have use my_len function length. how can my_len(?????) . should write function parameter? should create constructor? thanks lot. header: class string { public: .......... ......... int length(); private: ......... }; my codes: int my_len(const char* p) { int c = 0; while (*p != '\0') { c++; p++; } return c; } int string::length() { my_len(?????); }

swift - How to observe a change in viewModel in order to reload collectionView using RxSwift? -

i have following code configure collectionview: viewmodel? .observableexercises .bindto( exercisescollectionview .rx .items(cellidentifier: "my identifier", celltype: exercisecollectionviewcell.self)) { index, exercise, cell in cell.exercise = exercise } .adddisposableto(disposebag) it works fine @ first, later when viewmodel.observableexercises gets updated have exercisescollectionview reload data. how should it?

Django Python - Ldap Authentication -

i work on django python . aim authenticate user ldap directory . have python code access ldap directory , retrieve information. code : import ldap try: l = ldap.open("ldap.forumsys.com") l.protocol_version = ldap.version2 username = "cn=read-only-admin,dc=example,dc=com" password = "password" l.simple_bind(username,password) except ldap.ldaperror,e: print e my doubt , how implement in django? . how use these code in django , implement it? thanks in advance it same, have code specific search ldap (sam accountname usually) when want it, after submit call coming user´s login. userdn = "" passworduser = "" base_dn = 'node start seach, ad structure' #attrs = ['description', 'telephonenumber', 'title', 'mail' , 'lastlogon', 'memberof', 'accountexpires',] attrs = [] def myaccount(request): con = ldap.init

matrix - Adding 2 Int Lists Together F# -

i working on homework , problem 2 int lists of same size, , add numbers together. example follows. vecadd [1;2;3] [4;5;6];; return [5;7;9] i new , need keep code pretty simple can learn it. have far. (not working) let rec vecadd l k = if l <> [] vecadd ((l.head+k.head)::l) k else [];; i want replace first list (l) added numbers. have tried code different way using match cases. let rec vecadd l k = match l |[]->[] |h::[]-> l |h::t -> vecadd ((h+k.head)::[]) k neither of them working , appreciate can get. first , idea modifying first list instead of returning new 1 misguided. mutation (i.e. modifying data in place) number 1 reason bugs today (used goto , that's been banned long time now). making every operation produce new datum rather modify existing ones much, safer. , in cases may more performant, quite counterintuitively (see below). second , way you're trying it, you're not d

javascript - How to dynamically set scroll-height when using new css property 'position: sticky'? -

well, met problem in work. want left sidebar stick on top of viewpoint of mobile devices when scrolled 100px height. ok, use position: fixed; position: sticky; position: -webkit-sticky; height: 100vh; but problem there fixed cart bar on bottom height 100px; i tried use bottom: 100px; dynamically change height of sidebar can scroll bottom, doesn't work.

redis - max number of clients reached if more than 4 workers redistogo nano heroku -

i know question answered in here , did >= 5 redis connections trigger max connection error. on heroku link says max connections equals 10. , never seen in documentation there limit of 4 @ time. if upgrade redistogo micro, maximum limit of workers @ time? know can buy , experiment don't want cash out without knowing limits.

Magento block and layout confusion -

i'm new in magento. im trying understand how blocks , layouts working. here layout file ` <layout> <custom_index_getallfaq> <reference name="head"> <action method="settitle"> <arg>all faq's</arg> </action> </reference> <reference name="content"> <block type="custom/type" name="root" template="view.phtml" /> </reference> </custom_index_getallfaq> <custom_index_addnewfaq> <reference name="head"> <action method="settitle"> <arg>all faq's</arg> </action> </reference> <reference name="content"> <block type="custom/type" name="root" template="form.phtml"

python - PhantomJS no more loading GooglePlus pages -

i'm using phantomjs 2.1.1 (on ubuntu server 16.04.1 , mac os x 10.12.2) python selenium webdriver . phantomjs seems no more able load googleplus pages few days now. loads 404 error page. trying load same page firefox jeckodriver loads right page; pasting url on safari, firefox or chrome. what going wrong between googleplus , phantomjs? sample code: #!/usr/bin/env python selenium import webdriver import time driver = webdriver.phantomjs() word = "rock" driver.get("https://plus.google.com/s/%s/top" % word) time.sleep(7) f = open('googleplus-test-search.html','w') f.write( driver.page_source.encode('utf-8') ) f.close() driver.quit() exit(0) loaded page: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1, minimum-scale=1, width=device-width"> <title> error 404 (non trovato)!!1</title

php - issue with search form -

im developping plugin have custom search page custom post, have create custom page this <?php /* template name: search-sa_notification */?> <?php get_header(); ?> <section class="mo-content"> <div class="row"> <div class="large-9 columns"> <form method="post" action="<?php echo $_server['php_self']; ?>"> <br /><br /><br /> <input class="form-control" type="text" placeholder="something" name="cernmb" /><br /> <input class="button small yellow" type="submit" value="search" name="submit" /> <input class="button small yellow" type="hidden" value="test" name="sbtn" /> </form> </div> </div

Python for Security Testing -

i have written below python program http heaaders works site , sites not working. please correct code python program import sys import os import urllib import urllib.request url=sys.argv[1] response = urllib2.urlopen(url) if response.info().getheader('x-xss-protection') == '1; mode=block': print('x-xss-protection : enforced') print('(x-xss-protection) cross-site scripting protection enforced.\n\n') else: print('x-xss-protection : not enforced') print('vulnerability - x-xss-protection') print('- server not enforce cross-site scripting protection.\nthe x-xss-protection header setting either inadequate or missing.\nclient may vulnerable cross-site scripting attacks.\n\n') output python test.py <targeturl> example output x-xss-protection : enforced (x-xss-protection) cross-site scripting protection enforced.

c# - Tried save as image to project folder, but error to find a path -

Image
i have asp application save image project folder , save path mysql db, if try code, "could not find part of path 'c:\users\tree\documents\visual studio 2012\projects\ecommerce_hp\ecommerce_hp\foto\" here code if (f1.postedfile == null || f2.postedfile == null || f3.postedfile == null) { lbleror.text = "silahkan pilih foto, minimal 1 foto"; } else { try { string f1, f2, f3; f1 = path.getfilename(f1.postedfile.filename); f2 = path.getfilename(f2.postedfile.filename); f3 = path.getfilename(f3.postedfile.filename); f1.saveas(server.mappath("foto/"+f1)); f2.saveas(server.mappath("foto/"+f2)); f3.saveas(server.mappath("foto/"+f3)); con.open(); mysqlcommand cmd = new mysqlcommand("insert databarang(merkid,namabaran

[Android Studio]java.lang.RuntimeException: Unable to instantiate activity ComponentInfo java.lang.ClassNotFoundException: on path: DexPathList -

i'm having app , works in android lollipop , above, if installed app in android kitkat device, application crashes , show error below: java.lang.runtimeexception: unable instantiate activity componentinfo{com.splashactivity}: java.lang.classnotfoundexception: didn't find class "com.splashactivity" on path: dexpathlist[[zip file "/data/app/com.partner-1.apk"],nativelibrarydirectories=[/data/app-lib/com.partner-1, /system/lib]] @ android.app.activitythread.performlaunchactivity(activitythread.java:2131) @ android.app.activitythread.handlelaunchactivity(activitythread.java:2271) @ android.app.activitythread.access$800(activitythread.java:144)

jpa - Why is a field of my entity class null? -

i have these 2 entities in 1 many relation: public class category implements serializable { private static final long serialversionuid = 1l; @id @generatedvalue(strategy = generationtype.identity) @basic(optional = false) @column(name = "id") private short id; @basic(optional = false) @column(name = "name") private string name; @onetomany(cascade = cascadetype.all, mappedby = "categoryid") private collection<product> productcollection; ... @xmltransient public collection<product> getproductcollection() { return productcollection; } ... and public class product implements serializable { ... @joincolumn(name = "category_id", referencedcolumnname = "id") @manytoone(optional = false) private category categoryid; ... generated netbeans. problem when method getproductcollection() called controllerservlet collection of pro

azure - VPN Device name -

i use microsoft azure virtual network vpn gateway, want connect checkpoint site site vpn. the other party asks vpn device name. dont have answer to. asking brand name? azure portal says vpn type: route based. not show device name anywhere. how solve this? lot in advance. the other party asks vpn device name. azure vpn gateway not provide vpn device name, give your vpn gateway public ip address checkpoint manager. more information how create site-to-site vpn between azure , checkpoint please refer link . also, create site-to-to vpn using azure portal, please refer link .

c# - How to add right border of grid in Chart contol -

Image
here code setting properties of chart attached above: chart2.chartareas[0].cursorx.isuserenabled = true; chart2.chartareas[0].cursorx.isuserselectionenabled = true; chart2.chartareas[0].axisx.scaleview.zoomable = true; chart2.chartareas[0].axisx.title = "t"; chart2.chartareas[0].axisy.title = "w(t)"; chart2.chartareas[0].axisx.minimum = classes[0].first(); chart2.chartareas[0].axisx.maximum = classes[m - 1].last(); chart2.chartareas[0].axisx.interval = delta_t; chart2.chartareas[0].axisx.labelstyle.format = "{0:0.####}"; i need add right border of grid shown below: the right border missing since data don't nicely fit area. there many ways fix this. here simplest one: chart2.chartareas[0].axisy2.enabled = axisenabled.true; chart2.chartareas[0].axisy2.labelstyle.enabled = false; this adds secondary y-axis , turns off labels. you can style needed: chart2.chartareas[0].axisy2.majortickmark.enabled = false; chart2.chartareas

javascript - Migrate to angular 2 -

i got legacy application written in angular 1 needs fixed. i'm required write unit tests in order modifications app, questions are: is there framework can use write unit tests works in angular 1 , 2 without having modify them (or not much). how migrate thing? without having work, administration says should kept on angular 1, find angular 1 not angular 2 (probably because 2 reminds me of react more, , i'm react developer). thing every single page has module, controller , view (yes every single page), there no reusable components whatsoever, uses history api routing (in tangled way), if how change page page use angular 2 instead of 1? eg. module angular.module('catmodule') .config(function ($stateprovider) { $stateprovider .state('cats', { url: '/cats', templateurl: 'cats/cats.html', controller: 'catsctrl', authenticate: true }); }); controller: angular.module('catmodule') .contro

mysql - Django bulk_create of large datasets with foreign keys -

i have problem of creating big amount of data foreign keys in django orm on mysql. let's have 2 models: class student(models.model): school = models.foreignkey(school, related_name="students") name = models.charfield(max_length=200, blank=true, default="") class school(models.model): name = models.charfield(max_length=200, blank=true, default="") now want create lot of schools have lot of students, , lets assume have data structure have needed info creation of it. the way found out far create schools (in order pk) , on go create list of students(in of schools) , use bulk_create create students. it seems there should better way this. because if example have 10k schools , 200 students in school lowest managed ~10k inserts , much. thank in advance. i think doing incorrectly. better use fixtures this read more https://docs.djangoproject.com/en/1.10/howto/initial-data/ , https://code.djangoproject.com/wiki/fixtures

c# - Get connectionstring from Registry LINQtoSQL -

i confused how connectionstring stored in registry used datacontext. where , how go this: public dataclassesdatacontext() : base(global::ddstime.properties.settings.default.ddstimeconnectionstring, mappingsource) { oncreated(); } to not using properties.settings.default.ddstimeconnectionstring value registry? i want way, because application used @ different locations, , not want leave connectionstring in config file see. little script, machines insert connectionstring key in registry, , there no need create different 'versions' each locations uses own sql server onsite. if don't have suitable constructor, should easy create 1 : public dataclassesdatacontext(string connectionstring) : base(connectionstring, mappingsource) { oncreated(); } this means need pass connectionstring every time create new datacontext. if prefer, can change current constructor like private static string getdefaultconnectionstring()

php - Registered user data is not saved to database. Laravel 5.2 -

i tried implement role base authentication. authentication done correctly. if user admin can register new employee. matter data put registration form not saved database. route redirections correct data not saved. using builtin auth system of laravel 5.2. route:: get('/register',['middleware'=> 'roles', function(){ return view('auth.register'); }]); middleware: public function handle($request, closure $next) { if ($request->user()==null) { return redirect('/login'); } if (!$request->user()->isadmin()){ return redirect('books'); } return $next($request); } } user model: public function roles(){ return $this->belongstomany('app\role','roles_users', 'user_id', 'role_id'); } public function isadmin() { return in_array(2, $this->roles()->pluck('role_id')->

javascript - How can I add table to ajax response -

here code. tried lot. unable find luck. want ajax response should come in tabular form. if (uri.endswith("updateempbyid.action")) { employee emp; try { emp = new employeedaoimpl().findemployee(integer .parseint(request.getparameter("val"))); out.print("<div>"); out.print("<form action='updateemployee.action'><p> id:<input type='number' name='id' value='" + emp.getid() + "' readonly></p>"); out.print("<p> name:<input type='text' name='name' value='" + emp.getname() + "'></p>"); out.print("<p> designation:<input type='text' name='desig' value='"

imagick - Can't use ImageMagick on Laravel 5 with Intervention Image -

i followed these steps http://image.intervention.io/getting_started/installation install intervention image library on laravel 5. gd library working comes default library want use imagemagick function http://www.imagemagick.org/usage/crop/#trim_noisy . ran $php artisan vendor:publish --provider="intervention\image\imageserviceproviderlaravel5" command pull configuration file application got publishing complete tag[]! message , nothing change. mistake or missing something?

c# - Cast exception starting action mode in Xamarin Droid -

i'm having problem in xamarin droid app: i have appcompatactivity fragment. fragment has recyclerview , item template linearlayout textview. i handle long tap on recyclerview (inside fragment) , handler (minus not related code) is private void onlistitemselect(int position) { if (_actionmode == null) { try { _actionmode = (activity appcompatactivity).startsupportactionmode(this); } catch (exception ex) { toast.maketext(activity, ex.message, toastlength.long).show(); } } } the problem when try start action mode (same issue startactionmode() instead of startsupportactionmode() ) exception: java.lang.classcastexception: android.support.v7.widget.fitwindowsframelayout cannot cast android.support.v7.widget.viewstubcompat i can't seem find error , don't understand cause. ideas? i attach other code snippets. activity: <?xml version="1.0" encoding="utf-8"

c# - Launch application from App doesn't create files -

i need update windows 8.1 app adding functionality of calling external executable. i therefore created file custom extension , associated application. launching file, application creates 2 files in same directory of first file. if run application command line or double-clicking on file, works fine , creates both files. if run application launching file via windows store app this: await launcher.launchfileasync(file, options); the application starts (it displays alert telling me has started) doesn't create file. can me?

vba - Comparing 2 excel workbooks and highlighting the differences -

i'm trying create macro compare 2 excel work books , highlight differences. i've looked previous solutions , helped lot, still can't macro running. i've created 2 scripts see 1 works best. 1. sub compareworkbooks() dim varsheeta variant dim varsheetb variant dim strrangetocheck string dim irow long dim icol long strrangetocheck = "a1:ak900" 'get worksheets workbooks set wbkn = workbooks.open(filename:="u:\gebouwensep.xlsx") set nieuweversie = wbkn.worksheets("gebouwen") set wbko = workbooks.open(filename:="u:\gebouwenaug.xlsx") set oudeversie = wbko.worksheets("gebouwen") if nieuweversie <> oudeversie nieuweversie.sheets(gebouwen).cells(irow, icol).interior.color = vbyellow end if end sub 2 sub compareworkbooks() dim varsheeta variant dim varsheetb variant dim strrangetocheck string dim irow long dim icol long dim mycell range dim mydiffs integer nlin = 1 ncol = 1 'get worksheets

ios - Mirroring (flipping) camera preview layer -

so using avcapturesession take pictures front camera. creating previewlayer session display current image on screen. previewlayer = avcapturevideopreviewlayer(session: session) previewlayer.videogravity = avlayervideogravityresizeaspectfill it works should. have problem because need implement button flip / mirror (transform) preview layer - users have choice take normal selfie picture or take mirrored one. i have tried transforming previewlayer , kinda works. problem if rotate device, preview picture rotates in other way since transformed. (in default or other camera app picture rotates camera). has idea how achieve that? mirroring preview layer: (i tried transforming layer , view later, same result). @ibaction func mirrorcamera(_ sender: anyobject) { cameramirrored = !cameramirrored if cameramirrored { // transforming view self.videopreviewview.transform = cgaffinetransform(scalex: -1, y: 1); // or layer self.previewlayer.transform = catransfor

android - Enable/disable EditText based on whether adapter has items -

i'm using data binding library. have in xml: <edittext android:layout_width="match_parent" android:layout_height="wrap_content" android:enabled="@{!myadapter.isempty}"/> i want edittext enabled when spinner adapter not empty. when app starts, edittext disabled. far, good. then, in activity, items inserted in adapter. after: myadapter.notifydatasetchanged(); edittext not enabled. have more? to have ability notify data binding use observableboolean this: ... <variable name="isadapterempty" type="android.databinding.observableboolean" /> ... <edittext android:layout_width="match_parent" android:layout_height="wrap_content" android:enabled="@{!isadapterempty}"/> and notify databinding changes this: myadapter.notifydatasetchanged(); isadapterempty.set(myadapter.isempty()); or can make own method inside adapter return observablebool

sql - TSQL to drop tables from database if they appear in lookup table -

i'd drop tables databaseone based on if marked dropping in lookuptable . lookuptable similar below in design: tablename droptable ========================================= tablea y tableb y tablec n tabled y so in example, except tablec dropped. you can try this declare @sql nvarchar(max) = '' select @sql += n'drop table [' + name + '];' lookuptable droptable = 'y' order tablename select @sql exec sp_executesql @sql

java - Can't run individual tests within Intellij gradle -

i attempting create project gradle, when run individual tests error. information:26/10/16 11:22 - compilation completed 1 error , 0 warnings in 158ms error:gradle-resources-test:sunday-sessions_test: java.lang.nosuchmethoderror: org.gradle.api.specs.andspec.getspecsarray()[lorg/gradle/api/specs/spec; i have tried refreshing gradle project , have done file->invalidate caches , restart, has not helped. here gradle file, can see why happening? buildscript { repositories { jcenter() maven { url "https://plugins.gradle.org/m2/" } } dependencies { classpath "io.ratpack:ratpack-gradle:1.3.3" classpath "com.github.jengelman.gradle.plugins:shadow:1.2.3" } } ext { // drivers want use drivers = ["chrome", "phantomjs"] ext { gebversion = '0.13.1' seleniumversion = '2.52.0' chromedriverversion = '2.19&#

php - TYPO3 7.6.10: How to extend the felogin extension? -

i tried extend core extension felogin extension called "feloginextended". i want add first_name , last_name property of current user logout formular. this overridden template (only logout part): <!--###template_logout###--> <form class="login-form" action="###action_uri###" target="_top" method="post"> <div> <div class="user">###firstname### ###lastname###</div> <a class="page-link-button" href="http://tf.lightblue.eu/index.php?id=14">meine siegel</a> <a class="page-link-button" href="http://tf.lightblue.eu/index.php?id=15">mein account</a> <input class="form-btn" type="submit" name="submit" value="logout" /> </div> <div class="felogin-hidden"> <input type="hidden" name="logintype&qu

regex - Atom package grammar regular expression flag for case insensitivity -

i following a tuturial on creating package grammar syntax highlighting in atom. language case-insensitive, e.g. define equivalent define . atom seems running javascript regular expressions , seems flags not supported in cson grammar configuration file 'match': '(define)' it seems there no documentation grammars. how can case-insensitive matching achieved? use special group: https://github.com/kkos/oniguruma/blob/master/doc/re#l197 'match': '(?i)(define ...

android - How to get String from Intent? -

i wrote code text editview, put in intent extras , set in textview on other activity. here code sending activity intent intent = new intent(mylayoutactivity.this, layoutforoneactivity.class); intent.putextra("captionone", string.valueof(txt_caption1.gettext())); startactivity(intent); and here code receiving activity intent intent1 = getintent(); bundle bundle = intent1.getextras(); if (bundle != null) { caption = bundle.getstring("captionone"); } if try run code classcastexception looking this: java.lang.classcastexception: android.text.spannablestring cannot cast java.lang.string use intent.putextra("captionone", txt_caption1.gettext().tostring); instead of intent.putextra("captionone", string.valueof(txt_caption1.gettext())); and datatype of caption should string

scala: poll a http server via post for result -

i using scala in sprak streaming. need write client (in multi-threaded environment) first sends http post request (text file payload) server returns id , have call same server id status. second post call return total line processed till time (like progress tracking). have keep polling until returns count length of file sent(i.e. line processed). what efficient way implement polling second post call? using closeablehttpclient poolinghttpclientconnectionmanager http requests org.apache.http.impl package.

qt - mouseReleaseEvent() for QVTKWidget -

i using qt , vtk. tried create method below: void mainwindow::mousereleaseevent ( qmouseevent * event ) { if (!seedsmode) return; qmessagebox *msgbox = new qmessagebox(); // <-- never called...dont know why msgbox->setwindowtitle("hello"); char msg[30]; sprintf(msg, "you clicked on %d %d", event->pos().x(), event->pos().y()); msgbox->settext(msg); msgbox->show(); if (event->button() == qt::leftbutton ) { msgbox = new qmessagebox(); msgbox->setwindowtitle("hello"); msgbox->settext("you clicked left mouse button"); msgbox->show(); // adding seed (mouse click) current slice // but, have map x,y slice position // affine transformation seeds[currentslice].push_back(event->pos()); //delete msgbox; } } my target create seed points mouse click on qvtkwidget. but, using method can done.

Capybara::Poltergeist::StatusFailError -

i'm trying use puffing-billy gem poltergeist , have problems that. capybara_helper.rb contains next code: billy.configure |c| c.cache = true c.cache_request_headers = false c.path_blacklist = [] c.persist_cache = true c.ignore_cache_port = true c.non_successful_cache_disabled = false c.non_successful_error_level = :warn c.non_whitelisted_requests_disabled = false end my test is: scenario 'add new address', driver: :poltergeist_billy proxy.stub("https://maps.googleapis.com/maps/api/js?callback=window.initializegmaps&key=#{myapikeygoeshere}&libraries=places&language=en"). and_return(code: 500) visit new_address_path expect(page).to have_text('service unavailable') end and receive error: failure/error: new_address_path capybara::poltergeist::statusfailerror: request 'http://127.0.0.1:33173/addresses/new' failed reach server, check dns and/or server status - timed out following

java - WebSphere 8.5.5 EAR's topology -

i'm planning best topology project. need ability have ear running on part of cluster members, while other cluster members running different ear. such topology possibly on websphere 8.5.5 ? ! in context of websphere application server, clusters sets of servers provide workload management. servers part of same cluster must have identical application components deployed on them. other applications, members not have share configuration data. to have multiple applications running on multiple servers, can define additional clusters. additional info: introduction clusters clusters , workload management

node.js - Replacing text with data from pg-promise -

i replace text in string values database using pg-promise . have not used promise s before, i'm struggling how deal in best way. what have tried far doesn't work try combine synchronous , asynchronous programming: var uid = ...; "some string".replace(/\#\{([\w]*?)\}/gmi, function(m, c) { var r = ""; db.one("select ... x = $1 , y = $2", [c, uid]) .then(function(data) { r = data.a; }); return r; }); r is, unsurprisingly, empty string. there way rewrite block "wait" values database? what try is, replace placeholders in message send user. above part of function called preparemessage , send message user using socket.io looks this: io.to(socket.id).emit('message', { text: preparemessage(msg) }); after reading , more thinking, came solution i'd add if else has similar problem. (in addition question above, had additional complication message array of strings , order

android - Validation on EditText in alertDialog -

i trying add empty field validations on edittext on alertdialog . after field empty error message not getting displayed, instead alertdialog closing. if conditions working i'm not able post operations if of field empty. here java sample code: public class touractivity extends appcompatactivity { private layoutinflater inflater; private floatingactionbutton fab; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_tour); toolbar toolbar = (toolbar) findviewbyid(r.id.toolbar); setsupportactionbar(toolbar); fab = (floatingactionbutton) findviewbyid(r.id.fab); fab.setonclicklistener(new view.onclicklistener() { @override public void onclick(view view) { inflater = touractivity.this.getlayoutinflater(); view content = inflater.inflate(r.layout.activity_add_new_trip, null); final edittext editevent = (edittext) content.fin

javascript - How to add a span inside a link tag with jQuery? -

this question has answer here: add span tag within anchor in jquery 3 answers i have code here in html: <a class="cta" href="url" target="_blank">text</a> what try achieve add span tag inside link tag, this: <a class="cta" href="url" target=_"blank"><span>text</span></a> i tried prepend seems not work case… the .html( function ) method changing html content of element. current html content of element setted in html variable in function can set in new added child. $("a.cta").html(function(i, html){ return "<span>"+ html +"</span>"; }); span { color: red } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <a class="cta" href=&

canvas - c# InkStrokeBuilder loss of data -

i have drawing project user can create drawings, server , use elsewhere (on other platforms) to achieve this, can drawings in collection of points scheme, using following object. public class drawing { public drawing() { points = new list<list<int>>(); } public list<list<int>> points { get; set; } public string colour { get; set; } } i use c# inkmanager me draw sketches. save, extract strokes , save them list of points, follows. private list<drawing> getdrawingsfrominkmanager() { list<drawing> returnlist = new list<drawing>(); var strokes = m_inkmanager.getstrokes(); int scount = 1; foreach (var s in strokes) { var renderingstrokes = s.getrenderingsegments(); drawing drawing = new drawing() { colour = m_currentdrawingcolor.tostring() }; foreach (var rs in renderingstrokes) { drawing.points.add(n

java - deallocating direct ByteBuffer when used in LibUSB -

libusb (usb4java) requires use of direct bytebuffers sending/receiving bulk transfers. the problem according documentation java.nio.bytebuffer direct bytebuffer out of java heap , therefore out of reach of garbagecollector. i have implemented message sender/receiver in java use of libusb bulk sending, rapidly draining of ram. private synchronized boolean send(string msg) { //... bytes = msg.getbytes("utf-8"); sendbuff = bytebuffer.allocatedirect(bytes.length); sendbuff.put(bytes); intbuffer = intbuffer.allocate(1); result = libusb.bulktransfer(handle, (byte) 0x02, sendbuf, intbuffer, 0); try { if (result < 0) throw new libusbexception(result); } catch (libusbexception e) { e.printstacktrace(); } return true; } // in separate thread public void run() { try { intbuffer transfered = intbuffer.allocate(1); int result; bytebuffer recbuffer = bytebuffer.allocatedirec(500000);

c# - Bind Dropdownlist with viewbag get slow -

i'm trying bind list dropdownlist using 'htmlhelper' , slow. have approximately 200k records in dropdown list using select2.js searchable dropdown. how can make faster? @html.dropdownlistfor(model => model.stundetnumber, (list<selectlistitem>)viewbag.studentnumber, new { @class = "form-control stundetnumber select2", @multiple = "" }) you creating dropdown 200k items in view. may applying select2.js after that, server still has render , serve 200k items. it's going slow, , browser have trouble rendering intial dropdown. you should investigate loading data on demand, such select2.js provides ajax support: https://select2.github.io/examples.html#data-ajax

How do I implement the below view in iOS (Objective-C or Swift)? -

Image
basically i'm trying implement feature attached image. i'm trying create generic component. view can have list of items , minimum shown 2 , there should button 3 more options , click on should expand view , auto adjust container using auto layout. can 1 me giving brief idea how implement this? full. image , component i'm trying implement below: you use uitableview 2 uicustomcell 1 default view image , expand view, use nsmutablearray save flag value decide use first cell or second cell, , in uibutton action reset array , reload uitableview. i hope you.

Android TimeZone Turkey GMT -

for 2016 turkish government decided stay gmt+3 timezone save daylight, on android: calendar calendar = calendar.getinstance(); timezone tz = timezone.gettimezone("utc"); calendar.settimeinmillis(timestamp * 1000); date currenttimezone = (date) calendar.gettime(); calendar.add(calendar.millisecond, tz.getoffset(calendar.gettimeinmillis())); so problem is; it's showing gmt+3 date before november: wed oct 26 18:00:00 gmt+03:00 2016 after november: mon nov 07 20:00:00 gmt+02:00 2016 it should've stay @ gmt+3 whole year, special issue android lib of timezone or doing wrong? thanks, update although i've added check timezone , gmt parameters, situation little chaotic android devices uses turkey's timezone, cause after oct 29 hour of device hour normal, until android releases update , user applies that. see release note of tzdb-database version 2016g: release 2016g - 2016-09-13 08:56:38 -0700 changes future time stamps turk