Posts

Showing posts from April, 2015

opencl - Knapsack algorithm: strange behavior with pown() on the gpu -

the version on cpu ocl produces right results, gpu ocl in places gives different results in places after influence correctness of result. have debugged on intel ocl sdk right results. haven't spotted race condition or concurrent access memory. problem has appeared after have introduced in kernel (one line of code) pown function. void kernel knapsack(global int *input_f, global int *output_f, global uint *m_d, int cmax, int weightk, int pk, int maxelem, int i){ int c = get_global_id(0)+cmax; if(get_global_id(0)<maxelem){ if(input_f[c] < input_f[c - weightk] + pk){ output_f[c] = input_f[c - weightk] + pk; m_d[c-1] = pown(2.0,i); *//previous version: m_d[c-1] = 1;* } else{ output_f[c] = input_f[c]; } } } the purpose of pown compress m_d buffer holds outcomes. for example 1 0 1 0 2^0+2^2, 2^1, 2^0, 2^1 0 1 0 1 => 1 0 0 0 on gpu this: 2^0+2^2, 2^1, 2^0+2^2, 2^1 in 3rd column access pown 1 more again, whe

sbt compile in Compile meaning -

can kindly explain each compile , compile mean in cryptic sbt idiom: compile in compile <<= (compile in compile).dependson(def.task { println("task running") // or whatever code here in body }) compile means compile task, opposed to, say, package compile means compile configuration (derived from/matches apache ivy's configurations), opposed to, say, test

c++ - Why is std::unique_lock not derived from std::lock_guard -

std::lock_guard , std::unique_lock interfaces similar, in common part (constructors , destructor). why there no hierarchical relationship between them? they have non substitutable semantics: lock_guard guaranteed locked through of it's lifetime. unique_lock doesn't guarantee doesn't follow "is a"-rule ( unique_lock cannot lock_guard , offers fewer guarantees). also implementing unique_lock based on lock_guard wouldn't trivial (maybe impossible) reason. obviously same true other way round: although can implement lock_guard in terms of unique_lock (private inheritance), lock_guard doesn't provide same functionality ( lock()/unlock() ) unique_lock cannot publicly derived it.

gwt - Adding a dropdown or toggle button to DataGrid -

is there way add dropdown button or toggle button celltable or datagrid ? the documentation demonstrates using regular button ( buttoncell ). to add togglebutton grid, way found place button in panel (like flowpanel) add panel in grid. to found type of button, can visit showcase of gwt : http://samples.gwtproject.org/samples/showcase/showcase.html#!cwcustombutton here code have button in flowpanel : rootlayoutpanel rp = rootlayoutpanel.get(); flowpanel togglepanel = new flowpanel(); togglebutton toggle = new togglebutton("coucou"); toggle.setwidth("100px"); togglepanel.add(toggle); rp.add(togglepanel); css : .gwt-togglebutton-up, .gwt-togglebutton-up-hovering, .gwt-togglebutton-up-disabled, .gwt-togglebutton-down, .gwt-togglebutton-down-hovering, .gwt-togglebutton-down-disabled { margin: 0; text-decoration: none; background: url("images/hborder.png") repeat-x 0px -27px; -moz-border-radius: 2px; border-radius: 2px; } .

Empty table in MySQL even though Python can insert data into table -

i'm new mysql , python. i have code insert data python mysql, conn = mysqldb.connect(host="localhost", user="root", passwd="kokoblack", db="mydb") in range(0,len(allnames)): try: query = "insert resumes (applicant, jobtitle, lastworkdate, lastupdate, url) values (" query = query + "'"+allnames[i]+"'," +"'"+alltitles[i]+"',"+ "'"+alldates[i]+"'," + "'"+allupdates[i]+"'," + "'"+alllinks[i]+"')" x = conn.cursor() x.execute(query) row = x.fetchall() except: print "error" it seems working fine, because "error" never appears. instead, many rows of "1l" appear in python shell. however, when go mysql, "resumes" table in "mydb" remains empty. i have no idea wrong, not connected mysql'

ibm mq - Websphere MQ using XMS.Net -

i wanted understand how can use web sphere mq following scenario: 1.how can read message queue without removing message queue. 2. have web application need listener read queue. there tool ? yes, it's possible read message without removing queue, it's known browsing. need create browser consumer read messages. have posted snippet here, same code available in tools\dotnet\samples\cs\xms\simple\wmq\simplequeuebrowser\simplequeuebrowser.cs also. // create connection. iconnection connectionwmq = cf.createconnection(); // create session isession sessionwmq = connectionwmq.createsession(false, acknowledgemode.autoacknowledge); // create destination idestination destination = sessionwmq.createqueue(queuename); // create consumer iqueuebrowser queuebrowser = sessionwmq.createbrowser(destination); // create message listener , assign consumer messagelistener messagelistener = new messagelistener(onmessagecallback); queuebrowser.messagelistener = mes

php - Destroy the Session File after logout -

i have code login storing following in session variables: if($do == "login") { session_start(); $_session["valid"] = true; $_session["studentuniqueid"] = $user_row['studentuniqueid']; $_session["loginname"] = $loginname; $_session["timeout"] = $now; } session file looks likethis: valid|b:1;studentuniqueid|s:5:"10001";loginname|s:13:"abc@gmail.com";timeout|s:19:"2015-07-01 18:26:32"; also code logout destroying user session: if($do == "logout") { session_start(); $_session = array(); session_unset(); session_destroy(); } after logout session files contains: valid|b:0; even have used session_destroy(), after logout session file exist valid|b:0; on servers temp directory , size of temp directory increases considerably. i want rid of these files after session_destroy()/l

gcloud docker pull fails with Untar exit status 2 unexpected fault address -

edit: huge thank @mattmoor helping me debug issue. after had create new docker-machine. there problem docker daemon must've arisen due first machine not being created correctly. i having trouble pulling images computer, both of running osx yosemite. both machines have docker daemon running, , have authenticated desired project pull gcloud auth login on computer able run: gcloud docker pull gcr.io/projectid/image-tag without issues. however when try repeat on machine, large error message begins with: error pulling image (tag-here) gcr.io/projectid/image-tag, endpoint: https://gcr.io/v1/, untar exit status 2 unexpected fault address 0xc208ce5d04 fatal error: faultr downloading dependent layers [signal 0xb code=0x1 addr=0xc208ce5d04 pc=0x94109e] followed goroutine 1 stack trace. the docker version on both machines 1.6.2, client , server api version 1.18, both go versions go1.4.2 the google cloud sdk version on both machines 0.9.67, , both have following compo

java - Create a service class or not for gson data processing -

we using google gson process json data.should use of service class or getting new gson().tojson(objectreference); and new gson().fromjson(jsonstring, klass.class); inside methods if gson heavyweight object objectmapper in jackson api need create service? thanks in advanced

keyboard down key not working if chosen dropdown height set -

i have set max height chosen dropdown using following code `.chosen-container .chosen-results { height:100px !important; }` but results in keybord down arrow key not working on press of down key scroll bar not reaches end please try setting max-height:100px instead of height.

apache spark - How to move 1000 files to RDD's? -

i new in apache spark , need help. i have python script reading 6 tdms files (tdms() function) , building graph numerical data of each of them (graph() function). loop. want load 1000 such files , run script in parallels each one. want create rdd's files , apply function each file? how can it? can define number of nodes in spark? have tried making python list includes files need read, , run in loop read data file, create rdd, run graph function, , guess save it? or make file list rdd, , run map, lambda(for graph), each. if care parallel run, can keep loading data , make 1 big rdd, , call sc.parallelize. can either decide spark it, or can specify number want use calling sc.parallelize(data, ).

c++ - Linker Error 2019 without touching the linker properties? -

so i'm making game, , working fine, started developing next part of game chunking system , generation (you might able tell previous posts) of sudden got random linker errors, though haven't touched in linker , game working fine before. here errors: error 3 error lnk2019: unresolved external symbol "public: class sf::sprite __thiscall abstractblock::draw(void)" (?draw@abstractblock@@qae?avsprite@sf@@xz) referenced in function _main c:\(insert personal stuff here)\main.obj top down shooter error 4 error lnk2019: unresolved external symbol "public: void __thiscall abstractblock::destroy(class b2world *)" (?destroy@abstractblock@@qaexpavb2world@@@z) referenced in function "public: int __thiscall universe::savegame(void)" (?savegame@universe@@qaehxz) c:\(insert personal stuff here)\universe.obj top down shooter error 5 error lnk1120: 2 unresolved externals they don't have line numbers , appears problem in universe.obj ,

Swift core data code that only works sometimes -

i wrote code set value 1 on property of xcdatamodeld entity called variables in viewdidload . problem when code runs, half time res.valueforkey("runningforfirsttime") , equals nil , half time res.valueforkey("runningforfirsttime") equals 1. why happening? here code: var appdel:appdelegate = uiapplication.sharedapplication().delegate as! appdelegate var context:nsmanagedobjectcontext = appdel.managedobjectcontext! var request = nsfetchrequest(entityname: "variables") request.returnsobjectsasfaults = false var newvar: anyobject = nsentitydescription.insertnewobjectforentityforname("variables", inmanagedobjectcontext: context) var results:array = context.executefetchrequest(request, error: nil)! var res = results[0] as! nsmanagedobject println(res.valueforkey("runningforfirsttime")) if res.valueforkey("runningforfirsttime") == nil{ //some code println("this nil") } newvar.setvalue(1, forkey: "ru

asp.net - web service is unable to return back to default page -

i have asmx web service hosted on iis , purpose authenticate logined user. when run code using visual studio , debug service called , authenticate user db unable transfer control code has default page. protected void page_load(object sender, eventargs e) { if (httpcontext.current.user.identity.isauthenticated) response.redirect("default.aspx"); response.cache.setnostore(); if (!page.ispostback) { session["uri"] = request.urlreferrer; } this.hdnloginstatus.innerhtml = ""; if (!page.ispostback) { new das().authenticaterequest(); if (httpcontext.current.items["loginstatus"] == null) return; var key = (authws.loginstatus)httpcontext.current.items["loginstatus"]; string msg = (string)getglobalresourceobject("message", key.tostring()) ?? ""; t

html - Servlet returns "HTTP Status 404 The requested resource (/servlet) is not available" -

i have html form in jsp file in webcontent/jsps folder. have servlet class servlet.java in default package in src folder. in web.xml mapped /servlet . i have tried several urls in action attribute of html form: <form action="/servlet"> <form action="/servlet.java"> <form action="/src/servlet.java"> <form action="../servlet.java"> but none of work. keep returning http 404 error below in tomcat 6/7/8: http status 404 — /servlet description : requested resource (/servlet) not available. or below in tomcat 8.5/9: http status 404 — not found message : /servlet description : origin server did not find current representation target resource or not willing disclose 1 exists why not working? put servlet class in package first of all, put servlet class in java package . should always put publicly reuseable java classes in package, otherwise invisible classes in packa

how can I convert this date format in swift? -

i want convert wed jul 01 04:48:51 +0000 2015 2015-07-01 tried below could't execute well(returned nil). let d = "wed jul 01 04:48:51 +0000 2015" let formatter = nsdateformatter() formatter.dateformat = "yyyy-mm-dd" let date: nsdate? = formatter.datefromstring(d) is possible convert date format? let d = "wed jul 01 04:48:51 +0000 2015" let formatter = nsdateformatter() formatter.dateformat = "eee mmm dd hh:mm:ss z yyyy" if let date = formatter.datefromstring(d) { formatter.dateformat = "yyyy-mm-dd" let datestring = formatter.stringfromdate(date) println(datestring) // "2015-07-01" }

apache - .htaccess nice url settings not redirecting -

i've been reading documentation , tutorials on .htaccess file setup evening nothing seems pan out... based on tools found online, i'm looking have web-browser show non .html names in navbar - ie. domain.com/contact/ instead of domain.com/contact.html current .htaccess file contents follows: options -multiviews rewriteengine on rewritebase / # force search engines use slowandlowcoastal.com rewritecond %{http_host} !^slowandlowcoastal\.com$ rewriterule ^(.*) http://slowandlowcoastal.com/$1 [r=301,l] # specify search friendly urls rewriterule ^rates$ /rates.html [l] rewriterule ^trips$ /trips.html [l] rewriterule ^photos$ /photos.html [l] rewriterule ^videos$ /videos.html [l] rewriterule ^contact$ /contact.html [l]

binary - Julia: Base function 10,000x quicker then similar function -

i'm playing around decimal binary converter 'bin()' in julia, wanting improve performance. need use bigints problem, , calling bin() bigint within file outputs correct binary representation; however, calling function similar bin() function costs minute in time, while bin() takes .003 seconds. why there huge difference? function binbase(x::unsigned, pad::int, neg::bool) = neg + max(pad,sizeof(x)<<3-leading_zeros(x)) = array(uint8,i) while > neg a[i] = '0'+(x&0x1) x >>= 1 -= 1 end if neg; a[1]='-'; end asciistring(a) end function bin1(x::bigint, pad::int) y = bin(x) end function bin2(x::bigint, pad::int,a::array{uint8,1}, neg::bool) while pad > neg a[pad] = '0'+(x&0x1) x >>= 1 pad -= 1 end if neg; a[1]='-'; end asciistring(a) end function test() = array(uint8,1000001) x::bigint= 2 x = (x^1000000

linux - How to get wget only save file if its complete -

i downloading files using wget this wget http://www.example.com/mysql.zip -o mysql.zip then have stuff file. but if there error in url or somewhere corrupted file mysql.zip is placed in there , script don't download file there , script fails. is there way if mysql.zip placed if file download complete. there 2 cases when can happen url not exist user manually cancels download in both above cases don't want file there what bash script: #!/bin/bash if wget http://www.example.com/mysql.zip -o mysql.zip # file else rm mysql.zip fi

c++ - QPixmap load segmentation fault -

i creating qt console application on windows 7. using qt 5.3. , have error make me frustration because of it. check on stackoverflow, no answers me. my problem when creating qpixmap got error segmentation fault , don't have other error information it. here code : qstring filepath = (directory + xmlreader.attributes().value("relativepath").tostring()); qfile _file(filepath); if (!_file.exists()) { qwarning() << "error : file " << filepath << " not exist"; return false; } qimagereader imagereader(filepath); qimage mainimage = imagereader.read(); if(mainimage.isnull()) { qwarning() << "error read image : " << filepath; qwarning() << imagereader.errorstring(); return false; } qpixmap mainpixmap(qpixmap::fromimage(mainimage)); // segmentation fault here on last line of code generate segmentation fault error on machine. there can debug error? update : have code on qpixmap, lead

python - passing selenium response url to scrapy -

i learning python , trying scrape page specific value on dropdown menu. after need click each item on resulted table retrieve specific information. able select item , retrieve information on webdriver. not know how pass response url crawlspider. driver = webdriver.firefox() driver.get('http://www.cppcc.gov.cn/cms/icms/project1/cppcc/wylibary/wjweiyuanlist.jsp') more_btn = webdriverwait(driver, 20).until( ec.visibility_of_element_located((by.id, '_button_select')) ) more_btn.click() ## select specific value dropdown driver.find_element_by_css_selector("select#tabjcwyxt_jiebie > option[value='teyaoxgrs']").click() driver.find_element_by_css_selector("select#tabjcwyxt_jieci > option[value='d11jie']").click() search2 = driver.find_element_by_class_name('input_a2') search2.click() time.sleep(5) ## convert html "nice format" text_html=driver.page_source.encode('utf-8') html_st

java - Jfreechart - can we set a shape for a datapoint in StackedAreaChart? -

i using jfreechart make stacked area chart. using class stackedxyareachart. i wanted know if draw shapes @ data points stackedareachart, (it line chart can denote each data point setting setseriesshapes()). the method setseriesshape() doesn't seem work. have idea ? here's have tried till (please not comment have empty dataset. plotting dynamic graph , series filled later ): incomingdata = new timetablexydataset(); final jfreechart incomingdatachart = chartfactory.createstackedxyareachart( "chart", "time", "payload (in bytes)", incomingdata, plotorientation.vertical, true, true, false); final stackedxyarearenderer renderchart = new stackedxyarearenderer(); renderchart.setseriespaint(0, color.decode("#339900")); renderchart.setseriespaint(1, color.decode("#cc9933")); renderchart.setseriespaint(2, color.decode("#33ccff")); renderchart.setseriespaint(3, color.decode("#ff660

c# - Trying to get arround "Multiplicity constraint violated." / SaveChanges is Changing Values -

i'm trying overcome "multiplicity constraint violated." error. have created simple / contrived example demonstrate issue. in example, have task , has collection of sub-tasks , task can sub-task of 1 or more task s. want able order sub-tasks. i'm open other suggestions on how have many-to-many relationship keeps track of order. there 3 test bellow have different problems. 1 find interesting third test orderedtask created , values correct until value taskid changed someplace inside of 'context.savechanges()' solution on git: https://github.com/jrswenson/orderedmanytomany public class task { private icollection<orderedtask> subtasks; public task() { subtasks = new list<orderedtask>(); } public int id { get; set; } public string description { get; set; } public virtual user assigneduser { get; set; } public int? assigneduserid { get; set; } [inverseproperty("parent")] publ

DocumentDB auto generated ID: GUID or UUID? Which variant? -

tl;dr: ids auto-generated documentdb supposed guids or uuids, , there difference? if uuids, variant/version of uuid? background: of documentdb client libraries auto generate id if not provide one. have seen mentioned in azure blog , in several related questions generated ids guids. know there some discussion on whether guids uuids , many people saying are. the problem: however, have noticed of ids documentdb auto-generates not follow uuid rfc , allows digits 1-5 in "version" nibble ( v in xxxxxxxx-xxxx-vxxx-xxxx-xxxxxxxxxxxx ). documentdb generates ids hex digit in nibble, example d981befd-d19b-ee48-35bd-c1b507d3ec4f , version nibble first e of ee48 . it possible depends on client used create documents. in our documentdb database, have documents third grouping dde5 , 627a , fe95 , , on. these documents stored within stored procedure calling collection.createdocument() options {'disableautomaticidgeneration': false} . other documents create throug

android - Retrieving single image from the internet using multiple threads -

i have android application required download huge size images server. downloading takes long time if used sampling since sampling save memory in cases whole image should fetched server. so, need know how can create multiple threads download chunks of single resource , reorder chunks again restore image. think should use http headers control don't know how , appreciate if can help multithreading won't increase bandwidth. download bottlenecked network speed, not processor speed. multithreading won't you. depending on situation, try caching image, using smaller or lower res images, packaging image in app, etc.

Django Rest Framework update field -

i new drf , trying write custom view / serializer can use update 1 field of user object. i need make logic update "name" of user. i wrote serializer: class clientnameserializer(serializers.modelserializer): class meta: model = clientuser fields = ('name',) def update(self, instance, validated_data): instance.name = validated_data.get('name', instance.name) instance.save() return instance this method never called. tried setting breakpoint there , debug it, never called, if use put, post or patch methods. if add create method being called when use post. this how view looks like: class updatename(generics.createapiview): queryset = clientuser.objects.all() serializer_class = clientnameserializer permission_classes = (permissions.isauthenticated,) does have suggestion? thanks! my models.py looks this class clientuser(models.model): owner = models.onetoonefield(user,unique=true

Why am I getting a Redefinition of a C++ class error? -

using following code below getting "redefinition of sortedll" error. removed "class sortedll" header file below. when remove sortedll header file can't declare sortedll in main.cpp file. so stuck. missing? sorted linked list header file #ifndef sortedlinkedlist_sortedll_h #define sortedlinkedlist_sortedll_h struct node { int data; struct node * next; }; class sortedll { public: int find(int data); bool remove(int data); int size(); bool removeodd(); bool add(int data); private: struct node * phead; int length; }; #endif sorted linked list cpp file #include <iostream> #include "sortedll.h" class sortedll { private: // searches linked list linearly int findlinear(int data, struct node ** pprev, struct node ** pcurr){ // start @ head of list *pcurr = phead; *pprev = null; int index = 0; while (*pcurr != null){ if ((*pcurr)->data

javascript - "Unexpected reserved word You may need an appropriate loader to handle this file type." using Webpack in Reapp -

i'm trying import javascript code reapp project. i've error when run reapp run . module parse failed: line 8: unexpected reserved word may need appropriate loader handle file type. | var searchpagestore = require('../../../../core/modules/searchpage/store/searchpagestore'); it looks using of require function causes error. however, can't modify code because it's reused several other javascript applications. any suggestion on how fix error message? thanks!

python - working with crontab -

i'm new python. googling has got me module https://pypi.python.org/pypi/python-crontab . i've setup env , installed python-crontab==1.9.3. keep getting errors. doing wrong? appreciate. i'm trying use examples don't seem working me. what following: add cron job cron tab terminal error output: traceback (most recent call last): file "test5.py", line 5, in <module> users_cron = crontab(user='testuser') file "/users/testuser/desktop/sample1/prj-env/lib/python2.7/site-packages/crontab.py", line 187, in __init__ self.read(tabfile) file "/users/testuser/desktop/sample1/prj-env/lib/python2.7/site-packages/crontab.py", line 231, in read raise ioerror("read crontab %s: %s" % (self.user, err)) ioerror: read crontab testuser: crontab: must privileged use -u users_cron = crontab(user='testuser') it appears trying create cronjob user '

matplotlib - Seaborn box plot broken after update to 0.6.0 -

i have updated seaborn 0.5.1 new 0.6.0 version. had been using seaborn make box plots , violinplots in python notebookand can't seem make code work anymore. matplotlib plt.boxplot still works data. particularly, problem seems happen when have group of lists or arrays in subsets different in size. e.g.: import numpy np import matplotlib.pyplot plt import seaborn sns x = np.array([1,3,4]), ([1,2]) plt.boxplot(x) #this works import numpy np import matplotlib.pyplot plt import seaborn sns x = np.array([1,3,4]), ([1,2]) sns.boxplot(x) #doesn't work this error when try seaborn box plot valueerror: list of boxplot statistics , `positions` values must have same length in new seaborn tutorial, says sns.boxplot should take plt.boxplot does. has had same problem update? there way of making work? if not, there way of installing both 0.6.0 version , 0.5.1 version , calling specific version in notebooks? as discussed in release notes there have been

how to have a jquery fade animation with html/css -

i trying come duplicate of this i want duplicate flame icons. these appear in each section on far right or left away central container have text. <section id="ourfires" class="portfolio page-section add-top add-bottom"> <!-- inner-section : starts --> <section class="inner-section"> <!-- container : starts --> <section class="container"> <div class="row"> <article class="col-md-12"> <h1 style="text-align:left;"><span class="animated" data-fx="bounceinright">our fire</span></h1> <article id="article"><hr class="hr"></hr></article> <div class="clearfix"></div> <div id="mid"> <p class="

c++ - mousePressEvent of QWidget gets called even though QTabletEvent was accepted -

in qwidget derived class object implemented tabletevent(qtabletevent *event) , mousepressevent(qmouseevent *event), mousepressevent gets called every time tabletevent gets called type tabletevent::tabletpress. according qt documentation , should not happen: the event handler qwidget::tabletevent() receives tabletpress, tabletrelease , tabletmove events. qt first send tablet event, if not accepted widget, send mouse event . mainwindow.cpp #include "mainwindow.h" #include "tabletwidget.h" mainwindow::mainwindow(qwidget *parent) : qmainwindow(parent) { tabletwidget* tw = new tabletwidget(this); setcentralwidget(tw); } tabletwidget.h #ifndef tabletwidget_h #define tabletwidget_h #include <qwidget> class tabletwidget : public qwidget { q_object public: explicit tabletwidget(qwidget *parent = 0); protected: void tabletevent(qtabletevent *event) q_decl_override; void mousepressevent(qmouseevent *event) q_decl_override; s

r - Function returns 0x0 table -

i have function compute latitude , longitude points in order create "ring" around center location. problem results print screen not stored anywhere. function creates dataframe 0 columns , 0 rows. want able take these coordinates , use them elsewhere. able nest function well, can't nest when doesn't return anything. my end goal create kml code. have kml code need repeat many times. kml code creates radius rings, fills them color, , adds name place. want generate files automatically using list of locations in lat/lon. my question is, how can function return list of coordinates want may paste them in kml code accordingly? can loop using adply , printed results 3 coordinates, nothing created. i quite new coding, please gentle. in advance. make.ring.file=function(dist,df) { r = 6378.14 #radius of earth d = dist*1.609344 #distance of ring radius in km lat1 = df$lat*(pi/180) #current lat point converted radians lon1 = df$lon*(pi/180) #current

Update XML node through Javascript/JQuery/AJAX -

i have been searching day, , have found promising options, haven't panned out me (ie. is possible add,delete xml nodes jquery $.ajax? ). believe biggest issue not being overly familiar ajax or xml, here problem simplified: need update local xml page through html page (without use of php or other server-side tools). working within vendor-provided solution (so cannot modify product much). here's snippets of have working: mobilesettings.xml: <settings> <application> <firstcase>publicmonitor</firstcase> </application> </settings> customsettings.js: function loadsettings() { $.ajax({ type: "get", url: '../configurations/mobilesettings.xml', datatype: "xml", success: function(xml) { $(xml).find('firstcase').each(function () { startpage.value = $(this).text(); }); } }); } what cannot work part of same .js, sa

javascript - Returning values from a PHP script for an AJAX method: What am I doing wrong here? -

from i've read on internet, way of returning html, json, etc., php script echo ing it. can't work, however. my js jquery('#new-member').submit( function() { var formurl = jquery(this).attr('action'); var formmethod = jquery(this).attr('method'); var postdata = jquery(this).serializearray(); console.log(postdata); // test jquery.ajax( { url: formurl, type: formmethod, datatype: 'json', data: postdata, success: function(retmsg) { alert(retmsg); // test }, error: function() { alert("error"); // test }

ruby on rails - jruby bundle install not working at gem 'scrypt' -

i trying bundle install jruby (windows) , getting error: c:/jruby-1.7.19/bin/jruby.exe -rubygems c:/jruby-1.7.19/lib/ruby/gems/shared/gems/rake-10.1.0/bin/rake rubyarchdir=c:/jruby-1.7.19/lib/ruby/gems/shared/extensions/universal-java-1.8/1.9/scrypt-2.0.2 rubylibdir=c:/jruby-1.7.19/lib/ruby/gems/shared/extensions/universal-java-1.8/1.9/scrypt-2.0.2 io/console not supported; tty not manipulated mkdir -p i386-windows cc -fexceptions -o -fno-omit-frame-pointer -fno-strict-aliasing -wall -msse -msse2 -fpic -o i386-windows/crypto_scrypt-sse.o -c ./crypto_scrypt-sse.c rake aborted! command failed status (127): [cc -fexceptions -o -fno-omit-frame-pointer...] org/jruby/rubyproc.java:271:in `call' org/jruby/rubyproc.java:271:in `call' org/jruby/rubyarray.java:1613:in `each' org/jruby/rubyarray.java:1613:in `each' org/jruby/rubyarray.java:1613:in `each' org/jruby/rubyarray.java:1613:in `each' tasks: top => default => i386-windows/scrypt_ext.dll => i386-win

html - I thought using a percentage in margin would be responsive -

so @ moment, i'm trying center 3 social media icons in footer of website nicely. so instead of using margin , pixels, not responsive when viewed on smaller screens ofcourse, tried using percentages, thought made responsive. thought percentage of screen calculated, resulting in same percentage distance on different screens different widths.. as can see on website ( http://riksblog.com/marnik/index.html ) not case when resizing.. can please clear out how make responsive , why combination of percentages , margin isn't correctly working when resizing? how can make sure 3 logo's centered on every device? solution center multiple images in footer , margin between them: .footer { width: 100%; } .logo-container { margin: auto; width: 320px; text-align: center; /* can set lowest bound, * or can change based on breakpoint */ } .logo { margin: 0 10px; /*or whatever spacing need*/ } <div class="footer"> <div