Posts

Showing posts from August, 2013

ios - CoreData fetch nested objects -

Image
i have json contain objects each object have child object, example [ { "id": 1, "name": "obj1" }, { "id": 2, "name": "obj2" }, { "id": 3, "name": "obj3", "child": { "id": 2, "name": "obj2" } }, { "id": 4, "name": "obj4", "child": { "id": 5, "name": "obj5" } } ] so in core data have entity myobject has relation child (to itself, one), , relation parent (to many) so when try fetch object predicate like [nspredicate predicatewithformat:@"parent.@count = 0"] i got object id in [1,3,4], no id = 2 (here error) , id = 5 (here correct), because it's sets parent when it's mapped when object i

javascript - Ajax.Beginform is submitting only once mvc -

hello creating advance search form ajax.beginform called jquery .submit() event, ajax.beginform returns partialview , update div on page. when press search button first time works fine , page updated when try press again the form never submitted , controller action never called. when checked firebug found error showing in console every time press search button: typeerror: $.validator.methods[method] undefined result = $.validator.methods[ method ].call( this, val, element, rule.parameters... and code: the ajax beginfirm view: @using (ajax.beginform("advancedsearch", null, new ajaxoptions { updatetargetid = "searchresults", insertionmode = insertionmode.replace }, new { id = "advancedsearchform"})) the jquery function: function submitadvancedsearch() { if ($("#name").val().trim() == "" && $("#lastname").val().trim() == "" && $("#company").val().trim() ==

Switch Process in CRM Dynamics with Javascript error -

i trying switch selected process user's option set selection based on code below: xrm.page.getattribute("processid").setsubmitmode("always"); xrm.page.getattribute("processid").setvalue(workflowid); xrm.page.getattribute("stageid").setsubmitmode("always"); xrm.page.getattribute("stageid").setvalue(processstageid); xrm.page.data.entity.save(); however, when code runs following error: the traversed path should end new active stage. i have checked guids processid , stageid , believe valid. any ideas why error occurs , process not change?

android - Best practice for communitcating between modules -

from software engineers view, code should devided in modules. did in project. there classical 3 modules model-view-controller (as known pattern). in controller actions take long time (for example sync of model) , short (changing local model example). what's best way publish results/changes view via one interface ? in understanding, long actions syncing server should run in seperate thread service. using similar thread manipulating local model waste resource in eyes - since (also in future in case) quick operation. android has loaders/cursoradapter - works in keeping ui , data loading independently. you can have thread(volley netowrking lib) sync data , update database - , db(contentprovider) notify "observing" cursors update ui. lookup loaders/cursor adapter , volley.

url rewriting - How to do URL rewrite for all URLs except a specific URL using Nginx? -

i have deployed web application in nginx 1.8 , using nginx reverse proxy configuration. i want following happen. able achieve 1 & 2. how can 5 implemented in nginx configuration ? 3 & 4 sample scenarios of scenario 5 url http://localhost in browser --> have display index.html url http://localhost/app --> have proxy_pass http://localhost:8081 url http://localhost/login --> have display index.html http://localhost url http://localhost/dashboard --> have display index.html http://localhost url http://localhost/anything_other_than_app --> have display index.html http://localhost my problem is, index.html has login functionality, on successful, login redirects user url http://localhost/dashboard , displays list of users. if user name clicked, redirets http://localhost/user display details. usecase: if directly type http://localhost/dashboard or http://localhost/user url, nginx searching folder , index page under root , giving

javascript - add event listener with argument in a loop -

this question has answer here: adding 'click' event listeners in loop [duplicate] 5 answers i dynamically creating buttons on click event following way: //add button for(i=1;i<=narrow+1;i++){ var btn = document.createelement("button"); btn.id="element"+i; var t = document.createtextnode("3d view"); btn.appendchild(t); btn.style.position="absolute"; btn.style.top="520px"; btn.style.left=100+120*(i-1)+"px"; btn.addeventlistener('click', function(){window.alert(i-1+" "+nmol[i-1]);}); the buttons created fine argument in function of addeventlistener event seems no increment @ all. when printed stayed value 1. anyone can explain me why? thanks modify there inner closure within loop (function(index){ btn.addeventlistener('click'

How to require a Ruby gem directly from its path? -

in order work rubyzip installed gems: gem install --local rubyzip-1.1.7.gem gem install --local zip-zip-0.3.gem in code call gems using require method: require 'zip/zip' require 'zip/filesystem' i want use require load gems directly location on machine. i want somthing this: require 'path_to_my_zip_gem' where path_to_my zip_gem contains gem files basically, it's because require method loads files name paths listed in $: or $load_path "if filename not resolve absolute path, searched in directories listed in $load_path ($:)." http://ruby-doc.org/core-2.2.2/kernel.html#method-i-require if want require gem "local" path require_relative method since can specify path relative requiring file’s path. @ official documentation further details: http://ruby-doc.org/core-2.2.2/kernel.html#method-i-require_relative

javascript - Cannot call function on click -

Image
i beginner in php, want show confirm box on link click cannot result in that. gives me error onclick cannot read error because refreshes page. there mistake in single quote? is possible me use alert in link tag? echo '<tr><td align="center"><a onclick="confirm return("you want delete?");" href="persontype.php?person_type_id='.$postrow['person_type_id'].'">delete</a></td>'; you need escape quote, use javascript: , it's return confirm() , not confirm return() echo '<tr><td align="center"><a onclick="javascript: return confirm(\'you want delete?\');" href="persontype.php?person_type_id='.$postrow['person_type_id'].'">delete</a></td>'; i copied exact php code , modified. above php code should output exact functionality expecting. to show sweetalert: <script src="htt

javascript - Default headerCell Template in ng-grid -

consider following snippet of angularjs code: var myheadercelltemplate = '<div class="ngheadersortcolumn {{col.headerclass}}" ng-style="{\'cursor\': col.cursor}" ng-class="{ \'ngsorted\': !nosortvisible }">' + '<div ng-click="col.sort($event)" ng-class="\'colt\' + col.index" class="ngheadertext">{{col.displayname}} <img src="plus-icon.png" /></div>' + '<div class="ngsortbuttondown" ng-show="col.showsortbuttondown()"></div>' + '<div class="ngsortbuttonup" ng-show="col.showsortbuttonup()"></div>' + '<div class="ngsortpriority">{{col.sortpriority}}</div>' + '<div ng-class="{ ngpinnedicon: col.pinned

angularjs - Extension make deference performance in angular js -

i developing web application using angular js laravel 4.2 so, anugular js front-end , laravel getting data database can 1 please let me know in angular js whatever template file used , having extension .php or .html make deference in performance..? when starting out angular can tempting "double templating" - using templates on server side , client side. think of angular application disconnected backend ios or android application. i recommend templating on client side. can improve performance in 2 ways: 1) can use cdn distribute front end application since it's entirely static. 2) if don't use cdn can avoid processing involved in server side templating - request static resource faster dynamic one. to summarize, if using php tempting double templating. if manage avoid double templating request php file run through php interpreter. requires more processing time when compared serving static html resource.

assembly - Differences between: INT 10H , INT 16H, INT 21H -

could please explain me differences between: int 10h , int 16h, int 21h in assembly language? when should use of them , what? for example: in simple code printing "hello, world!" why did use int 10h in fourth line? why did use int 16h in line before last? name "hi-world" org 100h mov ax, 3 int 10h mov ax, 1003h mov bx, 0 int 10h mov ax, 0b800h mov ds, ax mov [02h], 'h' mov [04h], 'e' mov [06h], 'l' mov [08h], 'l' mov [0ah], 'o' mov [0ch], ',' mov [0eh], 'w' mov [10h], 'o' mov [12h], 'r' mov [14h], 'l' mov [16h], 'd' mov [18h], '!' mov cx, 12 ; number of characters. mov di, 03h ; start byte after 'h' c: mov [di], 11101100b add di, 2 ; skip on next ascii code in vga memory. loop c ; wait key press: mov ah, 0 int 16h ret first of int means interrupt , has nothing int data type. each int represents functions fa

python - How do i sort my text file alphabeticaly yet keep the line spaces -

i have following code: test=open("newtextdocument.txt", "r") lines1 = (test.readlines()) lines1.sort() print(lines1)` and using store text file these contents: ('lars', ' in class', '1', ' has got score of', 8) ('lars2', ' in class', '1', ' has got score of', 1) ('as', ' in class', '1', ' has got score of', 1) ('12', ' in class', '1', ' has got score of', 0) ('lars', ' in class', '1', ' has got score of', 8) ('lars', ' in class', '1', ' has got score of', 8) ('lars', ' in class', '1', ' has got score of', 7, ' time of', 39.79597997665405) ('test', ' in class', '1', ' has got score of', 1, ' time of', 17) what want sort lines of file alphabetically yet keep line breaks. example: ('a

php - Cancel submit jquery -

this part of code form requesting data check if email alredy exist. thing is, program supposed return 0 if there no mail this. dont work properly, because program keep sending data, if mail not correct. if want more info, or missing let me know. in advance. $(document).ready(function () { $("#enviar").click(function(e) { e.preventdefault(); var error = false; consulta = $("#email2").val(); $.ajax({ type: "post", url: "compruebaemail.php", data: "b="+consulta, datatype: "html", error: function(){ alert("error petición ajax"); }, success: function(data){ if(data==0){ $("#error").html("email incorrecto"); error = false; }else{ $("form").unbind('submit

android - Unable to import GoogleCloudMessaging class -

Image
im trying implement gcm client in app. follow this article. thing fine till try part: if (checkplayservices()) { gcm = googlecloudmessaging.getinstance(this); regid = getregistrationid(context); if (regid.isempty()) { registerinbackground(); } } else { log.i(tag, "no valid google play services apk found."); } my problem cant find googlecloudmessaging class import ! screen shot import section: , error when try rebuild project: java: cannot find symbol symbol: variable googlecloudmessaging location: class com.example.app.activity.homegroupactivity i added google-play-services library project , use g+ sharing , dont have problem it.

php - How to define schematron in xml file to validate? -

Image
i'm newbie in xml stuffs. answer simple struggling couple of days. ofcourse in stackoverflow solution don't know whether have enough knowledge in xml or understand it. so, here solution experts. well, have xml file, dtd , sch file. using eclipse validate xml against dtd. don't know how validate xml against sch file. sample xml file <?xml version="1.0" encoding="utf-8"?> <!doctype sage-hubxml public "-//sage//dtd sage hub xml dtd v1.0 20111101/en" "sage-hubxml.dtd"> <sage-hubxml xmlns="http://www.w3.org/1999/xhtml" xmlns:xi="http://www.w3.org/2001/xinclude" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <body> </body> </sage-hubxml> in this, have defined dtd file validate. don't know how define sch file validate. simplest way it? , use php validate xml against dtd. php $dom = new domdocument; $dom-&

bootstrap popover button click event does not working using jquery -

i use code bootstrap popover follows, <a href="javascript:void(0);" class="btn btn-primary btn-sm" rel="popover" data-placement="top" data-original-title="<i class='fa fa-fw fa-users'></i> enter new investor group" data-content="<div class='smart-form'><div class='col-sm-10'><label class='input'><input type='text' name='newinvestor' placeholder='investor group name' id='newinvestor' /></label></div><div class='col-sm-2'><button id='btntest' class='btn btn-primary btn-sm assignedgroup' type='button' data-target-id='newinvestor' >add</button></div></div><div class='clearfix'></div><br/>" data-html="true">add</a> i trigger e

sql - Checking format of timestamp with time zone variable in oracle plsql -

i need create oracle plsql script have input param v_date timestamp time zone type. need verify whether format of v_date per mentioned format 'yyyy-mm-dd hh24:mi:ss tzh:tzm' or not . how should achieve this? i thinking of achieveing changing input param v_date string , convert string timestamp time zone , if error occured while converting conclude format wrong. seems to_timestamp_tz functions doesn't throw error when date string in different format w.r.t specified format instead converts it. for e.g. select to_timestamp_tz('15-apr-15', 'yyyy-mm-dd hh:mi:ss tzh:tzm') dual; actual result : 14-apr-15 11.50.00.000000000 pm america/chicago expected result : some error format not per 'yyyy-mm-dd hh:mi:ss tzh:tzm' in short want know how verify format of timestamp time zone type. you try adding "fx" modifier format, says oracle "expect exact format": select to_timestamp_tz('15-apr-15 ', 'fx

ios - How to navigate from xib to other xib in swift? -

i want navigate xib controlled swift class other xib controlled objective-c class. here code: let cb_main_noticeview = cb_main_notice(nibname: "cb_main_notice", bundle: nil) cb_main_notice self.navigationcontroller?.presentviewcontroller(cb_main_noticeview, animated: false, completion: nil) ** didn't work ** note: cb_main_notice controlled objective-c class self.presentviewcontroller(cb_main_noticeview, animated: false, completion: nil) juste remove navigationcontroller, if don’t have navigation controller in app.

javascript - Uncaught Error: Mismatched anonymous define() module -

i'm masochist, decided change way in load require.js in project. did go (using modernizr.load)... <script type="text/javascript"> function requirejsconfig () { requirejs.config({ 'baseurl': '{{ static_url }}js', 'paths': { 'jquery': 'libraries/jquery', 'backbone': 'libraries/backbone', 'underscore': 'libraries/underscore', 'jquery.cookie': 'libraries/jquery-cookie', 'tinymce': 'tinymce/tinymce.min', 'react' : 'libraries/react', 'history': 'history' }, waitseconds: 30, shim: { 'jquery' : 'jquery', 'underscore' : { exports: '_' }, &#

java - How can I call a function every day at 00:00 in my web service -

my problem have restful web service using class gestion . in class, have function _update_ , , call function everyday @ 00:00. i had no idea how that, looked web, , found using threads might option. however, don't know how can use it. have move _update_ function new class ? if using ejb can use timer service @singleton public class timerservice { @inject helloservice helloservice; @schedule(second="0", minute="0", hour="0") public void update(){ system.out.println("timer: " + helloservice.sayhello()); } } https://docs.oracle.com/javaee/7/tutorial/ejb-basicexamples004.htm

microsoft edge - Browser screenshots never appear for non-Windows platforms -

i'm trying use browser screenshots feature eg: http://dev.modern.ie/tools/screenshots/#http://www.microsoft.com i've noticed screenshots never appear non-windows devices e.g. google nexus 7 on android 4.1. am missing something? they seem have resolved issue, whatever was. when have issues various edge properties, encourage hit @msedgedev folks on twitter. seem listen pretty aggressively. for future reference, links supply feedback on microsoft edge: bugs edge , ie - https://connect.microsoft.com/ie/feedback developer feedback home - https://wpdev.uservoice.com/forums/257854-microsoft-edge-developer developer feedback twitter - https://www.twitter.com/msedgedev feature suggestions - https://windowsphone.uservoice.com/forums/101801-feature-suggestions/category/18985-web-browsing hope helps. healy in tampa.

html - Bind multiple events in javascript -

i tried following change span red on mouseover , black on mouseout: <span onmouseover="this.style.color='red' onmouseout=this.style.color='black'">mouse on me!</span> but not work! how can bind more 1 event single element using javascript? forgot quote.. <span onmouseover="this.style.color='red'" onmouseout="this.style.color='black'">mouse on me!</span>

javascript - Jasmine false positive with {} and [] in jasmine-node -

for reason jasmine's... expect({}).toequal([]); is reporting true (but different types). how do check jasmine? you can move equality check within expect clause: a = {} b = [] expect(a === b).tobetruthy();

RavenDb Sharding Hilo storage pattern -

my understanding ravendb designed if 1 shard goes down, other shards can operate without problems. but implementing shardingresolutionstrategy , found out metadatashardidfor method. method each document type can specify shard use storage. so if right, if shard hilo specific document type stored down, can not create new documents of type @ other shards (at least autogenerated ids not work). or may wrong , hilo replicated between shards in magical way? sharding designed independent, in order create consistent ids, need able create them consistent store. because of that, separate notion of splitting data multiple nodes , ha. typical scenario metadata shard independent, , running replicated database shared on sharded nodes. in fashion, if lose metadata shard, switch over. this take advantage on fact ravendb sharding & replication orthogonal

javascript - File URLs or how to open folder from URL -

i have several users on intranet , have mapped drive server (e:). users on win7 , use firefox. have used xampp on server allow users access mysql files using php. use windows explorer open folder on (e:) save/modify files (jpgs, docs etc.). want put link in html open folder them. i've spent time researching varying amounts of success , have found out may have security issues such as... a web application not have access local machine's filesystem but these clients accessing same server on local intranet. i can type... file:///c:/myfolder/mysubfolder/ in browser address bar opens page directory listing of files in sub folder. not ideal half way solution! but script below not work... window.open("file:///c:/myfolder/mysubfolder/"); can done? you path be window.open("http://localhost/myfolder/mysubfolder/"); or window.open("http://ip/myfolder/mysubfolder/"); use absolute path this

oracle - Trigger Cannot query on same table? -

i want create trigger before insert or update trigger on table customer: create table customer (custnum number, debitnum number ); the validation need in trigger customer not assigned same debitnum twice. so trigger code is: create or replace trigger xx_mytrig before insert or update on customer declare ln_count number; begin select count(custnum) ln_count customer custnum:=:new.custnum , debitnum:=new.debitnum; if ln_count>0 raise fnd_api.g_exc_error; end if; end; when insert or update noticed select statement not executed. how can query on same table...? i think can achieve adding unique constraint on columns custnum , debitnum. approach more effective implemented trigger. alter table customer add constraint constraint_name unique (custnum , debitnum);

angularjs - How to relocate marker with ng-autocomplete -

i separated map initialize function , ng-autocomplete 2 directive one called my-map , other 1 ng-autocomplete my goal relocate marker while click prediction of autocomplete but unable pass basic variable my-map directive ng-autocomplete directive so how relocate marker? please ! ! angular.module( "mapdirective", []) .directive('mymap', function() { return { restrict: 'a', link: function(scope, element, attrs) { // var map, infowindow; var markers = []; var latlng = new google.maps.latlng(23.5,121); var map,config; var options = { zoom: 7, center: latlng, maptypeid: google.maps.maptypeid.roadmap, streetviewcontrol: false }; //init map function initmap() { if (map === void 0) { map = new google.maps.map(element[0], options); } }

mysql - Unable to insert row in table using mysqli (PHP) -

i trying insert row in table giving me syntax error. here html code: <form method="post" action="" > <!--form fields--> <div class="control-group"> <div class="customer_data"> <div class="controls" id="id_milesperday"> <label for="icao" class="left-text">icao:</label> <input type="text" id="icao" style='text-transform:uppercase' maxlength="4" name="icao" placeholder="" class="input-xlarge" required> </div> <div class="controls"> <label for="iata" class="left-text">iata:</label> <input type="text" name="iata" maxlength="3" style='text-transform:uppercase' id="iata" placeholder="" class="input-xlarge" required>

web scraping - C# Web scraper copying text -

i have web scraper written in c# extracting data. want copy text web browser control , paste word file programmatically. when try extract rich text box content using id , innertext, text contains encoded characters %2c. i need text formatting can't find way. have tried encoding , httputility.urldecode , sendkeys , elem.invokemember() without success. how can programmatically copy , paste text web browser control preserving formatting? here sample data extract: description the advance concepts engineering team designs , develops new vehicles meet future regulatory requirements , customer competitive requirements. qualified candidate responsible total vehicle packaging. candidate identify , resolve adaptation , packaging issues vehicle moves toward production. lead cross functional team meetings working systems & components, advance manufacturing, service, etc. ensure solutions optimized stages of vehicle's life. htmlelement elem = wb.document.getelementbyid

asp.net mvc 5 - MVC 5 SQL Network Interfaces, error: 26 - Error, with [Authorize] -

i'm having trouble setting authorization in mvc 5. have brand new mvc 5 website individual user accounts , sql server database 5 aspnet... tables. i can login locally, works fine on local server , can login production database local website when point local connection string @ production server can't login website on production server, i following error: a network-related or instance-specific error occurred while establishing connection sql server. server not found or not accessible. verify instance name correct , sql server configured allow remote connections. (provider: sql network interfaces, error: 26 - error locating server/instance specified) the error happens when use [authorize] on action have login, if remove [authorize] action , database work fine. any ideas edit just clarity, sql server on 1 of arvixe servers, , website @ godaddy here connection string <add name="mysiteentities" connectionstring="metadata = res://*/models.mysit

php - how to join a two tables with arrays of datas -

my first table category contain categoryid , categories . second table bloggers contains bloggercategory . bloggercategory contain array of categoryid (more 1 categoryid ). function selectusercategories($sess_id) { $this->db->select('*'); $this->db->from('categories'); $this->db->join('bloggers', 'blogger_category = category_id'); $this->db->where('id', $sess_id); $querycat = $this->db->get(); return $querycat->result(); } can join 2 tables display bloggercategory individualy array categories . tried way not working. for comma separated field, use mysql find_in_set() select * categories c join bloggers b on find_in_set(c.category_id ,b.blogger_category)

Android: Runtime error: thread exiting with uncaught exception (group=0x4198ccf8) -

i have created form , getting following error message: e/androidruntime﹕ fatal exception: main process: com.*****.******, pid: 15427 java.lang.illegalargumentexception: parameter must descendant of view @ android.view.viewgroup.offsetrectbetweenparentandchild(viewgroup.java:4779) @ android.view.viewgroup.offsetdescendantrecttomycoords(viewgroup.java:4713) @ android.view.viewrootimpl.scrolltorectorfocus(viewrootimpl.java:3017) @ android.view.viewrootimpl.draw(viewrootimpl.java:2641) @ android.view.viewrootimpl.performdraw(viewrootimpl.java:2587) @ android.view.viewrootimpl.performtraversals(viewrootimpl.java:2210) @ android.view.viewrootimpl.dotraversal(viewrootimpl.java:1189) @ android.view.viewrootimpl$traversalrunnable.run(viewrootimpl.java:6223) @ android.view.choreographer$callbackrecord.run(choreographer.java:788) @ android.view.choreographer.docallbacks(choreographer.java:591) @ android.

r - ggplot heatmap failing to fill tiles -

Image
this (minimal, self-contained) example broken: require(ggplot2) min_input = c(1, 1, 1, 2, 2, 2, 4, 4, 4) input_range = c(4, 470, 1003, 4, 470, 1003, 4, 470, 1003) density = c( 1.875000e-01, 5.598958e-04, 0.000000e+00, 1.250000e-02, 3.841146e-04, 0.000000e+00, 1.250000e-02, 1.855469e-04, 0.000000e+00) df = data.frame(min_input, input_range, density) pdf(file='problemspace.pdf') ggplot(df, aes(x=min_input, y=input_range, fill=density)) + geom_tile() dev.off() producing: why there big gaps? there gaps because don't have data of tiles. if want try fill them in, option interpolate (assuming don't have access additional data). in theory, geom_raster() (a close relative of geom_tile() ) supports interpolation. however, according this github issue , feature not functional. as workaround, however, can use qplot, wrapper around ggplot: qplot(min_input, input_range, data=df, geom="raster", fill=

node.js - Nodejs exception escapes the try/catch block -

var http = require('http'); console.log("subscriberservice.prototype.subscribe("+json.stringify(subscriber)+")"); var options = { host: 'my host goes here', path: 'path goes here', port: '3030', method: 'put', headers: {'content-type': "application/json", 'connection': "close"} }; /* * defines callback executed once http request executed , response received */ var internalcallback = function(response) { console.log('status: ' + response.statuscode); console.log('headers: ' + json.stringify(response.headers)); response.setencoding('utf8'); var str = ''; response.on('data', function (chunk) { str += chunk; }); response.on('end', function () { if(response.statuscode == 201 || response.statuscode == 200) { console.log("success, created new subscriber: &qu

logging - How to parse logentries log with goaccess? -

i having logs of servers on logentries , when try open goaccess gives me wrong statistics. there way through can parse logentries log goaccess. trying parse logentries log goaccess. trying change log format in goaccess.conf, not able find correct logs. adding following config file, works 2 lines posted above: log-format %^ %^ %^ %^ %^ %^ %^ %^ %^ %h %^[%d:%t %^] "%r" %s %b "%r" "%u" log-date %d/%b/%y log-time %h:%m:%s then run goaccess as: goaccess -f access.log -p /path/to/goaccess.conf make sure running v0.9 though.

java - Robot focus in minimized frame -

i'm using @ moment robot class of awt library java frame . but when minimize frame, robot still type , using mouse in application isn't written in java. how can set focus on frame , when minimize, it'll still continue? how can set focus on frame , when minimize, it'll still continue? you can't. design minimized frame not have, , cannot get, focus. you might able 'hack it' making frame go transparent when asked minimize, though block input window behind it, , fail if in front.

How to mentioned PartitionKey -- ConsumerGroup binding in EventHub, Azure -

i want integrate application through event hub multiple type of devices mobile app, different type of embedded system etc. different type of senders sending data in specific format , need specific handler well. shown below mobile app (partition key “mobileapp”) = consumer group 1 embedded system 1 (partition key “embedded1”) = consumer group 2 embedded system 2 (partition key “embedded2”) = consumer group 2 so can please tell me how should specify above binding in event hub implementation each type of message should handle particular consumer group? normally see on receiver side default consumer group name mentioned. can during eventprocessorhost implementation can create new consumergroup method namespacemanager.createconsumergroupifnotexists(ehd.path, consumergroupname) . not able understand how make sure messages associate particular partition key handling associate consumer group. should mentioned partitionkey, consumergroup binding. in short, there no str

javascript - How to create multiple tables and store json data in each table -

html code <html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"> </script> <script> $(function() { var dmjson = "three.json"; $.getjson( dmjson, function(data) { $.each(data.records, function(i, f) { var tblrow = "<tr>" + "<td>" + f.clue + "</td>" + "<td>" + f.answer + "</td>" + "<td>" + f.status + "</td>" + "<td> " + f.views + "</td>" + "</tr>" $(tblrow).appendto("#entrydata tbody"); }); }); }); </script> </head> <body> <div class="wrapper"> <div class="profile"> <table id= "entrydata" border="1"> <thead> </thead> <tbody> </tbody> </table> </div&

c# - Linq-To-SQL Association not working -

Image
need dealing linq-to-sql association. trying use join function like: asp:label id="label1" runat="server" text='<%#eval("tambour_area_language.areaname") %>' /> i have association ` the code generating [global::system.data.linq.mapping.associationattribute(name="tambour_area_tambour_area_language", storage="_tambour_area_languages", thiskey="areaid", otherkey="areaid")] public entityset<tambour_area_language> tambour_area_languages { { return this._tambour_area_languages; } set { this._tambour_area_languages.assign(value); } } all tables add primary key but still, not working. same error time databinding: tambour_area not contain property name tambour_area_language .

java - Casting string into <Integer>ArrayList -

scanner scan = new scanner(system.in); system.out.println("enter sequence of numbers ending 0."); arraylist<integer> list = new arraylist<integer>(); string num = scan.nextline(); for(int x=0; x < num.length(); x++){ system.out.println(num.charat(x)); int y = num.charat(x); system.out.println(y); list.add(y); system.out.println(list); } im trying cast string of numbers array. not adding correct vaule. keep getting 49 , 50. want store numbers user enters arraylist. can help? int y = num.charat(x); that give unicode codepoint character. 65 or 48 0. you probablay want int y = integer.parseint(num.substring(x, x+1));

I clicked on properties for the image, and added alt text when I click ok the image disappears and on save its come back in Sitecore -

i updating alt text in sitecore item. clicked on properties of image, , added 'alt' text when click ok image disappears , on save coming again. developer don't want marketers guys see such absurd behave. ! i checked templates , media library, things looking fine on there.

Oracle SQL display a different column depending on the date -

i have table has 33 columns employee month day1 day2 ...... etc. etc. the day column represents day of month. is possible display employee column , day of month depending on today's date? i.e. 12th may employee day12 no idea start if it's possible. great you record (here: month) clause. column (here: day) decode or case. select employee, decode( extract(day sysdate), 1, day1, 2, day2, 3, day3, ... ) day mytable t t.month = extract(month sysdate) group employee order employee;

spark : use the global config variables in executors -

i have global config object in spark app. object config { var lambda = 0.01 } and set value of lambda according user's input. object myapp { def main(args: string[]) { config.lambda = args(0).todouble ... rdd.map(_ * config.lambda) } } and found modification not take effect in executors. value of lambda 0.01. guess modification in driver's jvm not effect executor's. do have other solution ? i found similar question in stackoverflow : how set , static variables spark? in @daniell. 's answer, gives 3 solutions: put value inside closure serialized executors perform task. but wonder how write closure , how serialized executors, 1 give me code example? 2.if values fixed or configuration available on executor nodes (lives inside jar, etc), can have lazy val, guaranteeing initialization once. what if declare lambda lazy val variable? modification in driver take effects in executors? give me code example? 3.create broadcast

jquery - Navbar to overlay background color & image -

question 1: want have navbar affix overlay on top of background color & background image of div ( top-banner ), when scroll down. background color overlay navbar affix instead. how achieve such navbar on top of background color div class top-banner. there 1 more issue navbar sort of having margin left on itself, when added data-spy affix, navbar move right, causing white space on left , when rescale screen smaller device size, navbar collapse menu unclickable unless click extreme right, toggle menu. not sure why affix got such issues. how fix it. thanks helping resolve issues!! below code <html> <head> <title>demo</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <style type="text/css"> .navbar-header, .navbar-brand { line-height: 100px; height: 100px; padding-top: 0; } .aff

I'm trying to print an array using a loop in Javascript in Angular JS -

i'm trying print out each array item property in object: { position:"finance office assistant", employer:"washtenaw county finance department", location:"ann arbor, mi", start_date:"2012", current: false, end_date:"2012", duties: [ "item 1", "item 2", "item 3" ] }, this object in array, several other objects. i'm trying create function loops through of objects , prints out duties array items in unordered list exact number of list items , array items. here function i'm trying write task $scope.dutylist = function() { var arraylength = $scope.duties.length; while (arraylength > 0) { console.log("dutylist run") document.write("<li> {{ dutylist }} </li>"); --arraylength; } } you don't need function

javascript - Local variables giving global trouble -

i'm js super n00b. i asked aspect of problem in post ( puzzling behavior if ( ) statement ) on if statements looks actual issue related scope of variable i've created. seems after declaring (what think is) global variable, other functions in code cannot access variable. i'm doing js project/program prompts user input word , program reverses word input. in previous post (pp) user correctly determined getting 'false' console message (see code) no matter length of word input because assigning value variable when page loads not reading again when user clicks button on page. if variable 'word' local i'm able 'false' console message , when variable 'word' global i'm able 'referenceerror.' any ideas has appreciated. see js code below: var word = document.getelementbyid('wordchoice').value; var lttrs = []; function flipfail () { alert("please enter word of @ least 2 characters."); console

osx - Packaged python .app file crashing, but packaged python .sh file working fine -

i've produced app using python 3.4.3, pyqt4 , other extras (poppler being among them) on os x yosemite. i'm using cx_freeze produce working .app file , eventually, working msi file. i've been testing app works after building using build command in "python3 setup.py build". works fine, no unexpected crashes. moved on packaging using "python3 setup.py bdist_dmg". opened dmg file/app file, crash instantly giving error: process: main [1098] path: /users/user/*/fyp-0.1.app/contents/macos/main identifier: main version: 0 code type: x86-64 (native) parent process: ??? [1] responsible: main [1098] user id: 501 date/time: 2015-05-12 02:18:16.867 +0100 os version: mac os x 10.10.3 (14d131) report version: 11 anonymous uuid: 8a613a61-d35f-9a4c-8e97-57069a95bf20 time awake since boot: 1300 seconds crashed thread: