Posts

Showing posts from August, 2010

WebSphere Liberty CORS Feature Problems -

i trying use new cors feature in websphere liberty profile 8.5.5.9. think have set correctly, not working @ all, it's possible got configuration wrong. there nothing in log 1 way or other - no errors or informational messages. is there kind of trace turn on show me cors feature , possibly why it's not working? here our config: <cors domain="/talentplaybookservice/rest" allowedorigins="https://w3dev.somerslab.ibm.com/" allowedmethods="get, head, post, put" allowedheaders="referer, cache-control, pragma, accept, accept-language, accept-encoding, accept-charset, content-type, content-length, user-agent, authorization, passwd, x-update-nonce, x-shindig-st, x-ic-cre-request-origin, x-ic-cre-user, x-lconn-auth, accept*, content*" exposeheaders="content-type, last-modified, etag" allowcredentials="true" maxage="3600" /> the following trace setting activate cors logging: ...

Generating PWM using Scilab -

i using following codes in scilab generate pulse width modulation using vectorization method.but getting undesirable plot while varying number of cycles,timeperiod,percent.could 1 me in this? percent=input("enter percentage:"); timeperiod=input("enter time period:"); cycles=input("enter number of cycles:"); x=0:cycles*timeperiod; t=(percent/100)*timeperiod; n=0:0.01:cycles y(((n*timeperiod)< x) & (x<(n*timeperiod+t))) = 1; y(((n*timeperiod+t)< x)& (x<((n+1)*timeperiod))) = 0; plot(y,'b','linewidth',2) end i modified code , works. code slow due loop many many calls. (scilab , matlab optimated matrix operations. weaken in loops. reduced number of calls number of cycles. percent=input("enter percentage:"); timeperiod=input("enter time period:"); cycles=input("enter number of cycles:"); ts = 0.01; // sample time x=ts:ts:cycles*timeperiod; on = ones(1, percent/100...

javascript - How can I avoid flickering when image is changed for another with MouseEvent? -

i have clickable image (logo) want defined in html (not css) since it's logo sits in menu, should scaled text , semantic part of content. i want change on hover so: <img src="logo.svg" onmouseover="this.src='logo_hover.svg'" onmouseout="this.src='logo.svg'"> the problem menu , logo flickers when hover image. doesn't happen seems have takes blink new image scaled right. have width: 100% on logo , width: 5em set on div holds it. how can avoid flickering? should set both width , height on image, if how find out height image should have? or there other way avoid browser being "surprised" when new image loaded? what i've triend far: i've tried preload image javascript, , <link rel='prefetch'> tag, flickering still happens. based on looks you're trying do, advise against approach can manipulate properties of svg using css hover state. what changing on logo ...

scala - Spark ClosedChannelException exception during parquet write -

we have massive legacy sql table need extract data out of , pushing s3. below how i'm querying portion of data , writing output. def writetableinparts(tablename: string, numidsperparquet: long, numpartitionsatatime: int, startfrom : long = -1, endto : long = -1, fileprefix : string = s3prefix) = { val minid : long = if (startfrom > 0) startfrom else findmincol(tablename, "id") val maxid : long = if (endto > 0) endto else findmaxcol(tablename, "id") (minid until maxid numidsperparquet).tolist.sliding(numpartitionsatatime, numpartitionsatatime).tolist.foreach(list => { list.map(start => { val end = math.min(start + numidsperparquet, maxid) sqlcontext.read.jdbc(mysqlconstr, s"(select * $tablename id >= ${start} , id < ${end}) tmptable", map[string, string]()) }).reduce((left, right) => { left.unionall(right) }) .write .pa...

sql - Syntax for WHERE clause with AND/OR? -

i'm working on simple query pull list of patients @ clinic either have diagnosis or have had procedure done. diagnosis , procedure codes separate fields; patients diagnosis might not have had procedure done, , patients have had procedure might not have diagnosis, still need patients have had 1 or other. here's query i've got: select patientid, patientname, dateofbirth visit visitstatus = 'complete' , (diagnosiscode in ('abc','def','ghi') or procedurecode in ('123','456','789')) and yes, both code fields have varchar data type because codes use both letters , numbers. this simplified version of where clause, since have upwards of 60 diagnosis codes , 30 procedure codes. wanted make sure syntax right. query taking absolutely forever run, don't know if that's because there's lot of data sift through or if there's issue syntax has gotten stuck in similar infinite loop. don't have syntax...

c - Use sscanf for regex purpose -

i have string str , if str composed of pure digits, extract digits int , if not, extract nothing or 0. for example, str = "12345"; // composed of pure digits, extract 12345 str = "123abc"; // not pure digits, extract nothing or 0 can using sscanf ? how? int value; char unused; if (1 == sscanf(mystring, "%d%c", &value, &unused)) { // success } else { // bad input }

search from the first letter of first name or last name in PHP and MYSQL -

i need search first name or last name beginning of characters. example, firstname michael , lastname jordan. if search "dan" or "hae" words, shouldn't return result. if search "mic" or "jor", should return firstname , lastname together. there way mysql ? my following code not return expect. select * users (firstname '%$searchword%' or lastname '%$searchword%') if want search beginning of word have place wildcards @ end of condition: select * `users` (`firstname` '$searchword%' or `lastname` '$searchword%')

Scala Queue implementation that is parallel/thread safe? -

i have implementation of linked queue in scala, not parallel-safe. i'm not sure changes need make make implementation parallel-safe…any suggestions? class linkedqueue[a] extends queue[a] { private class node (var data:a, var next:node) private var head:node = null private var last:node = null def isempty():boolean = head == null def peek():a = { assert(head != null) head.data } def dequeue():a = { assert(head != null) val ret = head.data head = head.next if(head == null) last = head ret } def enqueue(elem:a) { if(last == null) { head = new node(elem, null) last = head } else { last.next = new node(elem, null) last = last.next } } }

Can Twilio send sms to google Project fi phones? Anyone has used it? -

we using twilio api send sms. can add phone project fi phone numbers? can twilio send sms project fi phones? has has experience in doing this? you should able send sms projectfi users. if using short code can long number isn't voip number. can use lookups api determine kind of number user has before sending avoid sending voip numbers.

ios - AVAudioSession Changing Category Freezing AVCapture Screen -

we want continue playing music other apps while capture video our ios app. our code modeled solution question linked below, setting audio session when go , out of our capture screen. how make avcapturesession , avplayer respect avaudiosessioncategoryambient? the issue app freezes lot when going 1 of our views avplayer -> capture , refuses capture, occurs on iphone 5s. confirmed works correctly on both 4s , 6s. is there else missing might need added working? investigating possibility of avplayer sticking around long , being why our app's capture screen stops functioning correctly when switching it. the primary issue here making sure paused running video before switching audio session, changing session, start video capture. order wasn't guaranteed before in our flow.

sublimetext2 - Saving .h file in /usr/include -

i wrote own .h file want able include in of future projects. thus, saved .h file in /usr/include directory , have been able compile c++ projects fine. however, when try make changes .h file in text editor (sublime, gedit) unable save. assume because text editors not have sudo root privileges enabled default. how can go saving changes .h file text editor? thanks help! you should not save own project files in /usr/lib/include reversed linux distribution installed include files only. instead, pass option gcc compiler tell find include files own project. own project folder , home folder, no sudo priviledges needed.

java - How does spring MVC do form validation (using hibernate) -

i following tutorial, showed how build using spring mvc framework simple form can validated. we created function annotated using requestmapping added @valid annotation first argument of function along side @modelattribute annotation. let's call first argument type classa . now in classa annotated of properties hibernate validation annotations (e.g. @notnull , @pattern , etc...) what trying understand how working? i checked code @interface notnull example , nothing. i assuming spring mvc framework, uses reflection detect first argument of requestmapping function annotated using valid , when form submitted calls something validate classa properties. where something ? in hibernate? code please... how did spring figure out call hibernate code, added hibernate jars project @ no point told spring use them. also, specification binds spring mvc hibernate? can simple terms , using high level (and references of code if possible) explain me how things work...

onJsAlert of android similar in ios -

below code of android , want same thing in ios(objective-c) private class mywebchromeclient extends webchromeclient { //display alert message in web view @override public boolean onjsalert(webview view, string url, string message, jsresult result) { new alertdialog.builder(view.getcontext()) .setmessage(message).setcancelable(true).show(); result.confirm(); return true; } }

asp.net - Converting C# DateTime to T-SQL Time in SelectCommand -

i'm trying return query (in gridview in asp.net) time >= datetime.now.add(-60). where clause has been giving me no end of difficulties. datetime pasttime = datetime.now.add(-60); ds_db.selectcommand = "select * [vpurchasetotals] [timeoftransaction] >= " + pasttime; my issue getting pasttime convert properly, returns newer data. [timeoftransaction] time(7) data type in table. how parse c#'s datetime sql server's time ? here, try this: using(sqlconnection conn = new sqlconnection(yourconnectionstring)) { datetime pasttime = datetime.now.add(-60); ds_db.selectcommand = @"select * [vpurchasetotals] [timeoftransaction] >= @pasttime"; sqlcommand cm = conn.createcommand(); cm.commandtext = ds_db.selectcommand; cm.parameters.add("@pasttime", sqldbtype.time).value = pasttime.timeofday; //for comparison tsql time type try { conn.open(); // ...

recursion - Recursive regex to check if string length is a power of 3? -

i'm attempting create regex pattern match strings containing periods (.) length power of 3. manually repeat length checks against powers of 3 until length no longer feasible, prefer short pattern. i wrote python method explain want do: #n = length def check(n): if n == 1: return true elif n / 3 != n / 3.0: return false else: return check(n / 3) to clarify, regex should match . , ... , ......... , ........................... , (length 1, 3, 9, 27) etc. i've read on regex recursion , making use of (?r) haven't been able put works correctly. is possible? it can done using regex (handles character, not period): def length_power_three(string): regex = r"." while true: match = re.match(regex, string) if not match: return false if match.group(0) == string: return true regex = r"(?:" + regex + r"){3}" but understand want...

Python factory pattern implementation with metaclass -

i have issues trying implement easy use abstract factory. goal to able define concrete factories way : class myconcretefactory( ... ): @classmethod def __load(cls, key): obj = ... # loading instructions here return obj to able use concretre factories way obj = myconcretefactory[key] my attempt i tried define metaclass factories wich override bracket operator , encapsulate factory pattern : class __factorymeta(type): __ressources = {} @classmethod def __getitem__(cls, key): if key not in cls.__ressources: cls.__ressources[key] = cls.__load(key) return cls.__ressources[key] @classmethod def __load(cls, key): raise notimplementederror class concretefactory(metaclass=__factorymeta): @classmethod def __load(cls, key): return "toto" = concretefactory["mykey"] print(a) issue this failed because __load method called 1 metaclass , not 1 concrete cla...

java - FileSystemNotFoundException: Provider "jndi" not installed -

i have jsp code i'm trying run read lines .java file. directory tree looks this: | webcontent - | resources - - | foobar.java (the file need read it's lines) - jspfile.jsp (where i'm running code) my code: string.join("\n", (string[])files.readalllines(paths.get(getservletcontext().getresource("/resources/foobar.java").touri()), charset.defaultcharset()).toarray()); whenever try run error: java.nio.file.filesystemnotfoundexception: provider "jndi" not installed java.nio.file.paths.get(unknown source) i have no idea means , i'd love help thanks all, wound using code: public string readresource(string resource){ try{ bufferedreader in = new bufferedreader(new inputstreamreader(getservletcontext().getresourceasstream("/resources/"+resource))); string line = null; string data = ""; while((line = in.readline()) != null) { if(data!=...

javascript - How to get Angular to toggle on a button and toggle off the other? -

really simple objective cannot seem work. have 2 toggles (using ionic css) represent 2 modes. 1 mode can on @ time, when toggle 1 on, other should turn off (visually , in code). i have binded toggles ng-model , ng-click , not working. toggles like: <input type="checkbox" ng-click='turnonac(true)' ng-model='ac'> <input type="checkbox" ng-click='turnonfan(true)' ng-model='fan'> so when turnonac(true) called, should set $scope.ac = true , $scope.fan = false . $scope.turnonac = function(bool){ if(bool == true){ $scope.fan = false; $scope.ac = true; } }; it must silly forgetting, blind it! me out? http://jsfiddle.net/dvtofn6l/59/ you didn't inject $scope in controller function. should inject $scope , should working fine. app.controller('navcontroller', function ($scope) { and if don't use this in controller may no need use controller as so use <div cl...

javascript - Binding dynamic checkbox in angular.js -

i have list of options pulled database via json based on product selection in angular.js here's sample code: <ion-checkbox ng-repeat="extra in extras" ng-model="order.extras" checklist-value="{{ extra.id }}"><strong>{{ extra.name }}</strong></ion-checkbox> i want user able select multiple extras can't seem able bind these selections. i think work ng-model="order.extras[extra.id]" can track checked extras in order.extras . please have @ demo below or @ jsfiddle . angular.module('demoapp', ['ionic']) .controller('maincontroller', maincontroller); function maincontroller($scope) { $scope.order = {}; $scope.extras = [ { id: 0, name: 'first' }, { id: 1, name: 'second' }, { id: 2, name: 'third' } ] } <link href="ht...

perl - How to make Time::Piece respect DST when converting localtime to UTC? -

i want convert timestamp localtime gmt. have legacy code "manually" time::local::timelocal() , gmtime . works, don't , wanted use time::piece instead. used this answer (albeit converting other way round, able replace + - :-)). this code: #!/usr/bin/env perl use strict; use warnings; use time::local; use time::piece; use posix qw(strftime); sub local_to_utc_timelocal { $local_ts = shift; ( $year, $mon, $mday, $hour, $min, $sec ) = ( $local_ts =~ /(\d\d)-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d)/ ); $local_secs = time::local::timelocal( $sec, $min, $hour, $mday, $mon - 1, $year ); return posix::strftime( '%y-%m-%d %h:%m:%s', gmtime($local_secs) ); } sub local_to_utc_timepiece { $local_ts = shift; $local_tp = time::piece->strptime( $local_ts, '%y-%m-%d %h:%m:%s' ); $utc_tp = $local_tp - localtime->tzoffset(); # *** return $utc_tp->strftime('%y-%m-%d %h:%m:%s'); } $local; # dst in effect (a...

android - Reload fragment/activity (or recyclerview) from adaptater -

i have simple app fragment , activity hosting recyclerview, vith data fom database, have delete function, can't refresh recycler view, tried method because longclick cardview on adapter, can't make work this adapter: public class loyaltycardrvadapter extends recyclerview.adapter<loyaltycardrvadapter.cardviewholder> { ... public loyaltycardrvadapter(context context, arraylist<loyaltycardobject> cards) { this.context = context; this.cards = cards; } public void setdata(arraylist<loyaltycardobject> cards) { this.cards = cards; } @override public int getitemcount() { return cards.size(); } @override public void onbindviewholder(cardviewholder holder, int position) { loyaltycardobject card = cards.get(position); holder.marque.settext(card.getmarque()); ... } @override public cardviewholder oncreateviewholder(viewgroup parent, int viewtype) { view view = layoutinflater.from(parent.getcontext()).inflate(r.layout.loyaltyc...

c# - Autosize to only some controls -

Image
i'm working on wpf gui, , want window auto-size content, not everything: have various buttons & other controls, , want autosize width that. if add long item list box, want window stay same size. example code: <window x:class="quickiewpf.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" title="mainwindow" sizetocontent="widthandheight" resizemode="canminimize"> <grid> <grid.rowdefinitions> <rowdefinition/> <rowdefinition/> </grid.rowdefinitions> <stackpanel orientation="horizontal"> <button width="100" content="foo" click="button_click"/> <button width="100" content="bar" click="button_click"/> <...

How to debug "ArrayIndexOutOfBoundsException: 0" in Processing -

i'm trying make kim asendorf's pixel sorting code work input webcam in processing. i error: "arrayindexoutofboundsexception: 0". ideas of how can fix this? //black int getfirstnotblacky(int _x, int _y) { int x = _x; int y = _y; color c; if (y < height) { while ( (c = cam.pixels[x + y * cam.width]) < blackvalue) { y++; if (y >= height) return -1; } import processing.video.*; capture cam; string[] cameras = capture.list(); int mode = 0; //mode: //0 -> black //1 -> bright //2 -> white //b(16777216) int loops = 1; int blackvalue = -10000000; int brigthnessvalue = 60; int whitevalue = -6000000; int row = 0; int column = boolean saved = false; void setup() { size(640, 480); import processing.video.*; string[] cameras = capture.list(); import processing.video.*; if (cameras.length == 0) { println("there no cameras available capture."); exit(); } else { println("available cameras:"); ...

xml - Running test inside testng suite in specific order -

i want run tests inside testng in specific order. possible? for example here testng.xml file. want run chrome test first , firefox. dont want them run parallel. how that? <?xml version="1.0" encoding="utf-8"?> <!doctype suite system "http://testng.org/testng-1.0.dtd"> <suite name="mycompany.myapp.local" parallel="none"> <test name="test module in chrome"> <parameter name="selenium.browser" value="chrome" /> <parameter name="wheretorun" value="local" /> <parameter name="chrome.driver.path" value="/path/to/chromedriver" /> <classes> <class name="com.mycompany.testclass"> <methods> <include name="navigatetouserpage" /> <include name="createuser" /> <include name=...

Revert subset of changes from git branch -

i have 2 different git branches: master , experimental . both branches have own changes , commits. in experimental branch tried out various different things (through different files , commits). now, want revert changes in experimental branch , keep 1 feature. want keep (pruned) experimental branch , keep working on until ready merged master . so far, did diff between 2 branches (to see changes) , did ''git checkout master'' on files in experimental wanted revert master . is there more efficient way? what simplest way revert changes in few files in experimental branch master ? what simplest way revert changes in few files in experimental branch master? create new branch master , , checkout experimental few files want: git checkout -b exp2 master git checkout experimental -- path/to/file/or/dir at point, on new branch exp2 , identical master , except few specific files/dirs checkout experimental .

php - SQL Query which helps me to get me no of "y"s in a column -

i want show how many "y"s there in date i wonder whether there thing :( i want display numner of "y"s in 2013.01.01 column <?php $link = mysql_connect("localhost", "", ""); mysql_select_db("", $link); $result = mysql_query("select * attendance date = '2013.01.01'", $link); $num_rows = mysql_num_rows($result); echo "$num_rows"; ?> my table (attendance) date pt17 pt18 pt19 pt20 pt21 pt22 pt23 pt24 2013.01.01 y n y n y y n 2013.01.02 n n y y y y n 2013.01.03 n y n y n y n n ...... desire output: no. of presents on 2013.01.01 4 your base sql query is select coalesce((pt17 = 'y'), 0) +coalesce((pt18 = 'y'), 0) +coalesce((pt19 = 'y'), 0) +coalesce((pt20 =...

c# - How to reset initial install directory of 2015 after using a custom install directory? -

problem: after installing visual studio 2015 community partition (f:), visual studio not recognizing assemblies installed. how reset installation install default c:\ location gac assemblies working properly? after research , many uninstalls , frustration, had use following tool check visual studio versions installed in registry. in order use tool, had follow instructions listed here allowing powershell run scripts. http://www.howtogeek.com/106273/how-to-allow-the-execution-of-powershell-scripts-on-windows-7/ i had run following tool check versions of vs installed. https://blogs.msdn.microsoft.com/heaths/2015/07/14/how-to-install-visual-studio-to-another-directory-when-a-pre-release-is-installed/ i extremely satisfied when able complete installation in default c:\ location. process: run powershell under context of admin (listed in order): set-executionpolicy unrestricted get-msicomponentinfo '{777cbcac-12ab-4a57-a753-4a7d23b484d3}' | get-msiprodu...

vb.net - VB .Net WPF Binding 2 controls to dictionary -

i have been trying head round binding in wpf forms , lost in this. i'm trying binding in vb .net code. have interface: implements inotifypropertychanged and if have dictionary: public property mydict new dictionary(of string, string) which fill key-value bunch of data, populate combobox on wpf window key. far using following: mycombo.itemssource = mydict mycombo.displaymemberpath = "key" then i'm trying link combobox textblock, combobox shows key , textblock shows value. there lots of these combobox-textbox combinations, can't hard code or have in xaml. last thing tried following: dim abinding new binding("value") abinding.source = mydict mytextblock.setbinding(textblock.textproperty, abinding) this shows textblock have first value in dictionary, doesn't alter combobox. i've tried binding combobox in same manner , new binding variable, has effect of blanking combobox, cannot seem working. apologies if really, simple problem,...

subquery runs really slow SQL Server -

the following query runs quick without ttfj_wtd , ttfj_mtd subqueries. without added in, run 5+ minutes. ideas on how tune it? select eid, tech_id, tech_name, w_start, w_end, m_start, m_end ,(select firstname+' '+lastname ems_nyc_employee eid=a.supeid) supname ,(select firstname+' '+lastname ems_nyc_employee eid=a.mngreid) mngrname ,activitydate ,shift_start+' - '+shift_end [shift] ,shift_start_time ,login_time ,first_ip_time ,datediff(mi, shift_start_time, first_ip_time) ttfj_yest ,(select avg(datediff(mi, shift_start_time, first_ip_time)) arr_tech a2 a2.eid=a.eid , a2.activitydate between w_start , w_end) ttfj_wtd ,(select avg(datediff(mi, shift_start_time, first_ip_time)) arr_tech a2 a2.eid=a.eid , a2.activitydate between m_start , m_end) ttfj_mtd arr_tech a, dates d d.rep_date=convert(date, getdate()-1) , a.activitydate=convert(date, getdate()-1) this code fixed wee bit readability: select eid, tech_id, tech_name, w_start, w_end, m_star...

oracle - ora-24033 : no recipent for message has been detected in FND_USER_RESP_GROUPS_API.UPDATE_ASSIGNMENT -

i using oracle e-business suite r12.1 , 11g database version. error encountered when trying create or modify user or responsibility: ora-24033 : no recipent message has been detected in fnd_user_resp_groups_api.update_assignment my workaround: have followed oracle metalink doc (doc id 358151.1)to fix error. whenever try first step (dropping existing subscriper), gives error: error @ line 1: ora-04020: deadlock detected while trying lock object 30x0c2abe5980x0c798b3f80x0d9ca49d8 ora-06512: @ "sys.dbms_aqadm_sys", line 7541 ora-06512: @ "sys.dbms_aqadm", line 441 ora-06512: @ line 5 so, have fix ora-04020 can later able recreate existing subscriper (by dropping the existing 1 ,then adding new one). i tried bounce applications , database. i compiled apps schema. i tried find out lock , schema blocking other can kill session: sql> select c.owner, c.object_name, c.object_type, b.sid, b.serial#, b.status, b.osuser, ...

mergesort - Merge Sort Iterative Implementation - Not working -

i have below merge sort iterative implementation, somehow, not working. debugged it, couldn't find cause. merge'ing function remain same recursive case, array dividing logic different, if i'm correct. please rectify, if i'm going in wrong direction. i think have problem when try use same object represent different intervals: @ mergesort_iterative loop , when adding new elements list1 using "info" object temporal variable , add list1 collection. in java, object variables references when add object collection not adding copy of reference being modified , inserted again. info.left = left; info.right = mid; list1.add(info); info.left = mid + 1; info.right = right; list1.add(info); to fix should create 2 objects in order 2 perform inserctions: info = new mergeposinfo(); info.left = left; info.right = mid; list1.add(info); info = new mergeposinfo(); info.left = mid + 1; info.right = right; list1.add(info); on other hand, once problem de...

c# - linq query that selects any object in the model -

edit understand trying give example suppose used entity framework generate multiple tables. have mydbentities objects (client, user, product, singer [attributes don't matter]). create method. method gets object parameter + mydbentities. object client, user, product, singer. in method have query given object return list of object. trying create method still trying either linq or sql in vain far update tried this, works, not way want to. understand me check code below. viewbag.ok = libmethods.get_all(mydbentities, "client"); //params = entity & string this how can method below method public static object get_all (mydbentitiesce, string given_entity_type) { if (given_entity_type.equals("client")) { var get_all = clt in ce.client select clt; return get_all.tolist().first(); } else if (given_entity_type.equals("product")) { var get_all...

javascript - How can I monitor Backbone ajax requests? -

i thought easy b.c. backbone uses jquery , has single access point thought this: backbone.ajax = function() { var xhr = backbone.$.ajax.apply(backbone.$, arguments); // xhr.addeventlistener("loadend", loadend); return xhr; }; but reason can not load event listener xhr object do. i error stating addeventlistener not function. see jqxhr : the jquery xmlhttprequest (jqxhr) object returned $.ajax() of jquery 1.5 superset of browser's native xmlhttprequest object. it not native xmlhttprequest, might not behave native one. there no guarantee exposes methods addeventlistener unless it's documented. if want set globally it's safer use jquery.ajaxsetup

c# - Telerik Rad Customized Theme using RadSkinManager -

i need create theme using telerik rad controls new client. there 2 ways can it. create , register telerik rad control custom skin manually create , embed telerik rad control custom skin assembly in existing application have few in-build telerik themes , populated using radskinmanager shown below. how can keep themes in radskinmanager drop down , add new customized theme client looking for? <telerik:radskinmanager id="radskinmanager" runat="server" showchooser="true" visible="false" persistencemode="session"> </telerik:radskinmanager> in order able list custom theme along side telerik themes required follow below steps. build custom theme using 1 of options listed under creating custom skin . made use of visual style builder tool create theme named metrored based on existing telerik theme , downloaded theme files. build custom skin dll skin assembly builder using custom theme files per steps outl...

javascript - How do I display a randomly generated list in columns with CSS? -

trying determine how display following randomly generated list in columns? code below generates vertical display of quotes. the goal able display quotes in rows of 4, not vertically. how this? current js: var my_res = _.sample([ 'quote 1', 'quote 2', 'quote 3', 'quote 4', 'quote 5', 'quote 6' ], 5); var arr_len = my_res.length; var targ = document.getelementbyid('i_need_quotes_within_this'); for(i=0; i<arr_len; i++){ targ.innerhtml += "<q class=\"style\">"+my_res[i]+"</q><br/>" } current css: .style{ color: rgb 0, 0, 255; background-color: firebrick; font-size: 12px; display: block; border: 1px solid green ; width: 300px; height: 100px; } instead of applying style class each quote. apply div containing of those. css: .style{ color: rgb 0, 0, 255; background-color: firebrick; ...

ubuntu 14.04 - Issue with using wildcards in php glob() -

i have strange situation happening php glob() , wondered if has encountered it. problem may broad here, trying anyway. i'm running following: distributor id: ubuntu description: ubuntu 14.04.4 lts release: 14.04 codename: trusty php 5.6.20-1+deb.sury.org~trusty+1 (cli) copyright (c) 1997-2016 php group zend engine v2.6.0, copyright (c) 1998-2016 zend technologies zend opcache v7.0.6-dev, copyright (c) 1999-2016, zend technologies xdebug v2.3.3, copyright (c) 2002-2015, derick rethans my glob function working before using: $images = glob($path . '/' . $id .'.*'); then stopped working. i've not changed on server or in other code. these different things i've tried see happen $images = glob($path . '/' . $id . '.{jpg,jpeg,png,gif}', glob_brace); //works $images = glob($path . '/*.jpg'); // doesn't work $images = glob($path . '/*'); // doesn't work basically, anytime use wildcard, no mat...

export cochrane.orcutt test from R to LaTex -

hi try export output of cochrane.orcutt test fro r latex. output looks this: $cochrane.orcutt call: lm(formula = yb ~ xb - 1) residuals: min 1q median 3q max -0.010742 -0.003844 -0.000546 0.002324 0.037165 coefficients: estimate std. error t value pr(>|t|) xb(intercept) 0.0399230 0.0011903 33.542 <2e-16 *** xbl(media, 6) -0.0004572 0.0008494 -0.538 0.591 xbl(endog1, 0) 0.0558362 0.0016637 33.562 <2e-16 *** --- signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 residual standard error: 0.005789 on 230 degrees of freedom multiple r-squared: 0.9911, adjusted r-squared: 0.991 f-statistic: 8540 on 3 , 230 df, p-value: < 2.2e-16 $rho [1] 0.1608004 $number.interaction [1] 3 if try using tidy function broom, r sais : "no tidying method recognized list " can in case? thnx try this: library(xtable) xtable(reg2$cochrane.orcutt$coefficients) % latex tabl...

explain bash variable assignement output -

can explain me why vbb:~ me$ test="zut"; echo $test; echo $test > test2; echo "echo test " $test2 output : zut echo test vbb:~ me$ and not zut echo test zut vbb:~ me$ because echo $test > test2 writes output file named test2. this set of commands expect: test="zut"; echo $test; test2=$test; echo "echo test " $test2

javascript - JS: Bug converting string to Date -

i converting data object json , json.stringify , json.parse . this works great, on devices on samsung galaxy sii line: console.log(jsonobj.gebdat+"::"+new date(jsonobj.gebdat)); i output: 1973-07-01t10:49:25.134z::invalid date i implementing @ this answer , , works devices, doing wrong?? update to clarify question. create string calling var stringtosave = json.stringify({gebdat: dataclass.gebdat, <here more variables>}); then save it. later, load string , parse with var jsonobj = json.parse(stringtosave); then, try set date again (calling log before line) with console.log(jsonobj.gebdat+"::"+new date(jsonobj.gebdat)); this.gebdat = new date(jsonobj.gebdat); the log gives me invalid date shown above, , when represent date displays nan.nan.nan instead of expected 01.07.1973 1.date string formats implementation dependent. recommended use timestamps when save dates. var timestamp = date.parse( new date() );//13726759...

Android have button on keyboard that switches custom keyboard to user specified default keyboard -

i have custom keyboard in android. want have button on keyboard when pressed hide keyboard , show keyboard user has specified default keyboard. (if worst comes worst, accept solution shows default android keyboard not specified user). i tried code: private void showsoftkeyboard() { inputmethodmanager imm = (inputmethodmanager) getsystemservice(context.input_method_service); imm.togglesoftinput(inputmethodmanager.show_forced,inputmethodmanager.hide_implicit_only); } but did nothing. what should do? edit one: i documenting progress in figuring out. so far have figured out how default user set keyboard: string currentkeyboard = settings.secure.getstring(getcontentresolver(), settings.secure.default_input_method); based off of post: how detect if user's keyboard swype? i believe there method in inputmethodmanager class allows set inputmethod. believe true due post: android: switch different ime programmatically now have figure out how figure out ho...

I got some errors when I create an header listview on xamarin android -

public class customadapter : baseadapter{ private const int type_item = 0; private const int type_separator = 1; private list<string> mdata; private treeset sectionheader; private layoutinflater minflater; public customadapter(context context) { minflater = (layoutinflater) context .getsystemservice(context.layoutinflaterservice); } public void additem( string item) { mdata.add(item); notifydatasetchanged(); } public void addsectionheaderitem(string item) { mdata.add(item); sectionheader.add(mdata.count - 1); notifydatasetchanged(); } public int getitemviewtype(int position) { return sectionheader.contains(position) ? type_separator : type_item; } public int getviewtypecount { get{ return 2; } } public override int count { get {return mdata.count;} } public override getitem this[int position] { get{ return mdata [position]; } } public override long getitemid(int posi...

sql server - Transpose and insert subquery into outer query (SQL, select) -

through subquery i'm trying insert values , categories columns of outer query. this makes more complex simple tranpose. column header of 'origin' column needs inserted value of column , value of 'origin' column goes yet column such: cywp name qty pr2 201607 m3 618400 0 201607 r1 329400 0 201607 m1 100056 0 201607 m2 20800 0 201607 r2 878921 113884 becomes: cywp name qty 201607 m3 618400 201607 r1 329400 201607 m1 100056 201607 m2 20800 201607 r2 878921 201607 pr2 113884 the code have far; select p.cuttingyearweekplanned, ps.name, sum(case when p.productionstateidto = 2 or p.productionstateidto =101 ( case when p.quantityplannedadjusted > 0 p.quantityplannedadjusted else p.quantityplanned end) else ( case when p.quantityplannedadjusted > 0 ceiling(convert(deci...

html - why doesn't block <a> within <li> accept color set in css file? -

i trying understand how change color of "a" tags within "li" elements. have following unordered list: <nav class="navbar navbar-default navbar-fixed-top"> ... <ul class="nav navbar-nav navbar-left"> <li><a href="#">about</a></li> <li><a href="#">blog</a></li> <li><a href="#">contact</a></li> </ul> ... </nav> why following work: .navbar-default .navbar-nav li { color: #333333; } .navbar-default .navbar-nav li a:hover { color: #ec5216; } but not: li { color: #333333; } li:hover { color: #ec5216; } nor: a { color: #333333; } a:hover { color: #ec5216; } i have read this post , still unclear. ahead of time answers! that because .navbar-default .navbar-nav li { color: #333333; } .navbar-default .navbar-nav li a:hover { color: #ec5216; } has more weight , more ...

ios - TableView + CoreData : Add and Refresh -

everyone i'm using coredata in ios application : problem add element need once , refuse add other element. , show me error : reason: '* -[__nsarraym objectatindex:]: index 3 beyond bounds [0 .. 2]** how can make table view update self , show me last results. can 1 check me code - (nsinteger)numberofsectionsintableview:(uitableview *)tableview{ return 1; } - (nsinteger)tableview:(uitableview *)tableview numberofrowsinsection: (nsinteger)section { //return 3; return _affichdata1.count; } - (uitableviewcell*)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { uitableviewcell* mycell=[tableview dequeuereusablecellwithidentifier:@"cellh" forindexpath:indexpath]; planificateur1 *p1=[_affichdata1 objectatindex:indexpath.row]; mycell.textlabel.text = p1.heuredep[indexpath.row]; return mycell; }

python - my code sleep on response.read() function, sometimes -

for index in range(1,10): send_headers = { 'user-agent':'mozilla/5.0 (windows nt 6.2;rv:16.0) gecko/20100101 firefox/16.0', 'accept':'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'connection':'keep-alive' } try: req=urllib2.request(url,headers=send_headers) response=urllib2.urlopen(req) sleeptime=random.randint(1,30*index) time.sleep(sleeptime) except exception, e: print e traceback.print_exc() sleeptime=random.randint(13,40*index) print url time.sleep(sleeptime) continue if response.getcode() != 200: continue else: break return response.read() i found code sleep on return response.read() sometimes, program not dead , there no error or exception, , not know why , how happens. how can fix it? it python, want picture on web. ...

java - Get the months name for the a particular date range -

Image
i have date range '2015/01/01' '2015/12/31'. database has date,device_id columns of table "device". from date range want display month-name , № of unique device_id s in month. e.g, database having date , devie_id 2 columns date device_id 2015-01-01 1 2015-01-20 1 2015-03-01 1 2015-03-01 3 2015-04-01 2 2015-06-01 3 2015-08-01 4 2015-09-01 1 expected result month device_count january 1 march 2 april 1 june 1 august 1 september 1 how bring month name ? using java class retrive data. below image clear idea of result needed select month(date),count(distinct device_id) table_name group month(date);