Posts

Showing posts from September, 2014

html5 - Choose between PX and Percentile -

i new bootstrap, have following question running in mind. what suggested way use between px , percentiles in bootstrap?? will there effect in website view if used px? there pretty significant difference between pixel units , percentile units. percentiles definition variable dimensions based on size of container, while sizes declared in pixel units going take given number of pixels. you need choose based on you're trying accomplish: do need rendered size fixed number of pixels? pick pixels (or fixed unit) ( this not responsive ) do want rendered size change based on dimensions of container? choose percentiles the best way learn difference experiment both. , change size of browser's window. <div style="width: 80%; border: 2px solid #000; height: 30px"> <span>80% wide div</span> </div> <div style="width: 40%; border: 1px solid #00f; height: 30px; float: left;"> <span>60% wide div...

algorithm - what's the greedy or dynamic programming approach for this? -

suppose making sentences using bi-gram, means probability of appearance of each word dependent on previous word. probability of sentence multiple of probability of words p(sentence) = p(t0)*multiple i=1 i=n p(ti|ti-1) we have probability matrix can use determine p(ti|ti-1) , want find probable sentence is there greedy or dynamic programming approach it? you can use viterbi algorithm . states words ( t0, t2, t7, ... ). initial state t0 , have matrix transition probabilities a_i,j = p(tj|ti) , have no "observations", can not think p(y|k) . every length ( t ) , every word ( t_k ) find v_t,k probability of probable sentence t words , word t_k @ sentence's end.

c# - Crystal Report Viewer Not Displaying the data. ( ASP.NET ) -

Image
i developing website using asp.net. use crystal report reporting tool. use code load report rpt.load(server.mappath("~\\reports\\a4\\grndetailreport-a4.rpt")); rpt.setparametervalue("datefrom", dtimefrom); rpt.setparametervalue("dateto", dtimeto); rpt.setparametervalue("companyid",ddcompanynames.selectedvalue); rpt.setparametervalue("locationid", ddlocations.selectedvalue); crystalreportviewer1.toolpanelview = crystaldecisions.web.toolpanelviewtype.none; crystalreportviewer1.reportsource = rpt; crystalreportviewer1.databind(); so above code working issues. report loading. data not displaying. when press refresh button on page displaying. whats gone wrong there? i called function @ bottom of above code. crystalreportviewer1.refreshreport(); but still got problem. also when press refresh button asking parameter window. how bypas window? sett...

linux - expect for non-interactive sessions -

i'm using docker container. need send bash commands container through expect script dont want console opened. #!/usr/bin/expect set cont_name [lindex $argv 0]; spawn docker attach vont1 send "netconfd&\n" interact the problem need achieve without opening console.if remove interact i'm not able send commands container. there way send commands container(bash shell) without interact should executed in background.

Git manage/merge remote branches from local host -

i working on project other developers , designer. when comes style project, can not work on else wait designer finish. tried do, , half way there, is: i set vhost designer, "different" project different url. i copied project designer_folder. i did git init, , add (developer_folder) remote. what failed is, pull on designer_project specific_branch changes specific_branch of developer_project. want have project him can play around , in end pull changes project. every time start working on something, create new branch on project, , merge changes pull changes project. just comments, googled , looked in stackoverflow. not find 1 work. i struggling. please help. you can use bare repository it. add folder can both access, go , call git init --bare then both use remote git remote add local path/to/created/folder you can push , pull that. have connected 2 remotes (origin , local) , can still push , pull other remote else working with.

cordova - Phonegap - Android Geolocation is not accurate -

i use cordova // platform: android // 3.5.1 when use geolocation var options = {enablehighaccuracy: true}; navigator.geolocation.getcurrentposition(that.geosuccess, that.geoerror, options); this.geosuccess = function(position) { console.log("geosuccess :"+position.coords.latitude+", "+ position.coords.longitude) that.mylocation = new google.maps.latlng(position.coords.latitude, position.coords.longitude); }; i in log: 31.4956033, 34.9326514 which 3.7 kilometre actual location. any idea why? or how fix? on ios following position: 31.518463052524, 34.90405467862522 which actual position, therefore code correct. when use google map (on android device) position correct, therefore it's not hardware problem. in manifest have: <uses-permission android:name="android.permission.access_coarse_location" /> <uses-permission android:name="android.permission.access_fine_location" /> ...

objective c - Disable Cut/Copy in Webview -

ok, scenario simple: i have webview i want user not to able cut/copy webview, no matter (either ⌘c , or via edit menu) i know have subclass webview, specific methods have override? any ideas? (any other approach welcome!) add following css file html { -ms-touch-action: manipulation; touch-action: manipulation; } body { -webkit-user-select: none !important; -webkit-tap-highlight-color: rgba(0,0,0,0) !important; -webkit-touch-callout: none !important; } and link css html <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link rel="stylesheet" href="layouttemplates/css/style.css" type="text/css" /> </head> </html> or programmatically disable - (void)webviewdidfinishload:(uiwebview *)webview { [webview stringbyevaluatingjavascriptfromstring:@"document.documentelement.style.webkit...

Adding to MATLAB gif images using imwrite() (white images beyond certain point) -

i've tried finding answer on place, i've had no luck far. see, i've ran problem i'm generating gif files appending images single gif using loop. after while, imwrite seems stop adding images gif file - adds white spaces instead. so, file large enough (250mb) feasibly have right number of images in, when open , play it, once gets past point have white images. i'm pretty damn sure it's nothing loop - i've had print out image file it's working on each loop iteration , that's correct. filenames correct. it seems give after number of images, thought maybe there's maximum number? have on 50 frames want stitch together. the code snippet i'm working on: delay_time = 0; % each frequency, read in iso-contour , stitch plots % make gif counter_frequency = freq_min:freq_inc:freq_max im_in = imread(['2d fft, ' num2str(counter_frequency, '%3.2f') ' ghz.png'], 'png'); [imind,cm] = rgb2ind(im_in,256); ...

java - Return BST/GMT for a given date -

in java accepted method determining daylight savings time given date object locale. for example if had 2 date objects date date = new date("01/01/2014"); date date2 = new date("01/07/2014"); and locale "europe/london", 'date' should return gmt , date2 should return "bst" string timezone = new string("europe/london"); timezone tz = timezone.gettimezone(timezone); system.out.println(tz.getdisplayname(tz.indaylighttime(date), timezone.short)); timezone tz2 = timezone.gettimezone(timezone); system.out.println(tz2.getdisplayname(tz2.indaylighttime(date2), timezone.short)); both these examples print gmt, shouldn't second print bst? i think dates both not in daylight saving time, pattern mm/dd/yyyy, dates 1st jan 2014 , 7th jan 2014. way: constructor use deprecated! date date = new date("01/01/2014"); date date2 = new date("01/07/2014"); date ...

xsd - Generate Sample XML: Could not find any element declaration for a root element -

i trying generate sample xml xsd. using altova xmlspy generate schemas. when go "generate sample xml file" receive error saying could not find element declaration root element. the program has worked other xsd files have tried. how can file converted or program can use generate sample xml? without seeing xsd, might guess lacks global element definitions. could, example, collection of xsd:simpletype , xsd:complextype definitions. if case, should still able create sample xml if can provide root element: decide type of root element of xml wish generate. create xsd:element declaration of desired type. place created xsd:element xsd directly, or place in own file , import or include type definitions new xsd. providing sample xsd (or preferably minimum version of still exhibits issue) have allowed more specific in answering question.

javascript - Targeting and moving child elements with jquery -

i attempting design template volusion platform e-commerce website. there table loaded on category pages need re-position using script. simple enough if able add unique class table element, volusion platform has locked down inner html of page, allowing me change template header/footer html. the script needs following: check if current page category page. target specified table append display before #mainform i have created js fiddle relevant information: http://jsfiddle.net/lno034u8/1/ thanks can provide! here jsfiddle html: <div class="content"> <main id="content_area"> <!--table move --><table width="100%" cellspacing="0" cellpadding="0" border="0"> <tr><td>this content should display second, , should colored blue</td></tr> </table><!-- / --> <table width="100%" cellspacing="0" cellpa...

math - solving T(n) = 4T(n/2) + n^3 + n*(log(n))^2 -

i trying solve recurrence using substitution method. recurrence relation is: t(n) = 4t(n/2) + n^3 + n*(log(n))^2 i tried solve master method. first supstitution can use n = 2^k . recurrence becomes: t(2^k) = 4t(2^(k-1)) + 2^(3k) + 2^k * log(2^k)^2 or t(2^k) = 4t(2^(k-1)) + 2^(3k) + c * k^2 * 2^k where c = (log 2)^2 . after supstitution, s(k) = t(2^k) , dividing 4^k get s(k) / 4^k = s(k-1) / 4^(k-1) + 2^k + c * k^2 / 2^k our final supstitution r(k) = s(k) / 4^k , new recurrence is r(k) = r(k-1) + 2^k + c * k^2 / 2^k by telescoping (ie. summing these equations k = 2, 3, ..., n) get r(n) = r(1) + sum(2^k) + c * sum(k^2 / 2^k) (where both sums go k = 1 k = n - 1). finally, r(n) = r(1) + 2^n - 1 + c * (6 - (n^2 + 2n + 3) / 2^(n-1)). t(2^k) can found last equation. other values of t(n) (when n not power of 2), don't have enough data without additional assumptions (continuity, example).

mapreduce - How to write first Map-Reduce Job programe for Hadoop? -

i new hadoop , trying learn hadoop, found many reference , learned lot of things hadoop architecture different resources.. i have setup single cluster setup in machine , following book "hadoop_ definitive guide, 3rd edition".. in 2nd chapter telling 1 example "national climatic data center".. but want know jar file should include in project , how start writing first map-reduce job programe.. thanks in advance, sombir in mr1 , required jars basic job following : hadoop-core-x.x.x.jar commons-logging-api-x.x.x.jar it's not direct dependency absence causes problem on running jar both these jars available @ hadoop installation directory, pick them there(to eliminate version issue). try more features, additional jars needed. example, commons-cli-x.x.jar has added use genericoptionparser . not sure yarn , following jars must : hadoop-common.jar hadoop-auth.jar i'll update list able confirm. now write job, think wordcoun...

php - paypal adaptive accounts installation difficulties -

i trying install paypal adaptive accounts api using php. i have set developer account, test accounts , app , tested parameters via paypal tool. need install api on our test site. i have used how check if curlssl working properly ensure have curl set up. i followed instructions here using php tab. installing without composer connected via ssl client , used command instructed. curl https://raw.github.com/paypal/adaptiveaccounts-sdk-php/stable-php5.3/samples/install.php | php however think repository has been moved , tracked down here . meaning command should curl https://raw.githubusercontent.com/paypal/adaptiveaccounts-sdk-php/master/samples/install.php | php i may have found wrong code because not install. error output is composer not installed or 'usecomposer' set false in install.php. running custom installation ... downloading adaptiveaccounts-sdk-php - v2.6.106 downloading sdk-core-php - v1.4.3 generating autoload file fatal e...

r - How do I increase or decrease an ordered factor's level? (Make a factor equal to the very next level) -

i have 2 lists of ordered factors , b, both contain thousands of items , have same ordinal scale of 30 levels. want find out how many items in equal or within 1 level above or below item @ same location in b if scale numeric convert ordered factors numeric values , following: table(a==b || a==(b+1) || a==(b-1)) however, of course, '+' not meaningful factors. do? write giant nested if statement or change ordinal scale numbers according level can convert ordered factors numeric... these seem roundabout (and lengthy) solutions i'd assume easy: how increase or decrease ordered factor's level? if have x<-ordered("b",levels=c("a","b","c")) how make x[1] equal "c" incrementing current level? sidenote : of course, in first example above i'd need account factors on lower , upper end of scale, think (hope) easy enough figure out once question has been answered. you should able modify example out...

c++ - How to pass strcut Datatype into template? -

i have 2 template classes inherits each other. , have struct date want pass function in 1 of classes error when compile: no operator found takes right-hand operand of type 'date' (or there no acceptable conversion) the error in line 95 specifically. as can see in code, passing different data types test if function works. of them worked except struct date. what doing wrong? my code: #include <iostream> #include <string> using namespace std; template <typename t> class b; //forward declare template <typename t> class { t valuea; public: a(){}; t getvaluea() { return valuea; } void setvaluea(t x) { valuea = x; } a(const &x) { valuea = x.valuea; } friend class b<t>; //a<int> friend of b<int> }; template <typename t> class b : a<t> { t valueb; public: using a<t>::setvaluea; using a<t>::getvaluea; ...

jquery - Validate dynamically added fields -

i'm adding table row jquery on button click: $("#add_row").click(function () { zeile++; $("#artikeltabelle > tbody").append('<tr id="reihe' + zeile + '">' + '<td rowspan="2"><b>' + (zeile + 1) + '</b></td>' + '<td><input class="form-control" id="cctabelle_' + zeile + '__ccartikelnr" name="cctabelle[' + zeile + '].ccartikelnr" type="text" /></td>' + '<td><input class="form-control" id="cctabelle_' + zeile + '__ccwarentarifnr" name="cctabelle[' + zeile + '].ccwarentarifnr" type="text" /></td>' + '<td><input class="form-control" data-val="true" data-val-number="das feld &quot;anzahl&quot; muss eine zahl sein." data-v...

shell - How to archive modified files between two git branch using command git archive? -

i use such command archive modified files between master , head: git archive --format=zip -o diff_archive.zip head `git diff --name-only master..head` however, if there no modified file, files in working copy archived, there way avoid this? now,what use dummy file, , change command this: git archive --format=zip -o diff_archive.zip head dummy_file `git diff --name-only master..head` it solves problem, not elegantly, dummy_file archived. assuming don't mind fact operation not @ safe oddly named files or include whitespace. can following: files=$(git diff --name-only master..head) git archive --format=zip -o diff_archive.zip head ${files:-no_such_file} and git archive error on non-existent file. (this uses use default value version of parameter expansion .) if rather avoid error use git diff --exit-code : if ! _files=$(git diff --exit-code --name-only master..head); git archive --format=zip -o diff_archive.zip head $files fi (this needs ! inver...

matlab - Calculating the corelation of 2D signals with different sizes -

i trying calculate correlation between 2 different signals , works perfect if signals have same size. gives error if there size different. wondering if there way can change size of 1 other can have same size? help?? as example: if signal 1 matrix of size 130x9 , signal 2 matrix of size 122x12 , same .. need scale 1 of them other, both of them can of size 130x9 or 122x12 . my code: norm_xcorr_mag = @(x,y)(max(abs(xcorr(x,y)))/(norm(x,2)*norm(y,2))); norm_xcorr_mag(signal1,signal2); if have signal processing toolbox , a = randi(100,[130 9]); b = randi(100,[122 12]); maxrow = max(size(a,1),size(b,1)); maxcol = max(size(a,2),size(b,2)); newa = resample(a,maxrow,size(a,1)); newb = resample(b,maxrow,size(b,1)); newa = resample(newa',maxcol,size(a,2))'; newb = resample(newb',maxcol,size(b,2))'; newa , newb both 130x12 you try intrep1 .

html - Erb: How to make a block repeat horizontally? -

if have block of following format: <% @model.each |f| %> <%= f.name %> <%= image_tag("some_picture.jpg") %> <br> <% end %> how repeat horizontally, instead of vertically? if list long enough reach end of containing div, continue line down, normal html text. this concatenates names array using array#join single space between them: <%= @model.map(&:name).join(' ') %> wrapping within paragraph element give looking for: <%= content_tag(:p, @model.map(&:name).join(' ')) %>

ios - how to load Different Array when table view Section Button Pressed? -

Image
i newbie in ios development developing magazine application. in have used tableview contains 2 section , each section has preview button shown in below image. show different images when preview button pressed. image array parsed json. here images in array (this array contains array of images). first section wrote code like nsdictionary *dict=[self.imagesa objectatindex:0]; but second section 2 cell there uses same custom cell. confused how show second object array when tableview's second section preview button pressed , same way load third image array when second section's second cell preview button pressed. if make different xibs each button in future if new cell added not work. please give me solution here web services link webservice link i show first -demopage: array first cell , second -demopage: second , upto last cell of table view. how possible please give me solution. here preview button code uibutton *preview = [uibutton buttonwithtype:uibuttontype...

exception - Testng throwing java.lang.IllegalMonitorStateException -

i using testng automation framework. when line of code below executed in test case results in java.lang.illegalmonitorstateexception . can suggest how fix this? method should wait 2 minutes. { timeunit.minutes.wait(2); } as javadoc says: the current thread must own object's monitor. in other words, can call object.wait on object within synchronized method or block locking object waiting on. you should using thread.sleep(...) or timeunit.sleep(...) . read respective javadocs understand units of parameters. if use wait , usage incorrect reason well. though looks waiting 2 minutes, actually waiting 2 milliseconds ... because calling object implementation of wait . if wanted use timeunit version, code need this: synchronized lock { timeunit.minutes.timedwait(lock, 2); } where lock suitable (private, unshared) object using locking. also, beware if notifies lock / locked object, wait(...) call wake early. makes wait , inappropr...

ASP.net Web Forms - Dynamic Form - C# -

i need create form dynamically using querystring parameter , access of fields id in code behind. now, have form (with server controls) can't set unique ids (using things eval...) passed server controls simple html , fields have unique ids can't access them code behind (form.findcontrol works server controls). this code html: <% int j = convert.toint32(request.querystring["j"]); (int = 0; < j; i++) { %> <div> <div> <input type="date" id='<%: "date_" + (i + 1).tostring() %>' /> </div> </div> <% } %> if impossible set ids server controls (if not, tell me how!) how can access fields? or how can create form using else can helps me? thanks in advice. since these controls posted upon form submission , need values after postback , can access using request.form["date_0"] , request.form["date_1...

javascript - Can I add a style tag to innerHTML? -

i'm trying post innerhtml table. font size in 1 cell bigger. possible include style tag so? cell4.innerhtml = "<style: font-size:40px>" + "john doe" + "</style>" + "</br>"; i tried following fiddle, isn't working. http://jsfiddle.net/s1dj3x8e/ the <style> tag meant container css code inside head, you're trying accomplish cannot done element in context. try replacing following line: cell4.innerhtml = "<style: font-size:40px>" + "john doe" + "</style>" + "</br>"; with: cell4.innerhtml = "<span style='font-size:40px'>john doe</span>"; updated fiddle (now span instead of div correctly pointed out zach below): http://jsfiddle.net/jbhw1qf0/

How to externalize json-ld and include in html doc -

is possible externalize json-ld , include in html document this: <script type="text/javascript" src="http://www.example.com/data123.jsonld"></script> there doesn't seem documentation online.... you can't that. should json ajax request. you can easy jquery js $(function(){ $.getjson("data123.jsonld", function(data) { $('.json').text(data); }); }); html <div class="json"></div> if json file not in file system ( cross domain ) should try this .

c# - CheckedListBox binding update DataSource -

here code. want update datasource when user check/uncheck item in checkedlistbox. when dump data source, nothing has been changed. why? bindingsource source = new bindingsource(); ilist<mystr> list = new list<mystr>(); list.add(new mystr() { index = 0, name = "a", checked = false }); list.add(new mystr() { index = 1, name = "b", checked = false }); list.add(new mystr() { index = 2, name = "c", checked = true }); list.add(new mystr() { index = 3, name = "d", checked = false }); list.add(new mystr() { index = 4, name = "e", checked = false }); source.datasource = list; ((listbox)this.cblist).datasource = source; ((listbox)this.cblist).displaymember = "name"; ((listbox)this.cblist).valuemember = "checked"; public class mystr { public int index { get; set; } public string name { get; set; } public bool checked { get; set; } } unfortunately, checkedlistbox not support functional...

Matlab: trying to fix the "RGB color data not yet supported in Painter's mode" warning -

i'm trying use export_fig matlab tool export matlab figures in vector format (pdf or eps). when trying that, "warning: rgb color data not yet supported in painter's mode" , none of colored parts shown. the author has addressed issue in readme.md (in package) with **rgb color data not yet supported in painter's mode** - see warning if try export figure contains patch objects face or vertex colors specified rgb colour, rather index colormap, using painters renderer (the default renderer vector output). problem can arise if use `pcolor`, example. problem matlab's painters renderer, affects `print`; there no fix available in export_fig (other export bitmap). suggested workaround avoid colouring patches using rgb. first, try use colours in figure's colourmap (instructions [here](http://www.mathworks.co.uk/support/solutions/en/data/1-6otpqe/)) - change colourmap, if necessary. if using `pcolor`, try using [uimagesc](http://www.mathworks.com/matlabcent...

.net - WPF Button Images Show at Design Time but Not Run Time -

i have 2 images stored in resources folder have build action set resources , copy output directory set not copy. images "font.png" , "open.png". when view designer, images appear in buttons them too, however; when run application buttons empty. below xaml, doing wrong? <window x:class="preferences" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:se="clr-namespace:therandomizerwpf.markupextensions" xmlns:res ="clr-namespace:therandomizerwpf.my" xmlns:clr="clr-namespace:system;assembly=mscorlib" title="preferences" icon="the randomizer.ico" height="227.509" width="453.736" windowstyle="threedborderwindow" resizemode="noresize" style="{dynamicresource resourcek...

c# - Proper naming of folder, namespace and class for big projects -

Image
i'm trying create artificial brain experiment, , know become big, because brain contain 4 structures , every structures contain mini-structures , on... organize brain need proper , correct naming of folder, namespace , class. ok, let's have object named brain inside brain have object or structure named cerebrum , cerebellum , limbic , stem . what have is: [folder]>class.cs for example: - [brain] - [cerebrum] - cerebrum.cs - [cerebellum] - [folder etc..] - etc.cs - cerebellum.cs - [limbic] - [stem] - brain.cs so when include them in other class. using app.brain; using app.brain.cerebrum; but problem here is, when create instantiate of class need type namespace brain show brain object if declare using app.brain; . brain.brain ai = new brain.brain(); brain.cerebrum.cerebrum aicerebrum = new brain.cerebrum.cerebrum(); can give suggestion fix structures?

java - Read android assets files throw NullPointerException -

i working on android automation test, create test project in eclipse. (in automation, packed apk , deploy onto emulator) , in project, want read xml file in assets folder. put xml file "mytest.xml" directly in folder assets . , want load , parse. seems nullpointerexception. below code 1.the function defined in class osncommonlib. public class osncommonlib extends activity { public string readtranslationfile(string filename,string transunitid) { if(doc == null) { try { inputstream in = getassets().open(filename); documentbuilderfactory factory = documentbuilderfactory.newinstance(); documentbuilder builder = factory.newdocumentbuilder(); doc = builder.parse(in); } catch ( exception e ) { system.out.println("mytest catch" + e.tos...

javascript - Promise chaining: Use result from previous promise in next then callback -

this question has answer here: how access previous promise results in .then() chain? 16 answers i'm using straight es6 promises (with es6-promise polyfill library) , i'm running problem accessing results previous promises in chained ones. this problem identical in context of angular/q, i'm dissatisfied answer , wanted see if there's better way: how access result previous promise in angularjs promise chain? consider code snippet below: student.find().then(function(student) { return helprequest.findbystudent(student); }, function(error) { //... } ).then(function(helprequest) { // things helprequest... // problem: still want access student. how can access it? }); in chained promise, want use student object got in first promise. written, can't access it. have couple apparent options: store student in variable in outer...

What is a uuid for in AngularJS? -

i came across term uuid in articles angular directives, factories, etc. example there package on github i can't find explanation or used for. can explain uuid 's when comes angularjs? it's normal universally unique identifier generator angularjs.( http://en.wikipedia.org/wiki/universally_unique_identifier ) you use uuid when need unique identifier id objects etc... (for example, user id across various systems).

ios - Auto fit all UICollectionViewCell from data source to screen without scrolling -

i've array of uicolor 's in data source, i'm trying fit cells' size can seen on screen without scrolling. i don't know how it, far i've: #pragma mark <uicollectionviewdatasource> - (nsinteger)numberofsectionsincollectionview:(uicollectionview *)collectionview { return 1; } - (nsinteger)collectionview:(uicollectionview *)collectionview numberofitemsinsection:(nsinteger)section { return self.datasource.count; } - (uicollectionviewcell *)collectionview:(uicollectionview *)collectionview cellforitematindexpath:(nsindexpath *)indexpath { uicollectionviewcell *cell = [collectionview dequeuereusablecellwithreuseidentifier:reuseidentifier forindexpath:indexpath]; // configure cell uicolor *cellcolor = (uicolor *)self.datasource[indexpath.row]; cell.backgroundcolor = cellcolor; (uiview *view in cell.contentview.subviews) { if ([view iskindofclass:[uiimageview class]]) { if ([[(uiimageview *)view image] is...

Error 403 when calling the authentication in Office365 APIs of Azure AD -

i'm making web application call office365 api, , using authentication function of azure ad. not having progress since last week, , got error: statuscode: 403, body: '{"error":{"code":"erroraccessdenied","message":"access denied. check credentials , try again."}} here request sent var request = { url: url, method: method, json: (method === constants.get || method === constants.delete) ? null : resource, headers: { 'authorization': credentials.tokentype + ' ' + credentials.accesstoken, 'user-agent': clientid, 'accept' : 'application/json' } could explain how fix this?

asp.net - Service Unavailable occuring even when app_offline.htm in use -

i have asp.net site hosted on shared hosting direct access logs unavailable. the site has been stable it's been going down every few minutes "service unavailable" message. funny thing is, encounter issue app_offline.htm page in use leading me believe issue not site hosting environment. the site hosted under iis6. ideas how investigate such issue, or might causing issue?

asp.net - Conversion of BitmapImage to Byte array and Store it Into Sql Database -

i want store bitmap image byte, in run time i'm getting error like conversion type image format type integer not valid please 1 me for each file uploadedfile in` doc.uploadedfiles` context.cache.remove(session.sessionid + "uploadedfile") dim stream stream = file.inputstream generatethumbnails(0.5, stream) dim documentimgname = file.filename dim imgdata byte() = new byte(viewstate("compressedimagedata")) {} dim documentsplit = documentimgname.split(".") dim imgname = documentsplit(0) dim imgext = documentsplit(1) stream.read(imgdata, 0, imgdata.length) viewstate("imgdata") = imgdata viewstate("filename") = imgname viewstate("fileextension") = imgext dim ms new memorystream() ms.write(...

html - How to apply css before child class -

i want apply css before p tag td. other td should not effected <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td>heading</td> <td>some data</td> <td><p class="may-class">date</p></td> </tr> </table> what sounds looking parent selector, css doesn't contain (yet...) http://css-tricks.com/parent-selectors-in-css/ what apply class td want style. if can't access html maybe can style p tag inside of td direct child selector: td > p { ... } refer question ways style using javascript: is there css parent selector?

java ee - ClassLoading issue in Jboss Wildfly -

i'm trying create application java ee , jboss wildfly. i've integrated spring security handle authentication , i'm using custom user detail service lookup user details in database. i have eao written in ejb module , being accessed userdeailservice in web module. but when login following error shown. java.lang.linkageerror: loader constraint violation: when resolving interface method "com.company.eao.usereao.findbyusername(ljava/lang/string;)lorg/springframework/security/core/userdetails/userdetails;" class loader (instance of org/jboss/modules/moduleclassloader) of current class, com/company/security/userdetailservicewrapper, , class loader (instance of org/jboss/modules/moduleclassloader) method's defining class, com/company/eao/usereao, have different class objects type org/springframework/security/core/userdetails/userdetails used in signature from articles read seem both ejb module class loader , web module class loader loads userdetail class ...

Form Fancybox Click.Funktion -> .php -

this question has answer here: fancybox sends form data other php page 1 answer this original html code: <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta http-equiv="content-script-type" content="text/javascript" /> <meta http-equiv="imagetoolbar" content="false" /> <link href='css/style.css' rel='stylesheet' type='text/css' /> <link href='http://fonts.googleapis.com/css?family=open+sans' rel='stylesheet' type='text/css'> <script type="text/javascript...

entity framework - EntityFramework: unable to determine the provider name for provider factory of type 'system.data.sqlclient.sqlclientfactory' -

i have website use entity framework , sqlserver. when trying run application on azure following error: unable determine provider name provider factory of type 'system.data.sqlclient.sqlclientfactory'. make sure ado.net provider installed or registered in application config. on premises works fine. i have discovered error caused configuration section (that don't use anymore): <system.data> <dbproviderfactories> <add name="mysql data provider" invariant="mysql.data.mysqlclient" description=".net framework data provider mysql" type="mysql.data.mysqlclient.mysqlclientfactory, mysql.data" /> </dbproviderfactories> </system.data> i have removed , worked correctly.

sql - change next_run_time at a job -

i have jobs in sql , need change next run date , time code. have following stored procedure updates job, job not starts @ specified time: create procedure [dbo].[pu_usp_update_ssis_package] @job_id varchar(50) , @next_run_date int, @next_run_time int begin update msdb.dbo.sysjobschedules set next_run_date = @next_run_date, next_run_time = @next_run_time job_id = @job_id end the data updated in table msdb.dbo.sysjobschedules job, don't know why job not starts here updates stored procedure create procedure [dbo].[pu_usp_update_ssis_package] @job_id varchar(50) , @next_run_date int, @next_run_time int begin declare @schedule_id int set @schedule_id = (select msdb.dbo.sysjobschedules.schedule_id msdb.dbo.sysjobschedules job_id = @job_id) exec msdb..sp_update_schedule @schedul...

javascript - Triggering different actions on same route based on request type in Zend Framework 2 -

i trying make zf2 respond in rest way different request type. in module.config.php have router config. 'router' => array( 'routes' => array( 'student' => array( 'type' => 'segment', 'options' => array( 'route' => '/student[/:action][/:id]', 'constraints' => array( 'action' => '[a-za-z][a-za-z0-9_-]*', 'id' => '[0-9]+', ), 'defaults' => array( 'controller' => 'student\controller\student', 'action' => 'index', ), ), ), ), ), on frontend using backbone send get, post, delete requests server based on user interactions. when user trigger action delete student id of n, back...

c# - Zooming of specific area in chart of win form -

i have win form application in c# contain system.windows.forms.datavisualization.charting.chart. i want zoom particular area or datapoint in chartdisplay area. note: zooming of area in chart, not whole chart zooming. have chart selected. in properties window, select chartareas. in chartarea collection editor, select (in right properties view) cursor. cursorx, set these properties true: isuserenabled , isuserselection. repeat cursory. close windows , run youur app. can zoom in chart area.

eclipse emf - HQL query with @JoinCoumn mapping returns object[] instead of Object -

i have hql query: from usergroup join us.user where usergroup , user both types. when data fetched. returns arraylist contains object[] cotnain usergroup , corresponding user. where from usergroup returns arraylist of usergroup objects... is there way can return former query arraylist of usergroup objects latter query, don't know why returns object array that...? if select more 1 "thing", hibernate give array. if don't specify want select join of 2 entities, give both. try select usergroup join us.user

c# - Cookie with different path value not present in Request.Cookies -

i'm creating mvc version of old asp web app , need reuse existing cookies users don't have reconfigure settings in mvc version. of cookies have path value of / others have path value of /scripts. ones /scripts path value not contained in request.cookies. can know how access , update /scripts cookies in controller? i'm new mvc way. ideally i'd server side solution if not possible client side solution should workable. thanks server side code , set cookies : public void setcookie(string key, string value, timespan expires) { var encodedcookie = new httpcookie(key, value); encodedcookie.httponly = true; if (httpcontext.current.request.cookies[key] != null) { var cookieold = httpcontext.current.request.cookies[key]; cookieold.expires = datetime.now.add(expires); cookieold.value = encodedcookie.value; httpcontext.current.response...

C++: How to compute hash value from several hashable members? -

suppose have c++ class class t { type1 member1; type2 member2; type3 member3; unsigned long hash() { // how implement? } }; assuming each member hash hash function member.hash() . best way implement hash function of class t ? java has hashcodebuilder class specific task, there counterpart in c++? i know 1 possible solution like member1.hash() + member2.hash() * 17 + member3.hash() * 37 is hash function? , how should choose constants 17, 37, etc., esp. if more 3 members? another minor question assuming 1 of member primitive type ( int , float , string , etc.), how should generate hash value it? boost has this: hash_combine size_t seed = 0; boost::hash_combine(seed, member1); boost::hash_combine(seed, member2); boost::hash_combine(seed, member3); return seed;

Alternative to $scope in Angular 2.0 -

in angular 2.0, there no $scope . what alternative that? how able share data between components? scope option available in directives? more practically, is there current alternative that can acquainted with? i aware of controller as read controllers eliminated too. confused on such revolution angular team has started. angular 2.0 using this instead of $scope . one of major changes coming in 2.0 death of controller, , new emphasis on components. big advantage of moving towards component-based apps it's easier define interfaces; plus, html elements have mappable interface in events, attributes, , properties. see migration of angularjs 1.3 2.0 here . see complete documentation of angular 2.0 here

ruby on rails - OmniAuth::NoSessionError - You must provide a session to use OmniAuth. (configured in devise) -

hi learning how use omniauth backend ember app. when run application below mentioned erroe omniauth::nosessionerror - must provide session use omniauth on resue rails s applicataion halts @ line below. 172: def call!(env) # rubocop:disable cyclomaticcomplexity 173: unless env['rack.session'] 174: error = omniauth::nosessionerror.new('you must provide session use omniauth.') => 175: fail(error) 176: end 177: config/intializer/devise devise.setup |config| config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com' require 'devise/orm/active_record' config.case_insensitive_keys = [ :email ] config.strip_whitespace_keys = [ :email ] config.http_authenticatable = true config.skip_session_storage = [:http_auth] config.stretches = rails.env.test? ? 1 : 10 config.reconfirmable = true config.expire_all_remember_me_on_sign_out = true config.password_length = 8..128 conf...

php - check if javascript var is equal to string -

i have php page verifies username users type in, , echo's "available!" if available div called "feedback". have javascript want check see if "feedback" div says "available! , echo "username good" "check" div if is. doesn't work , don't know why. <script type='text/javascript'> function check_info(){ var username_good = document.getelementbyid('feedback').value; if(username_good == "available!"){ document.getelementbyid("check").innerhtml = "username good"; } else{ document.getelementbyid("check").innerhtml = "bad"; } } </script> a div doesn't have value property, need use innerhtml : var username_good = document.getelementbyid('feedback').innerhtml;

jsf - Primefaces datatable export to excel won't work for huge data -

i have small poc application made of primefaces , derbydb. have 80000 records 4 columns in derby db reflected in prime faces datatable. added export excel feature datatable poi jar. when click export excel works fine till 55000(+-1000) records , when crosses heap memory exception in thread "http-bio-8080-asynctimeout" java.lang.outofmemoryerror: java heap space @ java.util.concurrent.concurrentlinkedqueue.iterator(concurrentlinkedqueue.java:452) @ org.apache.tomcat.util.net.jioendpoint$asynctimeout.run(jioendpoint.java:157) @ java.lang.thread.run(thread.java:619) i use primefaces 3.4.2 , tried lazy loading doesn't solve issue either. please advice.

grep - How to find php files with code outside of a function or class and doesn't contain a string? -

i want find php files code outside of function - ignore library , class files. then check if files call function - security function called require_login() is possible? finding files have code outside of classes , function non-trivial. instead: i looking files defining classes, interfaces or functions , excluding them , returning non-matching files. then looking in list php file. then looking calling require_login. grep -rel "^\ *(function|([aa]bstract |[ff]inal )?class|[ii]nterface)" \ | grep ".php$" \ | xargs grep -l require_login

linux - Seperate IP from port in CSV file using sed/awk -

i using following create csv output shown below. now, output csv want split ip address , port names in different columns , display process id in last column. script is:- netstat -anputw | awk '{if ($1 == "tcp") print $1,",",$4,",",$5,",",$6,",",$7}' > $home/mylog/connections_$hostname.csv netstat -anputw | awk '{if ($1 == "udp") print $1,",",$4,",",$5,",",",",$6}' >> $home/mylog/connections_$hostname.csv output in csv like:- tcp 127.0.0.1:25 0.0.0.0:* listen 1112/sendmail tcp 192.168.0.38:22 192.168.10.143:62998 established 3084987/sshd now, wish split ip address , ports (comma seperated) , last column, trim text , display process id. lastly, first column csv should ip address of host name of script run(displayed each of rows). so, output below:- 192.168.0.22 tcp 127.0.0.1 25 0.0.0.0 * listen ...