Posts

Showing posts from July, 2014

Serialize arrays from text file to inspector (Unity 5 with c#) -

i working on saving arrays have pulled long text file. used foreach loop arrays little lost on go here. can use [serializedfield] show coordinates x,y,z in inspector need figure out how save data loop. advice me in right direction awesome! thank ahead of time. here code: using unityengine; using system; using system.collections; using system.collections.generic; [serializable] public class multiarraylist : monobehaviour { public textasset datafile; private int i; //private float[,] coordinates; [serializefield] private float[] coordx; [serializefield] private float[] coordy; [serializefield] private float[] coordz; [serializefield] private float[] intensity; //private vector3 verts; // use initialization void start() { string[] datalines = datafile.text.split ('\n'); string[] linevalues; //print (datalines.length); i=0; //float[,] coordinates = new float[6853, 3]; float[] coordx = new float[6853]; float[] coordy = new float[6853]; f...

javascript - Injecting dependencies into Angular services for testing -

i'm trying test driven development of angular service i'm writing using jasmine. however, seem have stumbled @ first hurdle, , cannot $resource dependency resolve. the error unknown provider: $resourceprovider <- $resource <- lookupservice my code follows module: (function() { 'use strict'; angular .module('common', ['ngsanitize', 'nganimate']); })(); service: (function() { 'use strict'; angular .module('common') .service('lookupservice', lookupservice); lookupservice.$inject = ['$resource', 'api']; function lookupservice($resource, api) { return { getlookup: getlookup }; function getlookup() { return "something"; } } })(); test: describe('service tests', function () { var lookupservice, mockapi, $httpbackend; //mocks beforeeach(function () { mockapi = { geturi: jasmine.createspy() }; ...

database - Why I cant write dataframe in DB? -

i have 32 gb ram , use jupyter , pandas. dataframe isn't big, when want write in arctic data base have "memoryerror": df_q.shape (157293660, 10) def memory(df): mem = df.memory_usage(index=true).sum() / (1024 ** 3) print(mem) memory(df_q) 12.8912200034 and want write it: from arctic import arctic import arctic arc store = arctic('.....') lib = store['mylib'] lib.write('quotes', df_q) memoryerror traceback (most recent call last) in () 1 memory(df_q) ----> 2 lib.write('quotes', df_q) /usr/local/lib/python2.7/dist-packages/arctic/decorators.pyc in f_retry(*args, **kwargs) 48 while true: 49 try: ---> 50 return f(*args, **kwargs) 51 except (duplicatekeyerror, serverselectiontimeouterror) e: 52 # re-raise errors won't go away. /usr/local/lib/pyt...

c# - Paypal Express Checkout: Error 10001 Timeout -

so i'm trying implement paypal express checkout , keep recieving above error. my nv follows: method=setexpresscheckout& version=204.0& user=mylogicn& pwd=mypwd& signature=mysignature& paymentrequest_0_amt=26.65& paymentrequest_0_currencycode=gbp& returnurl=https://www.example.com/basket/notificationprocessor.ashx?type=paypalsuccess& cancelurl=https://www.example.com/basket/notificationprocessor.ashx?type=paypalfailure& paymentrequest_0_paymentaction=sale obviously information changed. can't find particularly wrong request without fail returns 10001, timeout processing request. i'm hoping here has encountered before , has solution. edit: here's code puts request , retrieves response: string[][,] nv = new string[11][,] { new string[,]{{"method", "setexpresscheckout" }}, new string[,]{{"version", "204.0" }}, new string[,]{{"user", "myuser"}}, new...

php - Dependent Dropdown and Input not getting populated (Codeigniter, Ajax, jQuery) -

i try cascading dependent select box , input in codeigniter ajax. first step works quite well. securities can loaded, when selecting account. problem starts second step. so, when try after security-selection set appropriate changeable inputs, security-select getting blocked , nothing works. don't understand problem is. please me, nasty blockage dissolve. thanks. ajax : $(document).ready(function(){ var _form = $("#trans_form").serializearray(); $('#amount_section').hide(); $('#quantity_section').hide(); $('#accountdrop').on('change',function(){ $("#securitydrop > option").remove(); var accountid = $(this).val(); if(accountid == '#') {return false;} $.ajax({ data: _form, type: "post", url: global_base_url + "custody/get_securities_dropdown/" + accountid, success: function(securities) { $.each(securities,function(id,value) { ...

php - Nginx PHP5.6 permission eror -

i getting following error in nginx error.log file, need prevent happening? 2016/06/28 09:43:37 [crit] 1631#0: *1 connect() unix:/run/php/php5.6 fpm.sock failed (13: permission denied) while connecting upstream, client: 192.168.56.1, server: my-vm, request: "get / http/1.1", upstream: "fastcgi://unix:/run/php/php5.6-fpm.sock:", $host: "my-vm-1" nginx runs www-data permissions. permissions of folder error message referencing ( /run/php/php5.6-fpm.sock ) follows: drwxr-xr-x 20 root root 700 jun 28 09:45 run drwxr-xr-x 2 www-data www-data 80 jun 28 09:44 php srw-rw---- 1 www-data www-data 0 jun 28 09:44 php5.6-fpm.sock the user/group of php ( /etc/php/5.6/fpm/pool.d/www.conf ) is: user = www-data group = www-data listen.owner = www-data listen.group = www-data listen.mode = 0660 the nginx.conf file not have user value set. people have suggested setting www-data , if set nginx service won't start,...

jquery - HTML.BeginForm/Ajax.Begin Form not working in Partial View -

i have partial view contains table , data dynamically append table. when click on save button in form , controller method not firing. please see below code partial view. <div id="cavitypartial"> <table id="ctable" class=" table table-bordered"> <tr> <th></th> <th>c name</th> <th>number of c</th> @foreach (var item in model.plbys) { <th>@item.plname (ct/sec)</th> } <th>comments</th> </tr> @foreach (var item in model.cbys) { //using (html.beginform("cavityupdate", "cavity", formmethod.post, new { id = "tblcavity" })) using (ajax.beginform("cavityupdate", "cavity", new ajaxoptions { httpmethod = "post", insertionmode = insertionmode.replace, updatetargetid = "cavitypartial" })) ...

c++ - "A()" vs. "A() = default;" vs. Implicit A()? -

#include <vector> // version 1 struct { std::vector<int> m_coll; // compiler generate ctor a() here }; // version 2 struct { std::vector<int> m_coll; a(){} }; // version 3 struct { std::vector<int> m_coll; a() : m_coll(){} }; // version 4 struct { std::vector<int> m_coll; a() = default; }; what differences between 4 versions? is m_coll guaranteed default-initialized in of these versions? it easier consider various options whenever add datum. consider: struct { int i; std::vector<int> coll; }; in case, compiler generates default c'tor you, i uninitialized, you'll have set explicitly. let's improve things: struct b { int {}; std::vector<int> coll; }; for b , compiler generates default c'tor you, i initialized in-class, , default-constructed object of type b initialized. suppose want add user-defined c'tor: struct c { int {}; std::vector<int...

python - How do I pick one dict inside a list of dictionaries that are differed by one value? -

i have list of dictionaries this: xyz =[ {"key1":"1","key2":"2","key3":"x_1"},{"key1":"1","key2":"2","key3":"x_2"},{"key1":"1","key2":"2","key3":"x_3"},{"key1":"5","key2":"6","key3":"y_1"},{"key1":"5","key2":"6","key3":"y_2"},{"key1":"5","key2":"6","key3":"y_3"}] i trying select first dict every unique 'key1' value. above dict expecting output as: xyz=[{"key1":"1","key2":"2","key3":"x_1"},{"key1":"5","key2":"6","key3":"y_1"},] i tried following code: dictout = [dict(sample) sample in set(tupl...

php - My PDO Statement doesn't work -

this php sql statement , it's returning false while var dumping $password_md5 = md5($_get['password']); $sql = $dbh->prepare('insert users(full_name, e_mail, username, password, password_plain) values (:fullname, :email, :username, :password, :password_plain)'); $result = $sql->execute(array( ':fullname' => $_get['fullname'], ':email' => $_get['email'], ':username' => $_get['username'], ':password' => $password_md5, ':password_plain' => $_get['password'])); if pdo statement returns false , means query failed. have set pdo in proper error reporting mode aware of error. put line in code right after connect $dbh->setattribute( pdo::attr_errmode, pdo::errmode_exception ); after getting error message, have read , comprehend it. sounds obvious, learners ove...

google maps - How to find out what is at a location? -

is there way google maps api or alternative find out @ given location? example: businesses @ latitude x , longitude y? you can places api nearby search https://developers.google.com/places/web-service/search for example, if wonder nearest cafe coordinate 37.441541,-122.146082, can execute following request https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=37.441541%2c-122.146082&rankby=distance&type=cafe&key=your_api_key the first result 'casa cowper - not business' (place id chijj6q3zd27j4arnljll4hpbp0) you can see in geocoder tool: https://google-developers.appspot.com/maps/documentation/utils/geocoder/#place_id%3dchijj6q3zd27j4arnljll4hpbp0

scala - F-bounded existential quantification -

i came across existential quantification f-bounded types while trying understand scala's type system. let a type trait a[f <: a[f]] { self: f => } where f f-bounded self-type of a . and b subtype of a case class b() extends a[b] if try declare list of a existential quantification val a: list[t] forsome { type t <: a[t] } i error when assigning a list of b . reason scala infers type list[a[nothing]] . val a: list[t] forsome { type t <: a[t] } = list(b()) // type mismatch when applying simplification rule 4 (as described in scala-spec ) covariant occurrence of t may replaced upper bound (here: a[t] ) val b: list[a[t]] forsome { type t <: a[t] } = list(b()) both examples should equivalent (if have not misunderstood something), simplified 1 works fine. furthermore following correct , should equivalent: val c: list[t forsome { type t <: a[t] }] = list(b()) but reason type of c , type of b not equal. so question is: bug of sc...

asp.net - How to count the number of ROWS in SQL table -

i have 2 tables. first table (class) table in there classes student can choose, , last column(numberofregistration) number of registration per class. here first table: idclass int; name varchar(50); date varchar(50); state bit; description nvarchar(50); numberofregistration int second table (registration) registration: idregistration int; dateofregistration date; name varchar(50); lastname varchar(50); city nvarchar(50); adress nvarchar(50); postalnumber int; idclass int - foreign key, references idclass class table ; does have idea how number of registration per class in table registration , , write data last column(numberofregistration) in table class. thank you try this: update c set numberofregistration = count(0) class c left join registration r on r.idclass = c.idclass group r.idclass;

javascript - How can I play a gif when scrolled into view -

i have here code have 2 events gifs: "play gif when click it" "play gif when hover cursor on gif". i want change first event "play gif when click it" "play gif when scrolled view", it's possible ? thanks. /* * based on: * gifplayer v0.1.0 * (c)2014 rubén torres - rubentdlh@gmail.com * released under mit license */ (function($) { function gapplayer(preview, options) { this.previewelement = preview; this.spinnerelement = $("<div class='spinner'></div>"); this.options = options; this.gifloaded = false; } gapplayer.prototype = { activate: function() { this.wrap(); this.addspinner(); this.addcontrol(); this.addevents(); if (this.options.autoload) { this.playelement.hide(); this.spinnerelement.show(); this.loadgif(); } ...

sonos - Self-test fails with python error 'global name 'parser' is not defined' -

im running self-test , in doing getting several failures instance message: "global name 'parser' not defined" i have packages installed python (using version 2.7 on ubuntu ) , tests updatetestcontent part of suite fails. does have suggestions on how fix error? an example of output is: (but im getting exact same error 30 times on updatetestcontent tests) stopped updatetestcontent test_combinatorial_get_test_content_173616823212099076936397683973588533375 (mediacollection){ id = "top" itemtype = "container" displaytype = "list" title = "hitsnl top30" canplay = true canenumerate = true albumarturi = " https://external.unplug.de/img/hitsnl_top_30.png " } instance messages: global name 'parser' not defined 2016-06-27 16:42:08,503 [info] sonos.sonos.workflow.fixture.updatetestcontent - test case: 1 updatetestcontent test_combinatorial_get_test_content_1736168232120990769363976839735...

e commerce - How thuttu.com works? How they take data from other website? -

how thuttu.com getting product details mrp price , current price? , how getting money filpkart, amazon, paytm, snapdeal, etc.. they more part of each sites affiliate networks therefore have access respective apis. how make money, when user clicks on item redirected sellers site, amazon.com example, if purchase item (or in cases affiliate networks, item) receive commission based on purchase amount.

eclipse - "No such file:" error in jenkins when integrating with Maven build -

Image
i have started using jenkins ci tool maven selenium automation project. the path of local eclipse workspace is: /media/user/data/automation_scripts and complete path of pom.xml file used execute project is: /media/user/data/automation_scripts/[project_name]/pom.xml now, have installed jenkins , added maven project it. when try enter path project's pom.xml file in 'root pom' text field under 'build' following error: no such file: ‘/media/user/data/automation_scripts/test/pom.xml’ whereas if navigate same path pom.xml file present. when build maven project in jenkins, following error shown: started user test building in workspace /var/lib/jenkins/jobs/test/workspace parsing poms error: no such file /media/user/data/automation_scripts/test/pom.xml perhaps need specify correct pom file path in project configuration? finished: failure update: i created pom.xml file in jenkins workspace located at: /var/lib/jenkins/jobs/test/workspace in ...

javascript - Onclick location, using location in function -

i'm making tile map 2 layers: map files stored on hdd, second osm. i've made gdal2tiles.py how looks: two layers using openlayers i want add onclick popup show link original tile in bigger resolution. idea attach .csv file following structure: [latitude],[longitude],[image index] my function in python parses file , gets image index. here it: def find_pic(lat, lng): my_file = open('log wynikowy epsg 3857.csv', 'r') list_of_lines = my_file.readlines() print len(list_of_lines) line in list_of_lines: if (line.rstrip()).split(",")[0] == lat , (line.rstrip()).split(',')[1] == lng: return line.rstrip().split(',')[2] then tried rewrite in javascript: function find_pic(lat, lng) { fh = fopen(getscriptpath('log wynikowy epsg 3857.csv'), 0); fh_length = flength(fh); var alltext = fread(fh, fh_length); var flddata = []; (x = 0; x < alltextlines.length; x++) { ...

angular - Angular2 vendor bundle with browserify -

im trying split compile app , vendor bundle minimize compile time. app made angular2 , im trying use gulp/browserify bundling. the issue when im loading webpage, following error: _prelude.js:1uncaught error: cannot find module '@angular/platform-browser-dynamic' s @ _prelude.js:1 s @ _prelude.js:1 (anonymous function) @ _prelude.js:1 (anonymous function) @ main.ts:2 7../app/app.component @ main.ts:7 s @ _prelude.js:1 e @ _prelude.js:1 (anonymous function) @ _prelude.js:1 the code can found at: https://github.com/ingvarkofoed/angular2-browserify what im doing wrong? :)

ajax - Rails Tutorial partial refresh -

i went through michael hartl's rails tutorial book , want use ajax automatic feed refresh, on micropost creation , micropost deletion. as far understand, need specify remote: true parameter in form inside correct partial , respond js inside appropriate method. nevertheless, when try accomplish partial refresh create action i'm getting strange nomethoderror indicating @feed_items nil object. started post "/microposts" 77.70.8.167 @ 2016-06-28 10:21:32 +0000 processing micropostscontroller#create js parameters: {"utf8"=>"✓", "authenticity_token"=>"qjhp9flp+ev+cxdef69l8eszc1fmsjr+mi57f3u3z2y/fji9dl1to9t4jlrx4g2uhip67fiwvjwl7sp2hmc4fw==", "micropost"=>{"content"=>"dsdsds"}, "commit"=>"post"} user load (0.2ms) select "users".* "users" "users"."id" = ? limit 1 [["id", 1]] (0.1ms) begin transaction s...

javascript - extend controller component - angularjs -

i use angular 1.5 develop application use .component() , had thre component , controllers quite similar. how can extend controller comp1 use comp2? each component in seperate js file. comp1.js comp2.js comp3.js you can extend component controllers each other well. use following approach: parent component (to extend from): /** * module definition , dependencies */ angular.module('app.parent', []) /** * component */ .component('parent', { templateurl: 'parent.html', controller: 'parentctrl', }) /** * controller */ .controller('parentctrl', function($parentdep) { //get controller const $ctrl = this; /** * on init */ this.$oninit = function() { //do stuff this.something = true; }; }); child component (the 1 extending): /** * module definition , dependencies */ angular.module('app.child', []) /** * component */ .component('child', { templateurl: 'child.html...

xcode - Connect NSSplitViewController to window -

Image
i want connect nssplitviewcontroller window in storyboard of xcode interface builder: how can that? right clicking on blue box (window controller) , drag window content nssplitviewcontroller: with no content set show small line can expand might miss if have lot of things on screen.

javascript - show spinner while loading new feeds -

how show spinner while waiting news feeds loaded in ionic? .controller('feedsctrl',['$scope','$http',function($scope,$http){ $http.get('http://example.com/feeds.php').success(function(data){ $scope.feeds=console.log(data) ; $scope.feeds=data; $scope.numberofitemstodisplay = 5; // use limit in ng-repeat $scope.addmoreitem = function(done) { if ($scope.feeds.length > $scope.numberofitemstodisplay) $scope.numberofitemstodisplay += 5; // load number of more items $scope.$broadcast('scroll.infinitescrollcomplete') } html <ion-infinite-scroll on-infinite="addmoreitem()" distance="1%" ng-if="feeds.length > numberofitemstodisplay"> </ion-infinite-scroll> your spinner directive (assuming have one) should have ngshow / nghide / ngif attached boolean variable preferably in service, in $scope aswell (or $scope....

android - No permission to access this object error -

i trying upload files using firebase. code works fine on devices internal storage while trying on devices external storage(sd card) shows user not have permission access object. code: -13021 httpresult: 403 error. my manifest file contains following permissions <uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.access_wifi_state" /> <uses-permission android:name="android.permission.write_external_storage" /> <uses-permission android:name="android.permission.read_external_storage" /> the default security rules storage buckets require sign in firebase authentication . can use authentication method. @ minimum, must anonymous signin by: enable anonymous signin in "auth" tab of firebase website follow steps here add code sign in: https://firebase.google.com/docs/auth/android/anonymous-auth#authenticate-with-firebase-anonymously y...

adobe - Word / PDF - Merge Documents -

i looking merge 2 documents, not typical merge. my first document mailmerge, creating cover letter, each page has name , address my next document static document cannot changed. i need insert static document first merged document, after every page, therefore, every 1 page document inserted. i have tried insert document in both word 2010 , pdf using adobe acrobat, , have thought inserted 1 document after first page. i'm looking @ vba, have never utilized vba , word before any pointers appreciated. many thanks i should have spent more time on this. the original template contains fields merge. on static document mention, click insert tab, text section, select object - text file select cover letter / template contains fields merge. insert template followed static document cannot changed note have spotted formatting changes on template following merge - further work required from point start mail merge, , complete merge adobe or word. this creates...

java - Switch active tabs with Selenium -

this question has answer here: how switch tab using selenium webdriver java 7 answers i have developed code used open search results new tab: string selectlinkopeninnewtab = keys.chord(keys.control, keys.return); results.get(i).sendkeys(selectlinkopeninnewtab); (int = 0; < results.size(); i++) { arraylist<string> tabs2 = new arraylist<string>(driver.getwindowhandles()); driver.switchto().window(tabs2.get(1)); driver.close(); driver.switchto().window(tabs2.get(0)); } what want when open tabs search results want switch between tabs 2 seconds delay. how can implement this? try code, import java.awt.awtexception; import java.awt.robot; import java.awt.event.keyevent; import java.util.arraylist; import java.util.list; import org.openqa.selenium.by; import org.openqa.selenium.keys; import org.openqa.selenium.webdriver; impo...

c++ - Converting 1-d array to 2-d array with overlapping -

i need convert 1 dimensional array of size n 2 dimensional array of size a*b > n. let take such case: int onedimensionalarray[6] = {7, 8, 10, 11, 12, 15}; //then second array int twodimensionalarray[2][4] = {{7, 8, 10, 11}, {10, 11, 12, 15}}; this used in called overlap-add method used in digital sound processing. have tried approach gives improper results: for(unsigned long = 0; < amountofwindows; i++) { for(unsigned long j = hopsize; j < windowlength; j++) { //buffer without overlapping if( (i * amountofwindows + j) >= bufferlength) break; windowedbuffer[i][j] = unwindowedbuffer[i * amountofwindows + j]; } } for(unsigned long = 1; < amountofwindows; i++ ) { for(unsigned long j = 0; j < hopsize; j++) { // filling overlapping region windowedbuffer[i][j] = windowedbuffer[i-1][windowlength - hopsize + i]; ...

python - How do I remove globals from Flask API calls? -

i working on flask application run foo . once foo running, should possible hit endpoints @ hostname:8080 perform api call changes state of foo . below minimal (though not complete) example. methods , functions referenced aren't terribly important question global object state being affected. __foo = none app = flask(__name__) @app.route("/start_foo") def start_foo(): return __foo._do_foo_init() or "" def run_foo(foo, debug=false): """ entry point clients run foo :param foo: :return: """ global __foo __foo = foo t = threading.thread(target=delayed_registration, args=(foo,)) t.start() app.run(host=hostname, debug=debug, port=8080) when user calls run_foo , provide bar , subclass of foo , shouldn't matter. i thinking making @app.route method of class , have foo member of class, don't know if possible within flask. does have recommendations how remove global __foo ...

c# - Azure Service Fabric Scaling -

i have app runs scheduled tasks on azure service fabric. app must run thirty forty tasks @ same time, using asynchronous programming. have questions: do recommend running tasks asynchronously? if not, should run task synchronously , scale up? how scale up? need no return information running task. should separate queuing , dequeuing separate stateful services? if so, how these services communicate each other? here code: internal sealed class jmataskrunner : statefulservice { public jmataskrunner(statefulservicecontext context) : base(context) { } /// <summary> /// optional override create listeners (e.g., http, service remoting, wcf, etc.) service replica handle client or user requests. /// </summary> /// <remarks> /// more information on service communication, see http://aka.ms/servicefabricservicecommunication /// </remarks> /// <returns>a collection of listeners.</returns> protected ov...

c++ - Unable to change private variable's content -

main.cpp : #include <iostream> #include <string> #include "players.h" using namespace std; int main () { cout << "**** welcome leviathan's first tictactoe game! ****\n\n"; players getnamesobject; players printnamesobject; getnamesobject.getplayersnames(); printnamesobject.printplayersnames(); } players.h: #ifndef players_h #define players_h class players { public: void getplayersnames(); void printplayersnames(); private: std::string _player1name; std::string _player2name; }; #endif // players_h players.cpp : #include <iostream> #include <string> #include "players.h" using namespace std; void players::getplayersnames() { string p1,p2; cout << "enter player 1 name : "; cin >> p1; cout << "\nenter player 2 name : "; cin >> p2; _player1name = p1; _player2name = p2; } void pla...

osx - macdeployqt - "file not found" - missing qml file from qrc -

i trying deploy app using qt (version 5.6.1) os x (10.11.5) macdeployqt tool. after running qmake , make app seems work fine. however, when try use macdeployqt experiencing errors. qml files become nonexistent, , following result: qqmlapplicationengine failed load component qrc:/qml/main.qml:-1 file not found i've tried run macdeployqt directory (as people on web suggested) , tried funky build of tool provided third party... aware of macqtdeploy qmldir option (it didn't change anything). know macdeployqt doing resources? why missing?

java - How can unpack ZIPs using Gradle and add it to the sourceSets? -

i'm migrating play framework project use gradle. have few play modules zipped. while i've migrated of dependency management gradle, i'm bit stuck zip dependencies. have folder called mods in turn contains artifact directories containing zip. mods/ └── play-mockito/    └── mockito-1.0.zip i'd iterate each of directories in mods folder , unpack zip in folder directory so: unpacked-mods/ └── play-mockito/    └── main.java ├── test.java    └── anotherclass.java once unpacked i'd add unpacked directory recursively sourcesets. i'm bit lost gradle , sure how accomplish this. got far: task modulate << { def tree = filetree('mods') { include '*/*.zip' } tree.each {file file -> def module = file.path.split('/')[-2] println "unpacking " + module copy { ziptree(file) 'modules/' + module } } } compilejava.dependson(modu...

python - What is the purpose of apps.py in Django? -

this question has been asked earlier: what purpose of apps.py in django 1.9? application configuration objects store metadata application. attributes can configured in appconfig subclasses. others set django , read-only. however, mean metadata application? limited appconfig metadata: name , verbose_name , path , label , module , models_module ? or make sense extends beyonds predefined metadata, application specific metadata, example in blog apps have date format configuration, defined follows: # file: settings.py blog = { 'date_format': 'ddmmyyy', } at being used follow: # file: blog/<...>.py django.conf import settings date_format = settings.blog['date_format'] on contrary, move configuration blog/apps.py blogconfig ? class blogconfig(appconfig): name = 'blog' verbose_name = 'awesome blog' date_format = 'ddmmyyyy' so throughout code in application, date_format being used b...

get max length of characters of a value from json jquery without loop? -

i have json, want maximum count of characters value under specific tag without each or loop, possible? { "language": { "ru": [ { "from": "set", "to": 444 }, { "from": "sc", "to": 222 } ], "he": [ { "from": "trdsss", "to": 3333333 }, { "from": "ahsss", "to": 55555 } ] } } let me explain exact requirement, have maximum length of string under "ru", ru has maximum lenght 3 i.e. "set" don't want string, want max. length. "he" 6 "trdsss". i can looping, don't want go in way, there other way can this. please me.. how can it. no, can't avoid looping. can avoid writing for loop (say) using array#reduce or array#foreach , something, somewhere, going have loop. when asked why wanted avoid looping, said because method c...