Posts

Showing posts from July, 2010

sqlalchemy - Rollback Many Transactions between tests in Flask -

sqlalchemy - Rollback Many Transactions between tests in Flask - my tests take long time run , trying rollback transactions between tests instead of dropping , creating tables between tests. the issues in tests multiple commits. edit: how rollback transactions between tests tests run faster here base of operations class used testing. import unittest app import create_app app.core import db test_client import testclient, testresponse class testbase(unittest.testcase): def setup(self): self.app = create_app('testing') self.app_context = self.app.app_context() self.app_context.push() self.app.response_class = testresponse self.app.test_client_class = testclient db.create_all() def teardown(self): db.session.remove() db.drop_all() db.get_engine(self.app).dispose() self.app_context.pop() here effort @ rolling transactions. class testbase(unittest.testcase): @classmeth

plsql - ORACLE USER role to limit user to view and execute function without modifying it -

plsql - ORACLE USER role to limit user to view and execute function without modifying it - i sorry newbie question. creating readonly user in oracle. want limit him view , execute function or procedure. dont want him modify func or proc. please help me on how accomplish this. thanks lot -- sysdba: -- 1) create user business relationship create user <username> identified <password>; -- 2) allow user log in grant create session <username>; -- 3) allow user execute single procedure in other schema grant execute on <other_schema.procedure_name> <username>; oracle plsql

objective c - Custom fonts in iOS 8 not showing -

objective c - Custom fonts in iOS 8 not showing - when building ios 7, custom fonts displayed in uilabel correctly. building xcode 6 , ios 8 "standard" font displayed. code: uilabel *label = [[uilabel alloc] initwithframe:rect]; uifont *font = [[captheme sharedtheme] apptitlefont]; label.text = title; label.textalignment = nstextalignmentcenter; label.textcolor = [uicolor whitecolor]; label.backgroundcolor = [uicolor clearcolor]; label.alpha = klabelalphaconstant; [label setfont:font]; ... - (uifont *)apptitlefont { nsarray *familynames = [uifont familynames]; (nsstring *afamilyname in familynames) { nsarray *fontnames = [uifont fontnamesforfamilyname:afamilyname]; nslog(@"familyname: %@", afamilyname); (nsstring *afontname in fontnames) { nslog(@" %@", afontname); } } homecoming [uifont fontwithfamily:@"myfont" size:15.0f]; } ... + (uifont*)fontwithfamily:(nsstri

java - C2 Compiler saturating CPU at startup -

java - C2 Compiler saturating CPU at startup - i have java servlet application on java 7 healthy in terms of scheme resource consumption. cpu usage on server below 50%. in few minutes next startup behaves much differently, point cpu can become pegged @ 100% several minutes if trying serve lot of traffic during period. result slow response times, network timeouts, , long garbage collection pauses sometimes. to diagnose issue, took series of thread dumps while server starting , ran top -h @ same time. matching each java thread pid, can consistently see c2 compilerthread using far cpu. have done research thread , understand java compiler optimizing code based on runtime statistics. reading i've done, can't tell best approach making situation better. options can glean are: switch c2 tieredcompiler (but result in improve performance in first few minutes after startup?) turn on -xx:+printcompilation see beingness optimized (but do information? can forcefulness optimiz

javascript - Push and pass array parameter -

javascript - Push and pass array parameter - i have little recursion routine, , curious how force array item , pass array item in phone call recurse? this: function recursefunc(element) { var $ = window.jquery; var walkfunc = function(element, apattern) { if($(element).parents('[pattern]')[0]) { homecoming walkfunc($(element).parents('[pattern]')[0], apattern.push($(element).attr('pattern'))); } homecoming concat(apattern,$(element).attr('pattern')); } homecoming walkfunc(element,[]); } array.push returns count of array , not array object. javascript

google apps marketplace - Gmail Contextual Gadget fails in long Conversation Mode Messages -

google apps marketplace - Gmail Contextual Gadget fails in long Conversation Mode Messages - we have been noticing google gadget failing in long conversations. in cases gadget not appear @ in longer conversation. in other cases of extractors available gadget visible. note:- happening in long conversations. i hoping others might able confirm/deny behaviour. to - open long gmail conversation , confirm whether gadget working expected. thanks help on this! edit 18/10 i've done more digging on issue. if debug gadget matches array has first 2 values our spec defines 6. we matches[2] matches[0] = date_sent matches[1] = date_received so reason matches array populated google not complete. on shorter conversations 6 matches values populated.... we matches[6] matches[0] = date_sent matches[1] = date_received matches[2] = message_id matches[3] = recipient_to_email matches[4] = subject matches[5] = sender_email google-apps-marketplace gmail-ap

java.util.scanner - Scanner nextLine issue in Java -

java.util.scanner - Scanner nextLine issue in Java - this question has reply here: scanner issue when using nextline after nextxxx [duplicate] just 1 question: why must type answer = in.nextline(); twice? if line single programme doesn't work expected. without sec line programme doesn't inquire come in string. public class main { public static void main(string[] args) { scanner in = new scanner(system.in); string reply = "yes"; while (answer.equals("yes")) { system.out.println("enter name , rating:"); string name = in.nextline(); int rating = 0; if (in.hasnextint()) { rating = in.nextint(); } else { system.out.println("error. exit."); return; } system.out.println("name: " + name); syste

javascript - HTML1701 on Windows 8.1 with jQuery, jQuery Mobile and Phonegap using Multi-Device Hybrid Apps for Visual Studio CTP2.0 -

javascript - HTML1701 on Windows 8.1 with jQuery, jQuery Mobile and Phonegap using Multi-Device Hybrid Apps for Visual Studio CTP2.0 - i developing app using multi-device hybrid apps visual studio ctp2.0. using jquery 2.1.1 , jquerymobile 1.4.3. app works fine in android , ios. next error in windows 8.1: html1701: unable add together dynamic content ''. script attempted inject dynamic content, or elements modified dynamically, might unsafe. example, using innerhtml property add together script or malformed html generate exception. utilize tostatichtml method filter dynamic content, or explicitly create elements , attributes method such createelement. more information, see http://go.microsoft.com/fwlink/?linkid=247104. i have tried lowers versions of jquery no success. is there solution this? javascript jquery jquery-mobile windows-8.1 multi-device-hybrid-apps

java - Interpolation Simulation (String Formating) -

java - Interpolation Simulation (String Formating) - here's example: int n1 = 20; int n2 = 40; string output = string.format("some guy **%d** years old while other **%d** ", n1, n2); system.out.println(output); why not work? i find works when i'm testing, , print belows: guy 20 years old while other 40 java format

c# - Simulate deriving from a value type -

c# - Simulate deriving from a value type - i building calculator, , have type called buttondigit , may contain chars 0 9 , , phone call buttondigit'. ideally derived from char`, isn't allowed, , don't want object like: public class buttonchar { public char value { get; set; } } i find rather clumsy having instantiate buttonchar object , access value property when want character stored. ideal type of alias char set 0-9 , don't that. stuck buttonchar object, or plain char , checking it's in range? char struct, can't inherit it. custom buttonchar class decent approach though. another approach create bunch of char constants public static class myconstants { public static char zero{get{return '0';}} .... } the range comparing easy since it's sequential range 0-9 c# class inheritance set alias

html - CSS image pathing when sourced from a different host using IE -

html - CSS image pathing when sourced from a different host using IE - [setup: asp.net mvc 3 on azure azure blob storage css files , assets on https] i'm creating website selects appropriate css style sheet depending on host beingness selected - allows website enabled different branding altered css, controlled referring host. mechanism uses mvc controller detects host, redirects (using asp.net rewrite rule) reference css file , associated assets (i.e. images) separate location. example: requests www.host1.com reference css file mycssandassets.mycoreserver.com/css/www.host1.com requests www.host2.com reference css file mycssandassets.mycoreserver.com/css/www.host2.com this works apart 1 minor issue, things break when using net explorer. in short, net explorer obtains css file, cannot reference images referenced in file. here, images referenced using relative path actual css file, assumption beingness (from w3c)... partial urls (as defined in [rf

ruby on rails - How to edit output from Ransack's "sort_link" method? -

ruby on rails - How to edit output from Ransack's "sort_link" method? - as total noob ruby on rails have, hope, simple question. i'm using ransack gem powerfulness site's search bar , there bunch of great methods. 1 of them sort_link method makes table of results sortable clicking on element. the problem when sorts, injects &nbsp;▼ (or &nbsp;▲ ) after column header name. all i'm trying edit output <span>▲</span> or <span>▼</span> instead. after looking everywhere , asking question in #rubyonrails irc can't seem find way customize output. as stop-gap, i've written javascript straight manipulate dom feels dirty approach, in custom site! any help here awesome. thanks! here in ransack gem source on github # lib/ransack/constants.rb:5-6 module ransack module constants asc = 'asc'.freeze desc = 'desc'.freeze asc_arrow = '&#9650;'.freeze # <- ascen

c# - if statement with datatables -

c# - if statement with datatables - synopsis :- 2 datatables lists of filenames in first column. using filename in datatable "search" datatable b & update 3rd datatable results. struggling if statements work foundrows part. any hints on how can function? // iterate through leftfiledt, extract filename & search rightfiledt (int = 0; < leftfiledt.rows.count - 1; i++) { // extract leftfilename & store in string variable leftfilematch = leftfiledt.rows[i][0].tostring(); // search rightfiledt leftfilematch string string expression; look = "right_file_name = '" + leftfilematch + "'"; datarow[] foundrows; foundrows = rightfiledt.select(expression); // if no match found if (notfound) { matchedfiledatarow["file_match"] = "false"; matc

css - Avoid padding for first and last column in line -

css - Avoid padding for first and last column in line - i have situation grid can't have outside left , right padding. how set padding-left:0; first column in line , set padding-right:0. should when screen changes... or create similar result. <div class="row line"> <div class="large-2 medium-3 small-4 columns"></div> <div class="large-2 medium-3 small-4 columns"></div> <div class="large-2 medium-3 small-4 columns"></div> <div class="large-2 medium-3 small-4 columns"></div> </div> line big screen line medium screen line little screen yellow space should no padding, white spaces has default foundation padding. one way accomplish target first , lastly columns. .row.line > .columns:first-child { padding-left: 0; } .row.line > .columns:last-child { padding-right: 0; } another alternative create class apply first , lastly co

ios - lldb error when trying to segue SWIFT -

ios - lldb error when trying to segue SWIFT - i next tutorial http://www.raywenderlich.com/76519/add-table-view-search-swift when ran error. adding feature app working on. 1 time in booths table view, want able navigate out main menu button on navigation bar. here section of code deals segues. override func tableview(tableview: uitableview, didselectrowatindexpath indexpath: nsindexpath) { self.performseguewithidentifier("boothdetail", sender: tableview) } override func prepareforsegue(segue: uistoryboardsegue, sender: anyobject!) { if segue.identifier == "boothdetail" { allow boothdetailviewcontroller = segue.destinationviewcontroller uiviewcontroller if sender uitableview == self.searchdisplaycontroller!.searchresultstableview { allow indexpath = self.searchdisplaycontroller!.searchresultstableview.indexpathforselectedrow()! allow destinationtitle = self.filteredbooths[indexpath.row].name

arrays - How to read data and create a dictionary of dictionaries in Python? -

arrays - How to read data and create a dictionary of dictionaries in Python? - i need read huge database hdf5 files , organize in nice way create easy read , use. i saw post python list variable name , i'm trying create dictionary of dictionaries. basically have list of info sets , variables need read form hdf5 files. illustration created 2 lists: dataset = [0,1,2,3] var = ['a','b','c'] now, there legacy "home brewed" read_hdf5(dataset,var) function reads info hdf5 files , returns appropriate array. i can read specific dataset (say 0) @ time creating dictionary this: data = {} type in var: data[type] = read_hdf5(0,type) which gives me nice dictionary if info each variable in dataset 0. now wan able implement dictionary of dictionaries can able access info this: data[dataset][var] that returns array of info given set , variable i tried next thing loop doing overwriting lastly variable read: for

xcode - Issues with printing a custom view to printer -

xcode - Issues with printing a custom view to printer - working on printing custom view , having difficulties - hope can point me in right direction. have read above every apple document it's not working. created simple programme test printing, subclassed nsview (mainview) , added next drawrect method. @implementation mainview - (void)drawrect:(nsrect)dirtyrect{ [super drawrect:dirtyrect]; nsmutableattributedstring *string = [[nsmutableattributedstring alloc] initwithstring:@"hi"]; [mystring drawinrect:dirtyrect]; } i created custom view on window , set it's class mainview. i run programme , text appears - far. when click print pull down, dialog opens , preview shows entire window - includes upper bar min, max buttons. so, question #1, why have entire window vs. view? second, created print routine in mainview , linked pulldown menu item it. -(ibaction) printtheview{ nsrect r = [self bounds]; [[nsprintoperation printoperationwithview

jquery - Bootstrap, WordPress & NavWalker - Top Level Nav Links not working -

jquery - Bootstrap, WordPress & NavWalker - Top Level Nav Links not working - i realize issue has been addressed in other postings, however, having problem top nav links not working on this site. this wordpress site built on bootstrap 3 , using navwalker integrate wordpress navigation bootstrap structure. here navigation code: <div class="navbar navbar-default col-md-9" role="navigation"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse"> <span class="sr-only">toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button>

c# 4.0 - Getting MetaData information from a file using C# -

c# 4.0 - Getting MetaData information from a file using C# - i trying metadata file using shell. using mvc5 , windows 8 os. here below code. code public jsonresult ind(string file) { list<string> arrheaders = new list<string>(); string filename = path.getfilename(file); shell shell = new shellclass(); folder rfolder = shell.namespace(file); folderitem rfiles = rfolder.parsename(filename); (int = 0; < short.maxvalue; i++) { string value = rfolder.getdetailsof(rfiles, i).trim(); arrheaders.add(value); } homecoming json(arrheaders, jsonrequestbehavior.allowget); } when seek run above code, getting error unable cast com object of type 'shell32.shellclass' interface type 'shell32.ishelldispatch6'. operation failed because queryinterface phone call on com component interface iid '{286e6f1b-7113-4355-9562-96b7e9d64c54}' failed due next error: no such interface supported (exception hr

javascript - Remove bottom border radius from the input when the suggestions are open -

javascript - Remove bottom border radius from the input when the suggestions are open - i using autocomplete plugin: https://github.com/devbridge/jquery-autocomplete using onsearchcomplete add together class input remove border radius i'm having issues removing class when selected or hidden. var $input = $('input[name=search]'); $input.autocomplete({ onsearchstart : function(){ $input.addclass('autocomplete-loading') }, onsearchcomplete : function(){ $input.removeclass('autocomplete-loading').addclass('autocomplete-open') } }); looking @ options dont think there way extend onclose/etc looking @ source need modify hide: function how can select input within plugin? demo: http://codepen.io/anon/pen/fbdhy you can utilize onselect callback remove class: $input.autocomplete({ serviceurl: 'search.json', onsearchstart: function() { $(this).addclass('autocomplete-loading') }, onsea

android - How to build an .so binary for a device with a 64-bit CPU? -

android - How to build an .so binary for a device with a 64-bit CPU? - as know, android l back upwards devices (mobile phones) based on 64-bit target cpu (arm). so preparing native code binaries ( .so file extension) kind of 64-bit android phone. how can build .so binary 64-bit target android ndk? according investigation, setting next variable fixes question in application.mk. app_abi := arm64-v8a coould confirm reply ? thanks. android android-ndk arm 64bit shared-libraries

Tomcat requests load issue "Connection refused" -

Tomcat requests load issue "Connection refused" - i have app on tomcat 7.50, works fine on single request on many simultanious requests (~1200) i'm getting: 2014-11-02 11:22:48,485 error [monitor-agent ] connection http://localhost:9080 refused url http://localhost:9080/monitorlog/monitor?id=21812&name=sv17222_db82c_201410282357.log... 2014-11-02 11:22:48,485 error [monitor-agent ] connection http://localhost:9080 refused org.apache.http.conn.httphostconnectexception: connection http://localhost:9080 refused @ org.apache.http.impl.conn.defaultclientconnectionoperator.openconnection(defaultclientconnectionoperator.java:158) @ org.apache.http.impl.conn.abstractpoolentry.open(abstractpoolentry.java:149) @ org.apache.http.impl.conn.abstractpooledconnadapter.open(abstractpooledconnadapter.java:121) @ org.apache.http.impl.client.defaultrequestdirector.tryconnect(defaultrequestdirector.java:573) @ org.apache.http.impl.

element stops firing jQuery after 2nd click -

element stops firing jQuery after 2nd click - i have anchor tag want utilize toggle class name on parent element. the code works fine 2 clicks of anchor click doesn't register jquery anymore. html <div class="toolbar"><form method="post" action="..." id="facsearch" name="facsearch" onsubmit="facsearch(document.facsearch); homecoming false;"> <a href="..." class="advanced-toggle">advanced</a></form></div> javascript $('#facsearch').on('click', '.advanced-toggle', function(e) { console.log($(this)); e.preventdefault(); $('.toolbar').toggleclass('is-advanced'); var mylink; if($(this).text() == 'advanced') { var mylink = $(this).text('close advanced'); } else { var mylink = $(this).text('advanced'); } homecoming false; }); jquery

hadoop - Hive : Concat a map -

hadoop - Hive : Concat a map - i have little problem hive, when seek concatenate map assume i've : var 1 | var 2 x | map(key1:value1) x | map(key2:value2) x | map(key3:value3) y | map(key4:value4) what i'am trying get, it's var 1 | var 2 x | map(key1:value1 ; key2:value2; key3:value3) y | map(key4,value4) something map concatenation. how can proceed whith hive ? use query... select var1,collect_set(concat_ws(',',map_keys(var2),map_values(var2))) var2 illustration grouping var1; this output this... var1 | var2 x | ["key1,value1","key2,value2","key3,value3"] y | ["key4,value4"] hadoop hive hql

java ee - JBoss SSO Cache -

java ee - JBoss SSO Cache - we have configured sso in jboss eap 6.3 cluster 2 nodes. the thing is, don't understand relation between replicated cache named "sso" had create, , cache-type (set default) in our security domain (the domain connects ldap). the security domain uses replicated cache? cache uses? because want configure timeout cache, if changes on ldap, cache refreshes. a mutual illustration of scenario when user gets new permissions, wants access new functionalities or in short period of time. have restart whole jboss, , thats not @ all. thanks, regards. in cluster mode, sso cache used authenticate user on 1 node (the authentication occurs in security domain) , authentication automatically carried across other nodes in cluster. the security domain cache speed authentication checks, can shared between nodes replicated cache. existence of credentials in cache doesn't warrant authenticated in application. for example, if sets true attr

java - I want use lower and upper case in the terminal for choosing -

java - I want use lower and upper case in the terminal for choosing - i want utilize lower , upper case in terminal choosing in cases in code can utilize upper case, want utilize both case 's ': { system.out.println("file status: "+partyplaner.getfilestatus()); break; } case 'n': { system.out.print("enter new name planner:"); string newname = keyboard.nextline(); partyplaner.setplannername(newname); break; } cast variable switching on uppercase() example. within switch statement, variable in uppercase, , need come in uppercase "cases". switch(s.toupper()){...} java

android - Convert milliSeconds To Gregorian Calendar -

android - Convert milliSeconds To Gregorian Calendar - i want convert milliseconds in long format gregorian calendar. searching in web, utilize code below: public static string getstringdate(int juliandate){ gregoriancalendar gcal = new gregoriancalendar(); time gtime = new time(); gtime.setjulianday(juliandate); gcal.settimeinmillis(gtime.tomillis(false)); string gstring = utils.getdf().format(gcal.gettime()); homecoming gstring; } public static simpledateformat getdf(){ homecoming new simpledateformat("yyyy-mm-dd, hh:mm",locale.us); } yes, code works find date , hr right there errors on minutes. if thing happens on 2014-11-06, 14:00, give me 2014-11-06, 14:11. want know there solutions modify or not recommended convert time gregorian calendar. many thanks! the problem simple, modify simpledateformat("yyyy-mm-dd, hh:mm",locale.us) with simpledateformat("yyyy-mm-dd, hh:mm",locale.getdefault()); will

java - Add icon next to each item in a list -

java - Add icon next to each item in a list - i have list item of strings, , assiate each item in navigationdrawer icon. below list item called: optionmenu = new string[] { "discover activities", "matches", "city selection", "preferences", "contact dooba" }; mdrawerlayout = (drawerlayout) findviewbyid(r.id.drawer_layout); mdrawerrelativelayout = (relativelayout) findviewbyid(r.id.left_drawer); mdrawerlist = (listview) findviewbyid(r.id.list_view_drawer); mdrawerlist.setadapter(new arrayadapter<string>(this, android.r.layout.simple_list_item_1, moptionmenu)); mdrawerlist.setonitemclicklistener(new onitemclicklistener() { @override public void onitemclick(adapterview<?> parent, view view, int position, long id) { fragment fragment = null; switch (position) { case 0: fragment = new firstfrag

python - Praw AttributeError: 'NoneType' object has no attribute 'get_comments' -

python - Praw AttributeError: 'NoneType' object has no attribute 'get_comments' - i wrote simple script identifying users contribute subreddits. disclaimer, if plan on using code should sure anonymize info (as will, aggregating info , removing usernames). works subreddits not seem robust, seen next error when run /r/nba: attributeerror: 'nonetype' object has no attribute 'get_comments' below code: import praw import pprint users = [] #[username, flair, comments] r=praw.reddit(user_agent="user_agent") r.login("username", "password") submissions = r.get_subreddit('nba').get_top(limit=1) #won't work higher limit? submission in submissions: submission.replace_more_comments(limit=3, threshold=5) flat_comments = praw.helpers.flatten_tree(submission.comments) comment in flat_comments: user_comments = [] in comment.author.get_comments(limit=2): user_comments.appen

android - Dynamically add a view in a custom layout after know layout's size -

android - Dynamically add a view in a custom layout after know layout's size - i want dynamically add together view in custom layout (extends relativelayout ). subview must placed specific coordinate , size. initialize , utilize addview method onmeasure (same problem onlayout ) of custom layout, can know size of layout. (after changing device’s orientation example) method onmeasure (or onlayout ) called multiple times (often twice). subviews added many times. does onmeasure right place dynamically add together subviews ? android layout view

c# - How do I change the encoding on this file? -

c# - How do I change the encoding on this file? - i'm opening file, , reading line line. each line beingness changed, written file. need alter encoding utf-16, can't find way this. can help? is, of course, c#. using (var inputstream = file.openread(sourcefile)) { using (var inputreader = new streamreader(inputstream)) { using (var outputwriter = file.appendtext(destfile)) { string templinevalue; while (null != (templinevalue = inputreader.readline())) { if (templinevalue != "\t\t\t\t\t") { var newendofline = string.format("{0}added info\r\0\n\0", '\0'); var firstreplace = templinevalue.replace('\t', '\0'); var secondreplace = firstreplace + newendofline; outputwriter.writeline(secondreplace); } } } } } you c

Regex validation doesn't work in bash -

Regex validation doesn't work in bash - i'd utilize next regex in order validate project version numbers: (?!\.)(\d+(\.\d+)+)([-.][a-z]+)?(?![\d.])$ demo valid inputs: 1.0.0-snapshot 1.0.0.rc 1.0.0 i'm trying utilize script follows: #!/bin/bash r=true; p="(?!\.)(\d+(\.\d+)+)([-.][a-z]+)?(?![\d.])$" while [ $r == true ]; echo "get_v: " read v; if [[ $v =~ $p ]]; echo "ok"; r=false else echo "nok" fi done but returns me nok using valid inputs. what doing wrong? bash doesn't supports pcre - perl regular expressions. supports extended regular expr - ere. you can check string grep -p like: while read -r ver res=$(grep -op '(?!\.)(\d+(\.\d+)+)([-.][a-z]+)?(?![\d.])$' <<<"$ver") echo "ver:$ver status:$? result:=$res=" done <<eof | column -t 1 1-release 1.2 1.2-dev1 1.0.0-release 1.0.0.3 q x-releas

expandablelistview - Android Expandable List groups textView random replace -

expandablelistview - Android Expandable List groups textView random replace - friends, i having problem expandable list - first time list groups drawn correctly, (respective textviews texts replaced, e.g. 3 of 9) when of groups clicked textviews of grouping (random) replaced instead of beeing untouched mm. what should done prevent this? here adapter class: public class interestlistadapter extends baseexpandablelistadapter { ... @override public view getgroupview(int groupposition, boolean isexpanded, view convertview, viewgroup parent) { if (convertview == null) { convertview = layoutinflater.from(_context).inflate(r.layout.activity_interest_list_group, parent, false); } seek { hashmap<string, string> involvement = this._listdataheader.get(string.valueof(groupposition)); string interestid = interest.get("interest_id"); string interestname = interest.get("interest_name"); jsonob

c# - Many to Many is creating new record everytime, code first, EF -

c# - Many to Many is creating new record everytime, code first, EF - this issue driving me crazy. know has been asked before , have tried solutions. know doing wrong unable find where. i have next model: public class user : userentitybase { /// <summary> /// gets or sets roles. /// </summary> public icollection<securityrole> roles { get; set; } } i have model roles: public class securityrole : entitybase { public string name { get; set; } public string description { get; set; } public icollection<user> users { get; set; } } the mappings set as: hasmany(u => u.roles).withmany(r=>r.users).map(m=>m.totable("securityuserroles").mapleftkey("userid").maprightkey("roleid")); i want insert new user security role called "everyone". using domain service > repository model. in user domain service insert method have next code: var

c++ - Why can friend class have access to Base class private data through Derived class -

c++ - Why can friend class have access to Base class private data through Derived class - this first time post question here. class base of operations { private: int base; friend class question; }; class derived : public base{ private: int super; }; class question{ public: void test(base& base, derived & derived) { int value1 =base.base; // no problem, because question friend class of base of operations int value2 =derived.super; // compile error, because question not friend class of base of operations // question here int value3 =derived.base; // no compile error here, not understand why. } }; the question indicated in lastly row of class question. friend applies of members of type, whether or not type inherited. stress point: members shared. this means question class has access members of base , int base::base . whether accesses fellow membe

android - How can i fetch data from Google play in my app? -

android - How can i fetch data from Google play in my app? - i have android app, want check version code of google play. please suggest way this. don't reply marketserviceapi , link unless have explored yourself. have done research on , got nothing, if working suggest procedure utilize it. android google-play-services versioning

php - sql: result be only data with a specific item_id -

php - sql: result be only data with a specific item_id - how can, in code, result info specific item_id item_id = 3 ? $articles = $dbread->select() ->from('articles', array('article_id', 'name', 'item_id')) ->joinusing('items', 'item_id', array('item_name')) ->order(array('updated desc')); try : $articles = $dbread->select() ->from('articles', array('article_id', 'name', 'item_id')) ->joinusing('items', 'item_id', array('item_name'))->where("items.item_id = 3") ->order(array('updated desc')); php sql

ruby - How can I list all gems in rubygems.org? -

ruby - How can I list all gems in rubygems.org? - recently diving tool gems. a feature requires repos' address given gems list. want fetch gems info in rubygems.org, , store them local, instead of searching them each time. searching list of gem name cost much time. however, not find response api in api page of rubygems.org. there apis search specific gem, or list gems owned guys. not 1 lists gems info in rubygems.org. so, how can list gems in rubygems.org? there 3-party api that? gem search without argument homecoming total list of gems on rubygems.org. since urls on rubygems follows simple patterns can start playing around gem names simple class this: class gemrepo attr_reader :names def initialize @names = [] load_names end def size @names.size end def urls @names.map { |name| "https://rubygems.org/gems/#{name}" } end private def load_names `gem search`.each_line |line| next if line.empty? || line.mat

ajax - return multiple json encoded array from the server -

ajax - return multiple json encoded array from the server - i want know how can homecoming multiple encoded json array server ex. //client $.ajax({ url: 'items-details.php', type: 'post', data: {member_id: 1}, datatype: 'html', success: function(responsetext) { } }); //server, items-details.php //some code here then, final output ex. itemsdata array , itemscategories array, utilize json_encode() on both array. how can homecoming both arrays client? know how handle echo() - treated client string before, utilize echo(json_encode(itemsdata)); then client parse .. how can homecoming multiple json encoded array: itemsdata , itemscategories for example, create let's $response array, contain both $itemsdata , $itemscategories arrays. // $itemsdata , $itemscategories defined here $response = array( $itemsdata, $itemscategories ); homecoming json_encode($response); ajax json

MySQL deadlock with update and delete on the same row -

MySQL deadlock with update and delete on the same row - i have simple table with: deviceid pushid tag external_id when sending messages users, update of pushid based on deviceid: update user_notifications set pushid='xyz' deviceid='abc' but @ same time can new registration user reset notifications delete user_notifications pushid='xyz' , external_id null this seems trigger deadlocks regularly. have added indexes on "deviceid" , "pushid, external_id" seems still trigger deadlock. table have no suitable primary key mysql have created gen_clust_index key. can reason? should add together auto-incrementing primary key? ------------------------ latest detected deadlock ------------------------ 141014 8:13:38 *** (1) transaction: transaction f5ed32, active 0 sec starting index read mysql tables in utilize 1, locked 1 lock wait 3 lock struct(s), heap size 1248, 2 row lock(s) mysql thread id 2422, os thread handle 0x7f6295

AngularJs Exception Handler going in infinite loop -

AngularJs Exception Handler going in infinite loop - i'm trying create angularjs app server level logging exceptions. my code: exceptionhandler.js app.config(function($provide){ $provide.decorator("$exceptionhandler", function($injector,$log, exceptionmodel, exceptionservice){ homecoming function(exception, cause){ //$log.error.apply( $log, arguments ); var exceptionmodel = new exceptionmodel(); exceptionmodel.exception = "exception"; exceptionmodel.cause = "cause"; exceptionmodel.stacktrace = "stacktrace"; exceptionservice.logexception(exceptionmodel). catch(function(){ // nothing}); }; }); }); exceptionservice.js app.service("exceptionservice", function ($injector) { var _logexception = function (exception) { var $httpresource = $injector.get("$resource");

Sharepoint oracle table integration with BCS or designer -

Sharepoint oracle table integration with BCS or designer - i'd set table form oracle on sharepoint 2010 (and updated 2013) site table can updated , new rows can inserted. after googling using bcs seems option. correct? sharepoint designer not work oracle? also when open visual studio 2012 professional , click on new project>>sharepoint>>sharepoint 2010 project error saying sharepoint server must installed workwith share point projects. do need install sharepoint server on machine? can provide documentation on how this? happens when go sharepoint 2013? oh yea , have windows 7. sharepoint server work on windows 7? thank you! i'll seek reply questions. oracle connectivity bcs supports oracle it's not trivial. sharepoint designer tool can create external types (bcs types). sharepoint designer limited sql server, wcf services , .net assemblies. there few workarounds: create linked server oracle in sql serve management studio , util

"Fatal error: Uncaught SoapFault exception: [HTTP] Could not connect to host" PHP Soap Client SSL -

"Fatal error: Uncaught SoapFault exception: [HTTP] Could not connect to host" PHP Soap Client SSL - i trying setup soap client communicate using ssl. can able test soap request , response in soapui application using ssl certificate. working fine in soapui application. when seek same using php throwing below error. "fatal error: uncaught soapfault exception: [http] not connect host in " below options used in soapclient. tried add together wssecurity header using wssoapclient.php $context = stream_context_create( array( 'ssl' => array( 'ciphers' => 'tls-rsa-aes-128-cbc-sha' ), ) ); $options = array( "uri" => $url, "location" => $url, "soap_version" => soap_1_2, "encoding" => "utf-8", "trace" => true, "exceptions" => true

excel - Create drop down list in input-box -

excel - Create drop down list in input-box - i'm creating task list our team, , come in new tasks i've created input-boxes. there 5 departments should entered in "department question" te prevent people entering wrong section name, utilize input-box drop downwards list. i've searched net, not find how create drop downwards list in input-box. don't know if possible? can help me? the code wrote inputs followed: private sub newaction_click() dim content string, date1 date, date2 date, section string sheets("do not delete").rows("30:30").copy rows("14:14").select range("c14").activate selection.insert shift:=xldown content = inputbox("describe task") range("c14").value = content section = inputbox("to section task assigned? ") '<-- here want create drop downwards list range("d14").value = section date1 = inputbox(&

Python Socket - Why connection closed after sending several messages? -

Python Socket - Why connection closed after sending several messages? - i have programme launches tcp client server, , can send messages , files client server (they transferred in direction). server expected listening, , respond each upcoming message. found after sent several messages, server never responds again, unless relaunch connect button on gui. here have in server , # found connection def conn(self): self.s = socket.socket(socket.af_inet, socket.sock_stream) self.s.bind((self.ip, self.port)) self.s.listen(1) print 'server ready.' self.conn, self.addr = self.s.accept() print 'connected by', str(self.addr), '\n' def recv(self): flag = self.conn.recv(buffer_size) info = self.conn.recv(buffer_size) # message if flag=='1': msg = "other >> %s" % info self.conn.send("success") print msg homecoming # there file elif flag=='

qml - 2 identical ListViews with small differences inside delegate -

qml - 2 identical ListViews with small differences inside delegate - i've got 2 identical qml files. list 1 of them here, differences of other 1 shown comment lines: // messageview.qml; diff. threadview.qml shown comment lines import qtquick 2.0 item { property var model property var selectedthread: threadslist.currentitem.mythread property alias spacing: threadslist.spacing signal activated(var selectedthread) id: root listview { anchors.fill: parent id: threadslist model: root.model delegate: rectangle { property var mythread: message // other file contains `thread` instead of `message` here color: threadslist.currentitem == ? "cyan" : index % 2 ? "lightblue" : "lightsteelblue" width: parent.width height: ti.implicitheight messageitem { // other file contains `threaditem`

ruby on rails - Routing confusion -

ruby on rails - Routing confusion - in routes have get '/about', to: 'pages#about' resources :reckoners resources :shift_requirements, shallow: true end and in layouts/_footer.html.erb, called application.html.erb, have <li><%= link_to "about", about_path %></li> which works fine, unless i'm in /reckoners/index.html.erb view, in case next error - couldn't find reckoner 'id'=about looking @ params on page, 'about' beingness passed id, , server log confirms query beingness run reckoner object id. kind of understand why it's going wrong, i'd understand why. i have pages_controller.rb, contains def end ruby-on-rails ruby-on-rails-4 routes

javascript - What should I do so that I block JS file(on server) access from URL but can be accessed from page in script tag? -

javascript - What should I do so that I block JS file(on server) access from URL but can be accessed from page in script tag? - i used block access url blocked access php page. rewriteengine on rewritecond %{http_referer} !^http://(www\.)?domain\.ltd [nc] rewritecond %{http_referer} !^http://(www\.)?domain\.ltd.*$ [nc] rewriterule \.(gif|jpg|js|txt)$ /messageforcurious [l] javascript php .htaccess

c# - How do I display all contents of List in a string.format? -

c# - How do I display all contents of List<DayOfWeek> in a string.format? - this little application different restaurants , days of week open. in interface, have check boxes each of days of week. want output in string.format each of selected days(check) boxes. possible? here code grabs checkboxes: foreach (checkbox cb in grpdaysopen.controls) // add together days of week restaurant open { dayofweek enumconvertedsuccessfully; // contain enums if (cb.checked && enum.tryparse<dayofweek>(cb.text, out enumconvertedsuccessfully)) favoritediningplace.opendays.add(enumconvertedsuccessfully); } here current override tostring : return string.format( "{0} chian of {1} seating capacity of {2}:\r\nsmoking {3}. lastly month's sales {4}, while lastly months costs {5}. \r\nthe restaurant open {6}", this.name, this.chain, this.seatingcapacity, this.smoking, this.lastmonthsales, this.lastmonthc

java - Illegal Argument Exception- name -

java - Illegal Argument Exception- name - i have searched past few days solution problem , beating head against wall. i'm knew programming in java bear me. i trying implement java applet html page of mine school project. applet runs fine in eclipse using appletviewer, in web browser in programme called bluish jay. have exported programme jar file in same directory html page, , added necessary code html file, whenever run html file applet gives me "illegal argument exception: name" error. details of error include phrase "java.net.malformedurlexception:unknown protocol:e." this relevant code html file: class="lang-html prettyprint-override"> <applet code="movingboxes.class" archive="e:\websystems\webpages\animations.jar" width="350" height="350" >animation of moving boxes</applet> when error occurs phrase within of applet tags not displayed either if significant. have tr

java - MVP Hold focus and list position with 2 Activities -

java - MVP Hold focus and list position with 2 Activities - i haven application 2 activities, 1 datagrid list , other 1 details activity entry of list. both on same layout page: __________________ | listview | | - entry 1 | | - entry 2 | | - entry 3 | | - .... | | - entry n | |------------------| | detailsview | |__________________| the datagrid height fixed hence i'm having scrollpanel entries , if klick on entries. when implemented function delete entry. send delete , after response ok new list get phone call , refill datagrid. when i, illustration delete entry 42, have scroll downwards bit, entry deleted , scrollpanel position stays same new loaded list, want to. next step alter details few, used placecontroller load new empty detailsview, because old selected 1 deleted. when phone call new detailsplace listview changes , scrollpanel position origin of list (scrollpanel default state, @ origin of list)

locale - Getting local language code from lat lon cordinates -

locale - Getting local language code from lat lon cordinates - i utilize current latlon centre of leaflet map observe local language can take wikipedia version query against. querying english language version limits results. illustration in tallin ... english - 80 results - https://en.wikipedia.org/w/api.php?action=query&list=geosearch&gsradius=1000&gslimit=500&gscoord=59.436682840436205%7c24.747337102890015 estonian - 109 results - https://et.wikipedia.org/w/api.php?action=query&list=geosearch&gsradius=1000&gslimit=500&gscoord=59.436682840436205%7c24.747337102890015 also, place names returned in local language, thing me. i appreciate there may ambiguity, , other times maybe i'll language there isn't wikipedia (list @ http://meta.wikimedia.org/wiki/list_of_wikipedias#all_wikipedias_ordered_by_number_of_articles), can code , default english language fallback. by way of background: i have prototype app @ http://postcodepast.c