Posts

Showing posts from February, 2015

Previous Row data Using KendoUi MVC Grid - Razor-C# -

i have grid (razor-c#) containing multiple columns/rows , there column named profit/loss .for every row need check previous row data profit/loss column , make calculation put values in current row profit/loss column update html.kendo().grid(model.accounthistory).name("history").columns(c => { c.bound(p => p.datetimecalculated).format("{0:dd-mm-yyyy}"); c.bound("").clienttemplate("#= purchasecriteria(data) #").title(" "); c.bound(p => p.numcontracts).clienttemplate("#= moneyformat(numcontdfracts) #"); c.bound(p => p.entityid); c.bound(p => p.leagueid); c.bound("") .clienttemplate("#= setseasonyear(data) #") .sortable(false) .title("year"); c.bound("") .clienttemplate("#= setseason(data) #") .sortable(false) .title("season"); c.bound(p => p.contra

php - javascript: allow user to login after session times out -

i want write javascript program html webpage forces user after leaving session idle x minutes (no mouse movement or keys pressed) reenter password resume session. note, not talking destroying session/closing session time goes out, forcing user log out. i'm trying "pause" session having pop box user must type username , password resume work. thanks you use var timeoutholder=settimeout(pausesession,60000*nminutes); and reset time each time user press key window.addeventlistener("keydown", function(e){ cleartimeout(timeoutholder); var timeoutholder=settimeout(pausesession,60000*nminutes); }); you can create similar event detecting mouse movement. finally, define pausesession function shows popup. some thoughts security: should take account measure executed in client easy circumvent , therefore should use if not imply security risk. a more sophisticated version send message server , keep track of timer there, user can't alte

ios - Why do I receive an error that says 'Unable to simultaneously satisfy constraints.' for auto layout? -

Image
i trying pin button on 4 sides fix button object @ exact location arbitrarily placed at, getting following error when run it. insight or appreciated. unable simultaneously satisfy constraints. @ least 1 of constraints in following list 1 don't want. try this: (1) @ each constraint , try figure out don't expect; (2) find code added unwanted constraint or constraints , fix it. (note: if you're seeing nsautoresizingmasklayoutconstraints don't understand, refer documentation uiview property translatesautoresizingmaskintoconstraints) ( "<_uilayoutsupportconstraint:0x9f494b0 v:[_uilayoutguide:0x9f40370(20)]>", "<_uilayoutsupportconstraint:0x9f3b6c0 v:|-(0)-[_uilayoutguide:0x9f40370] (names: '|':uiview:0x9f3feb0 )>", "<_uilayoutsupportconstraint:0x9f418e0 v:[_uilayoutguide:0x9f407c0(0)]>", "<_uilayoutsupportconstraint:0x9f18010 _uilayoutguide:0x9f407c0.bottom == uiview:0x9f3feb0.bottom>", &quo

java - How to get previous revision CL in perforce -

i writing program, have cl ,from need access previoius revision cl of each file. how can ? code have written till is: ichangelist cl = server.getchangelist(clid); list<ifilespec> files = cl.getfiles(true); for(int = 0; < files.size() ; i++) { ifilespec filespec=files.get(i); } revision specifiers can here (see 'p4 revisions'). in particular, previous revision of each of files file of previous changelist. so, since clid changelist care about, compute change clprev = (clid - 1) , , 'file@clprev'.

Message Type ID for subtitles in RTMP packet -

i looking messagetype id subtitles in rtmp packet. i tried looking up, didnt find info this. http://wiki.multimedia.cx/?title=rtmp https://en.wikipedia.org/wiki/real_time_messaging_protocol there no messagetype subtitles. can send them in script tag, or sei nalu in avc es.

Generate and print a PDF with specific size in Android -

i'm working in android application, , want generate , print pdf. i'm having trouble. need generate pdf 80mm of width , , height may vary. i'm trying this: public class pdfgenerator implements runnable { private context ctx; private view view; private intent mshareintent; private outputstream os; public pdfgenerator(context ctx, view view) { this.ctx = ctx; this.view = view; makeandsharepdf(); } public void makeandsharepdf() { new thread(this).start(); } @targetapi(build.version_codes.kitkat) public void run() { printattributes printattrs = new printattributes.builder(). setcolormode(printattributes.color_mode_monochrome). setmediasize(printattributes.mediasize.iso_c7). setresolution(new printattributes.resolution("zooey", ctx.print_service, 500, 500)). setminmargins(printattributes.margins.no_margins).

objective c - get UDID of IOS device programmatically? -

this question has answer here: uidevice uniqueidentifier deprecated - now? 33 answers i want udid of ios device programmatically. using following code udid of ios device. nsuuid *uuid = [nsuuid uuid]; nsstring *uuidstring = uuid.uuidstring; but output different actual udid of device. nsstring* identifier = [[[uidevice currentdevice] identifierforvendor] uuidstring]; // ios 6+ nslog(@"output : %@", identifier); swift 2.x (here x denote above version 2.0) let identifier: string = uidevice.currentdevice().identifierforvendor().uuidstring() nslog("output : %@", identifier) swift3 let identifier = uidevice.current.identifierforvendor?.uuidstring nslog("output : %@", identifier! string) additional reference apple apparently starting remove access udid (unique device identifier) in ios5. in event, best can id

what's wrong with this code to use clojure.java.jdbc/insert -

i tried use java.jdbc insert! function, can receive multiple objects. clojure.java.jdbc/insert! should called this: (clojure.java.jdbc/insert! db {:name "john" :password "123"} {:name "george" :password "234"}) i defined function add multiple user records: (defn add-users [user & more] (-add-users db-spec user more)) (defmacro -add-users ([db user] `(j/with-db-connection [con-db# db] (j/insert! con-db# ~user))) ([db user & more] (let [users (-mk-user-list user more)] `(j/with-db-connection [con-db# db] (j/insert! con-db# ~@(flatten users))))) (defmacro -mk-usre-list ([user] `~user) ([user & more] `(list ~user (-mk-user-list ~@more)))) when macroexpand -add-users, looks result ok this: => (macroexpand '(-add-users db-spec {:name "john" :password "1234"})) (let* [db-spec__21320__auto__ db-spec] (clojure

html - Add browser max-width (media query) to javascript when hide header? -

could use help* i want control on width hide header (javascript) starts working lets say: @ width 667px , downwards. mobile viewing, don't want use: if( /android|webos|iphone|ipad|ipod|blackberry/i.test(navigator.useragent) ) { because doesn't let me control larger screen sizes big tablets/phones. i saw media query scripts javascript, can't work code see below: --> fiddle // hide header on scroll down // var didscroll; var lastscrolltop = 0; var delta = 44; var navbarheight = $('header').outerheight(); $(window).scroll(function(event){ didscroll = true; }); setinterval(function() { if (didscroll) { hasscrolled(); didscroll = false; } }, 250); function hasscrolled() { var st = $(this).scrolltop(); // make sure scroll more delta if(math.abs(lastscrolltop - st) <= delta) return; // if scrolled down , past navbar, add class .nav-up. // necessary never see "behind" navbar. if (st > lastscrolltop && st > nav

html - style select tag when dropdown is open -

does know if there pure css way apply styles select tag when dropdown open. thought maybe :active, or :focus hoping for, it's not quite right. it's possible select tag have focused state without dropdown being open, style still applies. know can add javascript accomplish this, looking pure css way. in advance. unfortunately, there isn't way this. using :enabled tag style select box, when unclicked. you can try making own select box html/css , little bit of js. here great tutorial on how so.

jsf - commandButton/commandLink/ajax action/listener method not invoked or input value not set/updated -

Image
sometimes, when using <h:commandlink> , <h:commandbutton> or <f:ajax> , action , actionlistener or listener method associated tag not being invoked. or, bean properties not updated submitted uiinput values. what possible causes , solutions this? introduction whenever uicommand component ( <h:commandxxx> , <p:commandxxx> , etc) fails invoke associated action method, or uiinput component ( <h:inputxxx> , <p:inputxxxx> , etc) fails process submitted values and/or update model values, , aren't seeing googlable exceptions and/or warnings in server log, not when configure ajax exception handler per exception handling in jsf ajax requests , nor when set below context parameter in web.xml , <context-param> <param-name>javax.faces.project_stage</param-name> <param-value>development</param-value> </context-param> and not seeing googlable errors and/or warnings in browser's jav

java - spring-jpa how to get EntityNotFoundException or similar on find* query methods? -

i'm struggling following problem: don't want null reference if there's no object in database. all jpa providers have tried return empty list if there no matches query. also, collectionutils.isnotempty(resultlist); is friend.

Unable to hit the local file in android studio -

i have created project on android studio works fine when come change local hitting page local page located in assets floder under www folder, location path try use following code: mywebview.loadurl("../assets/www/pages/splashscreen.html"); i unable hit local pages. these line of code works fine mywebview.loadurl("http://www.google.com"); mywebview.loadurl("http://www.facebook.com"); why can not able hit local pages mywebview .loadurl("../assets/www/pages/splashscreen.html"); where wrong ? someone please me out. thanks in advance.

javascript - why use setTimeout on this slideshow? -

with this article create simple javascript slideshow. can't understand why used settimeout on last of codes. settimeout call 1 times function . <html> <script> var images = new array(); images[0] = new image().src = "1.png"; images[1] = new image().src = "2.png"; images[2] = new image().src = "3.png"; images[3] = new image().src = "4.jpg"; if (!document.images){ console.log("your browser not support images class"); } else {console.log("welcome slider")} </script> <body> <img src = "1.png" name = "slide" id="slider" width="300" height="100" /> </body> <script> var step = 0 function slideit(){ //if browser not support image object, exit. if (!document.images) { console.log("your browser doesn't support our site")} document.getelementbyid('slider').src = images[step] if

python - One of my models causes the ...has no attribute '_meta' error when registered to the Admin interface. -

my project consists of 'user' model , 'timer' model. my timer model looks this: class usertimer(models.model): timer_user = models.foreignkey('reguser', related_name='user', verbose_name="user", null=true) timer_ispresent = models.booleanfield(_("user present?"), default=false, blank=true) timer_entertime = models.timefield(blank=true, null=true, editable=false) timer_exittime = models.timefield(blank=true, null=true, editable=false) class meta: verbose_name = _('timer') def timerin(self, user): ... return after registering users model, in same way trying register timer model too: class timeradmin(admin.stackedinline): fieldsets = ['timer_ispresent'] admin.site.register(usertimer, timeradmin) but attributeerror: 'nonetype' object has no attribute '_meta' error. i realize issue me using foreignkey in timer , not sure why or how can

Android layout solution -

Image
i trying make layout comparable both phones , tablets. since there many different screen sizes , resolutions wondering best way achieve shown bellow. bottom banner should retain aspect ratio still fill 100% width of screen. of logo, image , buttons need close possible shown on devices. can point me proper solution (relative/linear) layout or there different approach? sorry if question not suitable nut struggling few hours finding best way display correctly. :( you can create own star view programatically , use background, public class starlayout extends relativelayout { public starlayout(context context) { super(context); } public starlayout(context context, attributeset attrs) { super(context, attrs); } @suppresslint("newapi") public starlayout(context context, attributeset attrs, int defstyle) { super(context, attrs, defstyle); } @override protected void ondraw(canvas canvas) { path clippath = new path(); clippath.addpath(s

json - REST service semantics; include properties not being updated? -

suppose have resource called person . can update person entities doing post /data/person/{id} . suppose simplicity person has 3 properties, first name, last name, , age. get /data/person/1 yields like: { id: 1, firstname: "john", lastname: "smith", age: 30 } . my question updates person , semantics of services this. suppose wanted update john, he's 31. in terms of design approach, i've seen apis work 2 ways: option 1: post /data/person/1 { id: 1, age: 31 } right thing. implicitly, property isn't mentioned isn't updated. option 2: post /data/person/1 full object have been received get -- properties must specified, if many don't change, because api (in presence of missing property) assume proper value null . which option correct recommended design perspective? option 1 attractive because it's short , simple, has downside of being ambiguous in cases. option 2 has sending lot of data , forth if it's not ch

Python path define / Python 2.7.3 -

i trying define simple python path, error. can please tell me how set correct path. working on raspberry pi. here code doesn't work: import re, os, rrdtool, time, sys # define pathes 1-wire sensor data pathes = "/sys/bus/w1/devices/10-000801ddae93/w1_slave" and # insert data round-robin-database rrdtool.update( "%s/temperature.rrd" % (os.path.dirname(os.path.abspath(__file__))), data) the errors get: 07/27/15 13:21:37 error reading s : [errno 2] no such file or directory: 's' 07/27/15 13:21:39 error reading y : [errno 2] no such file or directory: 'y' 07/27/15 13:21:40 error reading s : [errno 2] no such file or directory: 's' 07/27/15 13:21:41 error reading / : [errno 21] directory: '/' 07/27/15 13:21:42 error reading b : [errno 2] no such file or directory: 'b' 07/27/15 13:21:44 error reading u : [errno 2] no such file or directory: 'u' 07/27/15 13:21:45 error reading s : [errno 2] no suc

filereader - Reading ID3 In JavaScript -

i'm trying create media player chromebooks using javascript. need read id3 tags mp3s, can't find reliable id3 reader. eric bidelman's solution using jdataview isn't working . seems though jdataview meant node.js, while i'm looking browser-based solution. all other resources i've found sloppy/incomplete , don't work! don't exist on github anymore. ): is there reliable resource this?

makefile - What is the difference between %.c and *.c in GNU Make -

what difference between %.c , *.c in makefiles. example may have: vpath %.c $(base_dir)platform/$(target) and files += $(wildcard *.c) both include files in directory end .c take account. when use %.c , when *.c ? in other words why can't use vpath *.c $(base_dir)platform/$(target) instead of vpath %.c $(base_dir)platform/$(target) ? thank you. both % , * in gnu make wildcard functions. difference between them % can used part of text substitution function whereas * cannot. if trying make fastest possible makefile, should try , use * wildcard function in preference % substitution function there should no resources used store name of matched item , substitute subsequent function call. if not bothered optimising make system limit, not need worry 1 choose.

javascript - Better way to turn a one-dimensional array into multi-dimensional array by required group size in JS -

i rather new js , working on problem asked split array (first argument) groups length of size (second argument) , returns them multidimensional array. got problem work right test cases suggested using array `push()` method. tried multiple times , couldn't ever work right. think getting messed arrays being reference. declared new array each element. went more classic deep copy each element @ time. didn't go , try `push()` method again. there has more efficient way this. want write code. love see better versions please. thanks! function chunk(arr, size) { var group = 0; var counter = 0; var = false; var odd = false; if (arr.length % size === 0) { group = arr.length / size; = true; } else { group = math.ceil(arr.length / size); odd = true; } var newarr = new array(group); (var = 0; < group; i++) { newarr[i] = new array(size); } (i = 0; < group; i++) { (var j = 0; j

Using $injector vs. direct DI in angularjs? -

i not seeing difference (or pros/cons) directly injecting dependencies vs. using $injector in angularjs. why 1 or other? here sample of two. angular .module("myapp") .factory("myservice", [ "$injector", function($injector) { var $http = $injector.get("$http"); //used $injector $http, data, etc. } ]); angular .module("myapp") .factory("myservice", [ "$http", function($http) { //just use $http data, etc. } ]); in cases, second method simple, readable , works, if use precompiler writes string values you, e.g. ng-annotate : angular.module("myapp") .factory("myservice", /*@nginject*/ function($http, $locale, $window) { }); i see no reason why should avoid it. the first method, using $injector should reserved specific cases, e.g. when there many injections (and don't want ref

php - Export products with Category Names -

i'm exporting categories associated product array. it's working fine static indexes follow: foreach($collection $product) { $_cat = array(); $categoryname = array(); foreach ($product->getcategoryids() $id) { $_cat = mage::getmodel('catalog/category')->setstoreid(mage::app()->getstore()->getid())->load($id); $categoryname[] = $_cat->getname(); } fputcsv( $output, array( $categoryname[0] . $categoryname[1] . $categoryname[2] ) ); } when i'm trying give indexes dynamically using foreach() or for() loop, products not being exported. example, if i'm using fputcsv( $output, array( foreach($categoryname $name) { echo $name; } ) ); it's not working. also i've tried fputcsv($output, array( array_value($categoryname); ) ); but prints output array whereas i'm looking array values out

java - does asynchronous call in GWT get blocked due to another asynchronous call which taking long time to finish -

i have following codes executed every 3 seconds asynchronously <scheduler.get().schedulefixeddelay(new repeatingcommand() { @override public boolean execute() { try { requestbuilder builder = new requestbuilder(requestbuilder.post, "someurl"); request response = builder.sendrequest(null, new requestcallback() { public void onerror(request request, throwable exception) { } public void onresponsereceived(request request, response response) { // work } }); } catch (requestexception e) {} return true; } }, 3000); and below code takes long time proceed. try { requestbuilder builder = new requestbuilder(requestbuilder.post, "someurl"); request response = builder.sendrequest(null, new requestcallback() { public void onerror(request request, throwable ex

gradle - How to let subprojects choose their own repository configurations in a multi-project build? -

i'm new using build tools , working on multi-project environments in general i'll try explain best can. structure this directory structure. (there's more modules tried keep simple purpose of question) project vcs repo root +---project a/ | build.gradle | settings.gradle | +---project b/ | build.gradle | +---project c/ | | build.gradle | \---libs/ | +---project d/ | build.gradle | settings.gradle | +---shared libs/ | \---build.gradle project depedencies: a depends on b , c . d depends on b , a . each project can dependency 1 of 3 places: mavencentral a libs directory own root directory. (the libs dir under project c project c use) shared libs directory in project's parent directory. however libs folders contents not guaranteed in format, (it not dir jars, there might sub dirs , such) goal i want each project buildable project's root directory, , not want keep redundant copy of repositories

shell - Can I export variable with another variable inside? -

i have .sh script uses environment variables export before. variables this: var1="${libdir}/test" in script, ${libdir} replaced value. declared export below: export var1="${libdir}/test" in script libdir not taken account @ all. can way? no, can't have variable contains variable reference gets substituted in "delayed" fashion: $ libdir=foo $ var1="${libdir}/test" $ libdir=bar $ echo "$var1" foo/test you could around using eval , shouldn't. however, function want, price of touch syntax: $ var1() { echo "${libdir}/test" } $ libdir=foo $ echo "$(var1)" foo/test $ libdir=bar $ echo "$(var1)" bar/test

c# - How to use dependency injection in quartz.net scheduler -

i'm trying run quartz.net service in asp.net mvc 4 application using dependency injection & services. in application need quartz sending emails daily period. whats strange can't use di in quartz.net code because it's broke if i'm add constructor it. have ideas how can resolve problem? namespace bbwt.web.scheduler { public class emailjob : ijob { //private readonly iemailsender emailsender; //public emailjob(iemailsender emailsender) { // this.emailsender = emailsender; //} public void execute(ijobexecutioncontext context) { var result = new list<debtorsdto>() { new debtorsdto() { invoiceid = 1, clientname = "some client", clientemail = "someemail@mail.com", clientid = 1, //sessionid = 1, date = "17.07.2015&qu

Accessing a child node by name of an XML document using C# -

i have situation xml document contained similar following, order of "block" elements changed, , in application, accessing value of in using getelementsbytagname("amount")[0].innertext, first occurrence of "amount". order of "blocks" changed, , "amount" returned getelementsbytagname still first occurrence, want "amount" in "block1" returned. how accomplish in c#? before: <response xmlns="testsite.com/schema/testservice/2015-01-01"> <block1> <amount>$5.00</amount> </block1> <block2> <amount>$0.00</amount> </block2> <block3> <amount>$0.00</amount> </block3> </response> after: <response xmlns="testsite.com/schema/testservice/2015-01-01"> <block2> <amount>$0.00</amount> </block2> <block3> <amount>$0.00</amount> <

app crashes when no iBeacon is detected - Swift iOS -

i working on app uses ibeacons cllocation , light blue bean ios sdks. if run app battery out of beacon app works well. if insert battery beacon app detects beacon , works well. problem when remove battery beacon ( or when no beacon detected or beacon out of range) app crashes , gives me following error, fatal error: array index out of range. i understand error coming cllocationmanagerdelegate method didrangebeacons, im not sure how prevent app crashing? code below, func locationmanager(manager: cllocationmanager!, didrangebeacons beacons: [anyobject]!, inregion region: clbeaconregion!) { self.listbeans = beacons; nsnotificationcenter.defaultcenter().postnotificationname("updatebeacontableview", object: self.listbeans) if beacons.count == 0{ println("no beacons nearby") manager.stopupdatinglocation() manager.stopmonitoringforregion(lightblueregion) }else{ let knownbeacons = beacons.filter{$0.proximity != c

bash - Unix - batch file to unzip folder with specific name -

i need batch script unix don't know well. i have folder , subfolder a\a1\b\c\file.zip a\a2\b\c\otherfile.zip a\a3\b\c\thirdfile.zip each zip file contains xml file , text file the script have 2 things: unzip zip files in folder named 'c' of sub folder of 'a' ; unzipped files should stay in same folder in zip all unzipped files have xml extension have been renamed someone can me? thank much you can this. #find folder 'c' , unzip zip files folder in `find ./a -name c -type d`; unzip $folder/data.zip -d $foler; done #find .xml files , change extension .edefg file in `find ./a -name *.xml -type f`; mv "$file" "${file%.xml}.edefg"; done

ruby on rails - Why is my json not appearing in my params? -

in rails app, have: routes.rb: resources :tasks, :defaults => {:format => 'json'}, :except => [:index, :new, :create, :show, :edit, :update, :destroy] member :to_chrome post :from_chrome end end mime_types.rb: mime::type.register "application/xls", :xls mime::type.register "application/json", :json tasks_controller.rb: class taskscontroller < applicationcontroller skip_before_action :verify_authenticity_token, if: :json_request? def to_chrome @survey = survey.find(params["id"]) @survey = survey.last respond_to |format| format.json {render_for_api :private, :json => @survey} end end end def from_chrome binding.pry_remote render :nothing => true end protected def json_request? request.format.json? end end to_chrome working fine. i'm trying trigger from_chrome postman following settings: url: http://localhost:3000/

json - Can URL #anchor contain binary data? -

i'm trying encode web pages state in #anchor. right base64 encoding json string, gets long (10k+). apparently hit kind of url length limitation , doesn't work right (it gets cut off , json data structure can't reconstructed). i talked of buddies , said try bzip or gzip it. tried that, #anchor binary data. i haven't been able decode properly, , i'm not sure if got sent correctly part of url. does know how add binary data in #anchor , if it's idea, or how come alternative working solution problem? i not bother of this. use local storage large data, , send reference through anchor data.

javascript - How do I load multiple json arrays based on ng-route? -

i'm new angular , wondering if there way can load multiple json arrays app. basically, have json document contains data looks kinda example. it has multiple arrays within same file. thinking maybe loop through them , load data, i'm not sure. { 'title': 'myapp', 'data1': [ { 'listname': 'name1', 'id': '1' }, { 'listname': 'name2', 'id': '2' }, ], 'data2': [ { 'listname': 'name1', 'id': '1' }, { 'listname': 'name2', 'id': '2' }, ], 'data3': [ { 'listname': 'name1', 'id': '1' }, { 'listname': 'name2', 'i

amazon web services - AWS CloudFront Behavior -

i've been setting aws lambda functions s3 events. want set new structure bucket, it's not possible--so set new bucket way want , migrate old things , send new things there. wanted have of structure same under given base folder name old-bucket/images , new-bucket/images . set cloudfront serve old-bucket/images now, wanted add new-bucket/images well. thought behavior tab set such check new-bucket/images first old-bucket/images . alas, didn't work. if object wasn't found in first, end of line. am misunderstanding how behaviors work? has attempted this? that expected behavior. origin tells amazon cloudfront obtain data serve users, based upon prefix, suffix, etc. for example, serve old-bucket/* 1 amazon s3 bucket, while serving new-bucket/* different bucket. however, there no capability 'fall-back' different origin if file not found. you check existence of files before serving link, , provide different link depending upon files stored.

c# - List to Dictionary with incremental keys in one line LINQ statement -

i have list: var items = new list<string>() { "hello", "i value", "bye" }; i want convert dictionary following structure: var dic = new dictionary<int, string>() { { 1, "hello" }, { 2, "i value" }, { 3, "bye" } }; as can see, dictionary keys incremental values, should reflect positions of each element in list. i looking one-line linq statement. this: var dic = items.todictionary(i => **specify incremental key or element index**, => i); you can using overload of enumerable.select passes index of element: var dic = items.select((val, index) => new { index = index, value = val}) .todictionary(i => i.index, => i.value);

Square root in C++ programming language -

please help. syntax write square root of following √4*3.142*a in c plus plus programming language. variable. you can use sqrt(4*3.142*a) don't forget add first #include<cmath>

php - How to import big file sql to mysql locally -

i want import big sql file mysql database locally . i try import command line execute command , waited more 2 hours without results 170 mo sql file . i tried change php.ini wampserver don't start . memory_limit = 900m post_max_size = 500m upload_max_filesize = 500m how can import file please ? with following command mysql -u username -p password dbname < dump.sql you not have modify php.ini, not using php. you can use command display going: mysql -u username -p password dbname --verbose < dump.sql your file big, can take while load on local database, depends of own computer , example if datas loaded have lot of indexes.

javascript - Carousel Thumbnails still not auto updating -

building carousel thumbnails, thumbnail should correspond slide displayed , selected thumbnail should have border around let users know slide on. current code has thumbnails selected onclick should auto updating each slide of carousel, have done wrong? $('#mycarousel').carousel({ interval: 4000 }); // handles carousel thumbnails $('.carousel-selector').click(function () { var selectoridx = $(this).closest('li').index(); $('#mycarousel') .carousel(selectoridx) .find('.carousel-selector').removeclass('selected') .eq(selectoridx).addclass('selected') .end() .find('.item').removeclass('selected') .eq(selectoridx).addclass('active'); }); fiddle http://jsfiddle.net/gward90/xr8qzxmg/9/ the best way go use slide.bs.carousel event change "active" thumbnail. $('#mycarousel').carousel({ interval: 4000 }); var selectoridx = 1; var numitems = $('.carousel-sele

c# - Adding data to DataSource from UI with BindingSource -

i have form (form1) contains grid, bound datasource via bindingsource. i have button, once clicked opens form (form2) should let user enter new data. i pass bindingsource form1 form2, , goal once user "saves" input in form2, it'll automatically added form1. is there way this, w/o directly accessing ui controls? i.e - public partial class form2 : form { bindingsource bs = new bindingsource(); public form2(bindingsource bindingsourcefromform1) { initializecomponent(); this.bs = bindingsourcefromform1; } private void button1_click(object sender, eventargs e) { datarow dr = (this.bs.datasource datatable).newrow(); dr["col1"] = this.textbox1.text; dr["col2"] = this.textbox2.text; this.bs.add(dr); } } is there way bind controls on form2 (in example above textbox1/2) bindingsource, , ha

c# - Background Task sometimes able to update UI? -

i answered question whether task can update ui. played code, realized i'm not clear myself on few things. if have windows form 1 control txthello on it, i'm able update ui task, seems, if on task.run : public partial class form1 : form { public form1() { initializecomponent(); task.run(() => { txthello.text = "hello"; }); } } however if thread.sleep 5 milliseconds, expected crossthread error thrown: public partial class form1 : form { public form1() { initializecomponent(); task.run(() => { thread.sleep(5); txthello.text = "hello"; //kaboom }); } } i'm not sure why happens. there sort of optimization extremely short running task ? you didn't post exception stack trace, expect looked this: system.invalidoperationexception: cross-thread operation not valid: control 'textbox1' accessed t

javascript - Adding object to PFRelation through Cloud Code -

i trying add object pfrelation in cloud code. i'm not comfortable js after few hours, i've thrown in towel. var relation = user.relation("habits"); relation.add(newhabit); user.save().then(function(success) { response.success("success!"); }); i made sure user , habit valid objects isn't issue. also, since editing pfuser , using masterkey: parse.cloud.usemasterkey(); don't throw in towel yet. cause hinted @ variable name newhabit . if it's new, that's problem. objects being saved relations have have once been saved themselves. cannot new. so... var user = // got user somehow var newhabit = // create new habit // save it, , use promises keep code organized newhabit.save().then(function() { // newhabit no longer new, maybe wasn't great variable name var relation = user.relation("habits");

iOS, Swift, SqLite, Select and show all the rows -

i have sqlite database. use fmdb. how select , show rows of database selected?. in code can show first name, first row. how iterate through rows selected , show them swift? @ibaction func selectnoms(sender: anyobject) { let contactdb = fmdatabase(path: databasepath string) if contactdb.open() { let querysql = "select name contacts" let results:fmresultset? = contactdb.executequery(querysql, withargumentsinarray: nil) if results?.next() == true { status.text = results?.stringforcolumn("name") } contactdb.close() } else { println("error: \(contactdb.lasterrormessage())") } } you can try this: while results.next() { status.text = results.stringforcolumn("name") }

python - retrieve the tweets of the followers of a specified user using tweepy -

i want retrieve tweets of followers of specified user(ex: narendra modi) using tweepy. have got followers , printing names. guys me out how retrieve tweets well?? here how getting followers: import tweepy import time consumer_key = '' consumer_secret = '' access_token = '' access_token_secret = '' auth = tweepy.auth.oauthhandler(consumer_key, consumer_secret) auth.set_access_token(access_token, access_token_secret) api = tweepy.api(auth) if(api.verify_credentials): print 'we sucessfully logged in' users = tweepy.cursor(api.followers, screen_name="pmoindia").items() while true: try: user = next(users) except tweepy.tweeperror: time.sleep(60*15) user = next(users) except stopiteration: break print "@" + user.screen_name you can tweets using screen name user_timeline method. after collect users, can collect tweets following. tweets = tweepy.cursor(api.

javascript - Preserving back button in angular through a loading controller? -

depending on logic in services, route different views. facilitate service injection, use loading controller determine go next. this works great, except can't go "back" through loading controller. how either detect button, or fix loading model more friendly it? .when('/loading', { templateurl: '/app/views/mystuff/loading.html', controller: 'loadingcontroller' }) angular.module('app').controller('loadingcontroller', ['$location', 'whereservice', function ($location, whereservice) { if (!whereservice.donewitha()) { $location.path('/a'); } else if (!whereservice.donewithb()) { $location.path('/b'); } else { location.href = "/myapp/somewhereelseentirely"//this fine } }]); angular.module('app').controller('aloadingcontroller', ['$

compilation - Intel compiler segmentation violation when compiling using -openmp and -ipo with Cray LibSci on Cray XC30 -

i compiling code uses cray libsci numerical library blas , lapack on cray xc30 system using intel compiler "-ipo" flag , including "-openmp" compile openmp-enabled code. i see following error code try compile: ** segmentation violation signal raised ** access violation or stack overflow. please contact support. ifort: error #10106: fatal error in /opt/intel/composer_xe_2013_sp1.4.211/bin/intel64/fortcom, terminated segmentation violation ifort: error #10014: problem during multi-file optimization compilation (code 1) this can illustrated simple example: user@eslogin008:~> cat blas1f.f program blas1f implicit none real*4 x(4), y(4) external sswap data x/2, 3, 4, 5/ data y/5, 4, 9, 2/ call sswap(4, x, 1, y, 1) write (*,*) 'after swap..' end compiling: user@eslogin008:~> ftn -ipo -openmp blas1f.f ** segmentation violation signal raised ** access violation or stack overflow.

filemaker - XPath to parse eCFR XML using attributes and nodes -

this question has been edited make things bit clearer. i attempting pull data out of electronic code of federal regulations xml feed ( http://www.gpo.gov/fdsys/bulkdata/cfr/2015/title-15/cfr-2015-title15-vol2.xml ) , having trouble. specifically, i'd grab data matched combination of node , attribute. in following snippet of xml, can see of text i'd grab. obtain data each fp node attribute fp-2 present. grab data each fp node having attribute fp-1. <appendix> <ear>pt. 774, supp. 1</ear> <hd source="hed">supplement no. 1 part 774—the commerce control list</hd> <hd source="hd1">category 0—nuclear materials, facilities, , equipment [and miscellaneous items]</hd> <hd source="hd1">a. “end items,” “equipment,” “accessories,” “attachments,” “parts,” “components,” , “systems”</hd> <fp source="fp-2">