Posts

Showing posts from March, 2010

google maps - What is my next step in debugging this JavaScript error? -

Image
i understand chrome development tool: [vm] file javascript code executed inside [vm] file in google chrome code not directly tied file. a client reported geocoding feature no longer working on website. it's joomla site, uses mootools. geocoding done through google maps api v3. wrote code years ago, , started acting up. i've determined bug occurring in code, end of stack-trace ends in 1 of [vm] files obfuscated. where error crops in code: var pf_map = { geocoder: new google.maps.geocoder(), geocode: function() { var address = '123 fake st, nowhere, usa'; // valid address // error occurs somewhere between here console.log('this message makes console'); pf_map.geocoder.geocode({ 'address': address }, function(results, status) { // , here console.log('this message not make console'); }); } } the error reported in console is: uncaught typeerror: cannot read

php - Display multiple values on one line in mysqli generated dropdown box -

using mysqli code, have been able create dropdown box using data mysql database. sql statement selects userid, f_name, , l_name database. list part of form , when user selects name, want pass userid via $_post method. how can done? again help. <select name="names"> <option value = "">---select---</option> <?php $queryusers = 'select userid, f_name, l_name users'; $db = mysqli_query($mysqli, $queryusers); while ( $names=mysqli_fetch_assoc($db)) { echo "<option value='{".$names['f_name']."}' . {".$names['l_name']."}'>".$names['f_name']. " " . $names['l_name']."</option>"; } ?> </select> just this: echo '<option value="'.$names['userid'].'" >'.$names['f_name'].' '. $na

php - Better way to determine when users are active? -

i have table contains information users post messages website. table named logs , has following records: id, epoch, username, msg (epoch unix epoch of when posted, msg message posted) i have decided divide day 4 segments, 6 hours each (0-5, 6-11, 12-17, 18-23). i want determine percentage of posts user makes during each of these segments. is there nice way can 1 sql query? take forever if had make 4 queries below per username. select count( num ) `logs` username = 'bob' , from_unixtime( epoch ) between date_sub( now( ) , interval 1 week ) , now( ) , hour( from_unixtime( epoch ) ) between 0 , 5 the above query tells me how many posts bob has made between hours 0 , 5, past week. feels horribly inefficient, because better if query load of bobs posts, data need, , return that; instead of having load posts 5 different times (#1 total posts, #2/3/4/5 posts during specific hour range) my goal posts bob has made in 1 query, divided different times of day (i.e. bet

mysql - Separate user data from other data -

our client user table separated other tables "security reasons". practice given our application built using ror , mysql , running on unicorn , nginx ? i can think of 2 possible ways: create 2 different login accounts, 1 user table , 1 other tables. or have separate database user data. i think both solutions might create problems migrations , other tasks , don't know if effective method of protecting user data. junior developer , not familiar database , security concepts. suggestion? a common pattern have users table literally contain details of user account , no details of actual person behind account. ie, have username, email, password, or encrypted password & salt or whatever, nothing else - not name. so, "glue" makes system work stays in users table in regular database. then, details of real person behind account (name, telephone number, address, card details etc etc) stored in different table, or tables, foreign key in eith

ios - parse push notification acting peculiarly -

after nighter enough caffeine kill small rhino, got parse push notifications working realize not act expected. the notifications sent, , received in didreceiveremotenotification not acting coded. out of 5 test notifications sent, 2 worked perfectly. rest of time notification still appeared in notification center not interact didreceiveremotenotification. since did work few times, i'm not sure code post since i'm assuming code in appdelegate fine. , certificates/ plist/ provisional profile must set correctly since notification alert comes through time. so guess i'm wondering if there possible problems cause notifications work differently. if application.applicationstate != uiapplicationstate.background { // track app open here if launch push, unless // "content_available" used trigger background push (introduced in ios 7). // in case, skip tracking here avoid double counting app-open. let prebackgroundpush = !ap

meteor - How many times does Iron Router call subscriptions? -

i have multi-page application several routes. subscription each route implemented using "waiton", , works fine. i noticed when navigate different pages, subscription of previous route dropped. far, no problem. i implemented "waiton" call on router.configure level, particular subscription available pages. my question is: iron router make new call subscription each time switch pages? worry waste server resources. thank you. yes, when switch page previous subscription dropped, later when browse page meteor resubscribes. there community package in atmosphere caches subscriptions: https://github.com/meteorhacks/subs-manager

How to rewrite the javascript template string -

i'm trying modify code https://github.com/airblade/chartjs-ror/blob/master/vendor/assets/javascripts/chart.js i need rewrite original string template tooltiptemplate: "<%=datasetlabel%> - <%= value %>" , want add if else condition it. but template string complex how rewrite following logic ? my rough logic is if ( %value > 0) {%datasetlabel - %value} else { %datasetlabel - "empty value" } % means variable in above logic i guess can (untested code, idea): yourtemplate: "<%if (value > 0){%>" + "<%= datasetlabel - value %>" + "<%}%>" + "<%else {%>" + "<%= datasetlabel - \"empty value\"%>" + "<%}%>"

c++ - Exception when declaring multidimensional arrays

i'm new programming in general , i've run issue declaring 3d , 4d arrays. have several declarations @ start of main function, i've narrowed problem down these 4: string reg_perm_mark_name[64][64][64]; short reg_perm_mark_node_idex[64][64][64]; short reg_perm_mark_rot[64][64][64][4]; short reg_perm_mark_trans[64][64][64][3]; when run program these, "system.stackoverflowexception" in executable. prefer way allocate them dynamically, way have meant temporary anyway , i'm not sure how declare array pointers properly. the 4 elements i'm using in 4d array reg_perm_mark_trans, example, [node index][region index][marker index][xyz coordinates]. there's total of 35 multidimensional arrays being declared @ once. (most of them 1d , 2d) i'm not sure if helps. can show me how make these 4d arrays work or maybe how make them dynamically allocating pointers or vectors? descriptive please, i'm still learning. assuming simplicity siz

python - How to properly address a modified Django login form in the template files using crispy forms? -

i have modified django login form , have address in template file using long model {% crispy formname formname.helper %} . can't use short version ( {% crispy form %} ) because have differentiate between multiple forms. thing is, works normal forms, not modified django login form. code goes this: forms.py from crispy_forms.helper import formhelper django.contrib.auth.forms import authenticationform class loginform(authenticationform): def __init__(self, *args, **kwargs): super(loginform, self).__init__(*args, **kwargs) self.helper = formhelper() self.helper.form_class = 'login-form' self.helper.form_show_labels = false self.helper.layout = layout( field('username', placeholder="e-mail"), field('password', placeholder="password") ) self.helper.add_input(submit('submit', 'log in', css_class='btn-block btn-inset')) views

PHP - UserRole - Function - OOP -

i trying make own custom cms, can register users , can login aswel, trying make function user roles, file: class.user.php function getuserrole() { $username = htmlentities($_session['user_session']); $stmt = $this->db->prepare('select * users user_name = :username'); $stmt->bindparam(':user_name', $username); $stmt->execute(); $row = $stmt->fetch(pdo::fetch_assoc); $userrole = $row['user_role']; if($userrole == 3) { return $userrole = 3; } if($userrole == 2) { return $userrole = 2; } if($userrole == 1) { return $userrole = 1; } if($userrole == 0) { return $userrole = 0; } } file: home.php <?php $userrole = getuserrole(); if($userrole == 1) { echo "hi admin"; } else { echo "you not admin"; } ?> when try this, error shows up: fatal error: call undefined function getuse

c# - Impact of IEnumerable.ToList() -

i'm wondering goes on when calling .tolist() on ienumerable in c#. items copied new duplicated items on heap or new list refer original items on heap? i'm wondering because told me it's expensive call tolist, whereas if it's assigning existing objects new list, that's lightweight call. i've written fiddle https://dotnetfiddle.net/s7xic2 checking hashcode enough know? ienumerable doesn't have contain list of anything. can (and does) resolve each current item @ time requested. on other hand, ilist complete in-memory copy of items. so answer is... depends. backing ienumerable? if file system yes, calling .tolist can quite expensive. if in-memory list already, no, calling .tolist not terribly expensive. as example, lets created ienumerable generated , returned random number each time .next called. in case calling .tolist on ienumerable never return, , throw out of memory exception. however, ienumerable of database objects ha

python - Calculating speed using public GPS data -

i'm scraping web api displays latitude , longitude of bus. the web-service doesn't seems have fixed update time gps position, can take 1 second 30 seconds. when update takes long reasonable speeds (10km/h~80km/h), when update happens in less 10 seconds, unreal speeds, 1000 km/h. def haversine(lon1, lat1, lon2, lat2): """calculate distance between 2 points""" lon1, lat1, lon2, lat2 = map(radians, [lon1, lat1, lon2, lat2]) dlon = lon2 - lon1 dlat = lat2 - lat1 = sin(dlat/2)**2 + cos(lat1) * cos(lat2) * sin(dlon/2)**2 c = 2 * asin(sqrt(a)) r = 6371 # radius of earth in kilometers. use 3956 miles return c * r def get_speed(new_lat, new_lng, cur_time): old_lat, old_lng, old_time = buses[bus_prefix] if (new_lat, new_lng) != (old_lat, old_lng): distance = haversine(old_lng, old_lat, new_lng, new_lat) speed = distance / (cur_time - old_time) * 3600 _speed = "%.1f km/h" % s

javascript - detect certain value in style attribute and change it -

i thought following code work needs $("td[style='background-color: #ffbbbb']").css('background-color', '#333'); but problem facing each td has different values within style attribute instance: font-weight: normal;background-color:#ffbbbb; , code above doesn't seem execute since there multiple values. how can account this? essentially want change elements background color of #ffbbbb color. try utilizing attribute contains selector [name*="value"] $("td[style*=#ffbbbb]").css("background-color", "#333");

python - os.copystat fails on panfs when u+w not set on src, causing pip install to fail; where to report a bug? -

i'm doing pip install . , current working directory on panfs filesystem. when pip tries copy directory tree, including files in .git , fails due failure in os.setxattr : $ pip install . processing /home/users/gholl/checkouts/pyatmlab exception: traceback (most recent call last): file "/home/users/gholl/venv/stable-3.4/lib/python3.4/site-packages/pip/basecommand.py", line 223, in main status = self.run(options, args) file "/home/users/gholl/venv/stable-3.4/lib/python3.4/site-packages/pip/commands/install.py", line 280, in run requirement_set.prepare_files(finder) file "/home/users/gholl/venv/stable-3.4/lib/python3.4/site-packages/pip/req/req_set.py", line 317, in prepare_files functools.partial(self._prepare_file, finder)) file "/home/users/gholl/venv/stable-3.4/lib/python3.4/site-packages/pip/req/req_set.py", line 304, in _walk_req_to_install more_reqs = handler(req_to_install) file "/home/users/gholl/v

SQL Server - Select YEAR error -

currently using sql server 2008. in effort debug bad date data being processed, following code written example of bad data. select isdate('10-22-002') select year('10-22-002') running statements on database a, results are: '1' , '2002'. running statements on database b, results are: '1' , error. the date format mdy on sessions before running statements. msg 241, level 16, state 1 conversion failed when converting datetime character string. everything i'm able find says date format set @ either server or session level. there setting @ db level this? you need cast '10-22-002' datetime . select year(cast('10-22-002' datetime))

reactjs ensure parent child relationship -

suppose i've created 2 elements -- parent , child is there way ensure child element contained parent? want ensure dom looks -- <parent> <child /> </parent> and never <someotherelement> <child /> </someotherelement>

audioqueue - IOS reuse AudioQueueBuffer -

i have found in many examples of audioqueue, read audiofilepackets, , copy audiodata inbuffer in callback function. i want read audiodata buffers @ sometime before audioqueuestart, , repeat buffer continously without copying data, possible? after few minutes found audioqueue doesn't clear maudiodata field in inbuffer, question stupid. preload buffers , call audioqueueenqueuebuffer function

vba - Excel Macro for check mark to add a string at the end of an existing string for select cells in a row -

i'm wondering how can create, in vba, macro activex control checkmark add string @ end of existing string select cells in excel i have table of teachers associated classes teach, , want checkbox can select if they're bilingual. in event they're bilingual, adding string course name allows me use countif function find how many classes taught in each of 2 languages. thanks! you can need excel functions. first of activate de developer ribbon (rigth click on ribbon -> customize ribbon -> check developer tab). in developer tab, click on insert -> checkbox. put checkbox wherever want, right click on , select format control -> control, , set cell hold status of checkbox, in "cell link". cell hold values true/false, if() function can concatenate() suffix or whatever want.

Scala - arithmetic operations on params of type Any -

i looking define function takes 2 args of type , attempts add them, this: def plus(x:any,y:any):try[any] = { ... } yielding success if operands of types can added (arithmetically, not string concat or that), , failure if not. example: val x:any = 1 val y:any = 2 val z = plus(x,y) // z = success(3) or val x:any = "wrong" val y:any = 2 val z = plus(x,y) // z = failure(...) and, have type promotion work addition: int + int => int, int + double => double, etc. i know there must clever , terse way this, without having check every possible combination of types match. i'm pretty new (only week) scala appreciate suggestions. in samples know type of arguments @ compile time. in case can better job using type system: scala> def plus[t: numeric](a: t, b: t) = implicitly[numeric[t]].plus(a, b) plus: [t](a: t, b: t)(implicit evidence$1: numeric[t])t scala> plus(1, 2) res0: int = 3 scala> plus(1, 2.5) res1: double = 3.5 scala> plus

javascript - Hitting Linkedin API using Meteor JS -

i stuck @ point. want hit linkedin api (without using package) , profile information of user. so this, following these steps: 1. hit linkedin api authorization code 2. use auth code access token. 3. using access token profile info. so far, being able authorization code, not being able proceed further. here codes: these testing purpose doing on client. my template <template name="home"> <a href="#" class="calllinkedin">get profile linkedin</a> </template> my helpers var clientid='xxxxx'; var secret = 'xxxxx'; var redirecturi = 'http%3a%2f%2flocalhost%3a4000%2f_oauth%2flinkedin%3fclose'; var credentialtoken = "randomstring"; template.home.events({ 'click .calllinkedin':function(event,template){ var scope = []; var loginurl = 'https://www.linkedin.com/uas/oauth2/authorization' + '?response_type=code' + '&am

objective c - Data passing between two View Controller Swift IOS -

i have been making simple gpa calculation app. , takes user input lot of text fields , calculate , show result.i want show result in 2ndviewcontroller @ibaction func calculategpa(sender: anyobject){ //all calculation happen here //example let gpa:float = totalgici/totalgi } and want pass gpa 2ndviewcontroller label. did coding this override func prepareforsegue(segue: uistoryboardsegue, sender: anyobject?) { var resultviewcontroller : viewcontrollerresult = segue.destinationviewcontroller as! viewcontrollerresult resultviewcontroller.gparesultlabel = "\(gpa)" } then got error saying use of unresolved identifier gpa what can here? i tried removing @ibaction func calculategpa(sender: anyobject){ , replacing override func prepareforsegue(segue: uistoryboardsegue, sender: anyobject?) { because sender anyobject. got error unrecognized selector sent instance define variable globally var because variables declared let m

tsql - Not Getting Partition Elimination on a Foreign Key Join in SQL Server -

i have rather large fact table in sql server partitioned foreign key date dimension. foreign key constraint both enabled , trusted. when add clause: "f_clinicinvoicetransaction".servicedatekey>=40908 , "f_clinicinvoicetransaction".servicedatekey<42247 i partition elimination. when join on servicedatekey , filter on date range such: "d_calendar"."calendarkey" ="f_clinicinvoicetransaction"."servicedatekey" , "d_calendar".startdt>='2012-01-01' , "d_calendar".startdt<'2015-10-01' the partition elimination goes away. there way partition elimination based on join or stuck filtering explicitly on values in fact table? it easier answer these questions when give more details -- try , answer best can: perform sub-query 2nd filter ("d_calendar".startdt>='2012-01-01' , "d_calendar".startdt<'2015-10-01' ) , min , max v

ajax - Select2 4.0.0 can't select results -

Image
i'm trying use newest version of select2 query site's api , return multiple-select. it's fetching right data , it's formatting dropdown properly, combining 2 keys in returned objects "(a-123) john johnson", dropdown's not responding mouseover or clicks. i'm using select2.full.min.js , select2.min.css files. purposes of project, i'm including them in directory , accessing them through bundles in cshtml, instead of accessing them via cdn. html: <div> <select class="user-list" multiple="multiple" style="width: 100%"> </select> </div> at moment, it's looking this, how want it: not sure if relevant, when browse generated source code while searching, input looks fine, dropdown's code greyed out though hidden. per other suggestions i've found on here , elsewhere, i've tried few different solutions. found out how templateresult , templateselection supposed wor

ios - requestImageDataForAsset returns nil image data -

i've been stuck couple of days. i've bee trying image within call nil . these options used: let options = phimagerequestoptions() options.deliverymode = .highqualityformat options.resizemode = .none i tried options set nil without luck. data got in info value passed block. [phimageresultisincloudkey: 0, phimageresultdeliveredimageformatkey: 9999, phimagefileurlkey: file:///var/mobile/media/dcim/100apple/img_0052.jpg, phimageresultrequestidkey: 84, phimageresultisdegradedkey: 0, phimageresultwantedimageformatkey: 9999, phimageresultisplaceholderkey: 0, phimagefilesandboxextensiontokenkey: 64b47b046511a340c57aa1e3e6e07994c1a13853;00000000;00000000;0000001a;com.apple.app-sandbox.read;;00000000;00000000;0000000000000000;/private/var/mobile/media/dcim/100apple/img_0051.jpg] i tried using requestimageforasset , got same result. thought using requestimagedataforasset i'll more control on data. also, thought file exists in

python - Numpy array, indexing and convolving confusion -

i'm trying complete following function, have been running problems indexing, resulting in "valueerror: operands not broadcast shapes (0,9) (5)". i think error might coming how i'm trying call values ssd_difference[], i'm not entirely sure. also how go using convolve2d based on hint given below? understand numpy has function it, have no idea need put in make work. additional information: binomialfilter5() returns 5x1 numpy array of dtype float representing binomial filter. i'm assuming "weights[]" ssd_difference[] values. def transitiondifference(ssd_difference): """ compute transition costs between frames, taking dynamics account. instructions: 1. iterate through rows , columns of ssd difference, ignoring first 2 values , last 2 values. 1a. each value @ i, j, multiply binomial filter of length 5 (implemented later in code) weights starting 2 frames

indexing - Get index value of array -

trying simple hitting brick wall. i'm trying index value of item in array, i'm using coffeescript not plain javascript. code: for in ["the royal family", "residences", "history & tradition", "news", "events", "jobs"] createsubmenulayer(i, i.value) i've tried i.index, i.value, plain old (which gives me string). want index value position items based upon position in array. cheers. the for x in ... form of for loop iterates on values of array, not indexes. the documentation says: # fine 5 course dining. courses = ['greens', 'caviar', 'truffles', 'roast', 'cake'] menu + 1, dish dish, in courses # -------------------^^^^^^^ so you're looking this: for e, in [...] createsubmenulayer(i, e)

html - source an audio file in repo on github pages -

i'm hosting project on github pages , play audio file located in repository through html5 <audio> element. when source on dev environment, audio plays fine, when push gh-pages 404 console error cannot found. <audio ref='themesong' src="vendor/assets/music/tetris.mp3" autoplay loop></audio> error: get http://myname.github.io/vendor/assets/music/tetris.mp3 404 (not found) i've tried sourcing this: "vendor/assets/music/tetris.mp3" "/vendor/assets/music/tetris.mp3" "http://github.com/myname/myrepo/vendor/assets/music/tetris.mp3" "http://github.com/myname/myrepo/tree/master/vendor/assets/music/tetris.mp3" but nothing seems work. you can try , reference raw url https://raw.githubusercontent.com/myname/myrepo/master/vendor/assets/music/tetris.mp3 note: service rawgit.com mentions: when request file raw.githubusercontent.com or gist.githubusercontent.com , github serves (in

coding style - How could I indent C++ pragma using clang-format? -

i using vim-autoformat , uses clang-format external formatter. it seems clang-format won't indent c++ #pragma . example: #include <omp.h> #include <cstdio> int main() { #pragma omp parallel (int = 0; < 10; ++i) { puts("demo"); } return 0; } i have formatted : #include <omp.h> #include <cstdio> int main() { #pragma omp parallel (int = 0; < 10; ++i) { puts("demo"); } return 0; } i checked clangformat , didn't find option use. it's been late solution looking for. formats pragma along code block. https://github.com/medicineyeh/p-clang-format the main concept replacing string formatter uses "correct" rules on these pragmas. motivative example following. # replace "#pragma omp" "//#pragma omp" sed -i 's/#pragma omp/\/\/#pragma omp/g' ./main.c # format clang-format ./main.c # replace "// *#pragma omp" &

How can i save the facebook profile picture to my local folder using facebook graph api in codeigniter? -

i have sdk , facebook login working fine. getting user details without problem , problem profile picture. if geting user profile image use following function work me $this->save_profile_photo($socialuser['image']); function save_profile_photo($link) { if ($link) { $img = file_get_contents($link); $imagename = "/profile" . . '-' . date('y-m-d-h-i-s') . '.jpg'; $file = base_url(profile_image) . '/' . $imagename; file_put_contents($file, $img); } }

javascript - D3 Sunburst: Determine Leaf Color by Data and have its Parents Inherit that Color -

so new d3 visualizations , have run roadblock in learning. have pretty basic sunburst set running off data determines if test had "failure" or "success". failure or success represented outer ring of sunburst data's result. i'm trying change outer ring's color based on success or failure. example if test result success, color green , if failure turn red. feel there way i'm overlooking. also once color has been determined, want it's parent arcs, way innermost ring, "inherit" color , red have higher priority. if 1 group of test has failure in it, arc represents group red well. prtg's sunburst works in manner , cant find connection between 2 implement functionality. i'm using basic sunburst code d3's examples: define(function(require, exports, module) { var _ = require('underscore'); var simplesplunkview = require("splunkjs/mvc/simplesplunkview"); var nester = require("../underscore-n

open the docbar left side menu in the custom jsp page in liferay -

Image
i have requirement need add 1 link or button in docbar. custom jsp of portlet when click link or button should open docbar left menu.for example in docbar if click on edit page open left menu shown below.how achieve ? i have tried open left menu link form custom jsp page, not opened have included docabr.js in custom jsp page. can 1 guide me how achieve this? following code have tried: <script type="text/javascript" src="/html/js/liferay/dockbar.js"></script> <portlet:renderurl var="editlayouturl" windowstate="<%= liferaywindowstate.exclusive.tostring() %>"> <portlet:param name="struts_action" value="/dockbar/edit_layout_panel" /> <portlet:param name="closeredirect" value="<%= portalutil.getlayouturl(layout, themedisplay) %>" /> <portlet:param name="groupid" value="<%= string.valueof(scop

routes - Rails Routing - Reject any/all extensions? -

i want make request /session/update , return json response. have working right following route: get 'session/update', to: 'user_sessions#keep_alive' however, route allows requests have type of extension tacked on end of ( /session/update.txt , /session/update.abc123 , etc.). how can write route rejects request includes extension? want lock down responds /session/update . you can constraints below scope :format => true, :constraints => { :format => 'json' } 'session/update', to: 'user_sessions#keep_alive' end

android - How to add material design library switch in the action bar -

how insert com.gc.materialdesign.views.switch in actionbar using menuinflater ?? below code inflating android default switch. this oncreateoptionsmenu @override public boolean oncreateoptionsmenu(menu menu) { menuinflater inflater = getmenuinflater(); inflater.inflate(r.menu.menu_main, menu); menuitem item = menu.finditem(r.id.myswitch); switchbutton = (switch)item.getactionview(); } this menu_main.xml <menu xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@+id/myswitch" android:title="off/on" app:showasaction="always" app:actionlayout="@layout/switchlayout" app:actionviewclass="android.widget.switch" /> </menu> this switch layout <?xml version="1.0" encoding="utf-8"?&

c++ - Cross compilation "toolset" -

what cross-compilation "toolset" or "toolchain"? understand need cross-compiler when generating code platform, understood "toolset"? for example, when compiling boost libraries, there several toolsets, such "mingw", "gcc" or "msvc" - difference in compiled libs/dlls between these toolsets? cross-toolchain whole tool collection, containing cross-compiler itself, linker , other necessary tools, make templates , libraries link program with. optionally can contain debugger tools, gdb-server, buildscripts.

javascript - Apply .js file for required control only in mvc -

Image
i have 1 mvc application , created 1 form, in form use textbox datepicker , file input control pickup picture. browse button picture, i used js file file input <script src="~/scripts/jquery.min.js"></script> and used js file datepicker <script src="../../scripts/jquery-1.11.1.min.js"></script> now, problem datepicker used same jquery file different version. due datepicker js file , second js file overlapping.. , datepicker not working correctly. possible if above 1st mentioned js file apply input file tag , not other controls on same page....????

c# - Infragistics PanelToolWindow drops Ribbon Window Tab -

Image
the situation so have infragistics dockmanager inside of infragistics ribbon window. inside dock manager have number of separate user controls. of have ribbon tab items specific them. when content pane undocks dock manager , floats, it's tab removed ribbon. this happens because being spawned new window. when it's added new window, it's being removed main ribbon windows' visual tree. thus, removes it's ribbon because thinks it's gone. the proposed solution so overcome issue have decided best course of action restyle paneltoolwindow ribbon window display children controls' ribbons. the problem every time attempt restyle paneltoolwindow doesn't work. i'm not sure why it's not working , there practically 0 documentation regarding restyling window (please see links below documentation did find). the sample code i've tried few different solutions. maybe it's how implementing style. here basic template have used.

csv - Remove commas from end of line in text file with VBA -

i have written vba code output comma seperated data elements text file imported seperated application. however, stuck how remove end of line commas generated in text file. following example of data: scenario,capital,afe capital array,drilling capex 80/20,replace, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, capital array,facilities tangible,replace, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,250,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, capital array,recompletion 80/20,replace, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, the best solution not add trailing comma in first place. that, need modify code have not shown us. alternatively, if csv creation code black box not want touch, can manually remove last charac

c++ - Finding the upper bound of vector of pairs based on second value of pair -

i have vector of pair "v" sorted according second value of pair. want find out upper bound of vector "v" according second value of pair -- while finding upper bound want ignore first vector ( std::vector<int> ) of pair of vectors. int main () { std::vector<std::pair<std::vector<int>, int> > v; //10 10 10 20 20 20 30 30 std::vector<int> a; a.push_back(1); v.push_back(make_pair(a,10)); a.push_back(2); v.push_back(make_pair(a,10)); a.push_back(3); v.push_back(make_pair(a,10)); a.push_back(4); v.push_back(make_pair(a,20)); a.push_back(5); v.push_back(make_pair(a,20)); a.push_back(6); v.push_back(make_pair(a,20)); a.push_back(7); v.push_back(make_pair(a,30)); a.push_back(8); v.push_back(make_pair(a,30)); std::vector<std::pair<std::vector<int>, int> >::iterator low,up; std::vector<int> b; up= std::upper_bound (v.begin(), v.end(), make_pair(b,25)); std::cou

angularjs - Cannot access isolate scope of directive in Jasmine test -

i need access isolate scope of directive in order test functions contains. have tried solutions found so. problem in isolate scope of directive, because if don't set directive isolate scope, tests work fine. my directive looks this: angular.module('validators').directive('validatename', [function() { var directive = {}; directive.restrict = "a"; directive.require = 'ngmodel'; directive.scope = {}; directive.link = function(scope, element, attrs, ngmodel) { scope.checkifgoodcharactersonly = function(name) { if ( name.match(/[0-9!$%^&*@#()_+|~=`{}\[\]:";'<>?,.\/]/g) ) { return false; } else { return true; } }; }; return directive; }]); the testing set-up looks this: beforeeach(module('validators')); describe('directive: validatename', function () { var $scope, elem;

How to group by 3 columns -and- get a count in SQL Server? -

i'm trying create sql groups 3 columns , gets count of rows form grouped result. also, ordered highest count, first. i've created sqlfiddle me. table schema (simplified): create table [dbo].[foo] ( [fooid] [int] identity(1,1) not null, [createdon] [datetime] not null, [company] [varchar](20) not null, [productfirstname] [varchar](100) not null, [productlastname] [varchar](100) not null ) sample data: insert foo values ('2001-10-01t07:07:07', 'red', 'yummy', 'gummybear'); insert foo values ('2002-10-01t07:07:07', 'red', 'yummy', 'gummybear'); insert foo values ('2003-10-01t07:07:07', 'red', 'bannana', 'cake'); insert foo values ('2003-11-11t07:07:07', 'red', 'green', 'apples'); insert foo values ('2004-10-01t07:07:07', 'red', 'yummy', 'gummybear'); insert foo values ('2005-10-01t0

How to pass a variable from PHP to LESS? -

i use php (lessphp) compile less files css files on serverside. pass variable less file, color or language: compile('input.less?lang=en') and use variable in less @lang. is possible? if not, there workarounds? this built in feature of lessphp , here's documentation: http://leafo.net/lessphp/docs/#setting_variables_from_php

Why is `True is False == False`, False in Python? -

this question has answer here: why (1 in [1,0] == true) evaluate false? [duplicate] 1 answer why these statements work expected when brackets used: >>> (true false) == false true >>> true (false == false) true but returns false when there no brackets? >>> true false == false false based on python documentation operator precedence : note comparisons, membership tests, , identity tests, have same precedence , have left-to-right chaining feature described in comparisons section. so have chained statement following : >>> (true false) , (false==false) false you can assume central object shared between 2 operations , other objects (false in case). and note true comparisons, including membership tests , identity tests operations following operands : in, not in, is, not, <, <=, >, >=, !=, ==

c++ - std::iostream read or write with count zero and invalid buffer -

the following code reads file containing value represents length of more following data. auto file = std::ifstream(filename, std::ios::in | std::ios::binary); // datalen = read header field containing length of following data. std::vector<unsigned char> data; data.resize(datalen); file.read((char*)data.data(), datalen); it fails msvc 2013 compiler if datalen = 0 . causes abort message expression: invalid null pointer , because data.data() returns null pointer. this question suggests count of 0 valid std::basic_istream::read , third comment on question seems point out issue. is valid c++ pass invalid pointer std::basic_istream::read (or std::basic_ostream::write ) size of 0? seem logical me, because call should not touch buffer anyway. the obvious solution deal special case if clause, wondering if msvc wrong once again. here compiled example of clang running program fine: http://coliru.stacked-crooked.com/a/c036ec31abd80f22 here standard says std::basi