Posts

Showing posts from August, 2010

intel - unable to find SINIT ACM For processor xeon E5 1600 -

i have tried install tboot on lenovo thinkstation s30 having xeon e5 1600 processor. somewhere have read tboot uses txt (intel's techonology). txt requires sinit acm. unable find sinit acm these processor on internet. i have found 1 link http://software.intel.com/en-us/articles/intel-trusted-execution-technology this having sinit other processor family not e5. please .. if acm not in list, indicated there none available (yet). try write tboot development mailing list: tboot-devel@lists.sourceforge.net . read intel guys maintaining tboot , know available acms. maybe can tell module compatible or when compatible module released.

c# - how to update GridView row at once in sql database -

i have dll class call table public datatable gettemtablevalue(string tablename) { sqlconnection conn = new sqlconnection(sconnectionstring); conn.open(); string query = "select * " + tablename + ""; sqlcommand cmd = conn.createcommand(); cmd.commandtext = query; datatable ds = new datatable(); sqldataadapter da = new sqldataadapter(cmd); da.fill(ds); conn.close(); return ds; } and binding table grid view private void loaddata() { clsdataaccess objdal = new clsdataaccess(); datatable ds = new datatable(); string objbll = ddltemtablelist.selectedvalue.tostring(); ds = objdal.gettemtablevalue(objbll); if (ds != null && ds.rows.count != 0) { lblnorecord.visible = false; foreach (datacolumn col in ds.columns) { //declare bound field , allocate memo...

c# - Using ZeroMQ in Portable Class Library .Net & Mono -

i try use zeromq in new project. server , client must interact (exchange messages) through zeromq. planned implement several kinds of customers android, windows, may another. make basic logic of interaction in pcl. visual studio 2013 + xamarin i created pcl project, nuget installed clrzmq package. created test method: public string m1() { using (var c = new context()) { var subscriber = c.socket(sockettype.sub); subscriber.bind(transport.tcp, "192.168.123.23:9292"); subscriber.subscribe("", encoding.utf8); // subscribe messages var message = subscriber.recv(encoding.utf8, sendrecvopt.none); return message; } } when call method in android project, see dllnotfoundexception. problem described in this question (but android) the code compiles, in runtime - error dllnotfoundexception libzmq.dll. could tell me how configure linking libzmq properly? after reading post xa...

angularjs - Highcharts smooth transition on data update using Angular and ng-highcharts -

i've made prototype of highchart works strictly in jquery. had bunch of spaghetti code, had nice transitional animation when selecting controller animate chart , update series. in short, done so... var chart = new highcharts.chart(chartoptions); // ... $('select#dropdown').change(function(){ // ... chart.series[0].setdata(/*data*/, false); chart.series[1].setdata(/*data*/, false); chart.series[2].setdata(/*data*/, false); // ... chart.redraw(); } so chart (1) initialized on page load, (2) takes argument dropdown box (3) decides new value given series , (4) smoothly redraws chart value. my problem i'm having difficult time re-producing in angular. highcharts-ng, seems have every example under sun except updating existing points. http://pablojim.github.io/highcharts-ng/examples/example.html there things adding series, deleting series etc.. updating series? if wanted series tied scope variable, changing? how make $scope.$watch on drop-down box tel...

button - Random UIButton position in a Quiz -

how change randomly position of 4 uibuttons (quiz answers) in xcode 5, ios 7 ? i change position of buttons (answers) each time new question loads. compatibility iphone 4 , 5 should given. you can change position of object follows cgrect rect = [uiscreen mainscreen].bounds; cgpoint point = cgpointmake(rand()%(int)rect.size.width, rand()%(int)rect.size.height); mybutton.center = point; nslog(@"%@", nsstringfromcgpoint(point)); i hope helps e

php - Add tr after 4 uploaded images -

i want gallery of uploaded images, showing 4 images each tr. there needs loop somewhere can't work. needs add tr automatically when there 4 images in tr. <?php $folder = 'uploads/'; $filetype = '*.*'; $files = glob($folder.$filetype); $count = count($files); $sortedarray = array(); ($i = 0; $i < $count; $i++) { $sortedarray[date ('ymdhis', filemtime($files[$i]))] = $files[$i]; } krsort($sortedarray); echo '<table>'; foreach ($sortedarray &$filename) { echo '<td align="center">'; echo '<a name="'.$filename.'" href="#'.$filename.'"><img src="'.$filename.'" /></a>'; echo 'bestand naam: ' . substr($filename,strlen($folder),strpos($filename, '.')-strlen($folder)); echo '</td>'; } echo '</table>'; ?...

ruby on rails - How to "shift" objects from ActiveRecord array -

i have method def gen_events(score) events = location.events (1..rand(5..7)).each |n| random = rand(0.139..1).round(3) rarity = character.get_rarity(random) event = events.where(rarity: rarity).shuffle.shift #<-- here self.events << event end end currently, shift method grabs first element, doesn't remove it, how can go making both? this not array: events.where(rarity: rarity) , activerecord scope, can't remove things without destroying , erasing them database. instead, should keep array of object found, , use filter future results: def gen_events(score) events = location.events new_events = [] (1..rand(5..7)).each |n| random = rand(0.139..1).round(3) rarity = character.get_rarity(random) event = events.where(rarity: rarity).where.not(id: new_events.map(&:id).sample new_events << event end self.events << new_events end

java - Calling setEnable within an ActionListener -

in game making buttons, when click on "next" button, other buttons become 'grayed out' cannot click on them. have code in actionlistener 'next' button: public class nextlistener implements actionlistener { public void actionperformed(actionevent e) { nextbutton.setenabled(false); callbutton.setenabled(false); raisebutton.setenabled(false); } } however, when run program, buttons not gray out, , error: exception in thread "awt-eventqueue-0" java.lang.nullpointerexception why doesn't work? you're trying call methods on null variables, suggests 1 or of jbutton variables you're calling setenabled(...) on null. solution: assign valid references variables before trying call methods on them. this can done via constructor parameter or such. or better yet, give class holds button variables public method allows change state of buttons, , pass reference of object, container object ac...

php - Foreach a specific key from array -

i have array 2 same keys want foreach out if possible. code looks like: $arrayname = array( 1 => array('detail' => 'detail1' , 'detail' => 'detail2') ); foreach ($arrayname[1] $key['detail'] => $value) { echo $value; } thanks help! your keys overwriting themselves. may want approach solution this: $arrayname = array( array('name' => 'detail' , 'value' => 'detail1'), array('name' => 'detail' , 'value' => 'detail2') ); foreach ($arrayname $i) { echo $i['value']; }

google app engine - Write Cron Job in Java on GAE to Run BigQuery -

i want run cron job on gae internally calls bigquery. i able run bigquery need log in credentials. run cron job bigquery without login. any highly appreciated. i know it's not java you're expecting. secret use appassertioncredentials. here python sample: from apiclient.discovery import build oauth2client.appengine import appassertioncredentials import httplib2 google.appengine.api import memcache scope = 'https://www.googleapis.com/auth/bigquery' credentials = appassertioncredentials(scope=scope) http = credentials.authorize(httplib2.http(memcache)) return build("bigquery", "v2", http=http)

android - is something wrong with my query -

cursor cursor = database.query(mysqliteopenhelper.table_mots, allcolumns, mysqliteopenhelper.column_cat + " = ? , " + mysqliteopenhelper.column_mot + " ?", new string[] {cat, c + "%"}, null, null, null, null); knowing that: -mysqliteopenhelper.table_mots: table name -allcolumns string table columns names -mysqliteopenhelper.column_cat : column name (for condition) -mysqliteopenhelper.column_mot : column name (for condition too) and knowing sql query want is, example: select * mots cat = 'jobs' , mot "s%"

java - Securely Check If User Is Logged In -

question: secure method of storing , checking if user 'logged in' application. i building personal finance application security important. is storing key->value pair in sharedpreferences such loggedin->true secure enough? (my intuition tells me no). could please point me in right direction? much appreciated!

mysql - Delete Row based on all columns -

i'm beginning sql , know how delete row based on of columns. have table called rebels columns rebel_name , rebel_fleet , , rebel_skill . tried doing following no row affected. did fail include in logic? delete rebels rebel_name = 'matar sewtor' , rebel_fleet = 'alliance' , rebel_skill = 'pilot'; you're doing right thing. suspect you've made simple spelling mistake in 1 of fields, or there invisible trailing whitespace after 1 of fields.

git submodules - how to create an environment agnostic javascript library -

i'm creating javascript library, , want environment agnostic (it not use dom, ajax, or nodejs api. vanilla javascript). so, it's supposed run in javascript environment (browsers, npm, meteor smart packages, v8 c bindings...). my approach creating git repo library, library inside single global variable, without thinking patterns commonjs or amd. later, i'll create git repo, using library git submodule, , create needed release npm module. i'm concerned if it's approach, didn't found doing way. pros: code vanilla javascript, without awareness of environment patterns. not bind commonjs. repackable (copy , paste or git submodule) javascript environment. small needed sent browsers. cons: i'll have maintain many git environments want support. @ least second git repo deliver on npm. taking jquery example, runs in both browser , nodejs, 1 git repo. there code aware of "exports" variable run on nodejs or other commonjs compatible enviroment. pros: 1 ...

ios - UIImage not retrieving From NSUserDefaults -

in application grab image picker , try display in separate view. in mainviewcontroller.m have -(void)imagepickercontroller:(uiimagepickercontroller*)picker didfinishpickingmediawithinfo:(nsdictionary*)info { [picker dismissviewcontrolleranimated:yes completion:^ { self.image = [info objectforkey:@"uiimagepickercontrolleroriginalimage"]; nsuserdefaults *defaults = [nsuserdefaults standarduserdefaults]; [defaults setobject:uiimagepngrepresentation(self.image) forkey:@"imagekey"]; [defaults synchronize]; publishviewcontroller *publish = [self.storyboard instantiateviewcontrollerwithidentifier:@"publish"]; [self presentviewcontroller:publish animated:yes completion:nil]; }]; } i try retrieve image in publishviewcontroller.m - (void)viewdidload { [super viewdidload]; // additional setup after loading view. nsdata *imagedata = [[nsuserdefaults standarduserdefaults] objectforkey:@"imagekey"]; uiimage *userimage = [...

indexing - Getting MySQL to use multiple indices per table -

i remember reading somewhere mysql can use 1 index per table select query, don't know if still true recent versions of mysql. couldn't find topic. i'm trying optimize query on table has multiple indices, explain shows it's using 1 of indices. tried using force index(index1,index2) , isn't working. there way force mysql use multiple indices in table? i'm using mysql 5.6.15. basically mysql can use 1 index while retrieving rows table. there special cases when mysql able scan multiple indexes single table. called index merge optimalization , details describes under link: http://dev.mysql.com/doc/refman/5.6/en/index-merge-optimization.html few basic examples can find in demo there couple of indexes on mytable table in demo: create index m_x on mytable( x ); create index m_y on mytable( y ); and there 3 queries (you need click on view execution plan links in demo see expains): intersection access algorithm: select * mytable x = 4 ...

indexing - How to index pages that are automatically created in a database -

i have http://gamingsoup.com/ . when try create xml site map, automatic news pages such http://gamingsoup.com/news/4275 not indexed when google crawls site or when create xml site map. any help, resources, or tips appreciated!! google doesn't know nor care content stored in database. sees content served when requests url. if google not indexing site various reasons including site/pages new, poor quality content, thin content, spammy backlinks, etc. need create google webmasters tools account , messages google in there. if there none need patient , give google time index site and/or improve site's content.

php - How to upload an image on CodeIgniter and display it on another page -

i still learning codeigniter framework , completed news application tutorial, lets create news item title , text story. how can user able upload image news item, , display each image when viewing corresponding news item. ps. sorry if made mistakes, first question create.php <h2>create news item</h2> <?php echo validation_errors(); ?> <?php echo form_open('news/create') ?> <?php echo form_open_multipart('upload/do_upload');?> <input type="file" name="userfile" size="20" /> <label for="title">title</label> <input type="input" name="title" /><br /> <label for="text">text</label> <textarea name="text"></textarea><br /> <input style="margin-left: 18%; margin-right: 20%;" type="submit" name="submit" value="publish" /> </for...

c++ - How do I correctly operate tellg() and seekp() to accomplish this task? -

void edit_member() { int id; int slot; streampos pos; cout << "\n" << "enter member id#: "; cin.ignore(); id = only_int(); int mems = count_members(); (int = 0; < mems; a++) { if (id == member[a].id) { i_file.open("member_data.txt"); (int b = 0; b <= a; b++) { string void_data; getline(i_file, void_data, '#'); pos = i_file.tellg(); slot = a; } i_file.close(); break; } } o_file.open("member_data.txt"); cout << "\nenter new name id# " << id << ": "; cin.ignore(); getline(cin, member[slot].name, '\n'); o_file.seekp(pos) << member[slot].name; o_file.close(); load(); } i trying navigate specific point in file , overwrite name written t...

php - JS Jobs Extension in Joomla 2.5 -

i new joomla, have installed js jobs extension in site http://dotcomsourcing.com/lercorefinery/ extension installed, when clicked open it,shows following error fatal error: class 'jcontrollerlegacy' not found in /home/dotcom/public_html/lercorefinery/administrator/components/com_jsjobs/controller.php on line 24 help me figure out.. or tell other option the jcontrollerlegacy class added in joomla 2.5.6. upgrade that, , you'll fine. if you're not able upgrade, define classes yourself, since shell extends jcontroller. however, recommended way upgrade @ least 2.5.6. if these classes added joomla 2.5.0, classes can extend jcontrollerlegacy, jmodellegacy, , jviewlegacy. however, since these classes not available before 2.5.6, think need define temp class, : if (version_compare(jversion, '3.0', 'ge')) { class legacycontroller extends jcontrollerlegacy { } } else { jimport( 'joomla.application.component.controller' ); class legac...

python - Gunicorn+flask+pymongo+gevent hangs on initialization -

simple test app: from gevent import monkey monkey.patch_all() pymongo import connection, mongoclient flask import flask, make_response app = flask(__name__) print "connect" connection = mongoclient("host1, host2, host3", 27017, max_pool_size=4, **{"connecttimeoutms": 3000, "sockettimeoutms": 3000, "use_greenlets": true}) print "db" db = connection.barn_2 @app.route('/') def hello_world(): return make_response("hello world!", 200, {'content-type': 'application/json; charset=utf-8'}) if __name__ == '__main__': app.run() works if it's run standalone app: shcheklein@hostname:~$ python test.py connect db * running on http://127.0.0.1:5000/ 127.0.0.1 - - [07/apr/2014 13:07:31] "get / http/1.1" 200 - ^ckeyboardinterrupt but fails start gunicorn: shcheklein@hostname:~$ gunicorn -w 1 -k gevent -t 5 --debug test:app 2014-04-07 13:15:04 [9752] [info] start...

uitableview - Retrieving Multiple rows from SQLite in Xamarin iOS -

i'm doing app xamarin ios. put uitableview on xcode, when click on button, retrieves database , slot in. i'm able put onto row, couldn't figure out how have multiple rows of data in it. partial code i'm able display row of data. cmd.commandtype = commandtype.text; dr = cmd.executereader(); while (dr.read()) { var table = new uitableview(this.retrievedata.frame); string[] tableitems = new string[] {dr["admin_num"] + ", " + dr["name"]}; table.source = new tablesource(tableitems); add (table); } you creating new tableview each row in data. instead, should loop through data , create data structure (list, array, etc) containing of data want display, , pass data tableview/source. cmd.commandtype = commandtype.text; dr = cmd.executereader(); // need class mydata num , name properties list<mydata> data = new list<mydata>(); while (dr.read()) { data.add(new myda...

client - Java Card error with jcclient.properties file -

i'm trying run java card client side code try connect port 9025 folowing error message. after googling found file jcclient.properties main responsable connection parameters. connecting... java.net.connectexception: connection refused: connect @ java.net.dualstackplainsocketimpl.connect0(native method) @ java.net.dualstackplainsocketimpl.socketconnect(unknown source) @ java.net.abstractplainsocketimpl.doconnect(unknown source) @ java.net.abstractplainsocketimpl.connecttoaddress(unknown source) @ java.net.abstractplainsocketimpl.connect(unknown source) @ java.net.plainsocketimpl.connect(unknown source) @ java.net.sockssocketimpl.connect(unknown source) @ java.net.socket.connect(unknown source) @ java.net.socket.connect(unknown source) @ java.net.socket.<init>(unknown source) @ java.net.socket.<init>(unknown source) @ com.sun.javacard.clientlib.apduiocardaccessor.<init>(unknown source) @ card.controller.connect(controller.java:85) @ gui.healthcardgui.actionperf...

ios7 - navigation bar overlapping with status bar on rotating device -

this question has answer here: status bar , navigation bar issue in ios7 12 answers hi status bar overlapping navigation bar.though able display correctly when load screen when rotate navigation bar , status bar overlaps tried set these properties if([[[uidevice currentdevice] systemversion]floatvalue ] >= 7.0) { self.extendedlayoutincludesopaquebars = no; self.automaticallyadjustsscrollviewinsets = no; self.navigationcontroller.navigationbar.translucent=no; self.edgesforextendedlayout = uirectedgeall; } if you're not using storyboard, can use code in appdelegate.m in did finishlaunching: if ([[[uidevice currentdevice] systemversion] floatvalue] >= 7) { [application setstatusbarstyle:uistatusbarstylelightcontent]; self.window.clipstobounds =yes; self.window.frame = cgrectmake(0,20,self.window.frame.size.width,se...

security - Spring "redirect:" EL vulnerability? -

i have public-facing web application uses spring mvc (3.2.x) , spring security (3.1.x). morning observed requests of following form in our access logs: get / mywebapppath /login.do?redirect:${ some url-encoded el code here } what bug or feature of spring attempting exploit? under conditions spring (or other code) evaluate el expression? it looks ?redirect: parameter ignored me, makes me nervous because don't know verify i'm not vulnerable. googling has turned unrelated things (as best can tell). if code inside ${ } had run, have attempted dump contents of /etc/passwd client. (thankfully looks never did run. plus file doesn't exist on our system. , our tomcat runs user limited permissions.) edit: here actual code inside ${ } , after decoding , adding newlines readability: #a=(new java.lang.processbuilder(new java.lang.string[]{'cat','/etc/passwd'})).start(), #b=#a.getinputstream(), #c=new java.io.inputstreamreader(#b), #d=new java.i...

html - JavaScript global variable value does not change until after alerted -

this first question , hope don't wrong. first of all, thank reading. and problem is... design read data in text file javascript, process them through number of functions before creating content display in html div. after searching, figured done xmlhttprequest. because read data processed functions, decided store them global variable easy access. code seemed working fine @ first , print obtained data div. noticed strange bug. if assign data global variable , attempt retrieve them later, assigned value or undefined. try alert global variable's value , see above. however, if alert again, value changes needed. have been learning javascipt short while, facing error leaves me @ lost. the html file: <html> <head> <meta charset="utf-8"> <title>read file</title> <script> var output = ["next"]; function edit() { var rawfile = new xmlhttprequest(); rawfile.open("get", "test.txt", true...

java - Session attribute not reflected in JSP -

so have jsp 1 loads request params session access in second jsp . my jsp 1 code : <jsp:usebean id="emails" scope="request" class="java.lang.string" /> <% string email = emails; session.setattribute( "allemail",email); %> <p style="display:block" ><%= session.getattribute( "allemail" )%></p> my jsp 2 code : <p style="display:block" ><%= session.getattribute( "allemail" )%></p> now can see <p> in first jsp populated data paragraph in second jsp blank when change session.setattribute( "allemail",email); session.setattribute( "allemail","hello world); can see correct value reflected in both paragraphs . what doing wrong ? the servlet populates jsp1 has following request dispatcher requestdispatcher dispatch = request.getrequestdispatcher("jsp1"); i think issue both jsp's initialised...

javascript - Static HTML Iframe not working for non admin users -

i using static html iframe in facebook writing basic code tab. after testing facebook login, when try accessing tab test user's id, doesn't work. i changed role of 1 of test user manager , surprise popup came in saying "static html: iframe tabs receive following info: email address , photos" popup did not come when role not manager/admin. please guide on how resolve of popup not coming non manager/admin users. understand after necessary permissions, tab work properly. please note: using static the javascript code follows: // load sdk asynchronously (function(d){ var js, id = 'facebook-jssdk', ref = d.getelementsbytagname('script')[0]; if (d.getelementbyid(id)) {return;} js = d.createelement('script'); js.id = id; js.async = true; js.src = "//connect.facebook.net/en_us/all.js"; ref.parentnode.insertbefore(js, ref); }(document)); window.fbasyncinit = function() { fb.init({ appid : '190322544333196', status ...

python - Tkinter error after upgrading to OS X 10.9 -

i have tkinter application ran fine in os x 10.7.5. recently, when upgraded 10.9.2, ceased run, throwing error: traceback (most recent call last): file "roitracker.py", line 5127, in <module> starttracker(filename=filename) file "roitracker.py", line 5111, in starttracker tk = tk.tk() file "/system/library/frameworks/python.framework/versions/2.7/lib/python2.7/lib-tk/tkinter.py", line 1745, in _init_ self.tk = _tkinter.create(screenname, basename, classname, interactive, wantobjects, usetk, sync, use) _tkinter.tclerror: no display name , no $display environment variable tkinter , python versions: user:desktop user$ python python 2.7.5 (default, aug 25 2013, 00:04:04) [gcc 4.2.1 compatible apple llvm 5.0 (clang-500.0.68)] on darwin type "help", "copyright", "credits" or "license" more information. >>> import tkinter >>> tkinter.__version__ '$revision: 81008 $' ...

Does a Neo4j application exist in a jar or what? -

i'm trying understand form neo4j app typically take, particularly 1 using core , traversal apis. jar or other archive that's loaded neo4j extension? tomcat servlet connects neo4j? else haven't thought of? apologies if dumb question. google-fu weak today. tried understand looking neo4j "hello, world!", seem use embedded neo4j, not i'm after... the neo4j-kernel jar technically contains need creating neo4j database. neo4j is efficient way of storing data want file. kernel jar contains necessary information on how write nodes , relationships disk. when start neo4j server, web app accepts restful commands , console input write information filesystem. can use of other jars interact restfully neo4j though.

asp.net mvc - Solrnet query to use relevancy for search -

i have indexed "stockavailability" field solr true or false values. means if products in stock stockavailability field has "true" value otherwise has "false" value. now want search result per relevancy, means want show "in stock" products first "out of stock" products. example: assume if search "mouse", returns 10 products. if product "mouse special mouse" has no stock , remaining products have stock want show other products first in stock on search result page out of stock products. how can perform solr solrnet query this? thanks. based on have described, need sort results. applying sort query on stockavailability field should desired results. solr: http://<solrurl>/select?q=mouse&sort=stockavailability&20desc solrnet: var results = solr.query(new solrquery("mouse"), new queryoptions { orderby = new[] {new sortorder("stockavailability", order.desc...

php - Two DB::getIntance() running on the same page -

hi want know if possible have different queries db::getinstance() value in query @ same time on same page? , practice do? if not can show me best practice? i have update page (update.php) on update page have querying part id in database. this works fine. $id = $_get['id']; $agent = db::getinstance()->get('agent', array('id', '=', $id)); below of update.php page drop down field querying part of table data. instance director table user belong. but not work. $directors = $dbh->query("select * directors"); echo "<select name='director' id='director'> <option value=''>".$agent->results()[0]->agent_name."</option>"; foreach($directors->results() $director){ echo "<option value='$director->name'>".$director->name."</option>"; ...

encoding - ISO 8859-15 to UTF-8 conversion in PHP -

my string "die ard hat eines der gr=f6=dften korrespondentennetze weltweit.". guess itsiso 8859-15 , want convert in utf-8. "die ard hat eines der größten korrespondentennetze weltweit." i tried several ways: iconv("iso-8859-15", "utf-8", $content); but, not working, please guide further or let me know ready made function conversion. the quoted text in email transport encoding called "quoted printable". iso-8859-15 may underlying text encoding, best @ email headers.

c# - How to use custom functions in ADO.NET Entity queries -

does know how use custom functions in ado.net entity queries? var data = w in _context.workers select new workerdata() { worktime = hoursminssecs(w.starttime, w.stoptime); }; public string hoursminssecs(datetime starttime, datetime endtime) { timespan span = (endtime - starttime); return string.format("{0} hours, {1} minutes, {2} seconds", span.hours, span.minutes, span.seconds); } i'm getting error: linq entities not recognize method 'system.string hoursminssecs(system.datetime, system.datetime)' method, , method cannot translated store expression. it'is impossible, have write own linq provider make them work. can use ef canonical functions out of box.

groovy - Hibernate criteria subquery referring to value from "root" query -

i'm working in grails & groovy hibernate question. here's grails domain class: public card { // implicit long id string name // ... , on dozen other fields various types. } i have hibernate query: def name = "foo" def result = session.createquery("from card c lower(c.name) ? , c.id in (select max(c2.id) card c2 c.name = c2.name)") .setstring(0, "%${name}%") .list() this gets cards names containing substring "foo", skipping on cards duplicate names except "newest" (i'm assuming higher id means 'newer'). i must avoid returning cards duplicate names. in addition filtering on name , dodging duplicate-names problem, need filter and/or sort on other fields in card. need paginate. wanted use criteria api this, since approach of generating sql/hql leads maintainability nightmares. i can't understand how kind of querying via criteria api though. there detached queries...

vlc - MobileVLCKit for iOS fails to build -

i following instructions in https://wiki.videolan.org/vlckit/ build mobilevlckit.framework project. because have make minor tweaks source, cannot use ready made build. i run sudo ./buildmobilevlckit.sh -vd and stuck at the following build commands failed: libtool build/mobilevlckit.build/debug-iphoneos/mobilevlckit.build/objects-normal/armv7s/libmobilevlckit.a normal armv7s libtool build/mobilevlckit.build/debug-iphoneos/mobilevlckit.build/objects-normal/arm64/libmobilevlckit.a normal arm64 libtool build/mobilevlckit.build/debug-iphoneos/mobilevlckit.build/objects-normal/armv7/libmobilevlckit.a normal armv7 (3 failures) more debug info.. libtool build/mobilevlckit.build/debug-iphoneos/mobilevlckit.build/objects-normal/armv7/libmobilevlckit.a normal armv7 cd /users/me/vlckit export iphoneos_deployment_target=6.1 export path="/applications/xcode.app/contents/developer/platforms/iphoneos.platform/developer/usr/bin:/applications/x...

Need to filter 2 lists & add into seprate list in java -

i have 2 list: avaliableroomtype - [standard, superdeluxe ] wholeroomtype - [standard, superdeluxe, deluxe] i need filter & add separate list unavailableroomtype - [deluxe] for(int j = 0; j < avaliableroomtype.size() ; j++) { for(int = 0; < wholeroomtype.size(); i++) { string tempav = avaliableroomtype.get(j); string temphotelroomid = wholeroomtype.get(i); if(!tempav.equals(temphotelroomid)){ unavailableroomtype.add(temphotelroomid); } } } but have duplicate values. list<string> unavailableroomtype = new arraylist<>(); (string roomtype : wholeroomtype) { if (!avaliableroomtype.contains(roomtype)) { unavailableroomtype.add(roomtype); } }

android - LinearLayout height change with adding new view -

i have nested layouts in gui. don't ask me why made or why don't use grid layout...my question else. my layout looks this after add view, let's button, of these 4 relative layouts, changes this i set relative layout's weight 0dp. way, width not changed when add view layout. don't know height. if set 0dp well, ofc, disappears. here xml code: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:background="@drawable/rising_sun_blue" android:weightsum="2"> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_weight="1" android:background="#333111...

go - Traversing a Golang Map -

i initialized variable named data this: var data interface{} then unmarshalled raw json into. err = json.unmarshal(raw, &data) i've run these 2 functions on it: fmt.println(reflect.typeof(data)) fmt.println(data) and return this: map[string]interface {} map[tasks:[map[payload:map[key:36a6d454-feee-46eb-9d64-a85abeabbcb7] code_name:image_resize]]] and need access "key". have tried these approaches , few more: data["tasks"][0]["payload"]["key"] data[0][0][0][0] those have given me error similar one: ./resize.go:44: invalid operation: data["tasks"] (index of type interface {}) any advice on how grab "key" value out of interface? in advance. since know schema, best way unmarshal directly structs can use. http://play.golang.org/p/ainzp8izqa package main import ( "encoding/json" "fmt" ) type msg struct { tasks []task `json:...

html - Hiding margin-top after login -

i have following line of codes: <div align="center" style="margin-bottom: 5px; margin-top: 35px;"> <!-- ad code here --> </div> please follow site: http://www.electronicsforum.in/ when guest user shows pop-up message ' please login/register '. have no issue this. after login want hide margin-top of div . this code below fixes issue @ www.electronicsforum.in global $context; if ($context['user']['is_logged']) { echo'<div align="center" style="margin-bottom:5px; margin-top: 5px;"> ---ad code here 1-- </div>'; } else { echo'<div align="center" style="margin-bottom: 5px; margin-top: 35px;"> ---ad code here else-- </div>'; }

mysql - help me restore a database -

i have database backup i'm trying load can extract historical averages. think mysql database, syntax adjustments able create 1 , table need in oracle 11g. however, i'm having problems insert portion of backup. basically, of these text fields taken directly fields on our website, , whenever users entered apostrophe, messes follows. finding instances of take long time... is there way handle this? also, text in sql developer runs horizontally on 2 or 3 rows. there way fix that? makes lot of side-scrolling instead of vertical scrolling. use phpmyadmin reload database mysql.

Using Javascript to Replace Link -

i'm using javascript code in attempt replace links on page message says "download", hyperlink leads registration page. the problem "download" text not replacing original link text. original link displayed. lead registration page, again, original link on page still visible text. any ideas? <script> function replacelinks() { var links = document.getelementsbytagname('a'); (var = 0; < links.length; i++) { links[i].innerhtml = 'download' + '<a href="register.php">register here</a>.'; links[i].href = 'register.php'; } } </script> it should be: function replacelinks() { var links = document.getelementsbytagname('a'); (var = 0; < links.length; i++) { links[i].innerhtml = 'download register here.'; links[i].href = 'register.php'; } } the property inn...

c# - Input fields inside div of the same form cannot be processed -

i have form in aspx page processed code behind c#. working fine, until needed hide or show inputs based on user needs. part works well, when put in divs, c# cannot form values anymore. here's simulation of code: <form id="form1" runat="server"> <table width="100%" frame=box> <tr> <td> <div id='firsttext' runat="server"> <table> <tr> <td> <input name="input1" id="idinput1" runat="server" type="radio" value="someval" checked /> </td> </tr> </table> </div> </td> </tr> <tr> <td> <div id='secondtext' runat="server"> <table> <tr...

Action event for a combobox inserted into a JTable Cell in java swing -

i adding combobox 3rd column of table so..every time new row added create new combobox , adds items in vector1 tablecolumn profilecol = table.getcolumnmodel().getcolumn(3); profilecol.setcelleditor(new tablelist(vector1)); here tablelist a below mentioned class extends defaultcelleditor , constructor method public tablelist(java.util.vector v) { super(new jcombobox(v)); my problem if write action like table.addmouselistener(new java.awt.event.mouseadapter() { @override public void mouseclicked(java.awt.event.mouseevent evt) { int row = table.rowatpoint(evt.getpoint()); int col = table.columnatpoint(evt.getpoint()); if (row >= 0 && col ==3) { } } }); it not getting triggered.. i need code fire every selection of item in combo box i need code allow me dynamically update contents of combobox inserted in table please this. every time add new row table new combobox generated..so how can write ...

java - Testing Spring managed servlet -

i need test servlet, working fine now. the servlet needs use spring service, modified way: springbeanautowiringsupport.processinjectionbasedonservletcontext( this, config.getservletcontext()); // imageservlet.java line 49 after migration spring 4, test broke , throws exception: java.lang.illegalstateexception: no webapplicationcontext found: no contextloaderlistener registered? @ org.springframework.web.context.support.webapplicationcontextutils. getrequiredwebapplicationcontext(webapplicationcontextutils.java:84) @ org.springframework.web.context.support.springbeanautowiringsupport. processinjectionbasedonservletcontext(springbeanautowiringsupport.java:107) @ package.imageservlet.init(imageservlet.java:49) @ in.nasv.utils.imageservlettest.accessingimageviahttp(imageservlettest.java:45) here portion of code of imageservlettest: // prepare servlet instance mockservletconfig config = new mockservletconfig( new mockservletcontextpatched()); imageservlet ser...

Passing multiple word phrase from C# (ASP.NET MVC 4) to SQL Server Stored Procedure text search -

i want able take content web page text box , pass sql server stored proc perform search on full-text catalog. in c#, using sql command object setup parameters needed call on stored procedure: 1 of parameters contains query text: public list<searchitems> mysearchfunction(string query.....) { blah//.... sqlparameter paramqry = new sqlparameter(); paramqry.parametername = "@qry"; paramqry.sqldbtype = sqldbtype.nvarchar; paramqry.direction = parameterdirection.input; paramqry.value = query; cmd.parameters.add(paramqry); ...... } on sql side of things, stored proc use query text as: select requiredcolumns tablename contains((ourtablefield), @qry)..... this fine simple (one-word) search terms. how convert/pass multi-word or phrases in c# work in sql? for example, if user enters "barack obama" in text field, want setup @qry value passed sp in query: where contains((ourtablefield),'"barack" , "obam...

html - How to get the values of div using its id after retrieving the values from database using php -

i trying values of div elements using simple html dom parser. working fine hard coded values. here hard coded stuff. <table> <tr><td class='none'><div class='drag' id='d1'>1</div></td></tr> <tr><td class='none'><div class='drag' id='d2'>2</div></td></tr> <tr><td class='none'><div class='drag' id='d3'>3</div></td></tr> apart these constant values need other id values displayed based on selection drop-down menu. <form method="post" name="order" action="<?php echo $_server['php_self']; ?>"> <select id='test' name='test'> <option value="">please select</option> <option value='test1'>test1</option> <option value='test2'>test2</option> </select> </form> ...