Posts

Showing posts from February, 2014

c++ - Copy QTableWidget cell content to clipboard -

i built context menu opens right-click on cell in qtablewidget . me create command copy contents of cell clipboard? examples have found on web bad. thanks in advance you can in slot connected menu action in following way: qclipboard *clipboard = qapplication::clipboard(); clipboard->settext(tableitem->text());

hash - Compare two complex hashes in ruby -

i'm trying compare 2 hashes recursively in ruby, there caveats. can't compare strings because 1 hash uses nil , 1 uses 0 etc here function: def compare_yaml(yaml1,yaml2) f = ["f", "false", false] t = ["t", "true", true] nil_equivalents = [0, "", [], {}, nil, " "] return true if yaml1 == yaml2 if (f.include?(yaml1) , f.include?(yaml2)) or (t.include?(yaml1) , t.include?(yaml2)) return true end if (nil_equivalents.include?(yaml1) && nil_equivalents.include?(yaml2)) # puts "we found nil" return true end if (yaml1.class == yaml2.class) if yaml1.class.to_s == "hash" puts "gotta hash" + yaml1.to_s # = yaml1.inspect # b = yaml2.inspect yaml1.keys.map{|k| (yaml2.keys.include? k)? compare_yaml(yaml1[k], yaml2[k]) : false}.reduce{|n,m| n&&m} end i

xpath - XSLT 2.0, Checking for the existence of specific node at specific position -

i have xml several <mt> elements ones below <gsp> <res> <r> <mt n="authors" v="mckee, d.w.; general electric co., schenectady, ny (usa). corporate research , development dept"/> <mt n="english-title" v="advanced gas-cooled nuclear reactor materials evaluation , development program: corrosion behavior of experimental alloys in controlled-purity helium @ temperatures in 750 1050&lt;sup&gt;0&lt;/sup&gt;c range"/> <mt n="title" v="ni-20cr + al, ti, si, nb and/or y"/> </r> </res> </gsp> i want check if there element @n='title' after @n='english-title' . don't want use <mt> element @n='title' , if appears anywhere else. how can achieved? this xpath expression: //mt[@n='title'][preceding-sibling::mt[1][@n='english-title']] will select nodes. selects among all mt elements have n at

android - Interface NullPointerException - Sending Listener w/ Data to MainActivity on Button Click within Fragment -

been working on sending string data mainactivity on button click within fragment. doesn't seem difficult procedure, i'm getting tied somewhere , receiving nullpointerexception . i'm assuming has way i'm using interface. new android, suggestions , comments appreciated. thanks! interface code: public interface btninterface { public void btnclicked(string x, string y, string z, string w); } main activity snippet: public class mainactivity extends activity implements btninterface{ fragment_x frag; fragmenttransaction ft; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); frag = new fragment_x(); frag.setinterface(this); ft = getfragmentmanager().begintransaction(); ft.add(r.id._frag_container, frag); ft.commit(); } @override public void btnclicked(string x, string y,string z, stri

objective c - Logic Test vs Application Test - Conflicting Results -

i have 2 test targets in project, logic test ( modellogictests ) , application test ( myapptests ). have 1 class use in both test models built json objects. the test case follows: // modellogictests.m @interface mymodellogictests : xctestcase @property nsmanagedobjectcontext *context; @property nsmanagedobjectmodel *model; @property nspersistentstorecoordinator *store; @property nsbundle *bundle; @end @implementation mymodellogictests - (void)setup { [super setup]; nsbundle *bundle = [nsbundle bundleforclass:[self class]]; nsarray *bundles = @[ bundle ]; self.bundle = bundle; self.model = [nsmanagedobjectmodel mergedmodelfrombundles:bundles]; xctassertnotnil( self.model, @"managed object model \'nil.\'" ); self.store = [[nspersistentstorecoordinator alloc] initwithmanagedobjectmodel:self.model]; xctasserttrue( self.store, @"persistent store coordinator did not initialize properly." ); nserror *storeerror = 0

Google Drive SDK iOS - Upload LARGE video ALAssetRepresentation using NSData (not NSFileHandle)? -

the example ... https://code.google.com/p/google-api-objectivec-client/wiki/introduction#uploading_files ... uses nsfilehandle ... nsfilehandle *filehandle = [nsfilehandle filehandleforreadingatpath:path]; if (filehandle) { nsstring *mimetype = @"image/jpeg"; gtluploadparameters *uploadparameters = [gtluploadparameters uploadparameterswithfilehandle:filehandle mimetype:mimetype]; ... means need (re)persist alassetrepresentation disk able nsfilehandle, instead of using alassetrepresentation getbytes:, , using nsdata ... gtluploadparameters *uploadparameters = [gtluploadparameters uploadparameterswithdata:uploaddata mimetype:fileobj.mimetype]; ... there way stream alassetrepresentation nsdata gtlservicedrive query? trying alassetrepresentation getbytes: large video memory causes crash. also, re(

html - Oddly placed CSS -

i want news content centered (including image , text), instead, it's oddly placed right this: http://prntscr.com/3o7tjc i tried ways fix , can't find it... um... here html part: <div id="maincontentcontainer"> <div id="maincontent"> <div class="posttitle"> test </div> <div class="posterinfo"> <img width="40%" class="profilepic" src="/site/uploads/avatars/f3780c97491dd9f62f0dd7b1b8bb090a0b9e87d0.png"> <p>posted by: <a class="postedby" href="#">test</a></p> </div> <div class="postcontent"> <div class="postimagecontainer" align="center"> <img class="postimage" src="../uploads/img/test"> </div> <div class="po

javascript - Expand and collapse a DIV -

Image
this question has answer here: jquery - collapsing / expanding divs? 3 answers i trying make content div expand , collapse according contents. before expand should - after expand should - i not sure how use jquery this. tried toggle class couldn't work. this code far - http://jsbin.com/bicenomi/1/edit hope me. thank you. you may put content in div. , make display: none @ beginning, , once user clicks on view details toggle display display:block. and if user clicks on collapse, make div display:none again. <html> <head> <script type="text/javascript"> function hideinfo() { var chck = document.getelementbyid('viewcollapse'); alert(chck.innerhtml); if (chck.innerhtml == "collapse") { document.getelementbyid('moreinfo')

c# - Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index Emgu CV -

void framegrabber(object sender, eventargs e) { namepersons.clear(); namepersons.add(""); //get current frame form capture device currentframe = grabber.queryframe().resize(320, 240, emgu.cv.cvenum.inter.cv_inter_cubic); //convert grayscale gray = currentframe.convert<gray, byte>(); //face detector mcvavgcomp[][] facesdetected = gray.detecthaarcascade( face, 1.4, 4, emgu.cv.cvenum.haar_detection_type.do_canny_pruning, new size(20, 20)); //action each element detected foreach (mcvavgcomp f in facesdetected[0]) { t = t + 1; result = currentframe.copy(f.rect).convert<gray, byte>().resize(100, 100, emgu.cv.cvenum.inter.cv_inter_cubic); //draw face detected in 0th (gray) channel blue color currentframe.draw(f.re

jquery - Coinbase custom button in Chrome Extension -

i'm trying add custom coinbase payment button in google chrome extension. i've gotten work in jsfiddle: http://jsfiddle.net/hqhlv/ $(document).ready(function () { code = "65a580d7449cc35869c9bd0d49cf77bd"; function get_button_html(code) { var button_html = "<div class='coinbase-button' data-code='65a580d7449cc35869c9bd0d49cf77bd' data-button-style='none'></div>"; return button_html; } function loadbutton(code) { $('body').after("<a href='' class='my-custom-link'>show me modal!</a>", get_button_html(code)); }; loadbutton(code); $.getscript("https://coinbase.com/assets/button.js"); $('.my-custom-link').click(function () { console.log('coinbase_show_modal'); $(document).trigger('coinbase_show_modal', '65a580d7449cc35869c9bd0d49cf77bd'); return false; }); $(document).on('coinbase_payment_complete&#

android - Facebook deep link do not opens Google Play when APP not installed -

i developing android application facebook login , sharing, , deep linking. when user have app installed, goes well: facebook login/logout share link share dialog (feed dialog when fb app not installed) launch app applinkdata when clicking news feed shared app however when app not installed, news feed open shared link browser. want news feed shared app can send people app's google play page. can give me hints? in advance!! here want have done application: i created new app in facebook developer page. enabled single sign on & deep linking in setting page http://i.stack.imgur.com/km9tn.png i added custom url scheme in androidmanifest.xml i've read linking app news feed section facebook below: https://developers.facebook.com/docs/android/share#applinks saying when person clicks on story generating app, facebook check app installed? , mobile only? . how can set mobile only android application? i appreciate if kindly giv

javascript - Uncaught TypeError: Cannot read property 'ui' of undefined -

there weird problem server. have web application (vtiger crm) locally , works fine, loads neccessary data should (in email manager module). exact same copy hosted on server, , gives following: uncaught typeerror: cannot read property 'ui' of undefined mailmanager._mainui_callback (anonymous function) n o.firewith w d sometimes gives: uncaught typeerror: cannot read property 'ui' of undefined has ever happened anyone? there different in server php.ini file causes this? your appreciated, thanks! edit: give more descriptive example copy , paste actual code responsible since same code works locally, pretty sure server issue. , that's point of question. however, function accepts response parameter , sends argument via mailmanager._mainui_callback function: function(response){ mailmanager._mainui_callback(response); progressindicatorelement.progressindicator({

javascript - Leap Motion: Volume Control jPlayer (need to create smooth incremental values?) -

i building leap motion controlled music player , have come roadblock. the volume, want work on 'circle' gestures clockwise being volume , anticlockwise being volume down, cannot work out how 'right' values set volume to. i using jplayer audio player, volume set so: $("#jquery_jplayer_1").jplayer("volume", volumevalue); volumevalue needing between 0 , 1 i have working if rotate clockwise sets volume 0.75 , if rotate left 0.25, cant work out how increase volume incrementally rotation. to number of rotations, function can used circlecount = gesture.progress.tofixed(2); below code... (obviously realise doesn't atm) if (gesture.type == 'circle') { gesture.pointable = frame.pointable(gesture.pointableids[i]); if(gesture.state == 'start') { clockwise = true; } else if (gesture.state == 'update') { direction = gesture.pointable.direction; if(direction)

html - Why is my horizontal menu not floating to the right? -

Image
would know why horizontal menu floating right despite ? can view live here . <header> <nav> <ul> <li><a href="#">home</a></li> <li><a href="#">work</a> <ul> <li><a href="#">résumé</a></li> <li><a href="#">portfolio</a></li> </ul> </li> <li><a href="#">play</a> <ul> <li><a href="#">experiments</a></li> <li><a href="#">utilities</a></li> </ul> </li> <li><a href="#">contact</a></li> </ul> </nav> <div id="news_box" style="max-width: 400px; float: right; text-align: left;"></div> </header> css: body {

ruby on rails - Checking JSON response from browser -

i want render response in json , then, check json document generated rails browser. can't because templatenotfound exception raised. it's weird me because, it's seen, json sample text , shouldn't need template. def who_bought @product = product.find(params[:id]) @lastest_order = @product.orders.order(:updated).last if stale?(@lastest_order) respond_to |format| format.atom format.xml { render :xml => @product.to_xml(:include => :orders)} format.json { render json: @product } end end end anyone knows missing? to json response, request type must json. append .json url. e.g. localhost:3000/posts.json return json data.

osx - How to display animated GIF in Objective C on top of the layered View? -

i trying draw animated gif on screen in mac osx app . used code insert gif: can see gif 1 picture doesn't animates static picture :( should add make animated ? #import <cocoa/cocoa.h> #import <quartz/quartz.h>//for drawing circle #import "sharedprefferences.h" @interface genericfansubview : nsview { nscolor * _backgroundcolor; nsimageview* imageview; } - (void)setbackgroundcolor :(nscolor*)color; - (void)insertgif1; - (void)insertgif2; - (void)insertgif3; @end #import "genericfansubview.h" #define pi 3.14285714285714 @implementation genericfansubview - (id)initwithframe:(nsrect)frame { self = [super initwithframe:frame]; if (self) { // initialization code here. imageview = [[nsimageview alloc]initwithframe:cgrectmake(0, 0,self.frame.size.width,self.frame.size.height)]; [imageview setanimates: yes]; } return self; } - (void)drawrect:(nsrect)dirtyrect { [super drawrect:dirtyrect]; //

xaml - App Bar becomes hidden when navigating away from a page, with its background the phone's theme (and not what is defined in app) -

Image
when i'm navigating between pages on wp8 app, noticed part of transition animation (using telerik's i.e. "rootframe = new telerik.windows.controls.radphoneapplicationframe();"), app bar on page navigated becomes hidden first. it's sudden , short amount of time, still noticeable. here app bar of page: and here app bar of same page when hit i.e. navigating away it. app bar showing previously, there's white background showing instead. of course, said, split moment, because before know it, you're taken last page. it's still noticeable. the white background appears of phone's theme (its theme light), though i've reset rootframe's background black in app.xaml.cs, , reset brushes use dark theme's (advice windows phone 8 how on 1 theme if phone's theme changed ): public app() { // code here rootframe.background = new solidcolorbrush(colors.black); darktheme(); } public void darktheme() { ((solidcolorbrush

php - How I can delete image from DB in Yii? -

how can delete image view <?php if(!empty($model->image_name) > 0) { ?> <div class="row"> <?php echo chtml::image(img::getpostthumb($model->image_name, 700, 1000));?> <b><?php echo chtml::link('delete', array('mobilelandingpost/deleteimage','imagename'=>$model->image_name,'id'=>$model->id),array('confirm' => 'سنقوم بحذف الصور موافق ؟'));?></b> </div> <?php } ?> and controller public function actiondeleteimage($imagename,$id){ $model= mobilelandingpost::model()->find(array( 'condition'=>'image_name=:image_name ', 'params'=>array(':temp_posts_id'=>$imagename)) ); if(!$model) { t

node.js - Installing a PhoneGap plugin: BarcodeScanner -

i want install barcodescanner plugin in phonegap project. i've read readme within repository , says must installed plugman so: install plugin ---------------- $ plugman install --platform <platform> --project <directory> --plugin <plugin> [--variable name=value] parameters: - platform <platform>: 1 of android, ios, blackberry10, wp7 or wp8 - project <directory>: path reference cordova-generated project of platform specify - plugin <plugin>: 1 of path reference local copy of plugin, or remote https: or git: url pointing cordova plugin (optionally append #branch:subdir) or plugin id http://plugins.cordova.io - variable name=value: plugins require install-time variables defined. these things api keys/tokens or other app-specific variables. when run following command within project directory: cordova plugin add com.phonegap.plugins.barcodescanner i following error response: fetching plugin "com.phonegap.plugins.barcodes

Button to share website link on facebook Timeline -

how can have button on webpage shares link user viewing automatically or facebook timeline? eg if or in mypage.com/aboutme link shared on or facebook timeline when clicked... that not possible without user prior facebook authentication. if theat beforehands, then <div id="fb-root"></div> <script type="text/javascript">(function(d, s, id) { var js, fjs = d.getelementsbytagname(s)[0]; if (d.getelementbyid(id)) return; js = d.createelement(s); js.id = id; js.src = "//connect.facebook.net/en_us/all.js#xfbml=1"; fjs.parentnode.insertbefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> <div> also, make sure control og:meta properties in html head <meta property="og:image" content="http://www.mysite.me/my.png" /> <meta property="og:description" content="mycontent..." /> <meta property="og:title" content="blueflower

Jquery - adding image to multiple spans inside a table, dynamically created using Java -

i'm creating table in java class (in controltableinitial() method): res.add("<tr>"+"<td>"+result.getstring("product_barcode")+"</td>" +"<td>"+showed+"</td>" +"<td>"+result.getstring("product_price")+"</td>" +"<td>"+result.getstring("submit_user_email")+"</td>" +"<td>"+result.getstring("sales_date")+"</td>" +"<td id='setsale'><span id='img'></span></td>" +"</tr>"+"<br/>"); than, build table in .jsp file: <% arraylist<string> res = new arraylist<string>(); controlpanel tbl = new controlpanel(); res = tbl.controltableinitial(); %> <table id="table"> <% for(int i=0;i<res.size();i++) {out.println(res.get(

c# - Is there something funny with async OnNavigatedTo? -

i have 2 pages; mainpage , settingspage . in mainpage, in onnavigatedto method check isolated storage , if not match want app navigated settingspage . onnavigatedto marked async since i'm using awaited methods check on variable. works reads variable , reports needs navigate, call this.frame.navigate(typeof(settingspage)); no errors being thrown. 70%++ of time call navigate method nothing! way of navigating between pages different windows phone? i'm doing exact same thing there, using urls instead of typeof(xxxpage) what gives? seems not follow async flag, since times manages navigate settingspage... 70%+ of times seems application ignores async onnavigatedto , runs application synchronously. i've placed debug.writeline on navigation event, , calls navigate(typeof(settingspage)) each time... seems fail somewhere? i've encountered same behavior. queue new navigation @ low priority give first page load , app initialization chance complete.

c# - What is the difference between a UIElement and a Windows Form Control? -

if wanted create form drawing area in traditional windows form, extend panel class , override onpaint method custom drawing, so: public class specialpanel : system.windows.forms.panel { protected override void onpaint(painteventargs e) { graphics g = e.graphics; g.drawellipse(new pen(color.red), 50, 80, 50, 10); } } but in wpf if attempt extend canvas class there no onpaint method override public class specialcanvas : canvas //error no onpaint method { public override onpaint(painteventargs e) { } } if wanted draw canvas in way similar this: canvas.setleft(shape.shape, r.next(1, 1150)); canvas.settop(shape.shape, r.next(1, 500)); solidcolorbrush b = new solidcolorbrush(windows.ui.color.fromargb(255, (byte)r.next(1, 255), (byte)r.next(1, 255), (byte)r.next(1, 255))); shape.shape.fill = b; shape.shape.stroke = b; cann.children.add(shape.shape); where cann canvas object , shape.shape

java - ClassNotFoundException while running jar -

i getting classnotfoundexception when try run jar whith below command: java -jar myjar.jar i created jar eclipe. myjar depends of couple of other jars. saw in ecplise these other jars there in classpath . i added these jars classpath in unix using export classpath. still classnotfoundexception. exception stack trace: exception in thread "main" java.lang.noclassdeffounderror: org.apache.hadoop.conf.configuration @ com.a.hdfscopy.readuri(hdfscopy.java:16) @ com.a.copymain.main(copymain.java:9) caused by: java.lang.classnotfoundexception: org.apache.hadoop.conf.configuration @ java.net.urlclassloader.findclass(urlclassloader.java:434) @ java.lang.classloader.loadclass(classloader.java:660) @ sun.misc.launcher$appclassloader.loadclass(launcher.java:358) @ java.lang.classloader.loadclass(classloader.java:626) ... 2 more class path before: /opt/ibm/biginsights/ihc/lib/biginsights-gpfs-1.1.1.jar:/opt/ibm/biginsight

mysql - WEEKOFYEAR 3 weeks ago -

i looking able run simple query show week of year 3 weeks ago. have tried following without luck. select weekofyear(curdate()) - interval 3 week use mysql native function computing date differences: select weekofyear(date_sub(curdate(), interval 3 week))

testing - How to test model defaults in Rails with Rspec -

i want test new user when signed up, not admin (as set default: false in migration). here's user_spec.rb far: require 'spec_helper' describe user before { @user = factorygirl.build(:user) } subject { @user } { should respond_to(:username) } { should respond_to(:email) } { should respond_to(:admin) } describe "when username short" before { @user.username = 'ab' } { should_not be_valid } end describe "when username long" before { @user.username = 'a' * 26 } { should_not be_valid } end describe "username present" before { @user.username = " " } { should_not be_valid } end end i've tried it "should not admin" expect { @user.admin }.to be_false end but returns: expected: false value got: #<proc:0x007ffc4b544a58@" i suspect because i'm running tests based off factory defeat purpose of testing default value if expli

Multiple Object Properties JavaScript -

got code snippet in javascript defines multiple properties object. var book = {}; object.defineproperties(book , { _year: { value: 2004 }, edition: { value: 1 }, year: { get: function() { return this._year; }, set: function(newvalue) { if (newvalue > 2004) { this._year = newvalue; this.edition += newvalue - 2004; } } } }); book.year = 2005; alert(book.edition); so book has code claims alert(book.edition); would display 2 .instead , displays 1 . seems never executes part of accessors property code (year: get: set:) . knows why happening? edition has been defined non-writable property -- writable descriptor property hasn't been specified , false default. hence this.edition += ... fails silently. same applies _year property well. _year: { writable: true, value: 2004 }, edition: { writable: true, valu

ios - Include email verification within signUpInBackgroundWithBlock function -

Image
i have implemented following function (attached "register button") within registration view controller seen below. function relies upon parse , seamless in general. however encountering following issues @ present: if user inserts invalid email address mistake; error string listed under "else" activated (which good) username , password entered above registered regardless. users able leave password field blank. any whatsoever, pertaining issue 1, immensely appreciated. // register user. - (ibaction)registeruser:(id)sender { pfuser *user = [pfuser user]; user.username = self.mobiletextfield.text; user.password = self.passwordtextfield.text; user.email = self.emailtextfield.text; // show loading hud. [mbprogresshud showhudaddedto:self.view animated:yes]; dispatch_async(dispatch_get_global_queue( dispatch_queue_priority_low, 0), ^{ [user signupinbackgroundwithblock:^(bool succeeded, nserror *error) { if (!error) { [self performsegue

java - Background color does not change in bluej -

i have written code has label , button in frame. have changed background never changes. import javax.swing.*; import java.awt.*; import javax.swing.border.*; public class frames { jframe main_menu=new jframe("main menu");jframe circumference=new jframe("circumference"); jframe area=new jframe("area");jframe perimeter=new jframe("perimeter");jframe sets=new jframe("sets"); jframe fundamental_oprations=new jframe("fundamental oprations");jframe power_and_roots=new jframe("power_and_roots"); void main_menu() { jpanel contentpane = (jpanel) main_menu.getcontentpane(); contentpane.setlayout(new borderlayout(10,10)); contentpane.setborder(new emptyborder(300, 150, 300, 150)); contentpane.setlayout(new gridlayout(4, 4)); jpanel buttonpanel = new jpanel(new gridlayout(8,8)); contentpane.add(labels.main_menu,borderlayout.nor

Cant launch Android play store Leaderboard from Grid view -

i have more 1 leaderboard on clicking grid item want launch different leader board each level. but when trying launch leaderboard onitemclick leaderboard not getting launched my code goes below @override public void onitemclick(adapterview<?> parent, view v, int position, long id) { if (mactivitytype == activity_leaderboard_select) { if (issignedin()) { intent intent = getgamesclient().getleaderboardintent(util.getleaderboardid(levelselectactivity.this, position)); startactivityforresult(intent, 143); googleanalyics.addview(levelselectactivity.this.getapplicationcontext(), "leaderboardactivity:" + (position + 1)); finish(); } else { if (util.iswificonnected(levelselectactivity.this)) { beginuserinitiatedsignin(); } else { new customtoastsystem(levelselectactivity.this).toast(r.string.nointernet, toast.length_long); }

mysql - include and header function not working together in single php file -

i trying include config.php file database after completing task , redirect other page shows error message. "warning: cannot modify header information - headers sent (output started @ /home/prasan/public_html/theyplay.in/texttospeech/config.php:16) in /home/prasan/public_html/theyplay.in/texttospeech/input.php on line 14" <?php include("config.php"); try { $mi = $_post['main']; $i = $_post['item']; $dbo->query("insert ld (mainitem, subitem, item,fav)values ('$mi','$i',0)") ; } catch (exception $e) { echo 'caught exception: ', $e->getmessage(), "\n"; } header("location: index.php"); ?> edit: config.php <?php $dbhost_name = "localhost"; $database = "rrr"; $username = "rrr"; $password = "rrr"; try { $dbo = new pdo('mysql:host=' . $dbhost_name . ';dbname=' . $database, $username, $pass

php - Which one is the best way to get the URL in CodeIginter using base_url() URL helper? -

as per user guide, can url in codeigniter in following way using url helper : echo base_url('admin/profile'); but saw 1 developer using code this: echo base_url() . 'admin/profile'; which 1 think faster? i think both not make difference, under hood, must concatenating string passed in parameter. follow coding standard, former method better. right or wrong? code igniter base_url() call too function base_url($uri = '') { return $this->slash_item('base_url').ltrim($this->_uri_string($uri), '/'); } so base_url().$string not same base_url($string). also may interested in override base_url method in future , have other specifics process on uri. so standard approach is: echo base_url('admin/profile');

git - Move files & folders in github -

i need set github school project im getting lost in complicated workings of it. i managed push contents of folder repository since need add other files , want keep structure want take current files & folder have , move them new directory. for example, want change following: master folder x folder y file z to master project 1 folder x folder y file z how do exactly? i've found similar posts similar explanations never understood of them.. please explain in easy fashion? because i've been trying without success 2 hours now. move files want in local folder and after commit changes in git bash: git add "project 1" git commit -am "change folders layout" and push changes: git push

javascript - Handle event onfocus with function .on() from JQuery -

i have written script validate input in fields forms, , want script start action when field focus. right now, nothing happening. jsfiddle example: http://jsfiddle.net/klebermo/f8u4c/1/ code: $(document).on('.valida', 'focus', function(){ $("#result").append("<p>starting validation</p>"); var regex = $(this).attr('pattern'); var counter = 0; var tam = size_of(regex); var str = generate_string(regex, tam); $(this).val(str); $("#result").append("<p>counter = "+counter+"</p>"); $("#result").append("<p>str = "+str+"</p>"); $(this).keypress(function(event){ var tecla = e.which; if(typeof tecla == type_of(regex, counter)){ str[counter] = tecla; if(typeof tecla == 'number' || typeof tecla == 'string') counter++; else

Drupal 7 Menu Parent module alternative -

i using node collection module handle parent child relationships on site. module creates menu in form [parent , child-1, child-2 ... child-n] there way me attach menu item in main menu in drupal 7? , if work menu firstchild modules? the menu system in drupal 7 isn't good. instead of forcing node collection on main menu suggest don't use main menu block. use node collection block, if exist, or create own custom block using hook_block_info & hook_block_view.

osx - psql -h localhost won't connect on Mac OS X -

per postgresapp.com psql postgresql command-line interface database. mac os 10.7 ships older version of postgresql, can started following command: $ psql -h localhost so run psql -h localhost , get dans-macbook-pro:~ djechlin$ psql -h localhost psql: not connect server: connection refused server running on host "localhost" (127.0.0.1) , accepting tcp/ip connections on port 5432? as far can tell psql client side, , postgresapp.com's documentation talking smack. still have no idea how start postgres server locally , haven't been able find documentation on that. version: dans-macbook-pro:~ djechlin$ psql --version psql (postgresql) 9.1.5 contains support command-line editing i'm on mac 10.8.4. this admittedly more confusing should have been, but... pg_ctl command responsible starting postgres server. os x not come bundled it . how run explained in pre-postgres.app answer . when install postgres.app , run it, starts

javascript - Filter IndexedDB records with multiple values -

this question has answer here: searching compound indexes in indexeddb 2 answers i need able filter data indexeddb in 3 different ways. for example, if data stored following object: var cars = [ {type: 'econmoy',colour: 'red',agerange:'1 - 10'}, {type: 'econmoy',colour: 'blue',agerange:'11 - 20'}, {type: 'luxury',colour: 'yellow',agerange:'1 - 10'} ] i wanted allow users filter results type, colour , agerange separately and/or jointly. hoping idbkeyrange.bound method answer doesn't work: var lowerarray = ['econmoy','blue','1 - 10']; var upperarray = ['luxury','yellow','11 - 20']; var rangetest = idbkeyrange.bound(lowerarray,upperarray); index.opencursor(rangetest).onsuccess = ... can suggest way of going it? here rough f

Two headers for different url's in the same page (PHP) -

i want to, once user has arrived page, first, download item using script , then, redirect him or index. so have following code: $filename = $_get["file"]; $down = 'components/com_djclassifieds/views/item/tmpl/download.php?file='.$filename; header( "refresh:2;url=$down" ); header( "refresh:5;url=index.php" ); and, example, following url: http://my.web.com/index.php?option=com_k2&view=item&layout=item&id=39&file=test.pdf but not working. tried use 'location' in code: $filename = $_get["file"]; header('location: http://'.$_server['http_host'].str_replace(basename($_server['php_self']), '', $_server['php_self']).'/components/com_djclassifieds/views/item/tmpl/download.php?file='.$filename); exit; header( "refresh:5;url=index.php" ); and downloads file after not redirect me index. what doing wrong? don't bother php. can j