Posts

Showing posts from August, 2015

mysql - PHP Session Variable lost after click on page other category -

i have 1 site such olx.com used product buy , sell, index page has city filter drop down list, once user clicks filter see product filter city , redirect page city_filter.php till working, after city filter when user click on categories such computer or electronics user not found product, categories coming mysql database, city_filter.php included function_city.php calling function categories, please find city_filter.php function created on function_city.php follow: function displaycomputer_city(){ global $con; $get_cats = "select * categories categories_id = 1"; $run_cats = mysqli_query($con, $get_cats); while ($row_cats=mysqli_fetch_array($run_cats)) { $computer_id = $row_cats['categories_id']; $computer_title = $row_cats['categories_name']; echo "<li><a href='city_filter.php?computer_cat=$computer_id'>$

javascript - Client-Server AngularJS App - When should I update the model? -

i'm working on client-server application built angularjs. data exchanges i'm using html5 websockets. server has dataset exists copy on client. refer model here raw data. via websockets i'm able get/set data. there may random data updates server (push). i'm using different custom services/factories provide layer allows modules create data packets , send them server. provide wrapper model , may change reprasentation of data in view (like timestamps converted real time, etc.). have different controllers access services reach functions or values. i hope describes current architecture enough. question: on data updates server update model data , inform modules make use of data new value. it's like: server -> model -> viewmodel -> view that works fine , guess it's ok view of mvvm pattern. but i'm struggling bit publishing updates view. @ moment it's like: view -> viewmodel -> model (at first update model) |

java - JAXB - change property name without changing variable name in class -

so have code this: @xmlrootelement(name = "person") @xmltype(proporder = {"name", "secondname"}) public class person { private string name; private string secondname; public void setname(string name) { this.name = name; } public string getname() { return name; } public void setsecondname(string secondname) { this.secondname = secondname; } public string getsecondname() { return secondname; } } and when want create xml file makes me: <person> <name>john</name> <secondname>smith</secondname> </person> is way make in xml file <second-name> instead of <secondname> without changing in class on private string second-name ? problem solved. should this: @xmlelement(name="second-name") public string getsecondname() { return secondname; }

php - Group week names based on start and end time -

i have array this array( [mon] => array ( [start] => 09 [end] => 18 [hours] => 9 ) [tue] => array ( [start] => 09 [end] => 18 [hours] => 9 ) [wed] => array ( [start] => 09 [end] => 18 [hours] => 9 ) [thu] => array ( [start] => 09 [end] => 18 [hours] => 9 ) [fri] => array ( [start] => 00 [end] => 21 [hours] => 21 ) [sat] => [sun] => ); now task able display in simple format like mon-thu fri 09 - 18 00-21 so how can transform above array simple array display required format @ client i tried following code, giving dates group by, $workhours = $bhr->workinghours; $days = array_keys($workhours); $workhoursinfo = array_values($workhours); $result = array(); for($i=0;$i<count($workhoursinfo);$i++){ $info1 = $workhoursinfo[

ios - Error handling in block with Swift syntax -

the error handling here doesn't feel right. have suggests how improve it? using optional binding establish errors , return value variable. that cool? class chargepointsfetcher { func getdevices(location: nsurl, completion handler:([chargedevice]?, error: nserror?) -> void) { let request = nsurlrequest(url: location) let session = nsurlsession.sharedsession() let task = session.datataskwithrequest(request, completionhandler: { (let data, let response, let error) -> void in var returnvalue: nserror? if let e = error { returnvalue = e } var collection: [chargedevice]? if returnvalue == nil { collection = [chargedevice]() var parsingerror: nserror? if let json: nsdictionary = nsjsonserialization.jsonobjectwithdata(data, options: .allowfragments, error: &parsingerror) as? nsdictionary { if let chargedevices = json.valueforkey("chargedevice&qu

regex - php, strpos extract digit from string -

i have huge html code scan. until have been using preg_match_all extract desired parts it. problem start was extremely cpu time consuming. decided use other method extraction. read in articles preg_match can compared in performance strpos . claim strpos beats regex scanner 20 times in efficiency. thought try method dont know how started. lets have html string: <li id="ncc-nba-16451" class="che10"><a href="/en/star">23 - star</a></li> <li id="ncd-bbt-5674" class="che10"><a href="/en/moon">54 - moon</a></li> <li id="ertw-cxda-c6543" class="che10"><a href="/en/sun">34,780 - sun</a></li> i want extract number each id , text (letters) content of a tags. preg_match_all scan: '/<li.*?id=".*?([\d]+)".*?<a.*?>.*?([\w]+)<\/a>/s' here can see result: link now if want replace method st

java - How can I use oculus Mobile SDK in Android Studio? -

i have application supported google cardboard , runs great on gear vr. instead of cardboard supported oculus mobile sdk have trouble integrating sdk. how can that? without more details it's difficult know have implemented here couple of snippets a tutorial on building dual cardboard-gearvr app may or may not help, depending on project: google cardboard supports unity 4 , unity 5. although oculus’ mobile sdk technically work on unity 5, can’t ship because bugs in current version of unity 5 cause memory leaks , other issues on gear vr hardware. you can install cardboard , gear vr sdks in single unity project no problems. conflict both overwrite android manifest in plugin folder. there more information in link.

SSAS cube restoration / processing - partition issue when restored from server A to server B -

issue background : as part of our environment migration process, trying migrate 1 of our cubes our source environment server a destination environment server b . there partitions defined @ source server refers location: i:\xyz . please note cube up[ .abf file ] server a server b has been restored. while processing cube @ server b displays following error - 42 errors in metadata manager. i:\xyz storage location of vw fact xyz allup partition not exist, long, or contains characters not valid or reserved. we tried add folder in i drive of destination server b had solved issue. question: though had solved issue in way in our server b , have move server c not have i drive , cannot expect have i drive everywhere move our cube. we tried scripting out cube , searching i:\ where-in-which found nothing. is there way can change partition reference in destination server, after restoration ? many thanks. lakshman. yes, able change storage location

cakephp - fullBaseUrl not properly works with AuthComponent -

recenty i've moved application subdirectory i've configured fullbaseurl this: configure::write('app.fullbaseurl', 'https://example.com/subdirectory'); nothing more changed in app , works perfect, except 1 thing - accessing unauthorized locations. i've defined this: $this->auth->loginaction = ['controller' => 'app_users', 'action' => 'login', 'admin' => false]; $this->auth->loginredirect = ['controller' => 'dashboard', 'action' => 'index', 'admin' => false]; $this->auth->logoutredirect = ['controller' => 'app_users', 'action' => 'login', 'admin' => false]; $this->auth->unauthorizedredirect = ['controller' => 'dashboard', 'action' => 'index', 'admin' => false]; thus logged users when try access unauthorized action redirected their

ruby - Rails 4 - destroy action deletes wrong record -

i doing ajax request rails passing in data id. here ajax function delete_availability(id) { var id = id; $.ajax({ type: "delete", url: "/events/" + id, statuscode: { 200: function() { //alert("200"); }, 202: function() { //alert("202"); } }, success: function(data) { console.log('availability deleted'); }, error: function(xhr) { alert("the error code is: " + xhr.statustext); } }); } my destroy action def destroy @event = event.find_by(params[:id]); respond_to |format| if @event.destroy format.json { render json: {} } end end end my event model has nothing in it class event < activerecord::base end the problem though rails receives correct id, when goes destroying, changes id , destroys next one. here rails log: proces

ruby on rails - Query caching in controller -

rails 3.2.18 ruby 1.9.3 redis checking caching in development environment. development.rb : s2yd::application.configure # settings specified here take precedence on in config/application.rb # in development environment application's code reloaded on # every request. slows down response time perfect development # since don't have restart webserver when make code changes. config.cache_classes = false #config.assets.enabled = true # log error messages when accidentally call methods on nil. config.whiny_nils = true # show full error reports , disable caching config.consider_all_requests_local = true config.action_controller.perform_caching = false # don't care if mailer can't send config.action_mailer.raise_delivery_errors = false # print deprecation notices rails logger config.active_support.deprecation = :log # use best-standards-support built browsers config.action_dispatch.best_standards_support = :builtin

ios - XCode 6 UIViewController not resizing to fill screen -

i'm creating app without storyboard on xcode 6.4 , when run app, no matter simulator use, (320,480) screen. - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { self.window = [[uiwindow alloc] initwithframe:[[uiscreen mainscreen] bounds]]; uiviewcontroller *vc = [[uiviewcontroller alloc] init]; vc.view.backgroundcolor = [uicolor whitecolor]; self.window.rootviewcontroller = vc; [self.window makekeyandvisible]; return yes; } ref img: http://i.stack.imgur.com/hghmt.png already tryed: vc.view.autoresizingmask = uiviewautoresizingflexibleheight | uiviewautoresizingflexiblewidth; what should make fill whole screen? i had same problem, should set launch image of app default-568@2x.png 640 x 1136 pixel size. more info --> link also setting @2x @3x image assest you.

linux - Is "Ubuntu Server 14.04.3 LTS + LAMP" production-ready? -

installing fresh copy of ubuntu server 14.04.3 lts , then: $ sudo apt-get update $ sudo apt-get upgrade $ sudo apt-get install lamp-server^ is configuration production-ready in terms of security , stability ? no. no system "production-ready" without configuring according needs. neither in terms of security nor stability/performance.

php - How to select Unknown Number of Columns in mysql? -

given table , names of columns, have following information schema select query. select `column_name` `information_schema`.`columns` `table_schema` = 'm_college' , `table_name` = 'm_fee' , column_name not in ('id', 'classid', 'semid') but select not give me rows value each unknown column select. got names of unknown columns. possible select values of rows can have column key , rows value pair in php script? need insert column names , row values in other table. please or suggest. below quick attempt @ showing intersect table. this allows have fixed structure , add fee types on fly. create table if not exists `mz_fee222` ( `id` int(11) not null auto_increment, `classid` int(11) not null, `semid` int(11) not null, `batch` year(4) not null, `session` int(11) not null ); create table fee_type ( fee_id int auto_increment primary key, descrip

java - Migrating StringEscapeUtils.escapeSql from commons.lang -

i have started migrate commons.lang 2 commons.lang3. according https://commons.apache.org/proper/commons-lang/article3_0.html stringescapeutils.escapesql this misleading method, handling simplest of possible sql cases. >as sql not lang's focus, didn't make sense maintain method. understand recommended use instead of it? clarification can recommend third party perform simple escapesql similar stringescapeutils.escapesql? from javadocs : at present, method turns single-quotes doubled single-quotes ("mchale's navy" => "mchale''s navy"). this method code: /** 675 * <p>escapes characters in <code>string</code> suitable pass 676 * sql query.</p> 677 * 678 * <p>for example, 679 * <pre>statement.executequery("select * movies title='" + 680 * stringescapeutils.escapesql("mchale's navy") + 6

javascript - Inline editing for HTML table -

Image
i have following jquery function displays table. $(function() { $("#table-contact > tbody").html(""); $.ajax({ "url" : '/contact/' + id, type: 'get', success: function(data) { $.each(data.details, function(k, v) { var dataarr = new array(); dataarr.push('<label class="id">'+ v.id + '</label>'); dataarr.push('<select data-val=' + item.course + ' ><option>science</option><option>economics</option><option>literature</option><option>maths</option><option selected>' + item.course + '</option></select>'); // here getting 2 values selected option dataarr.push('<input type="text" name="category">' + v.catg + ' </disabled>');

Incremental counts in mysql -

i have table "userlogins" , when user login system drop record in "userlogins" table. jan 10th (users : 1,2,3,4) // 4 records ids 1,2,3,4 jan 20th (1,2,3,4,5,6) // 6 records ids 1,2,3,4,5,6 jan 30th (1,2) feb 10th (1,7) feb 20th (2,6,8) feb 25th (1,2,3,5) mar 10th (3,4) mar 20th (4,5,9) mar 30th (8,10,11) apr 10th (10,12) apr 20th (1,2,3,6,13, 14, 15) apr 30th (11,12,16) when write group results follows jan - 6 feb - 7 mar - 7 apr - 11 but need out put follows upto jan - 6 //count of distinct users upto jan upto feb - 8 //count of distinct users upto feb upto mar - 11 //count of distinct users upto mar upto apr - 16 //count of distinct users upto apr your first count this: select date_format(login_date, '%y-%b') year_month, count(distinct user_id) userlogins group date_format(login_date, '%y-%b') while count users given mount, use join: select date_format(last_day, '%y-%b') year_month, count

javascript - jQuery how to dynamically add a textbox with increment ID? -

i building form solely javascript , jquery. unable connect servers, unable use php script @ all. how add more , remove textboxes "add more"and "x" (for remove) buttons increments id's can capture individual values associated each id , use them later in variable. i have seen , tested several working examples of dynamically adding more textboxes don't have incrementing id any suggestions helpful. i have used data since can inbetween delete input boxes , need maintain sequential count you can elements id #count0 , #count1 ... (make sure have null check if wish delete #count1 not there) function addmore(){ var inps = $('#wrapper > div:last').data('count')+1 || 0; $('#wrapper').append('<div data-count="'+inps+'"><input type=text id="count'+inps+'" class="inp"/> <a class=remove>x</a></div>'); } $('#wrapper')

ios - BOOL variable changes to 'NO' automatically -

i have issue bool variable, in middle of function variable's value resets 'no automatically: game.h: @property bool playerturn; players.m: +(void)playturnwithboardpositions:(nsmutablearray*)boardpositions andplayerturn:(bool)playerturn//[playerturn(bool)'s value 'yes' { //printing turn player (x/o) if (playerturn) { nslog(@"\no turn"); } else nslog(@"\nx turn"); //user input instraction nslog(@"\nwhere want insert %s?",playerturn?"o":"x"); //getting user's input (char) char input[3]; gets(input); //converting input nsstring nsstring* inputstring=[nsstring stringwithutf8string:input];//playerturn's resets 'no' //checking user's input , implementing choice board [players inputcheckandimplementwithinputstring:inputstring andboardpositions:boardpositions andplayerturn:playerturn]; } does know how solve this? maybe arc?

java - Fabric/Crashlytics NoClassDefFoundError only on certain devices -

i'm seeing crash in google play related fabric/crashlytics. happened after updated normal crashlytics new fabric crashlytics. can reproduce on 1 of devices (galaxy s2). other devices have (nexus 5 , s4) not have crash. here's stack trace: 08-19 09:32:26.328 7084-7084/com.tsm.countryjam d/dalvikvm﹕ wait_for_concurrent_gc blocked 0ms 08-19 09:32:26.653 7084-7088/com.tsm.countryjam d/dalvikvm﹕ gc_concurrent freed 251k, 12% free 9567k/10823k, paused 12ms+2ms, total 70ms 08-19 09:32:26.653 7084-7084/com.tsm.countryjam d/dalvikvm﹕ wait_for_concurrent_gc blocked 42ms 08-19 09:32:26.653 7084-7100/com.tsm.countryjam d/dalvikvm﹕ wait_for_concurrent_gc blocked 42ms 08-19 09:32:26.668 7084-7084/com.tsm.countryjam i/dalvikvm﹕ failed resolving lcom/crashlytics/android/beta/beta; interface 9027 'lio/fabric/sdk/android/services/common/deviceidentifierprovider;' 08-19 09:32:26.668 7084-7084/com.tsm.countryjam w/dalvikvm﹕ link of class 'lcom/crashlytics/androi

c++ - Return pairs of points from N 2D points where each two points define a line -

i have list of 2d points: (x1, y1), (x2, y2) … (xn, yn) - n 2d points. each 2 points define 2d line. return list of unique 2d lines, can build using pairs of points list. how can implement using hash table/map - keep unique lines (there infinite lines) i trying find slope , intercept point of intersection. slope = y2 -y1 / x2 - x1 intercept = y1 - slope * x1; (trying in c++) you didn't specify language, use python here sake of easiness. joke python: import itertools def slope(p1, p2): return (p1[1]-p2[1]) / (p1[0]-p2[0]) def slp_intrcpt(p1, p2): """ return tuple of slope , intercept """ slp = slope(p1, p2) return slp, p1[1] - slp * p1[0] def uniq_lines(points): return set(slp_intrcpt(p1, p2) p1, p2 in itertools.combinations(points, 2)) since (slope, intercept) pair enough determine line, finished requirement. if want keep track of pairs produce lines, may import collections def uniq_lin

javascript - Image Upload ending prematurely nodejs -

Image
using node.js, decided time work file uploads. looking @ options, felt uploading socketio best bet me. of course brought list of modules down not being able use multer or other ways require load http request. settled socket.io-stream , working great until tried uploading bigger files (200 kb or bigger) not great being average size of stuff uploaded 50 kb 700 kb max of 1mb. seems me upload ending prematurely without clue on why. although feel problem server side, here both client , server. client: var file = $("#map").prop('files')[0]; var stream = ss.createstream(); ss(m).emit('file', stream, {name: file.name}); server: ss(socket).on('file', function(stream, data) { var filename = path.basename(data.name); var way = '/images/maps/uploaded/'; stream.pipe(fs.createwritestream('public'+way+filename)); stream.on('end', function() { socket

c# - What does Eric Lippert mean by "you need to know what the base class is to determine what the base class is"? -

i read interesting article eric lippert, top 10 worst c# features . near end states: the rules resolving names after aforementioned colon not founded; can end in situations need know base class in order determine base class is. by colon referring inheritance operator (e.g. dog : animal ). what situation eric referring to? can provide code sample? this can happen in convoluted scenarios generics, inheritance, , nested classes: class base<t> { public class inner {} } class derived : base<derived.inner2> { public class inner2 : inner {} } result to determine derived 's base class, need bind derived.inner2 . to bind derived.inner2 , need resolve inner symbol. the inner symbol inherited containing scope's base class, need determine derived 's base class again.

task parallel library - Reactive Extensions subscribing to an observable (subject) -

i'm playing around reactive extensions first time in winforms application. mind have been doing web development past 4 years, , familiar observables , observable pattern in knockout, guessing contributing confusion here. anyhow, question , code. have simple winforms experiment (see below) building illustrate question. subscribe below doesn't run until after thread in start new finished. can trace calls onnext, subscribe doesn't fire @ until 20-30 seconds later. can explain behavior me? public partial class form1 : form { private subject<int> progress; private cancellationtoken cancellationtoken; private ischeduler _scheduler; public form1() { initializecomponent(); cancellationtokensource source = new cancellationtokensource(); cancellationtoken = source.token; _scheduler = new synchronizationcontextscheduler(synchronizationcontext.current); } private void start_click(object sender, eventargs e

Selenium Webdriver (Java) , Need to send "Space" keypress to the website as whole -

my problem follows. i attempting automate part of test suite website work in, , while of went well, i'm @ point developers added lightbox confirm next action. using firebug found out xpath use click button need proceed, sadly isn't working. after manual attempts, figured pressing "space" key, can proceed. the problem sort of try using "driver.findelement" xpath, or link text, fails "no such element" error in console. so i'm trying send keypress of space , without using find element. to clear, want emulate pressing space without clicking or selecting beforehand. i tried driver.keyboard... "keyboard" isn't recognized , i'm @ loss of how send keypress without using driver.findelement. the piece of code giving me problems is: driver.findelement(by.xpath("//div[4]/div[3]/div/button")).click(); any appreciated. thank , have great day! if receive nosuchelementexception , know element ther

powershell - Copy-Item and exclude folders -

i need copy of c:\inetpub directory new location exclude following folders , subfolders: c:\inetpub\custerr c:\inetpub\history c:\inetpub\logs c:\inetpub\temp c:\inetpub\wwwroot so far doing this: # directory name created format string $dirname = "\\servername\folder1 _ {0}\inetpub" -f (get-date).tostring("yyyy-mm-dd-hh-mm-ss") $dirname # check output # create dir if needed if(-not (test-path $dirname)) { md $dirname | out-null } else { write-host "$dirname exists!" } #copy backup file dir copy-item "\\servername\c$\inetpub\*" $dirname -recurse this simple example of do. build array of parent folders want exclude. since accessing them via unc paths cannot use c:\ path (we can around show should enough.). then use get-childitem folders in inetpub directory. filter out exclusions using -notin , pass rest copy-item $excludes = "custerr","history","logs","temp","wwwroot&

javascript - Convert string from regexp match into object -

i have following string: var str = 'jfkdjffddf{aaa:12,bbb:25}kfdjf'; and want fetch object it: var objstr = str.match('/{(.*?)}/')[1]; // aaa:12,bbb:25 now want use fetched string object: var obj = json.parse('{' + objstr + '}'); do operations on it, convert string again , replace in initial text. the problem unexpected token a on 1 line in script, problem json.parse . what's problem, , how can solve this?

mysql - Multiple joins with multiple conditions with multiple tables -

at first tables: game +----+--------------+ | id | game | +----+--------------+ | 1 | game1 | | 2 | game2 | | 4 | game4 | +----+--------------+ group_game +---------+----------+ | game_id | group_id | +---------+----------+ | 1 | 33 | | 1 | 45 | | 4 | 33 | +---------+----------+ groups +----+------------+---- | id | group_name | ... +----+------------+---- | 33 | group33 | ... | 45 | group45 | ... +----+------------+---- users +---------+----------+---- | user_id | username | ... +---------+----------+---- | 1 | user1 | ... | 2 | user2 | ... +---------+----------+---- users_groups +---------+----------+ | user_id | group_id | +---------+----------+ | 1 | 33 | | 1 | 45 | | 2 | 45 | +---------+----------+ what want do now want check wether current user in group plays "game4" , if yes output should id , name of group. the current user &

css - Stylus s() & +cache blocks ignore media queries -

i noticing stylus applying +cache code in incorrect block. styles supposed display on tablet media queries gets displayed instead on non-cached scope. it looks issue stylus' s() function not recognizing if it's inside media block , printing out css // styles .content width 70% // mobile devices +media('sm') // tablet devices width calc('100% - ' + em($photo-size)) here calc mixin calc() if current-property prefix in vendors arguments = unquote(arguments) add-property(current-property[0], s('-%s-calc(%s)', prefix, arguments)) s('calc(%s)', arguments) else error('calc() must used within property') this cache implementation copied on http://kizu.ru/en/issues/new-stylus-features/ // mixin caching blocks given conditions media($condition) helper($condition) unless $media_cache[$condition] $media_cache[$condition] = () push(

java - bypassing @Test dependsOnMethods due to failure -

i have question regarding @test(dependonmethods{""}).. want tests run in particular order hit every test have written. best way far, atleast have found, dependsonmethods! however, since tests come after requires 1 before pass, cant run of tests , see ones failed. program exits! here i'm working with.. @test(dependsonmethods = {"shouldselectamountofdoors"}) public void shouldselectextcolor() throws interruptedexception{ sycoptionalinfopage.selectextcolor("green"); } @test(dependsonmethods = {"shouldselectextcolor"}) public void shouldselectintcolor() throws interruptedexception{ sycoptionalinfopage.selectintcolor("gold"); } @test(dependsonmethods = {"shouldselectintcolor"}) public void shouldenteracomment() throws interruptedexception{ sycoptionalinfopage.entercomments("<(*-<) <(*-*)> (>-*)> woot!"); takeabreakyo(); } boom. easy understand , trusty pom! but, if shoul

c# - Proper way to loop a SQL Query? -

i have list retrieves student's grades passing in list of student class, it pulls student grades querying student's name through database. code works fine however, when studentlist increases in size, code gets slow execute, what proper method looping list through sql query? private list<studentclass> getstudentgrades(list<studentclass> studentlist) { (int =0; < studentlist.count; i++) { string sqlcommand = "select studentgrades students studentname=@studentname"; conn.open(); using (sqlcommand cmd = new sqlcommand(sqlcommand, conn)) { cmd.parameters.addwithvalue("@studentname", studentlist[i].studentname); cmd.executenonquery(); sqldatareader reader = cmd.executereader(); while (reader.reader()) { studentlist[i].studentgrades = int.parse(reader["studentgrades"].tostring()); } } }

javascript - Access a specific path element using given ID -

i using topojson , world-110m.json visualize map of world. trying change fill property of 2 particular countries click event. the first country selected click user side , id of path retrieved using: var current_country = d3.select(this).style("fill", "red"); var current_country_id = d3.select(this).attr('id'); the second country changed given (does not matter) , defined id. have tried using this: var top = d3.select("path#643").style("fill", "green"); as suggested here: how select d3 svg path particular id seems pretty straight forward same error no matter try: uncaught syntaxerror: failed execute 'queryselector' on 'document': 'path#643' not valid selector. i have tried many things (all combinations come mind) , have seen lot of similar questions posted here have failed find proper solution. path id in fact exist. , of countries stored in world variable , seem ok me. here full code

regex - negative grep with multiple elements -

assuming following code using grep grepl("xyz|aba", results$category) how obtain negative statement? i know done using caret ^ don't seem find right syntax use negative lookahead. grepl("^(?!.*(?:xyz|aba))", results$category, perl=t)

Adding Google Maps API to AngularJS -

i need include google maps api in angularjs application. so, i've created plunker jsfiddle . i think have edit index.html not know how.. help index.html: <div ng-app="mapsapp" ng-controller="mapctrl"> <div id="map"></div> <div id="class" ng-repeat="marker in markers | orderby : 'title'"> <a href="#" ng-click="openinfowindow($event, marker)">{{marker.title}}</a> </div> </div> here updated plunkr . ideally put script i've put in script tags in javascript file (save files> .js) , link in <script src= "location.js"></script> or whatever call (make sure path correct). put style in css stylesheet , include <link rel = "stylesheet" src="style.css"> or whatever. don't forget include <script src="http://maps.googleapis.com/maps/api/js?key=&sensor=fal

javascript - Outputted results from query outputting, but not allowing some of the results to be selected -

i have following code supposed shuffle results database if user in group 3, 4 or 5. query outputting results fine, when click button shuffle results, results display group 3. believe issue in js, i'm not sure or why shuffling group 3 results when query selecting users group 3,4 , 5 , output shows that. lets say: bob group 3 joe group 4. bill group 5 the way page looks this. users need shuffled... -bob -joe -bill button - shuffle when click on shuffle button. bob shows up. what wrong in code this? $query = mysqli_query($con, "select * users `group` in (3, 4 ,5)"); echo 'users given draft order: <br>'; $array = array(); while ($row = mysqli_fetch_assoc($query)) { $array[] = $row; echo $row['firstname'] . ' ' . $row['lastname'] . '<br>'; } ?> <form method="post" name="form"> <input type="submit" value="create draft order" name="

node.js - Is there a high level http node module that supports what 'curl --negotiate' does? -

i searching node module make rest requests. found request module looks popular, doesn't seem mention whether can authentication negotiation. need emulate curl doing --negotiate flag: --negotiate (http) enables negotiate (spnego) authentication. i thinking use child_process module , call down curl myself, wanted check here first in case others using better solution. thanks seems exist module maybe bit immature you. https://www.npmjs.com/package/krb5 its native binding kerberos library it able generate spnego tokens npm install krb5

javascript - How to use jasmine toMatch multiple arguments? -

how can test if variable match multiple options in jasmine? want this, checking if taxonomytype matches 1 of 3 options 'gem', 'pager' or 'atc58': expect(taxonomytype).tomatch({'gem', 'pager', 'atc58'}); you reverse , use tocontain var = ['gem', 'pager', 'atc58']; expect(a).tocontain(taxonomytype); or write own loop (or use lodash/underscore) determine "found" , compare result true/false expect(_.includes(['gem', 'pager', 'atc58'], taxonomytype)).tobe(true);

javascript - Dijit horizontal slider color issue -

i'm trying implement horizontal slider using 'dijit/form/horizontalslider'. got slider working slider comes red color.. how can change color white or color want? below code snippet i'm using. createslider= function() { slideropacity = new horizontalslider({ name: "slider", value: 60, minimum: 0, maximum: 100, intermediatechanges: true }, "slideropacity"); slideropacity.startup(); dojo.connect(dijit.byid('slideropacity'), 'onchange', changeopacity); }, <div class="slider"> <div id="slideropacity"> </div> </div>

Arranging in Bootstrap -

Image
i have create character page mmorpg, page should have character image 130x130px , belonging items 32x32px inside parent of col-xs-12 col-sm-12 col-md-5 col-lg-5 . the output might not same picture close. html <div class="row-fluid"> <div class="col-xs-12 col-sm-12 col-md-5 col-lg-5"> <div class="row-fluid"> <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3"> <div class="beta32"></div> <div class="beta32"></div> <div class="beta32"></div> <div class="beta32"></div> </div> <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6"> <div class="alpha130"></div> <div class="row-fluid">