Posts

Showing posts from March, 2014

objective c - Changing label's text in another view controller -

i have 1 view controller named firstviewcontroller, , second named secondviewcontroller. present second view controller uiviewcontroller *controller = [self.storyboard instantiateviewcontrollerwithidentifier:@"maincontroller"]; [self presentviewcontroller:controller animated:yes completion:nil]; in secondviewcontroller's .m, want change text of uilabel in firstviewcontroller. however, label's text isn't updating. how make firstviewcontroller's label updated when uibutton pressed in secondviewcontroller? you use delegate pattern first create delegate protocol @class secondviewcontroller; @protocol secondviewcontrollerdelegate -(void) updatelabelwithstring:(nsstring*)string @end @property (weak, nonatomic) id<secondviewcontrollerdelegate>delegate; in ibaction connected uibutton [self.delegate updatelabelwithstring:yourstring]; in firstviewcontroller.h #import "secondviewcontroller.h" @interface firstviewcontrol

php - One Select statement for criteria of one column with multiple values -

i want make sql select statement selects multiple rows based on value of 1 column, have list of valid values match rows want select. specifically, have list of user ids. want select entire row every row has user id in list (this list in php, , i'm making sql calls there). my code far, looks this: $list_of_ids = array(1, 5, 7, 23);//list of user ids want select. $query = sprintf("select * users user_id=?????", ????); how do this? $ids = implode(',',$list_of_ids); $query = sprintf("select * users user_id in ($ids)");

jquery - Will paginate and endless page - from tutorial -

i made endless page scroll tutorial http://railscasts.com/episodes/114-endless-page-revised?view=asciicast , works. but problem javascript run endless page every paginate - on other pages - example, try endless paginate messages box. script simple think, im nobie in javascript , dont know how tell script endless scroll on selected page , not every will_paginate on project. see in js file $('.paginate) - tell script run every paginate class. i grateful tip. js in erb: $('.profile_list').append('<%= j render(@users) %>'); <% if @users.next_page %> $('.pagination').replacewith('<%= j will_paginate(@users) %>'); <% else %> $('.pagination').remove(); <% end %> and js js file: if ($('.pagination').length) { $(window).scroll(function() { var url; url = $('.pagination .next_page').attr('href'); if (url && $(window).scrolltop() > $(document).height() - $(w

PHP: Google Maps simulate moving marker on route according to predefined set of coordinates -

i trying develop site simulates moving bus on google maps according set of predefined coordinates. working on php, html , javascript (google maps api). database holding coordinates on localhost. question has actual simulation of bus moving towards coordinates in database. to explain: database looks this: id latt lon 1. 53.4877 -2.27519 2. 53.4859 -2.27489 etc. there 14 entries. the php script connects database: <?php $host = "localhost"; $user = "hidden"; $pass = ""; $databasename = "database"; $tablename = "locations"; $con = mysql_connect($host, $user, $pass); $dbs = mysql_select_db($databasename, $con); $result = mysql_query("select * $tablename"); $data = array(); while ($row = mysql_fetch_row($result)) { $data[] = $row; } echo json_encode($data); ?> the javascript function: function movebus(map, marker) { $.ajax({

"E315: ml_get: invalid lnum: 87" error in vim -

Image
when try change tab gt error occurred : "e315: ml_get: invalid lnum: 87" you can see in following picture: if further information need, comment it. an unfamiliar error in vim! do? here's what: look up. :h e315 read says. this internal vim error. please try find out how can reproduced, , submit bug report |bugreport.vim|. understand says. it bug in vim. act. investigate error conditions , file bug on vim_dev mailing list.

windows 8 - Attached.Property="{Binding}" does not work -

i have created simple attached property enables dragging item around screen. 1/ here's how implement on element: <rectangle fill="green" local:myextension.canmove="true" /> 2/ works charm. this: // in resources <x:boolean x:key="mycanmove">true</x:boolean> <rectangle fill="blue" local:myextension.canmove="{staticresource mycanmove}" /> 3/ 1 syntax not work. this fails : <rectangle fill="red" local:myextension.canmove="{binding path=canmove}" /> what's different? thing different is binding value attached property instead of setting explicitly or through static resource. i'm missing something. it? here's full xaml: <grid background="{staticresource applicationpagebackgroundthemebrush}"> <grid.datacontext> <local:viewmodel/> </grid.datacontext> <toggleswitch header="enable dragging"

php - MySQLi bind_param() reference -

i trying pass several parameters dynamically bind_param() function. here error receive: warning: parameter 2 mysqli_stmt::bind_param() expected reference, value given code: $con = new mysqli('localhost',user,pass,dbs); if(mysqli_connect_errno()) { error(mysqli_connect_errno()); } $con -> set_charset("utf8"); /*inside*/ $type=''; $query='select bugid bug'; if(!empty($_get['cena'])) { $build[]='ucena=?'; $type.='i'; $val[]=$_get['cena']; } if(!empty($_get['popust'])) { $build[]='upopust=?'; $type.='i'; $val[]=$_get['popust']; } if(!empty($build)) { echo $query .= ' '.implode(' , ',$build); } $new = array_merge(array($type),$val); foreach($new $key => $value) { $tmp[$key]=&$new[$key]; } echo '<br/><br/>'; foreach ($new $new ){ echo "$new<br/>"; } if ($co

regex - convert dateYYYY-MM-DD to yyyymmdd -

this question has answer here: factor date numeric 1 answer i have dataframe in r dates being 1 of column head(t) # date x #2013-04-05 32851 #2013-04-06 42523 #... i need parse date , 20130405 , 20130506 column in same data frame. how do ? how gsub ... df$new <- gsub( "-" , "" , df$date ) date x new 1 2013-04-05 32851 20130405 2 2013-04-06 42523 20130406

php - Variable not posting to what i believe is dynamic image? -

Image
i have simple port check wish post online/offline status's believe dynamic image. don't give me , error or nothing if it's online not post offline or offline post resource id #1 here's code: <?php $ip = $_get["ip"]; $port = $_get["port"]; $online = "online"; $offline = "offline"; $status = (fsockopen($ip, $port)); if ($status) { $online; } else { $offline; } // create blank image , add text $im = imagecreatetruecolor(215, 86); $text_color = imagecolorallocate($im, 233, 14, 91); // sets background light blue $lightblue = imagecolorallocate($im, 95, 172, 230); imagefill($im, 0, 0, $lightblue); //server information imagestring($im, 7, 5, 5, '3nerds1site.com', $text_color); imagestring($im, 2, 40, 30, $ip, $text_color); imagestring($im, 2, 40, 40, $port, $text_color); imagestring($im, 2, 40, 70, $status, $text_color); // set content type header - in case image/jpeg header('content-typ

add default content to custom taxonomy in wordpress -

i trying add default data set custom taxonomy called 'foods'. default data sets are; vegetarian salad carrot nonvegetarian chicken mutton i have created taxonomy called foods, unable add default data it. please help. don't understand how use wp_insert_term() in wordpress codex. here 2 examples in must customize theme , usage. step 1 creating term wp_insert_term() . must used hook called 'init' so: add_action( 'init', 'your_function' ); your_function(){ $parent_term = term_exists( 'fruits', 'product' ); // array returned if taxonomy given $parent_term_id = $parent_term['term_id']; // numeric term id wp_insert_term( 'apple', // term 'product', // taxonomy array( 'description'=> 'a yummy apple.', 'slug' => 'apple', 'parent'=> $parent_term_id ) ); } i register custom taxo's custom post type (within same file) he

ios - What does Entitlements.entitlements do? -

in 1 of projects , there file called entitlements.entitlements, file do? the content inside like <?xml version="1.0" encoding="utf-8"?> <!doctype plist public "-//apple//dtd plist 1.0//en" "http://www.apple.com/dtds/propertylist-1.0.dtd"> <plist version="1.0"> <dict> <key>get-task-allow</key> <false/> </dict> </plist> "entitlements confer specific capabilities or security permissions ios or os x app. set entitlement values in order enable icloud, push notifications, , app sandbox. each entitlement has default value, in cases disables capability associated entitlement. when set entitlement, overriding default providing appropriate key-value pair. icloud entitlements let enable use of icloud data storage ios or os x app. you set icloud entitlement values on target-by-target basis in xcode project. push notifications let app aler

django - NoReverseMatch at /accounts/register/ -

i following getting started guide django registration , getting following error when visit http://localhost:8080/accounts/register/ : noreversematch @ /accounts/register/ reverse 'index' arguments '()' , keyword arguments '{}' not found. request method: request url: http://localhost:8080/accounts/register/ django version: 1.5.1 exception type: noreversematch exception value: reverse 'index' arguments '()' , keyword arguments '{}' not found. exception location: /library/python/2.7/site-packages/django/template/defaulttags.py in render, line 424 python executable: /usr/bin/python python version: 2.7.1 python path: ['/users/studio/desktop/orro/t1/tut', '/library/python/2.7/site-packages/setuptools-0.9.8-py2.7.egg', '/system/library/frameworks/python.framework/versions/2.7/lib/python27.zip', '/system/library/frameworks/python.framework/versions/2.7/lib/python2.7', '/system/library/fra

php - How to install lessphp to be used in the assetic framework? -

i cannot find way add lessphp files project assetic finds them. not wish add require sentences assetic files or modify them in way future updates made. i error: fatal error: class 'lessc' not found in ....../kriswallsmith/assetic/src/assetic/filter/lessphpfilter.php on line 87 the code on line lessc intantiation: $lc = new \lessc(); note: cannot use composer install since composer brings issues project. assetic not import lessc.inc.php you. have manually. i assume using assetic standalone in application, should doing this: <?php use assetic\asset\assetcollection; use assetic\asset\fileasset; use assetic\filter\lessphpfilter; require "path/to/lessc.inc.php"; // should include $css = new assetcollection(array( new fileasset('/path/to/src/styles.less', array(new lessphpfilter())), )); echo $css->dump(); but causalities using symfony2, should configure lessphp filter in app/config/config.yml this: assetic: de

mysql - Do math inside a SQL statement? -

Image
i'm trying make can select values below 601 (slightly 10 minutes). take time() , subtract field time . don't understand why isn't working. can explain or sql not have ability. don't error, though gives data doesn't make sense. $pdo->query("select * `online` '".time()."'-`time` > 601"); it doesn't seem working. database sample data id = 1 uid = 1 time = 1376252614 (to honest, don't know why text . haven't had issue before though, that's why assume it's not problem) if you're working in mysql , time column datetime or timestamp data type, try query. where `time` >= now() - interval 601 second if time column integer containing unix-style timestamp (or text string showing integer), try this. where `time` >= unix_timestamp() - 601 this way of structuring query allows mysql exploit index on time column. but, if timestamp's text string index work little strange

javascript - How to load a db context in another Html page using YDN-DB? -

i've loaded data on first page: <script src="/scripts/jquery-1.5.1.min.js" type="text/javascript"></script> <script src="/scripts/modernizr-1.7.min.js" type="text/javascript"></script> <script src="/scripts/ydn.db-jquery-0.7.5.js" type="text/javascript"></script> <script src="/scripts/jquery.mousewheel.js"></script> ... var schema = { stores: [{ name: 'products', keypath: 'cdproduto', autoincrement: false, indexes: [ { keypath: 'cdcategoria' }, { keypath: 'dtultimaatualizacao' }] }] }; var db = new ydn.db.storage('db-test', schema); db.clear().done(function (num) { db.add('products', [<%=jsonproducts%>]); })

Python: Write csv header "with open" -

i have following code generate csv file without using csv module, , wondering best way header file: for language in languages: open ('user_edits.csv', 'a') f: f.write(str(user_count)+","+str(language[0])+","+str(language[1])+","+str(language[2])+"\n") open file once , use csv module's functions: import csv open ('user_edits.csv', 'a') f: writer = csv.writer(f, delimiter=',') language in languages: writer.writerow([user_count]+language[:3])

CSS - two divs "floating" right absolute in div relative -

the puzzle i'm trying solve today requires post div, inside post thumbnail. on top of (layered over) thumb image, based on php queries (that work great) need 2 icons align right behind each other. 'behind' mean x-axis, because right due position:absolute stack on z-axis 1 hidden. is post can have veriety of illustrated car icons (that align right), in cases, trailer icon needed. trailer needs follow behind car. trick is, each of cars , each of trailers has different picture width. here's have far, works except trailer hidden behind car. .post {margin:0; padding:12px; border:1px solid #fff; -khtml-border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px; border-radius: 6px; position: relative;} .carortrailer {display:block; position:absolute; right: 0; height:32px; margin-top:130px; margin-right: 4px; padding:0; z-index:990; } .car {background:url("images/ico-car.png") no-repeat scroll right; width: 70px;} .trailer {background:url("

python - Get revision value if present,if not get default revision value -

input:- <manifest> <default revision="jb_2.5.4" remote="quic"/> <project name="platform/vendor/google/proprietary/widevine" path="vendor/widevine" revision="refs/heads/jb_2.6" x-grease-customer="none" x-quic-dist="none" x-ship="none" /> <project path="vendor/widevine" name="platform/vendor/google/proprietary/bluetooth" x-ship="none" x-quic-dist="none" x-grease-customer="none"/> </manifest> i trying revision value input above if revision tag present,if not present use revision value in default tag,i have following code , running following error.. can provide inputs on wrong here? import shlex import os import sys import json import fileinput import pwd import itertools import subprocess subprocess import popen, pipe, stdout import xml.etree.elementtree et import re def

ajax - How does google move the search box to the top while typing? -

go google type , relocate search box top, , load results page without hitting search or enter. results page black @ first typing continues loads results. i'm assuming uses ajax, load new html page or somehow change home page? html: <div id="top_panel" class="main fluid"> <nav id="topnav" class="fluid"> <ul class="fluid fluidlist navsystem"> <li class="fluid navitem web"><a href="index.html" class="web">web</a></li> <li class="fluid navitem photos"><a href="#">photos</a></li> </ul> <!-- end .navsystem --> </nav> <!-- end #topnav --> </div> <!-- end #top_panel --> ajax: <script> function keypress() { var xmlhttp; if (window.xmlhttprequest) {// code ie7+, firefox, chrome, opera, sa

java - Javaee asynchronous request : Dispatching even after response closed -

i'm reading oscwcd books charles lyon on section asynchoronous request. says in asynchronous cycle, 1 can dispatch when response has been committed. don't understand why so? insight great! the general approach asynchronous approach client open new channel receive asynchronous response , provide handle of channel server. asynchronous response not sent on intial client request/response channel, rather sent on different channel, remains active till client not receive asynchronous response. if client not able provide channel server send asynchronous response, approach use polling. in case, server part of intial request response, provide polling url. client can poll periodicall, , when server has response ready, return response. when server not have response, should return meaningful in-progress message.

Camera capture orientation on samsung devices in android -

Image
i creating camera app. image when captured shown in grid view. now, code working fine on devices except samsung devices. i facing orientation issue. when capture image in portrait mode, image rotates when displayed in gridview. have not kept rotate code. secondly, exif achieved proper image in grid view when device orientation changes, again image rotates in wiered fashion. attaching images: sorry resolution of image. please lemme know if not visible properly. upload again. know there lot such on so. guess stuck somewhere. i referring following link: http://blog.andolasoft.com/2013/06/how-to-show-captured-images-dynamically-in-gridview-layout.html this code i've done (it working every device): this part set taken photo imageview in main activity: try { file imagefile = new file(cursor.getstring(0)); exifinterface exif = new exifinterface( imagefile.getabsolutepath()); in

JQuery Mobile Menu on Android menu button -

i'm developing small hybrid app using phonegap in android. want menu popped native app on press of menu hardware button on android phone. im using galaxy s2. did try creating div , toggling on menubutton. $(document).on("menubutton", onmenubutton); function onmenubutton(){ $("#sltmainmenu").toggle(); } and div not part of page. <div id="main_menu" data-role="fieldcontain" class="mainmenu"> <select name="sltmainmenu" id="sltmainmenu" data-native-menu="false"> <option value="search">search</option> <option value="logout">logout</option> </select> </div> how achieve native app menu action using phonegap? you want add script document's head: document.addeventlistener("menubutton", menubuttonhandle, false); function menubuttonhandle() { alert("menu button pressed!"); }

java - This code is showing only some files on the server.Other files can't be viewed -

public void checkfile (string servername) throws exception { if (servername == null) servername = ""; system.out.println("in check file method"); file folder = new file("d:\\mvxout412"); //path on server int count = 0; string abc; file[] files = folder.listfiles(); if (files != null) { system.out.println("in if method"); (int i=0;i<files.length ;i++) { count++; abc = files[i].getname(); system.out.println("number of files: " + count); system.out.println("name of files: " + abc); } } } this code showing files @ path/folder on server. other files can't viewed. login , logout happens successfully. public void listfilesforfolder(final file folder) { (final file fileentry : folder.listfiles()) { if (fileentry.isdirectory()) { listfilesforfolder(fileentry); } else { system.

android - App flow with AccountManager -

Image
i've been struggling while app structure. , seems structure give me lot of pain in developing of other features. before going further i'd have advice , see if i'm doing wrong here. my app's purpose connect server, use accountmanager mechanism create account on device , store token supposed used request data server. in creation of account, fine. (it works device settings -> add account) it goes : mainactivity activity that, when launch app, check if have account. if have account, token in static variable every fragment in mainactivity can access it. (supposed work doesn't) else, create intent loginactivity create account on device. problem fragments can't token because, i'm recovering token in thread using accountmanager.getauthtoken(), fragments created before token recovered. , therefore can't request data server. which led me think app structure might not good. thinking, "what if so?" : the user launches app mainactivity ac

c# - Postback resets the selectedValue of DropdownList inside GridView -

my gridview has 2 columns - dropdownlist & textbox. ddl databound datatable. selectedindex change of ddl populate textbox , add new row. of works fine, selected values of ddls of previous rows, reset 0 index, when new row added.the textbox values remain intact though. how can retain ddl selected values when adding new rows. for eg. if select 'abc' dropdown of row 1, populates text field , adds new row. postback happening, abc not remain selected in row 1 ddl: login phone 1 123456789 2 aspx: <asp:gridview id="gvcommissions" runat="server" onrowdatabound="gvcommissions_rowdatabound"> <columns> <asp:templatefield headertext="login" itemstyle-width="29%"> <itemtemplate> <asp:dropdownlist id="ddllogin" runat="server" width="98%" datatextfield="login" datavaluefield="id" onselectedindexchanged="ddllogin_sel

python - Accessing an object's attribute inside __setattr__ -

python bit me today. i'm trying access object's attribute inside __setattr__ implementation - can't figure out how. i've tried far: class test1(object): def __init__(self): self.blub = 'hi1' def __setattr__(self, name, value): print self.blub class test2(object): def __init__(self): self.blub = 'hi2' def __setattr__(self, name, value): print object.__getattr__(self, 'blub') class test3(object): def __init__(self): self.blub = 'hi3' def __setattr__(self, name, value): print object.__getattribute__(self, 'blub') class test4(object): def __init__(self): self.blub = 'hi4' def __setattr__(self, name, value): print self.__getattr__('blub') class test5(object): def __init__(self): self.blub = 'hi5' def __setattr__(self, name, value): print self.__getattribute__('blub') cl

Get the IBAN number from an emv card -

i have issues reading iban number german cashcards (also known geldkarte). can communicate card, , informations it. don`t know commandapdu must send card, iban number... the application runs on java 7 , use java.smartcardio api protocoll t=1 my commandapdu date looks this: byte[] commandbytes = new byte[]{0x00, (byte)0xa4, 0x04, 0x00, 0x07, (byte)0xa0, 0x00, 0x00, 0x00,0x04, 0x30, 0x60, 0x00}; the information is: 6f 32 84 07 a0 00 00 00 04 30 60 a5 27 50 07 4d 61 65 73 74 72 6f 87 01 03 9f 38 09 9f 33 02 9f 35 01 9f 40 01 5f 2d 04 64 65 65 6e bf 0c 05 9f 4d 02 19 0a can tell me correct apdu getting iban number? i sorry if forgott information needed, first question in board :-) okay card has sent this: 6f328407a0000000043060a52750074d61657374726f8701039f38099f33029f35019f40015f2d046465656ebf0c059f4d02190a which translates to : 6f file control information (fci) template 84 dedicated file (df) name a0000000043060 a5 file control informa

objective c - Obj-C: Callback is not executing -

any idea why callback not executing? panoservie initialized , everything. put nslog messages there, , nothing happens. - (cllocationcoordinate2d) randomlatitudelongitude { countrybbval aubb = [[ggdata sharedinstance] boundingboxforcountry:australia]; //nslog(@"bb: %f, %f, %f, %f", aubb.nelat, aubb.nelng, aubb.swlat, aubb.swlng); double ranlongitude = [self randomdoublebetween: aubb.nelng and: aubb.swlng]; // boundix box double ranlatitude = [self randomdoublebetween: aubb.nelat and: aubb.swlat]; cllocationcoordinate2d ranlatlng = cllocationcoordinate2dmake(ranlatitude, ranlongitude); //nslog(@"ranlatlng: [%f] [%f]", ranlatitude, ranlongitude); __block gmspanorama *panphoto = nil; [self.panoservice requestpanoramanearcoordinate:ranlatlng callback:^(gmspanorama *panorama, nserror *error) { nslog(@"panorama: %@ error: %@", panorama, error); panphoto = panorama; }]; if (!panphoto) return

ios - How to write block definition using properties? -

i writing class getting image photos library. want 1 single method return selected image library. started writing class named mediabrowser. used block give selected image. confused write block definition. please correct code if going wrong. in mediabrowser.h @interface mediabrowser : nsobject typedef uiimage* (^mediabrowsercompletionhandler)(void); + (id)sharedinstance; - (bool)startmediabrowserfromviewcontroller:(uiviewcontroller*)controller completionhandler:(mediabrowsercompletionhandler)completion; @end in mediabrowser.m @interface mediabrowser () <uiimagepickercontrollerdelegate, uinavigationcontrollerdelegate> @property (nonatomic, strong) mediabrowsercompletionhandler completionhandler; @end @implementation mediabrowser static mediabrowser *sharedmediabrowser = nil; + (id)sharedinstance { if (nil != sharedmediabrowser) { return sharedmediabrowser; } static dispatch_once_t oncetoken; dispatch_once(&oncet

java - SSL chain validation failed with intermediate cert -

i want understand way validation chain works. certs need in truststore? i have chain root ca -> intermediate 1 -> intermediate 2 -> server cert. have intermediate 2 cert in truststore. on 1 test machine works right, on other not (contacting different server similar configuration). popular suncertpathbuilderexception: unable find valid certification path requested target exception. server sends full chain. guess solution put whole chain root ca truststore. i want know why works on 1 machine , not other. possible have influence on how chain validation works? can server require full chain validation? i not figure out, if default truststore jdk automatically included or not. 2 machines have different jdk versions 1.7.0_21 (not working) , 1.7.0_25 (working). matter? one more thing: suncertpathbuilderexception - possible find out part of chain not like? i happy hints. thanks, heike you need certificate of any of signers in certificate chain. typically topmost

bash - unable to run commands in shell script after su mqm command,but able to run in putty?Pleae let me know how to execute.? -

my script is, #!/bin/bash su mqm echo "display qlocal (<queuename>) curdepth" | runmqsc queuemanager same command works in putty not through script. putty interactive command line. try below. bash variables can used. #!/bin/bash su - mqm -c "echo 'display qlocal (<queuename>) curdepth'|runmqsc queuemanager"

c++ - Different addresses while filling a std::vector -

wouldn't expect addresses printed 2 loops same? was, , cannot understand why (sometimes) different. #include <iostream> #include <vector> using namespace std; struct s { void print_address() { cout << << endl; } }; int main(int argc,char *argv[]) { vector<s> v; (size_t = 0; < 10; i++) { v.push_back( s() ); v.back().print_address(); } cout << endl; (size_t = 0; < v.size(); i++) { v[i].print_address(); } return 0; } i tested code many local , on-line compilers , output looks (the last 3 figures same): 0xaec010 0xaec031 0xaec012 0xaec013 0xaec034 0xaec035 0xaec036 0xaec037 0xaec018 0xaec019 0xaec010 0xaec011 0xaec012 0xaec013 0xaec014 0xaec015 0xaec016 0xaec017 0xaec018 0xaec019 i spotted because making initialization in first loop obtained uninitialized object in subsequent part of program. missing something? the vector performing re-allocations in order grow needed. each time this, a

EclipseLink MultiTenant and Spring Data JPA - @IdClass annotation required - Why? -

i'm developing multi-tenant (multi-schema) application using spring-data-jpa , eclipselink. when not using multi-tenant capabilities ok, jpa entity works charme , works 1 schema. when try activate multi-tenant adding folloqing annotation entity : @multitenant(value=multitenanttype.table_per_tenant) @tenanttablediscriminator(type=tenanttablediscriminatortype.schema, contextproperty="eclipselink-tenant.id") and restart application, following exception : caused by: java.lang.illegalargumentexception: no @idclass attributes exist on identifiabletype [entitytypeimpl@15818739:crsmomijob [ javatype: class com.gpdati.momi.model.core.crsmomijob descriptor: relationaldescriptor(com.gpdati.momi.model.core.crsmomijob --> [databasetable(crs_momi_job)]), mappings: 7]]. there still may 1 or more @id or @embeddedid on type. @ org.eclipse.persistence.internal.jpa.metamodel.identifiabletypeimpl.getidclassattributes(identifiabletypeimpl.java:169) @ org.springframework.data.jpa

symfony - Symfony2 combine entities in a query -

heelo guys! i have problem when try "union" 2 tables in symfony2 project. i'll try mix 2 entities in 1 query. example, have 2 entities: " games " , " films " (the 2 columns totally independents), , users can rate it. well, problem comes when try put in rating list 2 entities, because need join 2 tables obtain information , keep ordered according votes. can tell me correct way focus problem? many thanks!

javascript - Global footer in typeahead dropdown -

i have typeahead menu 2 categories, under categories need button. how can add global footer, available when 2'nd category missing? what did add footer in each dataset hide last 1 css, here's code : $('#search-query').typeahead([ { remote: appurl + 'franchiseesuggestions?query=%query', name: 'franchisees', minlength: 3, valuekey: 'name', template: [ '<p><strong>{{name}}</strong></p>' ].join(''), header: '<p class="tt-header">' + franchisees + '</p>', footer: '<p class="more"><a href="/recherche?q=%query">all results</a></p>', engine: hogan }, { remote: appurl + 'citysuggestions?query=%query', name: 'cities', minlengt

swing - Disable NO_BUTTON from JOptionPane Java if a condition is true -

i used showconfirmdialog method joptionpane options: yes_no_cancel. how can have access , disable no_button if condition true? thank you! why not show different type of dialog if said condition true? if(cancancel) { joptionpane.showconfirmdialog(" blah blah blah "); } else { joptionpane.showmessagedialog(" blah blah blah "); }

oracle - how to define a set of strings in declare section of pl/sql script -

in pl/sql can use in keyword set of strings: select * languages language_tag in ('en','fr','es') how can define set of ('en','fr','es') in declare section of script , use on again? --edit: nasty approach (which current approach!) define items csv strings in declare section , use execute_immediate : declare v_csv_tags varchar2(123) :='''en'',''es'''; begin execute immediate 'delete config_supports_language language_code not in ('||v_csv_tags||')'; execute immediate 'delete languages language_code not in ('||v_csv_tags||')'; end; / exit; you can create nested table or varray sql type(as schema object) , use in pl/sql stored procedure or anonymous pl/sql block follows: sql type create type t_list table of varchar2(123); / type created pl/sq block: declare l_list t_list3 := t_list3('en','fr','es'); -- l_list c

html5 - How to play a YouTube video with HTML 5's <video> -

i can play youtube video in site using html 5 <video> controls? i able run video mp4, ogg format, <video width="710" height="423" controls> <source src="testvideo.ogg" type="video/ogg"> browser not support video tag. </video> but how run teh video source youtube ex: <video width="710" height="423" controls> <source src="https://www.youtube.com/v/<youtube video id>?enablejsapi=1&rel=0&fs=1" type="????"></source> browser not support video tag. </video> i provided valid source , given type video/youtube , got error no video supported format , mime type found please let me know if have input thanks, sharath if tag <youtube video id> produces 11 character code such video https://www.youtube.com/watch?v=t2bylmlnyj8 the 11 character code t2bylmlnyj8 then think should try <iframe width="

python - node proxy closed connection unexpectedly -

my system runs python code apache , mod_wsgi. node proxyes connection apache. in python script serve file in response http get. when requesting connction cuts unexpectedly in middle. the node code: var server = https.createserver(httpsoptions,function (req, res) { var result=req.url.match(/^\/(.*?)(\/.*?)$/); if (!(result&&result[1]=='socket.io')) { return proxy.proxyrequest(req, res); } }); when make request apache if works fine. works fine first request affter node restart.

node.js - Browser not sending back cookies, but curl does -

Image
i developing nodejs application scratch. beginning play node. building login system, found issue: when login correct name , password, cookie set 'remember_token' value. supposed store user session. cookies in google chrome browser the cookie set correctly, when browser makes new request, cookie value not set in server: when make request trhoug curl, cookies recieved server: curl -i 'http://localhost' -b "remember_token=znvuy3rpb24gbm93kckgeybbbmf0axzlignvzgvdih0wlja1ntg2mzu1mtu2mjy1mtk5" aditional info i added lines app.js before middleware called: app.use(function(req, res, next){ console.log('\nrequest: ' + json.stringify(req.headers)); next(); }); and output when make request browser: request: {"host":"node","connection":"close","cache-control":"max-age=0","accept":"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8","use

php - Email confirmation sending -

i'm trying implement email confirmation newsletter subscription app. if user inputs valid data , added database, code goes: else { $insert = $db -> prepare ("insert newsletter (name, email, cfkey, time) values(:name, :email, :cfkey, now())"); $insert -> execute(array(':name' => $name, ':email' => $email, ':cfkey' => $cfkey)); //success! - notify user $usermsg = '<br /><br /><h4><font color="0066ff">thanks ' . $name . ', have been added successfully.</font></h4>'; $name = ""; $email = ""; }// end else $mail_body = '<html> <head> <title>my name</title> </head> <body> <p style="color: green";>

string - SELECT statement from two dataframes using RMySQL -

consider 2 data frames, dataframe1 , dataframe2 : dataframe1 has n columns (colmn1, ..., colmnn) dataframe2 has 3 columns (col1, col2, col3) can write statement like: select colmn1, colmn2, ..., colmnn, col1, col2 dataframe1, dataframe2 using rmysql ? maybe want package sqldf instead. try this: library("sqldf") sqldf("select colmn1, colmn2, ..., colmnn, col1, col2 dataframe1, dataframe2") of course must replace ... actual column names.