Posts

Showing posts from July, 2010

javascript - Close all other InfoWindows when one is clicked -

i trying amend below code other infowindows closed when 1 clicked, 1 open @ once. works great, besides fact user can open 20 infowindows. help. function infowindow(marker, map, title, address, url) { google.maps.event.addlistener(marker, 'click', function () { var html = "<div><h3>" + title + "</h3><p><a href='" + url + "'>read more</a></p></div>"; iw = new google.maps.infowindow({ content: html, maxwidth: 350 }); iw.open(map, marker); }); } if want 1 infowindow, create 1 , move between markers on click event. updated code: // global infowindow var iw = new google.maps.infowindow({ maxwidth: 350 }); function infowindow(marker, map, title, address, url) { google.maps.event.addlistener(marker, 'click', function() { var html = "<div><h3>" + title + "</h3><p><a href='" + url + ...

python - Authentication issue using requests on aspx site -

Image
i trying use requests (python) grab pages website requires me logged in. did inspect login page check out username , password headers. found names fields not standard 'username', 'password' used sites can see below screenshots password field i used them way in python script each time 'wrong syntax' error. sublimetext displayed part of name in orange can see pix below from know there must problem name. try escape $ signs did not help. login.aspx header disappears before google chrome register on network. the site www dot bncnetwork dot net i'd happy if me figure out this. here code`import requests import requests def get_project_page(seed_page): username = "*******************" password = "*******************" bnc_login = dict(ctl00$maincontent$txtemailid=username, ctl00$maincontent$txtpassword=password) sess_req = requests.session() sess_req.get(seed_page) sess_req.post(seed_page, data=bnc_login, hea...

Excel Index Match with text string -

enter image description here i trying write formula allow me return value based on being matched short text string contained in longer text string. please see below. "unit time" column in second table retrieve corresponding value first table matching shorter text string in product column of first table in longer product name in second table. thoughts appreciated. thanks excel if product xx-xx can use: =index(b:b,match(left(d2,5),a:a,0)) if product can more 2 characters around dash, you'll have use find() formula position of end of product in col d instead of left(). to account row 4 scott pointed out: =index(b:b,match(left(d2,find("-",d2,4)-1),a:a,0)) this find second dash in string , use variable length left() function.

c# - Is there a handy way to figure out whether an Object implements -

i'm trying figure out if there builtin routines or classes in .net framework provide convenient way test whether collection implements among following interfaces , hence hook relevant events, if any: ienumerable ilist icollection ibindinglist ienumerable <t> ilist <t> icollection <t> iraiseitemchangedevents inotifycollectionchanged mostly data-binding purposes... i can go lot of reflections (e.g. isassignablefrom) since seems pretty common scenario, wondering if there done in regard. [edit] seems question vague or poorly phrased, bad. indicated bit later in 1 of comments more looking way provide centralized databinding way of doing, interested make ui-agnostic, seems ms provides internally tooling such as: http://referencesource.microsoft.com/#system.windows.forms/winforms/managed/system/winforms/datagridviewdataconnection.cs,68950bc360ed4e45,references nothing public. right now, approach wrap kind of bindingsource equivalent , check whet...

MySQL timestamp column - auto update when last ACCESSED (not modified) -

so have timestamp column in table wanted update every time row accessed, including insert, select & update statements. (note not when row modified) is there built-in feature mysql achieve this? there feature this! in mysql called triggers . triggers can run additional mysql code when performing action (i.e.: when inserting, selecting, updating, deleting, etc. table).

sql server - View Connection String Information inside MS Access -

i have been given task, eventual re-write, in meantime, need document going on. we have access database doesn't store data. access database ui (ms access forms) user uses , data maintained in sql server database. 1 thing cannot seem find is: connection string used ms access connect sql server. need find database / server used store information, cannot seem figure out, nor has google been able give me answers. able help? open immediate window (ctrl+g) ? currentdb.tabledefs("a_linked_table").connect will give connect string. or open table in design view , open properties.

c# - Performing set-like operations on XML -

is there mechanism in c#/.net perform set-like operations on complex xml structures in general manner? for instance, suppose have following xml structure a: <a:rpr lang="en-us" sz="1500" b="1" i="1"> <a:effectlst> <a:glow rad="139700"> <a:schemeclr val="accent4"> <a:satmod val="175000"/> <a:alpha val="40000"/> </a:schemeclr> </a:glow> <a:innershdw blurrad="63500" dist="50800" dir="18900000"> <a:prstclr val="black"> <a:alpha val="50000"/> </a:prstclr> </a:innershdw> <a:reflection blurrad="6350" sta="60000" enda="900" endpos="58000" dir="5400000" sy="-100000" algn="bl" rotwithshape="0...

c# - Creating file then setting timestamp without releasing file lock -

i know if there way create file , set last write time (and other timestamp information) without allowing process acquire lock file between these 2 operations. the reason want fix issue antivirus acquires lock file after has been created , still has lock time file attributes being attempted set. code working sevenzipsharp (no longer maintained far can see). code reproduces issue is: var filepath = "test.txt"; using (var filestream = new filestream(filepath, filemode.create, fileaccess.readwrite)) { var bytes = encoding.ascii.getbytes("hello fail."); filestream.write(bytes, 0, bytes.length); var fileinfo = new fileinfo(filepath); fileinfo.creationtime = datetime.now; } this produces following exception when executing last statement: system.io.ioexception "the process cannot access file 'c:\test.txt' because being used process." i considering implementing setting of time attributes retry mechanism, wondered if there more ...

javascript - Issue with absolute positioned element that to be shown inside a scrollable div -

we using dropdown plugin, hiding original dropdown , painting input text element below original element. , options being painted unordered list(which appended body) position absolute. this working fine. when select/input element painted inside internal scrollable div , when scroll internal div, position of list not getting changed(it not sticking text box). but, when scroll external scrollbar, position of list moving expected(sticking text box). please provide inputs solve this. pfa sample html @ https://plnkr.co/edit/psviorvemilsfsbualfw?p=preview #scrollable { max-height:200px; overflow:scroll; } input{ width:200px; } ul { background:lightgrey; border:1px solid black; width:160px; position:absolute; top:13px; left:185px; } <div id="scrollable"> scrollable conatiner <input type="text" name="textbox"/> <br> <br> <p>lorem ipsum dolor sit amet, consectetur adipiscing e...

ios - why I have to unwrap value before I use -

a block defined below // declare block ( optional ) typealias sorting = (([schedule], [string]) -> [schedule])? var sortschedule: sorting = { (schedules, sortdescription) in var array = [schedule]() string in sortdescription { (index, schedule) in schedules.enumerate() { if string == schedule.starttime { array.append(schedule) break } } } return array } at points, invoking block doing let allschedules = sortschedule?(result, sortdescription()) schedule in allschedules // xcode complains @ here { .......... } im using ? because want make sure if block exists, something. however, xcode complains for loop value of optional type [schedule]? not upwrapped, did mean use '!' or '?'? im not sure why because return type of block array can have 0 or more 1 items. does...

url rewriting - create stackoverflow like url for search in node.js and javascript -

i want change page's url search item stackoverflow , display page newly created url,every time hit url in new tab. like if search using 'natures photography' retrieves photo named 'sunset in village' url should this: http://localhost:8080/sunset-in-a-village how node.js / javascript? if search using 'natures photography' retrieves photo named 'sunset in village' what mean exactly? search return not 1 item. suggest result set , have url /seach/natures-photography , 1 of finded item have url /photo/sunset-in-a-village app.get('/search/:query', function(req, res, next) { // client send dashed , lowercase query var query = req.params.query; // natures-photography // render result page. each image have url /photo/:dashed-lowercase-name }) ... app.get('/photo/:name', function(req, res, next) { var name = req.params.name; // sunset-in-a-village name = name.rep...

Java Date Timestamp conversion issue -

i doing simple string date conversion in java, 1 thing have take care conversion should in gmt. able convert string in gmt. when tried convert date timestamp got different value (seems value based on local timezone). public static void timefun(string str) throws parseexception { simpledateformat formatter = new simpledateformat("yyyy-mm-dd't'hh:mm:ss.sssxxx"); string dateinstring = "2015-07-10t09:54:31.000-04:00"; date date = formatter.parse(dateinstring); simpledateformat sdfamerica = new simpledateformat("yyyy-mm-dd't'hh:mm:ss.sssxxx"); timezone tz = timezone.gettimezone("gmt"); sdfamerica.settimezone(tz); string converteddate = sdfamerica.format(date); // convert string // first date dateingmt = sdfamerica.parse(converteddate); system.out.println(converteddate); // output = 2015-07-10t13:54:31.000z (right) timestamp timestam...

r - Conditionally rename the value depending on the previous row -

i have data frame df : event code picture no$ picture value picture $ picture value picture no$ picture value picture no$ picture value picture $ picture value i want rename value reward or no_reward depending on previous row. if it's $ reward , if it's no$ no_reward what best way it? another idea, df1$code[c(false, true)] <- ifelse(df1$code[c(true, false)] == 'no$', 'no_reward', 'reward') df1 # event code #1 picture no$ #2 picture no_reward #3 picture $ #4 picture reward #5 picture no$ #6 picture no_reward #7 picture no$ #8 picture no_reward #9 picture $ #10 picture reward note : assumes every $ or no$ , value follows

opengl - Contents of uniform int[8] area always zero? -

i'm building shader program render simple bitmap font in glsl. my programming environment c# i'm using opentk encapsulate opengl 4.0, syntax similar examples in c , c++. my issue i'm trying pass array of integers fragment shader, whenever do, array elements end being zero. integers should range between 0 , 255 , i've checked values before , after sending them. it's infuriating. currently i'm binding program, attempting send int[] array shader using following instructions: int[] ints = new int[] { 33, 34, 35, 36, 37, 38, 39, 40 }; gl.useprogram(programlocation); gl.uniform1(arraylocation, ints.length, ints); my fragment shader takes array , uses couple of functions determine part of quad place characters. i've tested these functions static numbers , arrays build manually in shader , work i'd expect them to. reason syntax above doesn't end sending data - elements evaluate 0. in shader, array denoted , used this: uniform int characters...

Java string to date conversion -

can recommend best way convert string in format 'january 2, 2010' date in java? ultimately, want break out month, day, , year integers can use: date date = new date(); date.setmonth().. date.setyear().. date.setday().. date.setlong currenttime = date.gettime(); to convert date time. don't it, that's hard way. moreover, setter methods of java.util.date deprecated since java 1.1 (1997). simply format date using simpledateformat using format pattern matching input string . in specific case of "january 2, 2010" input string, "january" full text month, use mmmm pattern it, "2" short day-of-month, use d pattern it, "2010" 4-digit year, use yyyy pattern it. string string = "january 2, 2010"; dateformat format = new simpledateformat("mmmm d, yyyy", locale.english); date date = format.parse(string); system.out.println(date); // sat jan 02 00:00:00 gmt 2010 note importance of explicit locale...

python - PyUSB: Why are bus.dirname and dev.filename empty string? -

i new using pyusb. have usb devices connected machine , trying of properties. based on have learnt other examples using pyusb, have produced short program in linux. here snip of program: busses = usb.busses() bus in busses: devices = bus.devices dev in devices: print dev.filename print bus.dirname print dev.idproduct when checked output, both dev.filename , bus.dirname empty string devices. dev.idproduct correct. can these questions please? (1) dev.filename? (2) bus.dirname? (3) can both of these properties empty? thanks.

ios - Obstacles With GameplayKit -

Image
here question: how can convert skspritenode array array of gkobstacles agent can appropriately avoid these obstacles using goaltoavoidobstacles:(nonnull nsarray<gkobstacle *> *) maxpredictiontime:(nstimeinterval) /? it seems way in creating gkobstacle array not allowing gkgoal identify these obstacles correctly, no matter weight give goal. i have several sknode s added skscene chapterscene . each of these nodes added array storing called obstaclesarray . have set test in following way works quite well: working obstacles - (void)didmovetoview:(nonnull skview *)view { [super didmovetoview:view]; // add 3 obstacles in triangle formation around center of scene. nsarray<gkobstacle *> *obstacles = @[ [self addobstacleatpoint:cgpointmake(cgrectgetmidx(self.frame), cgrectgetmidy(self.frame) + 150)], ...

java - Counting the same Strings in List -

i new android , java programming. have problem method. trying count how many times same strings appeared. for example: input in list l , output in list m list l : string1 string1 string2 string2 string2 list m : 2x string1 3x string2 my lists: list<string> l = new arraylist<>(); list<string> m = new arraylist<>(); my method: public string generuj() { string generator = ""; int x = 0; int j = 0; if (l.size() > 0) { m.add(l.get(0)); (int = 1; < l.size(); i++) { while (j < l.size() && m.get(m.size() - 1).equals(l.get(j))) { x++; j++; } m.add("\n" + x + "x " + l.get(i)); } } (int = 0; < m.size(); i++) { generator = generator.concat(m.get(i)); } return generator; } thank in advance help. modified op's solution: (without hashmap ) p...

.net - How to get names of files in a folder moved on a particular date in windows using C#? -

i coding using c# , .net on vs 2012. there server cuts 2-3 files onto folder on computer everyday @ 3 am. need program gets filename , extension of file moved on current day. have tried numerous methods - directoryinfo filepath = new directoryinfo("c:\\users\\gaurav\\desktop\\randomfolder"); fileinfo[] files = filepath.getfiles("*.txt"); foreach (fileinfo file in files) { if (file.lastwritetime > datetime.today) { filecount++; } } however, file.lastwritetime gives date last written to. other methods file.creationtime gives date when created might not same date moved folder on computer. there way solve problem? update: have no control on server cannot add timestamp when moved computer. if have control on target machine create service watch directory , time stamp file @ point. here decent example of how create directory watch service: creating service monitor directory then change event listener methods around liking, th...

mysql - phpmyadmin error closing bracket was expected. (near ")" -

i trying import sql database in phpmyadmin, i'm getting error: a closing bracket expected. (near ")" @ position 194) sql query: create table if not exists `wll_product` ( `product_id` int(5) not null auto_increment, `product_name` varchar(60) not null, `product_type` tinyint(1) unsigned not null default '0'comment ) i'm new mysql, please me out, thanks. you need add comment after comment keyword (or leave comment out). need make product_id key if want use auto_increment on it. create table `wll_product` ( `product_id` int(5) not null auto_increment, `product_name` varchar(60) not null, `product_type` tinyint(1) unsigned not null default '0' comment 'a comment', key (`product_id`) ) engine=innodb default charset=latin1 edit: scaisedge mentioned, key enough, not pk said before.

Marklogic only converts the half of my documents via the Content Processing Framework -

Image
i use webdav server import pdfs, docs, pptxs , xlsxs database drag , drop. webdav server called "cpf", root "/" , port number "9999". and installed content processing framework standard configuration. can have not needed security requirements? for case marklogic says: set needed permissions on root directory when add documents database conversion, user adds documents must have needed permissions add , modify documents. if using webdav server drag-and-drop documents database, root directory of webdav server must have needed permissions. one simple way accomplish these security requirements following: create uri privilege uri configured root directory of webdav server. create role has uri privilege , has default permissions of read. insert, , update role. set permissions on webdav root directory role created. example, if role created named webdav, , root directory has uri /webdav/root/, run query (as privileged use...

angularjs - Trouble binding complex input to variable, efficiently -

Image
i'm new angular , trying learn. trying find way bind quantities ids. here template: "<div class='tableborder'><label> <input ng-model='" + modelngqty + "' type='number' name='{{value.detailid}}' /> {{value.text | lowercase}} </label> </div>" the modelngqty is: modelngqty = "selectedoptions[value.customid].details[value.detailid].qty"; unfortunately object gets generated code is: {"36":{"details":{"107":{"qty":2323232},"108":{"qty":232323}}}} i want this: {"36":{"details":[{detailid: "107", "qty":2323232},{detailid: "108","qty":232323}]}} here side-by-side visual of two. want 1 on left: the version on right terribly hard loop through ng-repeat. have data cant figure out how write model. have tried {} , [], lot of different ngmodel versions. best vers...

.net - Solving error "Microsoft.NETCore.App 1.0.0 does not support framework .NETFramework,Version=v4.6.1" -

i have asp.net core 1.0 complete application running using net461 references. trying add framework - netcoreapp1.0 . this, have updated project.json this: { "usersecretsid":"", "version":"2.4.0-*", "buildoptions":{ "emitentrypoint":true, "preservecompilationcontext":true }, "dependencies":{ "microsoft.applicationinsights.aspnetcore":"1.0.0", "microsoft.aspnetcore.authentication.cookies":"1.0.0", "microsoft.aspnetcore.diagnostics":"1.0.0", "microsoft.aspnetcore.diagnostics.entityframeworkcore":"1.0.0", "microsoft.aspnetcore.identity":"1.0.0", "microsoft.aspnetcore.identity.entityframeworkcore":"1.0.0", "microsoft.aspnetcore.mvc":"1.0.0", "microsoft.aspnetcore.mvc.taghelpers":...

javascript - How to catch an Isset, or POST information, with a form in JQuery? -

so trying simple. there form, self post , want post information jquery , put div. <!doctype html> <html> <head> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> jquery here catch button click , "php_self": <script> $(document).ready(function(){ $(".gettingpostbutton").click(function(){ $.post( "<?php echo htmlspecialchars($_server["php_self"]);?>", function( data ) { $("#add_post_information_html_here").append(data+" number $_post"); });/**/ ...

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

i have entity inherits other. on other hand, i'm using lombok project reduce boilerplate code, put @data annotation. annotation @data inheritance produces next warning: generating equals/hashcode implementation without call superclass, though class not extend java.lang.object. if intentional, add '@equalsandhashcode(callsuper=false)' type. is advisable add annotation @equalsandhashcode (callsuper = true) or @equalsandhashcode (callsuper = false) ? if not added, 1 callsuper=false or callsuper=true ? the default value false . 1 if don't specify , ignore warning. yes, recommended add @equalsandhashcode annotation on @data annotated classes extend else object. cannot tell if need true or false , depends on class hierarchy, , need examined on case-by-case basis. however, project or package, can configure in lombok.config call super methods if not direct subclass of object. lombok.equalsandhashcode.callsuper = call for configuration system ...

linked list - How is the built in C# linkedlist library so much quicker than a simple implementation? -

i have created barebones linkedlist following node type gets chained up: class node { string somedatabecausewhynot; node next; node previous; } while iterating on nodes delete so: void removenode(node n) { n.next.previous = n.previous n.previous.next = n.next } this solution 3x slower c# linkedlist.remove function. i can't imagine why , love know difference in internal c# implementation makes quicker?

r - How to sort set of data.frame objects in the list by increasing order? -

i have set of data.frame object in list. want sort these increasing order. however, have simulated data 5 data.frame objects in list, how can sort them? know useful trick of doing in r? in advance set of data.frame object df1 <- co2[1:10,] df2 <- airquality[1:10,] df3 <- iris[1:10,] df4 <- cars[1:10,] df5 <- attitude[1:10,] d.list <- list(df1, df2, df3, df4, df5) desired output (manually pin out reference) out_1 <- list(df1, df2, df3, df4, df5) # original out_2 <- list(df2, df1, df3, df4, df5) out_3 <- list(df3, df1, df2, df4, df5) out_4 <- list(df4, df1, df2, df3, df5) out_5 <- list(df5, df1, df2, df3, df4) you can use [ reorder (and subset) lists: test_1 <- df.list[c(1, 2, 3)] test_2 <- df.list[c(2, 1, 3)] test_3 <- df.list[c(3, 1, 2)] will return desired outputs. test_1.1 <- df.list[c(1, 2)] will return list first 2 list elements , test_1.1 <- df.list[c(2, 1)] will return first 2 list elements orde...

excel - I need to grayed a cell out depending on user input using vba -

Image
so have list of information need user submit can included in different sheet.(see pic below) want code gray out row if picked. if user inputs "starting" time, want row "dependency" gray out, , user won't able use it. if user clicks "dependency" "starting time" needs gray out. here current code. sub finddata() dim finalrow integer dim integer dim workflows string sheets("sheet1") workflows = .range("c5").value servergri = .range("c9").value gridf = .range("c9").value starttime = .range("c11").value end sheets("sheet3") finalrow = .range("c" & rows.count).end(xlup).row = 5 finalrow if .cells(i, 3) = workflows , (.cells(i, 4) = servergri or .cells(i, 5) = gridf) .rows(i).insert 'add new information new row. 'the new row num...

Not able to run scenario while using cucumber-jvm with selenium -

specification |-src |-test |-java |-myfeature1 |-myfeature1steps.java |-myfeature1test.java |-myfeature2 |-myfeature2steps.java |-myfeature2test.java |-resources |-features |-myfeature1 |-myfeature1.feature |-myfeature2 |-myfeature2.feature in myfeature1test.java , have this: @runwith(cucumber.class) @cucumberoptions(format = { "pretty", "html:target/cucumber", "json:target/cucumber.json" }, features = "classpath:features" , tags = "@registration", glue={"classpath:myfeature1/myfeature1steps.java"}) public class myfeature1test { } scenario file myfeature1.feature : @registration feature: login , registration tests background: given user on sign in page # 1 register using username , password scenario outline: given user clicks on sign , user fills details when user provides "n...

html - Maxlength attribute on textarea not working for mobile -

how restrict user not enter more maxlength in text area mobile. have tried maxlength attribute not working when user select text predective text. i want limit text in text area 300 in case of mobile responsive website. i using chrome , firefox browsers on mobile the maxlength attribute not stable on mobile browsers. looking @ mdn documentation attribute, find this feature android firefox mobile (gecko) ie mobile opera mobile maxlength ? 4.0(2.0) no support ? because of volability, recommend using simple javascript. this var textfield = document.getelementbyid("text-field"); var charcount = document.getelementbyid("char-count"); textfield.addeventlistener("keydown", function(event) { if (this.value.length === 299 && event.keycode != 8) { event.preventdefault(); return false; } var length = event.keycode != 8 ? this.value.length + 1 : this.value.len...

c - Pebble crashes on `realloc`, but only in a certain function -

i'm using custom vector in pebble app. pebble crashing on call realloc . main.c #include <pebble.h> #include "movement.h" static pointarray point_array; int main(void) {; point_array_create(&point_array, 1); gpoint point1 = (gpoint){.x = 1, .y = 1}; gpoint point2 = (gpoint){.x = 2, .y = 2}; gpoint point3 = (gpoint){.x = 3, .y = 3}; point_array_push(&point_array, point1); point_array_push(&point_array, point2); point_array_push(&point_array, point3); app_log(app_log_level_debug, "done\n"); } movement.c #include "movement.h" #include "pebble.h" static void point_array_resize(pointarray *point_array){ point_array->capacity *= 2; size_t new_size = point_array->capacity * sizeof(gpoint) + sizeof(gpoint); point_array->points = (gpoint*)realloc(point_array->points, new_size); } void point_array_create(pointarray *arr, int capacity) { arr->points = (gpoi...

Export sheet as new Excel file (values only) -

i found code in discussion has been extremely helpful exporting excel sheets new workbook. i've posted version of code use below. as code stands, copies content of desired sheet new workbook, formulas , all. is possible modify code copy values new workbook? i appreciate insight can lend. sub exportxlsx() 'exports desired sheet new xlsx file dim mypath string dim myfilename string dim datestring string datestring = format(now(), "yyyy-mm-dd_hh_mm_ss_am/pm") myfilename = datestring & "_" & "whatever like" if not right(myfilename, 4) = ".xlsx" myfilename = myfilename & ".xlsx" sheets("desired sheet").copy application.filedialog(msofiledialogfolderpicker) .title = "where should save this?" .allowmultiselect = false .initialfilename = "" '<~~ start folder path file picker. if .show <> -1 goto nextcode mypath = .selecteditems(1) & "...

ruby - undefined method for calling methode in class -

i try call methode check_table_exists check table. methode on module, , dont understand why error . i know @connexion mysql2::client instance, doesn't include module sgbd . dont see how include methode ? ./yamlreadfile.rb:44:in `mysql_connection': undefined method `check_table_exists' #<mysql2::client:0x000000033a7750> (nomethoderror) $load_path << '.' require 'yaml' require 'rubygems' require 'mysql2' require 'creatdatabase' #binding.pry class streammysql include sgbd def mysql_connection(conf) @connexion = mysql2::client.new(:host => conf['ost'], :username => conf['user'], :password => conf['password'], :table => conf['table'], :port => conf['port']) if @connexion puts check_table_exists @connexion.check_table_exists puts "connexion etablie" else puts "error connexion" ...

url - jQuery POST redirects to http://127.0.0.1:8080/MyApp/[object Object] -

in jquery post request, url gets directed local host (with message http://127.0.0.1:8080/myapp/[object object] ) with jquery works fine (connects external url). how can change post behavior access specified url? var tmpurl='https://myhost.com/message'; $.post({ data: { 'v': value, 'key' : 'mykey' }, datatype: 'jsonp', url: tmpurl, success: function(response) { console.log("success!", response); } }); since making ajax call on https, recommend have / @ end /message/ . crossdomain requests use crossdomain: true. var tmpurl='https://myhost.com/message/'; $.post({ data: { 'v': value, 'key' : 'mykey' }, crossdomain: true, datatype: 'json', url: tmpurl, success: function(response) { console.log("success!", response); } }); that should solve problem.

zend framework - How to solve this error in pimcore CMS -

fatal error: call member function getgoals() on non-object controller: { $newslist = new object\homepage\listing(); } view: {<?= homepage->getgoals(); ?>} i guess doing wrong way, because don't understand fundamental of mvc. believe doon't want list of homepage objects. there several ways check code: 1. sure have object field "goals" 2. use documentation list of objects for example. controller: // list of news objects $newslist = new object\news\listing(); $this->view->news = $newslist ; view: <?=$this->news->getname()?> or <?=$this->news->getgoal()?> if create field.

java - Android internal files seems to disappear after I restart my application -

i new android , trying save few files in little "play-around" application making learn, files seem persist until application shut down. when run: file.exists() file.isfile() or similar methods return false when application restarted. this method found online save files: public void writetofile(string data, string filepath, context context){ file file = new file(context.getfilesdir(), filepath); if(!file.exists()){ try{ file.createnewfile(); }catch(ioexception e) { e.printstacktrace(); log.e("exception", "file couldn't created"); } } try { outputstreamwriter outputstreamwriter = new outputstreamwriter(context.openfileoutput(filepath, context.mode_private)); outputstreamwriter.write(data); outputstreamwriter.close(); } catch (ioexception e) { log.e("exception", "file write failed: " + e.tostring()); } ...

ngresource - How send some params by POST and some by GET in $ng-resource in Angularjs -

we have service using ng-resource: var app = angular.module('salonesbelleza', []); app.service("centroborrar_srv", function ($resource, urlbaseapi_srv) { return{ return $resource('wa-centros/:id', {id:'@id', access_token:'@access_token'}, { "post": { method: "delete", isarray: false, headers: { 'accept': 'application/json; q=1.0, */*; q=0.1', 'content-type':'application/json' } }} ); } }); in controller use way var centroborrar_data = centroborrar_srv.post({ id:10, othervar1:'value_1', othervar1:'value_2', access_token:'my token' }); with ng-resource delete element id=10 using vars acces_token this work well. , url generated ng-resource wa-centros/10?access...

php - Echo values to table based on date -

Image
i working io creating staff app keep track of number of actual employees , number needed each month each department. want keep track next 12 months whenever app run. have following table: id | group_id | group_name | needed | actual 1 | 1 | apartments | 10 | 9 2 | 2 | apartments spanish | 12 | 8 my code far: <?php $getgroups = mysqli_query($con, "select * `su_cal_groups`"); while($groups = mysqli_fetch_assoc($getgroups)) { echo "<tr>"; echo "<td>" . $groups["group_name"] . "</td>"; echo "<td><span style=\"background-color: red;\" class=\"badge\">" . $groups["actual"] . " / " . $groups["actual"] . "</span></td>"; echo "<td><span class=\"badge\">" . $groups["actual"] . " / " . $groups...

c - Why isn't my removeString function removing the characters? -

i'm working through exercise in book, i'm not allowed use library functions aside printf , scanf . i have written program takes in string. can input how many characters remove string. , choose @ index, performed. my attempt @ loop through characters want keep @ end of function , replace them functions want lose. for reason doing exact opposite. if input string: "the wrong son" , choose remove 6 characters , begin @ 4th index of array, i should get: "the son" instead, getting "the wro" . i have been banging head against 4 hours now. can please tell me i'm going wrong? #include <stdio.h> void removestring(char source[], int start, int count); int stringlength(const char string[]); int main(void) { int start, count; char source[20]; printf("what's string?\n"); scanf("%[^\n]s", source); printf("how many characters want remove?\n"); ...

explain bin/kafka-run-class.sh kafka.tools.ConsumerOffsetChecker --zookeeper localhost:2181 --group group1 -

can explain output of below command: bin/kafka-run-class.sh kafka.tools.consumeroffsetchecker --zookeeper localhost:2181 --group group1 output: group topic pid offset logsize lag owner group1 nil_rf2_p2 0 2 2 0 group1_nilotpal-1469374217666-b7619d68-0 group1 nil_rf2_p2 1 2 3 1 group1_nilotpal-1469374217666-b7619d68-0 i need explanation on each columns pid,offset,logsize,lag,owner. i have 1 consumer running , following command, why 2 rows apperaing the above command. bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic nil_rf2_p2 --consumer.config config/consumer1.properties sarkar hello again!! thanks in advance!! the columns have following meaning: pid : partition id offset : latest committed offset partition corresponding consumer gr...

c# - How dbContext materializes data to entity objects -

i'm new entity framework , found out dbcontext class primary class interacting data object , 1 of it's responsibility object materialization, couldn't find out mechanism of dbcontext materializing data database. mean how dbcontext converts raw data(like tables) entity objects. thanks helps.

javascript - How can I blur the dynamic contents behind a div? -

im working on project full screen styled google maps page. there way (css, jquery, or other options...) overlay header , slide-in sidebar blur effect similar ios frosted/blur effect? im trying achieve this. sample blurred header my problem is, because don't control underneath header , changes can't use 2 image trick simulate blurred background. suggestions? read post https://stackoverflow.com/a/19688466/1663572 , related link http://abduzeedo.com/ios7-frosted-glass-effect-html-5-and-javascript the solution uses steps. render html duplicate content area , convert canvas. move canvas header part sync scroll of content canvas in header down on page example (the narrow one). there missing image or else , bit spilled try scrolling. i'm not sure frequency of changes of content mentioning. causing serious performance issues. try it. i don't think of other option achieve comlicated think want.