Posts

Showing posts from February, 2010

php - Adjust a dropdown menu for mobile devices -

i use dropdown menu swmenu contains function mobile devices disables link of parent button tried figure out time how change opens submenu first click , second click on parent open parent's url. since couldn't make can tell me how it? here's code: if (count($ordered) && ($swmenufree['tablet_hack'])) { $useragent=$_server['http_user_agent']; if(preg_match('/android.+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|meego.+mobile|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i',$useragent)||preg_match('/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cel...

add android button's on click event in a separate class -

i have button in android have defined in fragment_main.xml - <button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/love_button_text" android:onclick="onlovebuttonclicked" /> the main_activity xml file follows - <framelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/container" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.newa.newapp2.mainactivity" tools:ignore="mergerootframe" > <button android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margintop="100sp" android:text="@string/a_but...

javascript - for loop variable expressions mathematical manipulating -

i'm writing program in js , im feeling i'm repeating code, not good. i'm trying avoid if else block has 2 similar for loop , re-write without if else using 1 for loop . consider this: minimum has value 0 . maximum has value 10 . if new_value less old_value wanna execute loop minimum to new_value , else wanna execute maximum downto new_value lets see in action, lets javascript (language-agnostic answers welcome , upvoted -but not grant cookie) var minimum = 0; var maximum = 10; var old_value = 5; /* var new_value = taken user input whatever ... */ if(new_value<old_value) { for(i=minimum;i<new_value;i++) { // whatever } } else { for(i=maximum;i>new_value;i--) { // whatever } } i have feeling these 2 for loop s similar enough written 1 in mathematical approach maybe. have tried bit using absolute values math.abs() math.max.apply() had no luck. i don't want set other helping variables using if else...

class - Method name must be a string, error in PHP -

here code, class tasks { public $parent; public function __construct($parent) { $this->parent = $parent; } public function get_task($parent) { return mysqli_query($db, "select task, status, created_at tasks parent '$parent' , user='$user_id'"); } } $project = new tasks("null"); print "<div class='project'>" . $project->$get_task() . "</div>"; i expect should pass "null" mysql_query , return result(s). error, fatal error: method name must string update : fix didn't make instances of class. instead passed value wanted function tasks::get_task(value-here) . replace print "<div class='project'>" . $project->$get_task() . "</div>"; with print "<div class='project'>" . $project->get_task() . "</div>"; (remove $ sign).

java - Getting two different outputs from a Stream -

i testing out new stream api in java-8 , want check outcome of 10000 random coinflips. far have: public static void main(string[] args) { random r = new random(); intstream randomstream = r.ints(10000,0, 2); system.out.println("heads: " + randomstream.filter(x -> x==1).count()); system.out.println("tails: " + randomstream.filter(x -> x==0).count()); } but throws exception: java.lang.illegalstateexception: stream has been operated upon or closed i understand why happenning how can print count heads , tails if can use stream once? this first solution relying on fact counting number of heads , tails of 10 000 coinflips follows binomial law. for particular use case, can use summarystatistics method. random r = new random(); intstream randomstream = r.ints(10000,0, 2); intsummarystatistics stats = randomstream.summarystatistics(); system.out.println("heads: "+ stats.getsum()); system....

c# - Google TTS speech issue -

i trying google tts speech work, because windows rt/metro not contain definition system.speech. code below compiles no errors, there nothing being spoken. have debugged , checked whether 'listbox.selecteditem' contains text, , does. libraries called: using system; using system.collections.generic; using system.io; using system.linq; using windows.foundation; using windows.foundation.collections; using windows.ui.xaml; using windows.ui.xaml.controls; using windows.ui.xaml.controls.primitives; using windows.ui.xaml.data; using windows.ui.xaml.input; using windows.ui.xaml.media; using windows.ui.xaml.navigation; using windows.ui.popups; using system.net.http; this how i'm calling mymediaelement: mediaelement mymediaelement = new mediaelement(); this trying do: private void repeatword_click(object sender, routedeventargs e) { string pathx = "http://translate.google.com/translate_tts?tl=en&q=" + listbox.selecteditem.tostring(); mymediaelemen...

javascript - Trying to insert in-line HTML to iframe srcdoc tag -

i have array filled html contents want, way map each of contents proper iframe. here chunk of code using function replaceframes(docelement) { array.prototype.foreach.call(docelement.queryselectorall("iframe, frame"), function (node) { var name = node.getattribute("name"); var blah = singlefile.test[name]; node.setattribute("srcdoc",blah); }); } the docelement parameter standard dom element i use jquery, feel wont able modify want, since dont have access document, specific element/node. the problem is, in output document have "&gt'; , &lt'; instead of tags (ignore quotes there, make pop up.)

openstack - Getting a list of block storage volumes at Rackspace using novaclient Python API -

i'm trying list of block storage volumes have on rackspace account using novaclient python api. here's code i'm using: from rackspace_auth_openstack.plugin import rackspaceauthplugin rackspace_auth_openstack.plugin import auth_url_us novaclient.client import client nova = client(version = 2, username = '******', project_id = '******', api_key = '******************************', region_name = 'dfw', auth_system = 'rackspace', auth_plugin = rackspaceauthplugin(), auth_url = auth_url_us()) print nova.servers.list() print nova.volumes.list() all of libraries installed using pip install --upgrade rackspace-novaclient should using lastest version of libraries. here's results of running above code: $ python test.py [<server: svr01>, <server: svr02>] traceback (most recent call last): file "test.py", li...

android - GPS Location Always Shows Location as zero -

i sending location of user email on button click. doinbackground of asynctask given below. @override protected boolean doinbackground(string... arg0) { // todo auto-generated method stub boolean status = false; try { double latitude=0; double longitude=0; gpstracker gps=new gpstracker(mainactivity.this); if(gps.cangetlocation()){ latitude=gps.getlatitude(); longitude=gps.getlongitude(); } string mapurl= "https://www.google.co.in/maps/@"+latitude+","+longitude+",17z"; gmailsender sender = new gmailsender( "myemail@gmail.com", "password", getapplicationcontext()); status = sender.sendmail(" subject ", "\nlocation : "+mapurl,"myemail@gmail.com", "anothermail@gmail.com"); } catch (exception e) { } return status; } but returns location 0,0 gpstracker.java locationmanager = (locationmanager) mcon...

python - django 1.6.2 : CSS not extending to child templates -

i´m having problem this. appreciate help. base.html has {% block content %}{% endblock %} . made signup.html looks this: {%extends 'base.html'%} {% block content %} <h1>join now</h1> <form method='post' action=''>{% csrf_token%} {{form.as_p}} <input type='submit' class= 'btn btn-success btn-block'> </form> {% endblock %} base.html has few css links work fine when launch signup.html. made thankyou.html extends base.html in same way signup.html : {% extends "base.html" %} {% load staticfiles %} <!-- bootstrap core css --> <link href="{%static "css/bootstrap.min.css" rel="stylesheet"%}"/> <!-- custom styles template --> <link href="{%static "css/jumbotron.css" rel="stylesheet"%}"/> <!-- custom css --> <link href="{%static ...

How to use OpenGrok with GitHub? -

github's advanced search okay, opengrok has desirable features. to use opengrok github hosted repo's have to: set own opengrok server clone various repos schedule pulls keep up-to-date or there way? that general idea, but: 2/ should full clone: git clone --mirror https://github.com/user/repo 3/ can triggered by webhook : if listen json payload generate, can pull there push on github repo, , push opengrok server. note: might want exclude pull refs ( refs/pull/{id} ), pull requests github stores in git repo.

postgresql - How to manually lock and unlock a row? -

i trying circumvent double-writes locking , unlocking rows. i have table personnel , user tries edit row, want lock row. so begin; // guess have lock somehow here select * personnel id = 12; commit; and once edit been made, want submit update in same style: begin; //unlocking update personnel set ... id = 12; commit; in time between, when user tries edit same row, message. locks released @ end of transaction. need keep transaction open uphold lock , in single transaction: begin; select * personnel id = 12 for update nowait ; -- row level locking commit; begin; update personnel set ... id = 12; commit; alternatively can use less restrictive for share clause. details in manual on select in chapter "the locking clause". concurrent reads allowed . quoting chapter "row-level locks" in manual : in addition table-level locks, there row-level locks, can exclusive or shared locks. exclusive row-level lock on specific row auto...

javascript - Working with variables outside of jquery UI dialog -

i have .each loops through table rows , compares information entered user attempting add. have conditionals in loop duplicate entries across each of s in row. depending on how many match, there's yes/no decision user make. if user chooses yes, current row needs removed. using jquery ui , having problems getting dialog box know row remove, or having .each loop know selected in dialog. .each loop looks this: $('#tblselectedlist > tbody > tr').each(function() { here's code dialog (within in loop): $('<div></div>').appendto('body') .html('<div><h6>delete duplicate?</h6></div>') .dialog({ modal: true, title: 'delete message', zindex: 10000, autoopen: true, width: 'auto', resizable: false, buttons: {...

java - Server RMI stop automatically when I start it -

i'm frensh sorry english. i'm trying start server rmi application stop whitout error : here code: public class server { public static void main(string[] args) { try { remotefunction skeleton = (remotefunction) unicastremoteobject.exportobject(new functionimpl(), 0); int port = integer.parseint(jndiprop.getstring("port")); registry registry = locateregistry.createregistry(port); registry.rebind(jndiprop.getstring("url"), skeleton); system.out.println("rmi start"); } catch (exception e) { e.printstacktrace(); } } } the port , url ok. someone can me ? you must store registry in static variable. otherwise can garbage-collected, leads train of events allows whole jvm exit.

Issue with dataTables bStateSave and using iDisplayLength -

i'm trying have datatables remember users last selection pagination bstatesave: true , showing user default display length of 50 results using idisplaylength this not working. ideas? delete cookies beginning sprymedia on relevant host, try again.

python - Exit code 139 when performing image subtraction -

i performing image subtraction using python. have images in form of numpy arrays. size of list carrying images 1000. each numpy array in list of 360*640 type. frame subtraction happening correct when number of frames around 300. def find_der(frames): der = [] in range(len(frames)-1): der.append(frames[a + 1] - frames[a]) return der framesprocessing = 1000 j in range(framesprocessing): img = cv.queryframe(video) if img none: print("images not captured") else: tmp = cv.createimage(cv.getsize(img), 8, 3) saveimagescolor = 'abhiram_images/rgb/frame' + str(i) + '.png' #saving iplimages local pc cv.saveimage(saveimagescolor, img) saveimagesgray = 'abhiram_images/gray/frame' + str(i) + '.png' #saving grayscale images local pc img1 = cv2.imread(saveimagescolor) grayimg = cv2.cvtcolor(img1,cv2.color_bgr2gray) cv2.imwrite(saveimagesgray, grayimg) graynumpyimage = np.array(gray...

jquery - outerHeight() method returning a string data type instead of a number data type -

i need jquery method of outerheight() return number data type instead of string data type. var firsttd = $.trim($(this).find("td:first").outerheight()); alert(typeof firsttd); // output ---> string alert(firsttd); // output ---> 58 and triedusing parseint var firsttd = $.trim(parseint($(this).find("td:first").outerheight()),10); alert(typeof firsttd); // output ---> string alert(firsttd); // output ---> 58 how can output number data type? you can removing $.trim() around rest of code. you're receiving integer, there's nothing more trim it. so, use this: var firsttd = $(this).find("td:first").outerheight(); alert(typeof firsttd); // output ---> number alert(firsttd); // output ---> 58

javascript - Changing nav-bar color after scrolling? -

how can set navbar no background color? when scrolling down after div nav-bar gets new background-color (the nav-bar should fixed @ top, use navbar-fixed-top in bootstrap) i've tried tutorials didn't succeed. this website : http://attafothman.olympe.in/ i'm talking black nav-bar on top. here jsfiddle example . using jquery change background color based on scroll pixel position. here fiddle using bootstrap $(document).ready(function(){ var scroll_start = 0; var startchange = $('#startchange'); var offset = startchange.offset(); if (startchange.length){ $(document).scroll(function() { scroll_start = $(this).scrolltop(); if(scroll_start > offset.top) { $(".navbar-default").css('background-color', '#f0f0f0'); } else { $('.navbar-default').css('background-color', 'transparent'); } }); } });

iphone - Push notifications with JavaPNS successful but nothing on mobile device -

problem: code appears executing fine, no errors, , proper log results, or appears, no push notifications end on iphone. i'm sending notifications apache tomcat running on mac: mountain lion. note: can run using same certificates, except in .pem format in php. javapns not accept .pem use .p12 files. since .pem version of certificates works in php i'm starting suspect entire problem shortcoming of javapns. background: code below executes without error , notifications.issuccessful() returning true. receiving no message on device , no error. when had utilized wrong key got appropriate errors, , when token string long had received errors. application runs no exception nothing reaching device. string keyfilepath = request.getservletcontext().getrealpath("")+system.getproperty("file.separator")+"keys"+system.getproperty("file.separator")+"key.p12"; list<pushednotification> notifications = pus...

Python: Not able to slice string -

i trying make 1 program using python user has put value equal name or word , cut first letter of word , paste @ end of word , adds 2 more alphabet equal 'py'. ex- enter value: shashank 'output getting shashankspy' value want 'hashankspy' the code made this: pyg = 'ay' original = raw_input('enter word:') if len(original) > 0 , original.isalpha(): print original word = original.lower() first = word[0] new_word = word + first + pyg new_word[1:] else: print 'empty' i not able real value. please help! there 1 simple error making , can done as: new_word = new_word[1:len(new_word)] pyg = 'ay' original = raw_input('enter word:') if len(original) > 0 , original.isalpha(): print original word = original.lower() first = word[0] new_word = word + first + pyg new_word = new_word[1:len(new_word)] else: print 'empty'

python - Django form/formset for a tabular list of forms -

Image
a picture worth thousand words. here i'm trying accomplish: this simple enough manually creating table within template so: <form> <table class="table"> <thead><tr><th>{% trans 'name' %}</th><th>{% trans 'available quantity' %}</th></tr></thead> <tbody> {% p in products %} <tr><td>{{p.name}}</td><td>{{p.available}}</td><td><input name="{{p.id}}" type="number" /></td></tr> {% endfor %} </tbody> </table> <form> however, doing way makes hassle deal submitted form data error validation. i'd prefer in django form (formset seems more suitable). i've tried this approach doesn't make want easier accomplish. here's minified version of (relevant) models: class product(models.model): name = models.charfield("name", max_length=50)...

ruby - How should I disable some of my devise flash messages in rails -

how should disable of devise flash messages in rails? have customized devise flash messages in config/locales/devise.en.yml file. don't want of them. evenafter comment or delete of find appear in ui. example en: devise: confirmations: confirmed: "your account confirmed." # send_instructions: "you receive email instructions how confirm account in few minutes." send_paranoid_instructions: "if email address exists in our database, receive email instructions how confirm account in few minutes." this added in layouts/application.html.erb <% if notice %> <p class="alert alert-notice" style="color:#c09853;"><%= notice %></p--> <% end %> <% if alert %> <p class="alert alert-error" style="color:#b94a48;"><%= alert %></p> <% end %> i have commented send_instruction. when run restart serve...

ruby on rails - Routing Error uninitialized constant ArticleController -

i new ruby on rails.i written code in app/controllers/articles_controler.rb def create @article = article.new(article_params) @article.save redirect_to @article end private def article_params params.require(:article).permit(:title, :text) end when opened rails server got error routing error uninitialized constant articlecontroller. in config/routes.rb have following code rails.application.routes.draw 'articles/new' resources :article root 'welcome#index' end controller names plural class articlescontroller < applicationcontroller #notice, articles this means, in config/routs.rb , need have route maps articles (plural). this surely means, in config/routes.rb , have resources :article . , route being mapped controller named article , don't have it, , incorrect anyway. why getting routing error uninitialized constant articlecontroller because can't find controller named article (singular) it should res...

Cannot clone with Git though all permissions have been set up -

i owner of assembla-account git repository. tried clone , have authentication errors. what did do? created folder, did git init create initial .git directory. added per-project user-name , -email via git config user.name "myproject" # set name git config user.email "myproject@mymail.com" # set email then created new ssh key via ssh-keygen -t rsa -c "myproject@mymail.com" , uploaded ssh key manager @ assembla's project page. after tried git clone git@git.assembla.com:myproject.git , still error error -- : permission denied fatal: not read remote repository. why still have authentications errors? if open .git/config , can see proper user-name , -email set in [user] section. ps.: intentionally did not change global user-name , -email, project only, since global credentials multiple other projects. if read question correctly, have server contains number of different projects, , have different ssh identity (public key) each pr...

c# - Webcam capture with directshow.net - performance -

i have performance issues capturing in directshow.net. using resolutions above 920x720 resulting in stutters on i5 dual core. logitech software record smooth on higher resolutions. i use directshow.net capturing webcam , muxing in avi muxer audio input. file writer writes capture disk. [webcam (logitech 920c)-> m-jpeg compressor] + microphone -> -> avi-muxer -> file writer webcam (logitech 920c)-> mjpegcompressor the logitech software record smooth on higher resolutions. logitech software supposedly capturing mjpeg right camera, without software compression. not stock windows m-jpeg compression being of substandard quality, problem usb 2.0 throughput: high resolution @ high rates can captured hardware compressed. you need either of 2 or both: capture compressed video, m-jpeg or h.264, not raw look @ logitech software filter graph find out topology using see also: processing / c920 logitech capture frame rate video discourse ...

git - Fatal error when pushing to GitHub -

i completley new git. working on sl6 , created file in local repository. have created remote repository on github. added new file, , committed it, following error when try push repository error: requested url returned error: 403 forbidden while accessing any great, if has been idiot proofed :) to able login using https protocol, should first set authentication credential git remote uri: git remote set-url origin https://yourusername@github.com/user/repo.git you'll asked password when trying git push. in fact, on http authentication format. set password too: https://youruser:password@github.com/user/repo.git should aware if this, github password stored in plaintext in .git directory, undesirable. so in such way won't 403 error

java - JavaFX Parameter passing -

this question has answer here: passing parameters javafx fxml 6 answers i've been endlessly struggling code, i'm trying send values of 2 strings "window" perform function on them keep getting sorts of errors. i've thoroughly read dependancy injection thread , main problem (pane) cast in 10th line. also, i've read this 1 well , answer , code plain chaotic. what trying this: i have lets main document , i'm trying send 1 of values child: my code maincontroller: @fxml void initialize() throws malformedurlexception { parametersender.setonaction(new eventhandler<actionevent>() { @override public void handle(actionevent event) { parent root; try { root = fxmlloader.load(getclass().getclassloader().getresource("filetree/childwindow.fxml...

c# - How do i parse a dictionary from a uri? -

i'm trying write webservice method pulls string/string dictionary uri. wrote signature this, hoping smart enough parse dictionary itself: ([fromuri]dictionary<string, string> parameters) the query string in uri looks this: ?keyfordictionary=valuefordictionary when moused on "parameters", showing null. next decided try , accept string, instead of dictionary, , parse out dictionary in body of method. when moused on string... showed key-value pair!! can tell me how either a) dictionary uri, or b) manipulate mysterious "key-value/string" object can pass stuff db? also, links guys have on understanding what's going on here appreciated.

comparators in java collection framework -

import java.util.*; class mycomp implements comparator<string>{ public int compare(string ,string b){ system.out.println(a+" "+b); string astr,bstr; astr=a; bstr=b; int g = bstr.compareto(astr); return g; } } public class compdemo { public static void main(string[] args) { treeset<string> ts =new treeset<string>(new mycomp()); ts.add("c"); ts.add("e"); ts.add("b"); ts.add("a"); ts.add("d"); ts.add("g"); ts.add("f"); for(string element:ts) system.out.println(element+" "); system.out.println(); } } can explain how reverse of input happening ? not able understand how 2 characters being compared. you're not comparing characters one-length string s. , custom com...

haskell - Using netwire's periodic vs. at wires -

i'm trying write framework real-time interactive graphics in haskell. i've been trying handle on things using netwire 5, don't seem have handle on how things "depend" on 1 another. for example , following code should produce val 2 seconds before switching (val + 1), , continuing on indefinitely. somewire :: num => -> wire s e m a somewire x = (-->) ((pure x) &&& (periodic 2) >>> until) (somewire (x + 1)) however, creates sort of memory leak program stalls , keeps allocating memory until on system crashes. alternatively, definition somewire :: num => -> wire s e m a somewire x = (-->) ((pure x) &&& (at 2) >>> until) (somewire (x + 1)) behaves way expect to: count val onwards having value change every 2 seconds. can please explain behavior? the key insight periodic produces event immediately . hence, when go produce value wire, have evaluate following: somewire x (-->) ((pure x...

objective c - cocoa: How do I suppress NSPopUpButton automatic selection/synchronization? NSArrayController and NSMenu do not work -

i have nspopupbutton . whenever add or remove items it, first item gets automatically selected. want inhibit this; want nspopupbutton appear nothing selected, , not select until user selects something. everything being constructed in code. (this backend; gui layout comes elsewhere.) nscombobox already. with nstableview , used nsarraycontroller , cocoa bindings, do: [ac setselectsinsertedobjects:no]; // insertions [ac setavoidsemptyselection:no]; // deletions i tried nspopupbutton , however, , did not change behavior: first item still automatically selected. i have tried accessing backing nsmenu @ on irc's suggestion , adding that; behavior did not change. i noticed there's method on nspopupbutton , synchronizetitleandselecteditem , seems said nspopupbutton itself, don't see way disable it, either in nspopupbutton or nspopupbuttoncell . going have subclass nspopupbutton make method nothing? i'm not particularly attract...

asp.net mvc - Bespoke form as widget in Orchard CMS? -

i'm new orchard , mvc, i'd create form on front-end saves input external database. if user's submitted form data valid, saved external database , confirmation view need displayed in place of form. need use ajax i'm not sure how go doing in orchard. it's important form displayed widget can place on various pages in site. ideas on how can done using ajax including model validation? i've tried creating widget content part , rendering view using driver display method. in view have form submits view model own controller, i'm not sure how send validation errors , confirmation view 1 data has been saved.

css - Align number beside glyphicon -

Image
i cannot seem number align inline glyphicon. want number 3 pushed more lines up. css body { background-image: url("bg1.png"); } .icons { margin: 0px 0px 0px 10px; } .well { min-height: 20px; padding: 20px; margin-bottom: 20px; background-color: #ecf0f1; border: 1px solid transparent; border-radius: 4px; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); } .well blockquote { border-color: #ddd; border-color: rgba(0, 0, 0, 0.15); } .well-lg { padding: 10px; border-radius: 6px; } .well-sm { padding: 9px; border-radius: 3px; } #alertbox { padding: 2px 2px 2px 2px; text-align: center; } #topicon { font-size: 50px; } #stats { font-size: 50px; display: inline-block; float: right; } html <div class="col-md-3"> <div class="well well-lg"> <div id="alertbox" class=...

jsf 2 - primefaces datatable rowEditor error -

i'm using jsf 2.2 , primefaces 4.0 mojarra 2.2.2 on tomcat server. i'm using p:datatable row editor, whenever try edit row following error when press "check" button save changes: may 17, 2014 10:17:03 pm com.sun.faces.context.partialviewcontextimpl processpartial información: java.lang.numberformatexception: null java.lang.numberformatexception: null @ java.lang.integer.parseint(integer.java:454) @ java.lang.integer.parseint(integer.java:527) @ org.primefaces.component.datatable.datatable.queueevent(datatable.java:666) @ org.primefaces.behavior.ajax.ajaxbehaviorrenderer.decode(ajaxbehaviorrenderer.java:47) @ javax.faces.component.behavior.clientbehaviorbase.decode(clientbehaviorbase.java:132) @ org.primefaces.renderkit.corerenderer.decodebehaviors(corerenderer.java:486) @ org.primefaces.component.datatable.datatablerenderer.decode(datatablerenderer.java:64) @ javax.faces.component.uicomponentbase.decode(uicomponentbase.java:831) ...

Reset Rails Database -

i in world of mess. had issues mailboxer gem , tables created in schema, commented offending attributes , reset database. nothing changed when ran db:migrate, dropped table, created anew , reran migration. schema has not updated reflect attributes had been commented out. ideas why? have error message when trying rake db:migrate aborts , says that: pg::undefinedtable: error: relation "roles" not exist : alter table "roles" drop "user_id" my schema has roles table includes following attributes: create_table "roles", force: true |t| t.string "name" t.datetime "created_at" t.datetime "updated_at" t.integer "user_id" end i have migration in file intended remove user_id: class removeuidfromrole < activerecord::migration def change remove_column :roles, :user_id, :integer end end i have no idea why aborting error telling me remove user id, when have migration that. further, why doe...

windows - mongodb : listen() attempts to access socket in a forbidden way -

i downloaded 64-bit zipped version of mongodb windows, created '/data/db' instructed. now, when run "mongod" command, getting following error & mongodb server shuts down automatically. "error : listen() failed error-10013. attempt made access socket in way forbidden access permissions. " please me clear firewall settings in windows prevent error & run mongodb. i able fix error using following command : "mongod --bind_ip="127.0.0.1". :)

awk - Extracting content of a file in bash -

i have file content like: (this nmap output) nmap scan report x.x.x.x host (0.12s latency). port state service 23/tcp open telnet | telnet-brute: | accounts | var1:var2 | statistics | performed 5 guesses in 3 seconds, average tps: 1 | |_ error: many retries, aborted ... nmap scan report y.y.y.y host (0.17s latency). port state service 23/tcp open telnet | telnet-brute: | accounts | var3:var4 | statistics |_ performed 2 guesses in 13 seconds, average tps: 0 nmap scan report z.z.z.z host (0.19s latency). port state service 23/tcp open telnet | telnet-brute: | accounts | no valid accounts found i want extract pattern: x.x.x.x var1:var2 y.y.y.y var3:var4 what tried is: #!/bin/bash nmapresult=$1 rm oooo while read line if [[ "$line" == *nmap* ]]; out=$(grep "nmap" -a6) if [[ "$out" == *valid* ]]; continue else grep "nmap" -a6 >> ...

css - Inner Border With Different Values Each -

Image
how can made inner border different values each? example: top: 20px right: 80px bottom: 40px left: 10px example want made... thank you. :) to make inner border, use 2 box-shadows on element, separated comma, , use negative values on second set. this: box-shadow: inset 10px 20px 0px #000, inset -80px -40px 0px #000; here jsfiddle demo: http://jsfiddle.net/dr_lucas/23egu/326/ this cross-browser compatible css: -webkit-box-shadow:inset 10px 20px 0px #000, inset -80px -40px 0px #000; -moz-box-shadow:inset 10px 20px 0px #000, inset -80px -40px 0px #000; box-shadow:inset 10px 20px 0px #000, inset -80px -40px 0px #000; note if need compatible old ie versions don't support box-shadow, can use css3pie: http://css3pie.com/ hope helps.

Understanding android UDP server app code -

i'm novice both android , java. i'm trying develop simple udp server first android app (the second 1 if consider hello world!). i've collected code web , result: package com.example.androidsocketserver; import java.net.datagrampacket; import java.net.datagramsocket; import android.app.activity; import android.widget.textview; public class mainactivity extends activity { public void updatetextview(string tothis) { textview textview = (textview) findviewbyid(android.r.id.text2); textview.settext(tothis); } private mydatagramreceiver mydatagramreceiver = null; protected void onresume() { mydatagramreceiver = new mydatagramreceiver(); mydatagramreceiver.start(); } protected void onpause() { mydatagramreceiver.kill(); } private class mydatagramreceiver extends thread { private boolean bkeeprunning = true; public void run() { string message; byte[] lmessage = new byte[200]; datagrampacket packet = new data...

scala - Why does IntelliJ override each method by default when programatically implementing method stubs? -

just curious if knows reason. i'm new scala figure it's obvious seasoned scalaroo, , oughtn't bug jetbrains it. you can switch behaviour off. uncheck "add override modifier" field @ bottom of "select members implement" dialog. intellij idea remember setting.

hadoop - Appending a sequence file in HDFS -

i have live streaming tweets need store in hdfs . can access live tweets , able extract information tweets . requirement such need append tweets single sequence file in hdfs . have thought resolve issue 2 ways . either can make single tweet store small file in hdfs , periodically can bundle them single sequence file .the second approach thought of @ run time read sequence file , append new contents sequence file . please let me know approach should go . kindly suggest me if there better solution handling these type of use cases . i recommend using flume. can see how tweets streamed hdfs in example: https://github.com/cloudera/cdh-twitter-example

python - Django URL Routing misbehaving, routing to an unanticipated path -

i made changes model.py, foreignkey adjustments. (i realized placed them on wrong class). deleted database , created new scratch since far in. when felt corrected in db run, , ran runserver again, keyerror error, path shouldn't directed to. when type in url 127.0.0.1:8000/add_tech/, or add_exp/ loads right form, when submit, shows function received term tech or exp through regex in urls.py, disappointingly stack trace output shows differently. the views.py doesn't seem routing correctly. there steps should follow step through , debug this? urls.py has following from django.conf.urls import patterns, include, url resume.views import add_entry, remove_entry urlpatterns = patterns('', url(r'^add_(\w+)/$',add_entry), url(r'^remove_(\w+)/$',remove_entry), ) it's being routed views.py in resume/: (as seen) def add_entry(request, option): print "print option in url is:"+option #<----- see console out below. options={ ...