Posts

Showing posts from August, 2010

node.js - Query aggregate match with filters specified in document -

node.js - Query aggregate match with filters specified in document - i have document this: { "name" : "henrik", "info" : { "phone" : "040*" } } the input query url?phone=040123456 var query = req.query; db.people.aggregate([{ $match : { "info.phone" : query['url'] // match 040* } }]) in case want match input filter defined in database. is possible? node.js mongodb

jquery - Setting scroll position on div tag inside a gridview -

jquery - Setting scroll position on div tag inside a gridview - i have gridview there div within want set scroll position on div. set div overflow=scroll . used code, fine work first row of gridview not of them. should ? <script type="text/javascript"> sys.application.add_load(function () { var t = document.getelementbyid('commentdiv'); t.scrolltop = t.scrollheight; }); </script> document.getelementbyid gets 1 element, elements using document.getelementsbyclassname instead of document.getelementbyid giving class name of div elements , apply properties should work fine. jquery html css asp.net gridview

Image at top of android application -

Image at top of android application - i need similar android layout like this i have set image when select bigger screen size device in emulator. image looks stretched a-lot. , when increment height looks on big screen size cover more half of little mobile screen. don't have tablet test app can test in mobile. please help not old android <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".queryactivity" > <scrollview android:layout_width="match_parent" android:layout_height="wrap_content" android:scrollbars="vertical" > <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:gravity="center_horizontal" &g

Creating a 1x1 Julia array -

Creating a 1x1 Julia array - i create 1x1 array (say in array{float64,2}) , ini8tialize value. of course of study works: m=zeros(1,1) m[1,1]=0.1234 is there more concise way create m , initialize @ same time? since [1.1234] give vector in julia simplest way come is: julia> fill(1.234,1,1) 1x1 array{float64,2}: 1.234 julia-lang

c# - Error on DataContractAttribute, IExtensibleDataObject, ExtensionDataObject -

c# - Error on DataContractAttribute, IExtensibleDataObject, ExtensionDataObject - i got error on win forms 'system.runtime.serialization.datacontractattrubute not defines' same 'iextensibledataobject, extensiondataobject' i have next in app, imports scheme imports system.runtime.serialization what did was, have web service , want debug it, , easier in win form app. copied code , copied web reference. i don't know why happens. c# help welcome you missing reference system.runtime.serialization (.net) assembly. add together project reference , should good. you can see in documentation (msdn), datacontractattribute , extensiondataobject , iextensibledataobject defined in system.runtime.serialization.dll assembly. http://msdn.microsoft.com/en-us/library/system.runtime.serialization.datacontractattribute.aspx http://msdn.microsoft.com/en-us/library/system.runtime.serialization.extensiondataobject.aspx http://msdn.microsoft.com/en-us/lib

concurrency - Does java.util.concurrent.Delayed really force me to violate equals/compareTo consistency? -

concurrency - Does java.util.concurrent.Delayed really force me to violate equals/compareTo consistency? - trying utilize java's delayqueue , have implement delayed interface requires compareto() "method provides ordering consistent getdelay method.". intention of course of study delayqueue can sort queued objects such next 1 running out of delay can returned taker. now have need remove objects queue ahead of time. need phone call delayqueue.remove(queuedobject) . of course of study works if queued objects have equals() method reflects payload , not unrelated remaining delay time. as result, compareto() based on remaining delay time while equals() based on payload of queued objects, not consistent, "strongly recommended" in javadoc of comparable . question: missing or indeed bit of quirk in design of delayqueue ? the available wiggle room may in ambiguity of requirement ths ordering consistent getdelay method. consistent mean? can me

java - Eclipse Plugin Help - Displaying result in a custom view -

java - Eclipse Plugin Help - Displaying result in a custom view - i quite new eclipse plug-in development , please bear me if question trivial. in process of developing eclipse plugin.i have completed it, except stuck in lastly step. have created custom view in plugin.xml file , implementing iaction function perform corresponding action selection. so, logic behind using after user has performed particular action, result of action should displayed in custom view if opened otherwise view should opened through programme , result should displayed in it. code have written below - public class illustration extends viewpart { private text text; @override public void createpartcontrol(composite parent) { text text = new text(parent,swt.null); this.text = text; } @override public void setfocus() { } @override @override public void printonview(string str) { text.settext(str); } } the problem every time programme fails nullpointerexeption @ first settext() statemen

php - How to pin Vimeo video -

php - How to pin Vimeo video - as have utilize code sharing youtube video on pinterest. how can share vimeo video on pinterest? <a class="scmpinterest w-socials-item-link" target="_blank" href="http://pinterest.com/pin/create%2fbutton/?url=<?php echo wp_get_shortlink();?>&amp;media=http://img.youtube.com/vi/<?php echo $valuesd; ?>/0.jpg&amp;description=<?php the_field('video_title') ?> "title="share on pinterest!"> <i class="fa fa-pinterest"></i> </a> without javascript , without anyplugin. youtube giving image of video using youtube api. how can done in vimeo? php pinterest vimeo-api

mysql - PHP Echoing a list -

mysql - PHP Echoing a list - i have 2 sections coding, first section echo out dates between start date , end date (my possible dates). sec section echoes dates stored in mysql database (event dates). issue have when seek echo variable possible dates , event dates. echo total list in there individual sections in lastly section echoes lastly value in list both variables. i've tried making them global variables still has same outcome. codes below: <?php //section one// $date1 = '10/06/2014'; $date2 = '30/06/2014'; function returndates($fromdate, $todate) { $fromdate = \datetime::createfromformat('d/m/y', $fromdate); $todate = \datetime::createfromformat('d/m/y', $todate); homecoming new \dateperiod( $fromdate, new \dateinterval('p1d'), $todate->modify('+1 day') ); } $dateperiod = returndates($date1, $date2); foreach($dateperiod $date) { $possible=($date->format('dmy')); } /

oracle - better way to assign variable percentage change calculated -

oracle - better way to assign variable percentage change calculated - i have 2 variables in pl/sql procedure counts. using values calculating percentage alter between 2 tables. how doing it: select ( decode(original_count, 0, to_number(0), ((todays_count - original_count)/original_count) ) ) percentage_change dual; i wondering if there way using := assignment like: percentage_change := (decode(original_count, 0, to_number(0), ((todays_count - original_count)/original_count) ) ) can this? you can utilize case construct: percentage_change := case when original_count=0 0 else (todays_count - original_count)/original_count end; oracle plsql

java - Using a lot of String Comparisons... Is there a better method than simply .equals()? -

java - Using a lot of String Comparisons... Is there a better method than simply .equals()? - i writing programme info intensive , requires considerable amount of string comparisons sense .equals() costly method. there more efficient method of comparing strings? edit: i have 2 csv files contain client related information. in these 2 csv files info recorded not same except name , address. (this not guaranteed that's exclusively different problem) tasked making programme identify matches in clients on these 2 csv files combine info given client , output master csv file info 2 files nowadays given client. asking equals method because way saw of tackling problem doing great deal of string comparisons along way. approach going to develop specific sort on csv prior entering programme puts lastly name (or address haven't figured out 1 better) in alphabetical order running binary search algorithm on clients or sort of pointer driven search desired client via la

binding - Universal Image Loader namespace error -

binding - Universal Image Loader namespace error - in xamarin, have added "universal-image-loader-1.9.2-with-sources.jar" file in "jars" folder of binding project, have built application getting 1 error. here error: error cs0234: type or namespace name 'disklrucache' not exist in namespace 'com.nostra13.universalimageloader.cache.disc.impl.ext' (are missing assembly reference?) can please have help code working? thanks in advance you need add together binding project reference in startup project. click on references directory in solution tree , select binding project in "projects" tab. good luck! binding reference namespaces xamarin universal-image-loader

objective c - Application crashing on numberOfRowsSection -

objective c - Application crashing on numberOfRowsSection - -(nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section { homecoming [array count]; // <--- crashes here } i'm not sure why crashing considering array simple nsarray. your "array" must not nsarray. can provide context array defined? using arc? a simple test set next line before homecoming statement: nslog(@"array = %@; array class = %@", array, array.class) paste output , can help further! guess array beingness deallocated, , there's other (or garbage) property in memory. wouldn't surprised if saw array.class nsnumber... objective-c arrays

Re-opening a package in Python -

Re-opening a package in Python - maybe it's not possible (i'm more used ruby, sort of thing fine). i'm writing library provides additional functionality docker-py, provides docker package, import docker , access docker.client etc. because seemed logical naming scheme, wanted users pull in project import docker.mymodule , i've created directory called docker __init__.py , , mymodule.py within it. when seek access docker.client , python can't see it, if docker bundle has hidden it: import docker import docker.mymodule docker.client() # attributeerror: 'module' object has no attribute 'client' is possible, or top-level bundle names have differ between source trees? this possible if docker set namespace package (which it isn't). see zope.schema , zope.interface , etc. illustration of namespace bundle ( zope namespace bundle here). because zope declared namespace bundle in setup.py , means zope doesn't re

google app engine - Does Objectify cache the Query.fetchKeys results in memcache? -

google app engine - Does Objectify cache the Query.fetchKeys results in memcache? - i have limited seed-data in entity, want fetch keys (unique strings) , whole entity not frequent. if fetch keys using query.fetchkeys, objectify cache results in memcache or nail datastore everytime query.fetchkeys results? query.fetchkeys() method old version of objectify. but in reply question, 'queries' (that is, besides get-by-key) must pass through datastore. datastore knows satisfies query. google-app-engine objectify

angularfire - Firebase Security API - Complex Data Structure - How to enforce relationships? -

angularfire - Firebase Security API - Complex Data Structure - How to enforce relationships? - for past few weeks i've been exploring firebase , features build web app, i've kind of ran wall when comes security rules. i've build info construction on firebase i'm not sure if follows best practices (if doesn't, sense free suggest different it): { "groups" : { <group_key> "name": "", "rels": { "users": { <rels_users_key> "key":"" (user_key) }, "notes": { <rels_notes_key> "key":"" (note_key) } }, "isprivate": true }, "users": { <user_key> "email": "", "rels": { "friends": { <rels_friends_ke

c# - List with references don't let me continue -

c# - List with references don't let me continue - i'm doing c# programme , have problem when modify element of list<> menor , list<> mayor value alter list<> menor , here code. give thanks you. list<string[]> listas(list<string[]> mayor, list<string[]> menor) { list<string[]> may = new list<string[]>(mayor);//here clone list mayor list<string[]> men = new list<string[]>(menor);//here clone list menor string[] var_aux = null; ; (int = 0; i<mayor.count;i++ ) { if (men.find(delegate(string[] s) { homecoming s[0] == may.elementat(i)[0]; })==null)//here find similar elements { var_aux = new string[4]; var_aux = may.elementat(i); var_aux[3] = "0";//here alter de element[3] men.add(var_aux);//and here element changed in men, alter elements in may how can avoid this?

python - How to use user profiles with MongoEngine (Django)? -

python - How to use user profiles with MongoEngine (Django)? - so, i'm trying build simple site mongodb database , django (using mongoengine), stuck trying understand how user profiles work. can save mongo_auth.mongouser document database fine, when comes downwards saving profile, i'm not doing right thing. here user profile model/document trying setup mongouser: from mongoengine.django.auth import user mongoengine import * [...] class userprofile(document): user = embeddeddocumentfield('user') telephone = models.charfield(max_length=30,null=true,blank=true) address = models.charfield(max_length=100, null=true, blank=true) birthdate = models.datefield(null=true, blank=true) def create_user_profile(sender, instance, created, **kwargs): if created: profile, created = userprofile.objects.get_or_create(user=instance) post_save.connect(create_user_profile, sender=user) in django relational databases, userprofile models.model , user

java - JodConverter application is not working in webapplication -

java - JodConverter application is not working in webapplication - i converting docx file pdf file using jodconverter. same code working fine standalnoe java application not working when using same within webapp , throwing severe: servlet.service() servlet cmiswebclient threw exception java.lang.classnotfoundexception: com.artofsolving.jodconverter.openoffice.connection.openofficeconnection @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1680) @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1526) @ org.ap.cmis.web.cmiswebclient.dopost(cmiswebclient.java:98) @ javax.servlet.http.httpservlet.service(httpservlet.java:643) @ javax.servlet.http.httpservlet.service(httpservlet.java:723) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:290) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206) @ org.apache.

c# - Check the operating system at compile time? -

c# - Check the operating system at compile time? - i running windows 7 64-bit operating scheme on development machine, using .net 4.5 , ms visual studio 2012. have several c# projects utilize system.threading.task namespace. want able build these projects on server of our developers have access to. problem that server running windows server 2003, not back upwards .net 4.5, , system.threading.task namespace not exist in versions of .net before 4.5. i can set new build configurations compile-time constant can check determine namespace include, before that, i'm wondering if there's pre-defined constant can use. uncertainty it, since far know compile-time constants can defined or not defined in c#, unlike c++ in can have specific values. first, task namespace (or rather, tasks namespace) did exist in .net 4.0, albeit far more limited features (read: fewer sugar methods) , no async/await keywords. though more limited, may help open possibility setting platfor

cakephp - To re-set / overwrite the Brain Tree disbursement id in php -

cakephp - To re-set / overwrite the Brain Tree disbursement id in php - in our application using braintree maintain credit card transaction, when disburse transaction braintree generating 1 disbursement id , reflect same in bank statement, instead of using braintree disbursement id , can set our own disbursement id in braintree , same should display in bank statement. we coding in cakephp, welcome help or solution. thanks. php cakephp braintree

security - LDAP authentication password encryption -

security - LDAP authentication password encryption - i using ldap technique authenticate user in web application . accessing ldap service accepting clear text string password . how encrypt , decrypt user password , avoid sending actual password in network .my network channel ssl secured . . how encrypt , decrypt user password, avoid sending actual password in network. network channel ssl secured. you've answered own question. ssl you. security ssl encryption cryptography ldap

javascript - jQuery Datepicker clone has opposite of expected effect -

javascript - jQuery Datepicker clone has opposite of expected effect - i noticed odd in jquery-ui datepicker: as seen in fiddle, clone of datepicker doesn't retain events want, append does! <p>date: <div id="datepicker"></div> <p><p><p> <div id="clone"></div> <div id="append"></div> </p> js: var obj = { ... onselect: function(thing) { console.log(thing); $(this).attr('data-thing',thing); } }; $("#datepicker").datepicker(obj); $('#clone').append($("#datepicker").clone(true)); $('#append').append($('#datepicker')); i had case each module has different sections on page, each of has settings (including date) kept same within sections. even cloning existing settings, removing original, , appending selected section, messes callback, has "this" root ( $(t

Sailsjs many-to-many associations using non-transactional save -

Sailsjs many-to-many associations using non-transactional save - i'm happily using beta v0.10 of sailsjs , worrying 1 question regarding many-to-many associations: say, model-a , model-b have many-to-many-association via 2 attributes. api recommends using "add"-method append 1 existing model-a-object collection of model-b-object, followed phone call "save"-method of model-b, create alter persistant. works expected, documentation mentions next save-method: "this instance method. currently, instance methods not transactional. because of this, recommended utilize equivalent model method instead." but unfortunately, phone call model-b-update not persist changes in collections in many-to-many relationship. not expert in databases, insecure if bug, feature or misunderstanding on side. suggestions welcome! ben edit: here more detailed description of issue: say, have 2 models, user , group: /** * user.js * module.exports = { attri

jquery - IE returns incomplete HTML via Ajax -

jquery - IE returns incomplete HTML via Ajax - it comes downwards line: jquery.ajax( { type : "post", url : "....", info : daten, datatype: 'html', success : function(response) { jquery('div[id="main"]').html(response); ... the problem ist ie responds incomplete blocks of "response" depending of ie version use. not homecoming content in ie 8 whereas returns 90 % of content in ie-9. interesting thing is: in ie-9 cuts off html-code (like 10 lines) goes on. not cutting off randomly creates "holes" in html code. in ie 10 works fine ... on machine, on others not. we tried utilize append(), appendto(), empty(), innerhtml , stuff none of them worked. also, working in demandware; there production instance, not show code correcty. other instances working same code-version. seems beingness loaded additionally makes ajax phone call go cray in ie. does

applescript - Remove numbers in front of file[working] + append number to duplicate filenames[not-working] -

applescript - Remove numbers in front of file[working] + append number to duplicate filenames[not-working] - i have applescript removes numbers and/or hyphens , underscores origin of filename. works fine. however, might have situation this: filename eg; 01-dog.jpg, 02-dog.jpg, 03-dog.jpg, etc. in such case, script stops/does not run, telling me there file name. not tell me file conflicting (sometimes there lot of files through). could please help in modifying script in such case, file same name have number or letter appended end of filename (before extension). eg; dog2.jpg, dog3.jpg, etc. on run {input, parameters} repeat thisfile in input tell application "finder" set filename name of (thisfile alias) set filename (do shell script "echo " & quoted form of filename & " | sed 's/^[0-9_-]*//'") set name of thisfile filename end tell end repeat homecoming

implementation butterworth filter in matlab -

implementation butterworth filter in matlab - i have accelerometer 3 axis. as far know acceleration sum of static acceleration (gravity) , dynamic acceleration. my goal's extract gravity acceleration show me direction of device. i apply butterworth filter extract gravity acceleration. have problem in choosing cut-off frequency , filter order. t = 0.16 s ; %time of sample rate fs = 1/0.16 ; % sampling rate? correct? after reading few articles, found cut-off varie between 0.1 0.5 , here take 0.5 (because don't know based on choice. this programme execute in matlab extract gravity acceleration 3 axis. fc = 0.5 ; %cut-off frequency fs = 6.26 hz (1/0.16) ; % sampling rate order = 4; [b,a] = butter(order,fc(fs/2),'low'); x = filter (b,a,x0); y = filter(b,a,y0); z = filter(b,a,z0); what doing is, "slow" measurements downwards butterworth filter. thus, in practice seek rid of "fast" part. means in frequency domain is: wan

apache - .htaccess rewrites with excluded files/folders, multiple domains resolving to one host and HTTPS -

apache - .htaccess rewrites with excluded files/folders, multiple domains resolving to one host and HTTPS - i have client atypical server setup , i'd few more eyes on code. basically there few domains resolve same host. 1 of domains ssl , has files/folders used app. so, domainone.com needs forced www.domainone.com, ssl. then, www.domainone.com needs redirect www.domaintwo.com excluding needed files/folders. after that, basic rules fire redirect domains have hanging around along wildcard sub-domains, excluding known sub-domains. here latest revision of code (waiting on client test). rewriteengine on # forces domainone traffic https (www version) rewritecond %{server_port} ^80$ rewritecond %{http_host} ^domainone.com rewriterule ^(.*)$ https://www.domainone.com/$1 [r=301,l] # redirects https traffic exceptions www.domaintwo.com rewritecond %{server_port} ^443$ rewritecond %{http_host} ^www.domainone.com rewritecond %{request_uri} !^/domaintwo/crash.ashx$ rewritecond %

c# - Wpf TreeView get data item used to bind template -

c# - Wpf TreeView get data item used to bind template - i binding treeview custom template. have button in template , when user clicks need find out info item used bind specific template instance against. so if bind treeview ilist need mytreeitem that provided info specific template instance. my code looks this: <treeview grid.column="1" horizontalalignment="left" height="268" margin="10,41,0,0" verticalalignment="top" width="197" x:name="trviewcodetree"> <treeview.itemtemplate> <hierarchicaldatatemplate itemssource="{binding children}" datatype="roslyndemos:trviewcodetreeitem"> <wrappanel> <label content="node type:" horizontalalignment="left" margin="10,10,0,0" verticalalignment="top" height="26" width="70"/> <tex

pthreads - pthread_cancel when using mutexes an conditional variables -

pthreads - pthread_cancel when using mutexes an conditional variables - hello have question cancelling thread uses mutexes , conditional variables. thread has cancel type deferred. when utilize functions pthread_mutex_lock/unlock , pthread_cond_wait, , cancel request arrives, thread's cancelation point pthread_cond_wait. lock mutex or not? not sure, if thread leaves mutex unlock. or pthread_mutex_lock/unlock functions cancellation points? give thanks you. i uncertainty can phrase improve the documentation: a status wait (whether timed or not) cancellation point. when cancelability type of thread set pthread_cancel_deferred, side effect of acting upon cancellation request while in status wait mutex (in effect) re-acquired before calling first cancellation cleanup handler. effect if thread unblocked, allowed execute point of returning phone call pthread_cond_timedwait() or pthread_cond_wait(), @ point notices cancellation request , instead of r

PowerShell: How to check which button is clicked -

PowerShell: How to check which button is clicked - i have gui buttons check scheme informations. routine same, don't want write 5 times. how can check button user has pressed? for example: foreach ($server in $serverlist) { if ( (test-connection $server -quiet -count 1) ) { if ($button1.clicked) { #get os info } else {} if ($button2.clicked) { #get disk info } else {} else { write-output "`r`n$server not available...`r`n" | out-file c:\temp\error.txt } } else {} } [reflection.assembly]::loadwithpartialname('system.windows.forms'); [system.windows.forms.messagebox]::show('query complete') rather multiple if($buttonwhatever.clicked) , attach an event handler button , create work. $btngetosinfo.add_click( { # stuff getting os } ) $btngetdiskinfo.add_click( { # stuff getting disk info } ) powershell button user-interface

apache - htaccess Map One Directory To Another One Level Up -

apache - htaccess Map One Directory To Another One Level Up - so here’s i’m trying accomplish. have link: https://www.mydomain.com/foo/bar/ now, directory "foo" has site in , operational. sake of organization have had create site this: https://www.mydomain.com/fubar/ so in reality link https://www.mydomain.com/foo/bar/ isn’t directory it. rather happen when people go https://www.mydomain.com/foo/bar/ address doesn’t alter in address bar, rather on backend software brings , uses https://www.mydomain.com/fubar/ . example: when goes https://www.mydomain.com/foo/bar/sign_up.php still see in address bar, they're getting https://www.mydomain.com/fubar/sign_up.php . what i've tried far no avail: htaccess @ https://www.mydomain.com/foo/ options +followsymlinks rewriteengine on rewritebase / rewriterule ^bar/(.*) ../fubar/$1 [nc,l] also rewritecond %{path_info} ^bar/(.*)$ rewriterule ^.*$ ../fubar/%1 [l] htaccess @ https://www.mydoma

c++ - Cache Flushing issue in release build -

c++ - Cache Flushing issue in release build - i seeing unusual problem in code: namespace{ std::vector<int> my_vect; } thread1: sleep(5); my_vect.push_back(1); main_thread: while(my_vect.empty()); //do return; when built in debug, works expected. when in release while loop never exits... when changed while loop busy wait a: while(my_vect.empty()) { sleep(1); } the release built started working again. any thought why happening? yes: unsynchronized access shared variable undefined behavior, , may happen. observed behavior isn't particularly unusual. c++ cpu

javascript - Serialize and de-serialize array (without jquery?) -

javascript - Serialize and de-serialize array (without jquery?) - i have method sends ajax request. when reply server received need serialize , later de-serialize $.ajax({ //..... done(function(data) { //1 need serialize info (which array) }); function myfunction() { //2 need de-serialize info has been serialized } i know utilize jquery#serializearray() if had form serialize: $( "form" ).submit(function( event ) { console.log( $( ).serializearray() ); event.preventdefault(); }); but don't have form , info server (i guess) has nil serializearray function of jquery . how can it? what's 1 of best ways? preferably not utilize third-party libraries except jquery or not utilize jquery @ all. the mutual way serialize js-objects json via json.stringify() . the other way around via json.parse() . o={"firstname":"john","lastname":"doe"}; console.log(json.stringify(o)); console.log(js

twitter bootstrap - Implement Multiple Models in Different Servers On Single View -

twitter bootstrap - Implement Multiple Models in Different Servers On Single View - good morning, first, environment: vs 2013 asp.net mvc5 ef5 (forcibly because vs wouldn't allow me take ef6) plant info on sql server in server contains db_a plant b info on sql server in server b contains db_b i creating page display production info coming scada system. so, thought maybe asp.net mvc w/ bootstrap carousel blow bosses' minds. tried this illustration , this 1 complementing asp.net mvc 5 database first tutorial. dbs same, except taking in info different plants, eg. db name same, column names same. when create model a, shows model.cs dba under model edmx, when create model b, shows under model b edmx. my problem starts when need bring together both models utilize on view. both examples show different models yes on same database; mine in different servers. how can go this? poluskinha if databases same can utilize same model house them (one edmx f

javascript - duplicated titlebar when jquery-ui dialog is displayed -

javascript - duplicated titlebar when jquery-ui dialog is displayed - in spring application, each 1 of sub-pages displayed in jquery-ui dialog. right now, facing next problem: when window opened, 2 titlebars presented on screen, this: links pages , <div> pages inserted placed in page dashboard.jsp: <%@ include file="../include/header.jsp" %> <div class="navbar navbar-inverse navbar-fixed-top" role="navigation"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" 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"><

ruby on rails - heroku Error: wrong argument type Hash (expected Data) (TypeError) -

ruby on rails - heroku Error: wrong argument type Hash (expected Data) (TypeError) - i have deployed app heroku. however, getting next error when setting env values -->> heroku config:set gmail_username=myemail@gmail.com i using vagrant virtual box ubuntu 10.04.4 ruby 2.0.0p451 rails 4.0.1 heroku-toolbelt 3.8.4 one thing notice in error message says version: heroku-toolbelt/3.8.4 (i486-linux) ruby/1.9.1 on lastly line below. why saying ruby/1.9.1 when using 2.0. not sure if has error. thanks setting config vars , restarting damp-forest-1123... failed ! heroku client internal error. ! search help at: https://help.heroku.com ! or study bug at: https://github.com/heroku/heroku/issues/new error: wrong argument type hash (expected data) (typeerror) backtrace: /usr/local/heroku/vendor/gems/multi_json-1.10.1/lib/multi_json/adapt ers/json_common.rb:21:in to_json' /usr/local/heroku/vendor/gems/mult

ios - CoreData Related data in a tableviewcell -

ios - CoreData Related data in a tableviewcell - i working on project related entities in coredata. want have tableview cells show attributes of records related entity, struggling find way this. here's basics: my custom tableviewcell has 5 things: uilabel *eventtime uilabel *person1name uiimageview *person1image //storing string uilabel *person2name uiimageview *person2image //storing string event entity has time, person1name, , person2name attributes , to-many relationship person entity. person entity has string attributes name , image , to-many relationship events entity. events have 2 related person records. persons affiliated many events. in cellforrowatindexpath, how configure cell related person attributes show each event? i playing this: eventstableviewcell *cell = [tableview dequeuereusablecellwithidentifier:@"eventcell" forindexpath:indexpath]; event *event = [self.fetchedresultscontroller objectatindexpath:indexpath]; nsset *persons

SaveAs feature Qt5.3+ QML FileDialog? -

SaveAs feature Qt5.3+ QML FileDialog? - is there functional cross-platform saveas feature in qt5.3+ qml filedialog? if not, there best practice providing similar feature? filedialog can used save in desktop, initial filename can't set. in android there no place in dialog add together file name. i've tried workaround "hack" regarding subject posted elsewhere. doesn't help. qml filedialog

php - Prestashop - Orders showing no date -

php - Prestashop - Orders showing no date - just wish start i'm not great prestashop , been forced inquire here since question on back upwards fourms has gone unanswered 3 months. i'm trying help site owner runs prestashop site on "prestashop™ 1.4.6.2" using barclay card payment taken payments. has impact orders no longer show dates. i'm unsure how debug or resolve i'm hopeful can aid in pointing in right direction can understand more , resolve this. i can see order dates , times showing correctly in database unsure why order page isn't pulling info database thanks in advance more information: requested comments database correctly storing dates of order. from experience there many important changes made each new version of prestashop, php, , barclaycard's integration platform impact upon right working behaviour of module introducing bugs or compatibility issues unless module maintained , software updates made available you.

html - php-handling dynamic created radio button -

html - php-handling dynamic created radio button - i creating dynamic quiz page 2 options each question , radio button compare value value in database in order know if reply correct the questions , choices stored in database , retrieved in code every question in own table <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title></title> </head> <body> <form method="post" class="regularfont" action="quiz.php"> <?php require_once 'database.php'; $res = mysql_query("select * quiz"); while ($row1 = mysql_fetch_array($res)) {\\create table every entry echo <<<_end <div style="padding-bottom: 30px"> <table border=""> <th colspan="2">question 1</th> <tr> <td colspan=&

api - Instagram response error "you cannot like this media" -

api - Instagram response error "you cannot like this media" - i have problem. when utilize instagram api error says, "you cannot media". when utilize instagram application, can media. ok. not banned instagram. when utilize api can no longer media. when utilize different business relationship ok. what can it? don't want utilize different account. api instagram

angularjs - Directive custom control -

angularjs - Directive custom control - i trying create directive custom video control. loading html file templateurl of directive. problem when there more 1 controls, have same src file set of them , sharing state of video well. when pause control, pauses video beingness played on 1st control. here directive template using: dapp.directive('myvideocontrol', function(){ homecoming { scope: { cameraurl: '=vccameraurl' }, restrict: 'e', templateurl: './../../js/directives/myvideocontrol.html', link: function (scope, element, attrs) { scope.playvideo = function(){ var v = document.getelementsbytagname("video")[0]; v.play(); } scope.pausevideo = function(){ var v = document.getelementsbytagname("video")[0]; v.pause(); } } } }); will appreaciate if can point out if doing wrong here. thanks. it looks problem having looking element

matlab - Identify if a column is repeated sequentially N times in a Matrix -

matlab - Identify if a column is repeated sequentially N times in a Matrix - i know question has been asked in different way: matlab: identify if value repeated sequentially n times in vector i wondering how can follow upper link if dealing matrix coordinates, like: m = [ x1 x2 x3 x4 ... xn; y1 y2 y3 y4 ... yn] for illustration n= 3 times: m= [ 2 3 3 3 1 4 4 4 6 6 6 6 8; 1 2 2 7 9 5 5 5 4 4 3 3 2] ans: [ 4 4 4; 5 5 5] @ position 6 i looking finding column has been repeated 3 times "sequentially". in mentioned link there way vector. try this k = size(m,1); %// fg matrix sum of differences of n continuous columns\ fg = conv2(diff(m'),ones(k,n-1))'; %// coll row vector column indices fg 0 [roww coll] = find(fg(k:size(fg,1)-k+1,n-1:end - n) == 0); %// out_cell cell entries required matrices out_ = arrayfun(@(x)(m(:,x:x+n-1)),coll,'uniformoutput',0); out_ cell containing matrices size k x n columns have occurred n times simult

php - how to add link to meta using custom field - wordpress -

php - how to add link to meta using custom field - wordpress - hello know how add together link invitee author meta? using these code , add together external links each invitee author. add_filter( 'the_author', 'guest_author_name' ); add_filter( 'get_the_author_display_name', 'guest_author_name' ); function guest_author_name( $name ) { global $post; $author = get_post_meta( $post->id, 'guest-author', true ); if ( $author ) $name = $author; homecoming $name; } php wordpress

Split PHP array into two arrays based on associate keys -

Split PHP array into two arrays based on associate keys - how split associate array 2 arrays given keys maintain in first resultant array? for instance... //given: $myarray=array('a'=>123,'b'=>'abc','c'=>321,'d'=>'cba','e'=>111); $split=array('a','c'); //obtain elements who's keys in $split $newarray1=array('a'=>123,'c'=>321); //obtain elements who's keys not in $split $newarray2=array('b'=>'abc','d'=>'cba','e'=>111); no frills: $newarray1 = []; $newarray2 = []; foreach ($myarray $key => $value) { if (in_array($key, $split)) { $newarray1[$key] = $value; } else { $newarray2[$key] = $value; } } frills: $newarray1 = array_intersect_key($myarray, array_flip($split)); $newarray2 = array_diff_key($myarray, $newarray1); see also: array_intersect_key() array_flip()

javascript - d3.js Two Dimensional Array Bar Chart -

javascript - d3.js Two Dimensional Array Bar Chart - i trying create bar chart containing 3 'groups' of info in d3.js. have been able implement illustration "let's create bar chart" sample http://bost.ocks.org/mike/bar/2/, wondering how implement 2 dimensional info set instead. i'm having bit of tough time wrapping head around sense should straight forwards process (select first index of 2d array -> iterate through array , display values of each element in bars -> select sec index of array -> iterate through array , display value of each element in bars etc...), examples hugely appreciated. the code far is: var info = [4, 8, 15, 16, 23, 42];*/ var width = math.max(500, innerwidth), height = math.max(500, innerheight), barheight = 80; var x = d3.scale.linear().domain([0, d3.max(data)]).range([0, width]); var chart = d3.select(".chart").attr("width", width).attr("height", barheight * data.length *

serialization - Serializing a lucene query into JSON? -

serialization - Serializing a lucene query into JSON? - is there best practice serializing lucene queries json format? saw elastic search query dsl, looks strays lucene terminology. also, lucene appears moving away maintaining serialization code. i looking have "standard" format in json. need able save query, when users saving queries on web ui, not entering title:matrix . have able search saved searches, edit saved searches. nice if there standard json format representing query. lucene query. i know little of elasticsearch i'm guessing doing (also) because back upwards query functionality other lucene does. if need marshall/unmarshall query, treat whole single unescaped string. if want break downwards key-value (field name/value) elements, don't forget can have conjuction/disjunction/etc. not trivial. as comment on serialization code - don't think applies queries. query has abstract tostring(string field) method each query subclass sh

android - Make TextView bold using selector -

android - Make TextView bold using selector - when user presses textview, i'd create textview bold. i'm trying: // styles.xml <style name="texton"> <item name="android:textstyle">bold</item> </style> <style name="textoff"> <item name="android:textstyle">normal</item> </style> // my_selector.xml <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_focused="true" android:state_pressed="true" style="@style/texton" /> <item android:state_focused="false" android:state_pressed="true" style="@style/texton" /> <item android:state_focused="true" style="@style/texton" /> <item android:state_focused="false" android:state_pressed="false"

Powershell - add results when 2 fields match -

Powershell - add results when 2 fields match - i have input info this: type site count ====================== copper site1 10 copper site1 7 bronze site1 3 bronze site1 9 copper site2 32 copper site2 1 bronze site2 3 bronze site2 13 what have output this type site count ====================== copper site1 17 bronze site1 12 copper site2 33 bronze site2 16 i have next code: function getindex($location) { for($j = 0; $j -lt $result.count; $j++) { if($result[$j].location -contains "$location") { $index=$j break; } } homecoming $index } ($i=0; $i -lt $outarray.length; $i++) { $loc=$outarray[$i].location $pcount=$outarray[$i].'count' $ltype=$outarray[$i].'license type' if(!($result | where-object {$_.location -eq "$loc"})) { $result+=new-object psobject -property @{'location' = $loc; 'count' = $pcount; 'license t

How to free memory using Java Unsafe, using a Java reference? -

How to free memory using Java Unsafe, using a Java reference? - java unsafe class allows allocate memory object follows, using method how free memory allocated when finished, not provide memory address... field f = unsafe.class.getdeclaredfield("theunsafe"); //internal reference f.setaccessible(true); unsafe unsafe = (unsafe) f.get(null); //this creates instance of player class without initialization player p = (player) unsafe.allocateinstance(player.class); is there way of accessing memory address object reference, maybe integer returned default hashcode implementation work, do... unsafe.freememory(p.hashcode()); doesn't seem right how... "memory address" of object reference not create sense since objects can move across java heap. you cannot explicitly free space allocated unsafe.allocateinstance , because space belongs java heap, , garbage collector can free it. if want own memory management outside java heap, m

jquery and php utf-8 encode decode -

jquery and php utf-8 encode decode - hi in project making turkish letter checkking script. if user enters key not turkish letter give warning . this jquery code $( "#singup_surname" ).keyup(function() { var singup_surname = $( "#singup_surname" ).val().trim(); var request = $.ajax({ url: "check.php", type: "post", encoding:"utf-8", data: { singup_surname_only:singup_surname}, datatype: "html" }); request.done(function( msg ) { msg=msg.trim(); if(msg=="ok"){ $('#singup_surname').removeclass('wrongfield'); $('#singup_surname').addclass('truefield'); }else if(msg=="no"){ $('#singup_surname').removeclass('truefield') $('#singup_surname').addclass('wrongfield') }else { alert("database connection error"); } }); }); for illustration if user enters

java - NullPointerException when making a change from a JDialog to a JFrame -

java - NullPointerException when making a change from a JDialog to a JFrame - cuando la ejecuto me marca este error `exception in thread "awt-eventqueue-0" java.lang.nullpointerexception @ ventana.ventanaprincipal.actionperformed(ventanaprincipal.java:136) @ javax.swing.abstractbutton.fireactionperformed(unknown source) @ javax.swing.abstractbutton$handler.actionperformed(unknown source) @ javax.swing.defaultbuttonmodel.fireactionperformed(unknown source) @ javax.swing.defaultbuttonmodel.setpressed(unknown source) @ javax.swing.plaf.basic.basicbuttonlistener.mousereleased(unknown source) @ java.awt.component.processmouseevent(unknown source) @ javax.swing.jcomponent.processmouseevent(unknown source) @ java.awt.component.processevent(unknown source) @ java.awt.container.processevent(unknown source) @ java.awt.component.dispatcheventimpl(unknown source) @ java.awt.container.dispatcheventimpl(unk

broccolijs - Broccoli.js and Ember-cli, Long compile times with Less -

broccolijs - Broccoli.js and Ember-cli, Long compile times with Less - when compiling ember-cli, broccoli, broccoli-less-single, compile times extremely long. using template bootstrap3 , dependent less files. number of less files admittedly excessive, compile times 20+ secs. it recompiling less files on every save seems excessive less files not ones editing. how go problem shooting issue? thanks insight on this. it's known issue apparently.https://github.com/stefanpenner/ember-cli/issues/538 ember-cli broccolijs

delphi - How to increase the reference count of subarrays when the refcount of the holding array increases? -

delphi - How to increase the reference count of subarrays when the refcount of the holding array increases? - i have cowarray works ok, want expand number of dimensions so: type tcowarray2<t> = record private type titem = record fitems: tarray<t>; fstart, ffinish: nativeint; end; private fitems: array of titem; private methods public .... end; the array splits items in blocks. every sub array has e.g. 100 items , mean array has many items needed. outside 1 dimensional array presented, internally info of type t stored in subarray. this way can have re-create of write little copying going on when single item changes. instead of cloning 20,000 items, 100 items clones plus mean array 200 items, i.e. 300 items 99% reduction of effort , storage. the problem need maintain track of changes in reference count of main array , propagate sub-arrays. something like: procedure tcowarray<t>.someme

javascript - Using an array inside of a function to store names -

javascript - Using an array inside of a function to store names - i trying practice javascript , read little challenge on website making little scheme users can follow , unfollow 1 another. still new javascript , programming in general please forgive ignorance. below came with. trying create off top of head because might best way larn language imo. basically in little function, created empty array set in function. set function onclick handler in tag. way store names or things in general? on right track little task? <!doctype html> <html> <head> </head> <body> <input id="searchbox" value = "names"> <button type="radio" onclick="listofpeople();"> <script type="text/javascript"> "use strict"; function listofpeople (){ var storedpeople = []; listofpeople(); }; </script> </body> </html> since you've dec

ios - UINavigationController with UISearchBar and UISearchDisplayController -

ios - UINavigationController with UISearchBar and UISearchDisplayController - heres few photos started: this have main view: then when user selects uisearchbar, happens: instead of sec photo, view alter this: here code far: - (void)viewdidload { [super viewdidload]; // additional setup after loading view. /* self.searchview = [[usersearchview alloc] initwithframe:self.view.frame]; self.searchview.searchresults.delegate = self; self.searchview.searchresults.datasource = self; [self.view addsubview:self.searchview]; */ self.maintableview = [[uitableview alloc] initwithframe:self.view.frame style:uitableviewstyleplain]; [self.maintableview setdelegate:self]; [self.maintableview setdatasource:self]; [self.maintableview setshowshorizontalscrollindicator:no]; [self.maintableview setshowsverticalscrollindicator:no]; [self.view addsubview:self.maintableview]; self.searchbar = [[uisearchbar alloc] init];

express - how to send json as a response after passport authenticationin node.js -

express - how to send json as a response after passport authenticationin node.js - i trying git example. which works when integrated project, want accomplish send json response client/request, instead of successredirect : '/profile' & failureredirect : '/signup'. is possible send json, or there other methods same? any help appreciated,tu create new route, e.g.: /jsonsend res.json in , create successredirect: '/jsonsend' . should it. node.js express passport-facebook passport-local