Posts

Showing posts from July, 2014

javascript - Customize Button mute of video -

i have code. works perfect. <button id="mutebtn2">mute</button></li> <script> mutebtn2 = document.getelementbyid("mutebtn2"); mutebtn2.addeventlistener("click",vidmute2,false); function vidmute2(){ if(idle_video.muted){ idle_video.muted = false; mutebtn2.innerhtml = "mute"; } else { idle_video.muted = true; mutebtn2.innerhtml = "unmute"; } } </script> this code mute video, works fine. the question is, want replace button image on/off. tried code seems me error. i'm appreciate you can replace text inside <button id="mutebtn2">mute</button> img <button id="mutebtn2"><img src="link-to-image" /></button> and within vidmute2() function, instead of replacing innerhtml text replace img html function vidmute2(){ if(idle_video.muted){ idle_video.muted = false; mutebtn2.innerhtml = "...

javascript - Using ng-model with select to show data attribute instead of value? -

i have simple select list contains both data attributes , value: <select ng-model="mylist"> <option value="1" data-name="test name 1">option 1</option> <option value="2" data-name="test name 2">option 2</option> <option value="3" data-name="test name 3">option 3</option> </select> <div id="displayselected"> {{mylist}} </div> inside div (with id of displayselected ), displaying value of selected option. how can change display data-name attribute instead? i not sure of complete data structure , other possibilities not mentioned in question. here simple solution static list. app.directive('dataselector', function(){ return{ restrict:'a', require:['ngmodel','select'], //require ng-model , select in order restrict used else link:function(scope, elm, attrs, ctrl){ ...

string - Puppet conditional assignment and += operator -

in puppet, want write file string based on configuration in nodes.pp . nodes.pp defines $sslclientcertconfig variable, has loadbalancerip property. i want create configuration string, we'll call $config , without repeating string code. configuration string should either a: if loadbalancerip valid string, combination of strings 1 , 2 b: if loadbalancerip empty string, string 2 then, using configuration string, want set variable. i know puppet allows single declaration of variable name per scope, not know if supports += operator, or if variable declarations below work if/else clause later. here's want try: if $sslclientcertconfig { $loadbalancerip = $sslclientcertconfig[loadbalancerip] $config if $loadbalancerip { $config += "string1" } $config += "string2" } if $config { $custom = "true" } else { $custom = "false" } is pattern supported puppet? there way can improve this? ...

php - Dealing with concurrent requests in CodeIgniter -

say have created online banking system using codeigniter/php , mysql, , have following withdraw money bank account: function withdraw($user_id, $amount) { $amount = (int)$amount; // make sure have enough in bank account $balance = $this->db->where('user_id', $user_id) ->get('bank_account')->balance; if ($balance < $amount) { return false; } // take money out of bank $this->db->where('user_id', $user_id) ->set('balance', 'balance-'.$amount, false) ->update('bank_account'); // put money in wallet $this->db->where('user_id', $user_id) ->set('balance', 'balance+'.$amount, false) ->update('wallet'); return true; } first, check see if user can perform withdrawl, subtract account, , add wallet. the problem can send out multiple requests @ ...

c# - How to capture RightMouse Click in empty area of tab control? -

i have normal c# tab control. want execute function when user right-clicks in empty area right of right-most tab header (anywhere in tab header area that's not tab ok too). i looked @ positioning hidden button in empty area, doesn't fill space , hard-coded approach. i looked @ creating hidden tab in empty area, won't fill empty space , required header width dependent on how many other tabs showing; in addition, users might accidentally click on , navigate away current tab, not because things happen automatically on tab changes. is there elegant way capture right-click in empty area? i ended doing setting style event handler so: <style x:key="{dxt:dxtabcontrolinternalthemekey resourcekey=panelcontainertoplayoutstyle, isthemeindependent=true}" targettype="{x:type dx:tabpanelcontainer}" basedon="{staticresource {dxt:dxtabcontrolinternalthemekey resourcekey=panelcontainertoplayoutstyle}}"> <eventsetter event=...

vb.net - Trying to make command like "Shell" with commands with RichTextBox -

trying make command shell commands richtextbox. can make simple way make it? im searching on entire webs can't find way make it. should terminal / shell / console app can add custom commands whatismyip shows me ip address etc. should this . private sub button1_click(sender object, e eventargs) handles button1.click integer = 0 richtextbox1.lines.count - 1 dim parts() string = richtextbox1.lines(i).split select case parts(0).toupper case "getip" richtextbox1.appendtext("sys $~ 127.0.0.1") case else richtextbox1.appendtext("sys $~ invalid command.") end select next end sub try this: private sub form1_load(sender object, e eventargs) handles mybase.load commands = new dictionary(of string, func(of string, ienumerable(of string), string))() _ { _ {"getip", function(c, ps) me.getip().tostring()}, _ {"nop", function(c, ps) "no command...

Python parsing data from a website using regular expression -

i'm trying parse data website: http://www.csfbl.com/freeagents.asp?leagueid=2237 i've written code: import urllib import re name = re.compile('<td><a href="[^"]+" onclick="[^"]+">(.+?)</a>') player_id = re.compile('<td><a href="(.+?)" onclick=') #player_id_num = re.compile('<td><a href=player.asp?playerid="(.+?)" onclick=') stat_c = re.compile('<td class="[^"]+" align="[^"]+"><span class="[^"]?">(.+?)</span><br><span class="[^"]?">') stat_p = re.compile('<td class="[^"]+" align="[^"]+"><span class="[^"]?">"[^"]+"</span><br><span class="[^"]?">(.+?)</span></td>') url = 'http://www.csfbl.com/freeagents.asp?leagueid=2237' sock = urllib...

php - How to write a migrate to undo the unique constraint in Laravel? -

Image
i make email field unique in table. $table->unique('email'); i've tried public function up() { schema::table('contacts', function(blueprint $table) { $table->dropunique('email'); }); } then, when run php artisan migrate, got it tell me it's not there, i'm 100% sure it's there. how write migration undo ? you have $table->dropunique('users_email_unique'); to drop index must specify index's name. laravel assigns reasonable name indexes default. concatenate table name, names of column in index, , index type.

core motion - Is it possible to get the current healthkit status of an iOS user? -

for instance if wanted respond when user walking/running/sedentary/bicycle/etc possible in current sdks? lucked upon answer. in cmmotionactivitymanager : the cmmotionactivitymanager class provides access motion data stored device. motion data reflects whether user walking, running, in vehicle, or stationary periods of time. navigation app might changes in current type of motion , offer different directions each.

powershell - Exe file remote Execution -

i'm trying write script patch sql instances remotely. referring forum, have framed following line executing .exe remotely on other server: invoke-command -computername $computer -scriptblock { & cmd /c 'd:\sql_patch\sqlserver2012sp2-kb2958429-x64-enu.exe' /qs /action=patch /allinstances /iacceptsqlserverlicenseterms } also tried well: invoke-command -computername $computer -scriptblock { & 'd:\sql_patch\sqlserver2012sp2-kb2958429-x64-enu.exe' -argumentlist "/qs", "/action=patch", "/allinstances", "/iacceptsqlserverlicenseterms" } one more peculiar thing is, first command running fine on windows 2012 servers not on windows 2008r2 server. don't know what's reason behind this. the following did trick looking for: psexec \\$computer -s -u adminuser -p adminpassword e:\sql_patch\sqlserver2012sp2-kb2958429-x64-enu.exe /quiet /action=patch /allinstances /iacceptsqlserverlicenseterms thi...

python - Annotate with intermediate model in Django -

i have 2 models group , user. class user(models.model): name = models.charfield(max_length=50) class group(models.model): users = models.manytomanyfield(user) a user can in multiple groups , group can have multiple users have made manytomanyfield in group. i have made intermediate model store date when user added group class user(models.model): name = models.charfield(max_length=50) class group(models.model): users = models.manytomanyfield(user, through='groupuser') class groupuser(models.model): user = models.foreignkey(user) group = models.foreignkey(group) it works should. but have userlistview in want annotate number of groups each user belongs to. i have overriden get_queryset in listview def get_queryset(self): return super(userlistview, self).get_queryset().annotate(num_groups=count(?)) but don't know how count correctly. i believe should work: def get_queryset(self): return super(userlistview, self)...

ruby on rails - How to prevent user to upload a big file with ActiveAdmin? -

i'm using activeadmin . in 1 of views user can upload picture, want show error if trying upload file bigger x size. how can that? code far: form(html: { multipart: true }) |f| f.inputs "bs" f.input :latitude, as: :hidden f.input :longitude, as: :hidden f.input :name f.input :picture, as: :file end f.actions end your going have write custom validation in model, if using paperclip doesn't allow pass function limits size. the validation this validate :validate_image_size def validate_image_size if document.file? && document.size > get_current_file_size_limit errors.add_to_base(" ... error message") end end private def get_current_file_size_limit 10.megabytes # dynamically change end

java - Inverse 2D FFT is outputting correct values in wrong order -

my 2d fft algorithm outputting correct values, in wrong order. example, input: 1050.0 1147.0 1061.0 1143.0 1046.0 1148.0 1118.0 1073.0 1072.0 1111.0 1154.0 1101.0 1078.0 1101.0 1106.0 1062.0 taking fft, , inverse fft results in: 1050.0 1143.0 1061.0 1147.0 1078.0 1062.0 1106.0 1101.0 1072.0 1101.0 1154.0 1111.0 1046.0 1073.0 1118.0 1148.0 you can see if flip last 3 columns horizontally, last 3 rows vertically, data correct. far can tell true input sizes it's easy (albeit hacky) fix. worried about computational time of fix because may have perform on 1024x1024 or 2048x2048 images in future. i confident 1d fft algorithm dofft() correct, , getting expected values forward 2d fft. inverse 2d fft causing me trouble. does see error is? code private static double[] cose; private static double[] sin; public static void main(string[] args) { float[][] img = new float[][]{ { 1050.0f, 1147.0f, 1061.0f, 1143.0f}, ...

html - Radio Button CSS3 - Customization -

i trying customize radio buttons on bootstrap not working, when try outside bootstrap environment in plain html works, below code html followed css using <div class="radio"> <label> <input type="radio" name="optionsradios" id="optionsradios1" value="option1" checked> current amp policies </label> </div> <div class="radio"> <label> <input type="radio" name="optionsradios" id="optionsradios2" value="option2"> financial planning , retirement advice </label> </div> <div class="radio"> <label> <input type="radio" name="optionsradios" id="optionsradios3" value="option3"> lifecover </label> </div> the css .newr...

java - The service class does not comply to one or more requirements of the JAX-RPC 1.1 specification, and may not deploy or function correctly -

i new java webservices, trying create simple soap based web-services getting issue in creating it. here webservice class: @webservice public class teams { private teamsutility utils; public teams() { utils = new teamsutility(); utils.make_test_teams(); } @webmethod public team getteam(string name) { return utils.getteam(name); } @webmethod public list<team> getteams() { return utils.getteams(); } @webmethod public string getdummyteams() { return "hi"; } } as can see have 3 methods here. if keep getdummyteams , ask eclipse create webservice, have no issues. when tried add remaining 2 methods public team getteam(string name) & public list<team> getteams() while creating webservice getting error : the service class "helloservice.endpoint.teams" not comply 1 or more requirements of jax-rpc 1.1 specification, , may not deploy or function correctly. field or property "play...

javascript - Use nan to receive and return Float32Array in an addon -

i'm trying use nan in order calculate on array of floats in add-on , return float32array . but while args have isnumber() , numbervalue() functions has isfloat32array() function , no float32array() . i've tried @ those: 1 , 2 tutorials found no suitable examples. nan_method(calc) { nanscope(); if (args.length() < 2) { nanthrowtypeerror("wrong number of arguments"); nanreturnundefined(); } if (!args[0]->isnumber() || !args[1]->isfloat32array()) { nanthrowtypeerror("wrong arguments"); nanreturnundefined(); } /* vector of floats ? */ args[0]-> ???; double arg1 = args[1]->numbervalue(); // calculation on vector nanreturnvalue(/* return float32array array */); } accepting typedarray best done nan::typedarraycontents local<typedarray> ta = args[0].as<typedarray>(); nan::typedarraycontents<float> vfloat(ta); float firstelement = (*vfloat)[0]; there no nan helper constr...

ios - Rounding corner causes top edge to blur -

Image
i have uibutton subclass rounding corners of. using either usual cornerradius property on layer, or creating rounded mask , applying layer, effect shown in image below (blown can see clearly). top pixel transparent, making edge soft. if remove rounded corners, edge goes solid (like bottom edge in image), know it's not trying draw view between pixels. any ideas? be sure frame , mask composed of integers not floats, in case use floor or ceil closest integer rounding low or top. frames cgrectintegral helpful. floats values automatically create sort of antialiasing while rendering on screen.

Using "Not in" in drools decision table -

how use "not in" range of values in drools decision table? example, i've method called hmt_homeinfo.get("hm").value , values 368.00-368.99, v72.0-v72.9, 369.00-369.99, 366-367.99, 7430-743.99. if $v variable bound value need test, then ! ("368.00" <= $v && $v <= "368.99" || "v72.0" <= $v && $v <= "v72.9" || ... "743.00 <= $v && $v <= "743.99" ) is expression returns true if $v not in 1 of these intervals. be advised these comparisons use string comparison, may or may not return expect when these strings contain looks number.

excel - Autofilter Column data one by one using buttons -

i have filtered data in column see 1 value @ time macro. far have got code below filters out when manually select value column. possible values picked macro function , when run populates data 1 one. sub macro1() columns("c:c").select activesheet.listobjects("table_query1_added_columns2").range.autofilter field _ :=3, criteria1:="101" activesheet.listobjects("table_query1_added_columns2").range.autofilter field _ :=3, criteria1:="102" activesheet.listobjects("table_query1_added_columns2").range.autofilter field _ :=3, criteria1:="103" end sub try (off top of head) sub macro1() static filter integer columns("c:c").select if filter = 0 activesheet.listobjects("table_query1_added_columns2").range.autofilter _ field:=3, criteria1:="102" filter = 1 elseif filter = 1 activesheet.listobjects("table_query1_added_columns2").range.autofilter _ ...

javascript - jquery & css target nth li with varaible instead of a number -

i using jquery add class li in ul . code: $('ul').children('li:eq( '2' )').addclass('active'); how can replace "2" variable dynamic? code below not work. think syntax issue advice? var count = 2; $('ul').children('li:eq( 'count' )').addclass('active'); you need concatenate variable. $('ul').children('li:eq( ' + count +' )').addclass('active'); however can use $.fn.eq() reduce set of matched elements 1 @ specified index. $('ul').children('li').eq(count).addclass('active');

c++ - Converting ICON to BITMAP -- side-effect -

how make code strictly conversion windows icon cbitmap? the code incorrectly displaying new bitmap on screen. :( this code acquired 'someone' on web. , though achieves it's goal of converting icon, it displays icon on screen (upper left hand corner) should not doing. d'oh! void cuihelper::converticontobitmap2(cbitmap& bmpobj, hicon hicon) { cclientdc clientdc(null); cdc memdc; memdc.createcompatibledc(&clientdc); assert(hicon); iconinfo info; verify(geticoninfo(hicon, &info)); bitmap bmp; getobject(info.hbmcolor, sizeof(bmp), &bmp); hbitmap hbitmap = (hbitmap)copyimage(info.hbmcolor, image_bitmap, 0, 0, 0); assert(hbitmap); assert(memdc.getsafehdc()); hbitmap holdbmp = (hbitmap)memdc.selectobject(hbitmap); clientdc.bitblt(0, 0, bmp.bmwidth, bmp.bmheight, &memdc, 0, 0, srccopy); memdc.selectobject(holdbmp); verify( bmpobj.attach(hbitmap) ); deleteobject(info.hbmcolo...

php - preg_match - Regular Expression To Create Array -

my data - {'/users/aaron/applications/developer-vagrant/web/g.php': {'total': 22}} {'/users/aaron/.vim/autoload/timetap.vim': {'total': 0}} {'/users/aaron/.vimrc': {'total': 5}} {'/users/aaron/documents/programming/php/timetapcli/composer.json': {'total': 144}} {'/users/aaron/documents/programming/php/timetapcli/timetap.php': {'total': 351}} {'/users/aaron/box/linux/.vim/autoload/timetap.vim': {'total': 37}} {'/users/aaron/box/cats.tex': {'total': 184}} i attempting create regular expression can convert above array using preg_match. want data - i want array of of data believe should below- array ( [0] => array ( [0] => '/users/aaron/box/cats.tex' [1] => array ( [total] =>'184' ) } } my attempt @ preg_match - $subject = file_get_contents('/users/aaron/.timetap/full.db'); $pat...

c# - How to best pass an object into .Net from Coldfusion for system migration -

i'm trying find clarity on area seems have little way of documentation aside adobe documentation on using cfobject . in effort migrate organization coldfusion .net, best way data .net applications? had looked cf gateway .net or using xml pass data .net coldfusion. initial starters, data represents reports , results calculations performed on coldfusion side. idea ease people .net platform , ui rather spring whole new system on them out gate.

batch file - Generated script doesn't create shortcuts -

my windows 8 pc doesn't seem want create shortcuts using vbscript. problem is, somehow can't saved. seems problem pc has. i trying create temporary vbscript using batch, output is: c:\users\albert~1\appdata\local\temp\11338-3520-31784-27073.vbs(5, 1) wshshortcut.save: shortcut "c:\users\albertmøller\downloads\desktop\askontrolpanel.lnk" not saved. this vbscript code: set script="%temp%\%random%-%random%-%random%-%random%.vbs" echo set ows = wscript.createobject("wscript.shell") >> %script% echo slinkfile = "desktop\askontrolpanel.lnk" >> %script% echo set olink = ows.createshortcut(slinkfile) >> %script% echo olink.targetpath = "%programdata%\autoshutdown\automaticshutdown.bat" >> %script% echo olink.save >> %script% cscript /nologo %script% del %script% it seems work on other computers have tested on, 3. try open administrator rights, still doesn't work. try cod...

timezone - Add PDT or PST in output display in mysql -

how can add timezone display on output? when pdt, wanted pdt, , if pst automatically change pst. this current query select if (dayofweek( curdate() ) = 1, date_format(date_add(curdate(), interval 2 day), "%h:%i %p"), date_format(curdate(), "%h:%i %p")) the output of is 12:00 it great if can output timezone , like 12:00 pdt or 12:00 pst mysql doesn't store time zone, datetime value have doesn't include time zone. have store time zone separately. a little warning: if store timezone "pst" or "pdt" easy display, hard convert other time zones, "pst" isn't unique, there several different time zones abbreviation. if need convert datetime other timezones, should store datetime utc, , store time zone it's full tz-name, "america/new_york". however, need use programming language handle this, pyhton, ruby, php, java, sql doens't have time zone support, , afaik that's true mysql well. ...

R contour levels don't match filled.contour -

Image
hopefully straightforward question made simple figure in r using filled.contour(). looks fine, , should given data. however, want add reference line along contour 0 (level = 0), , plotted line doesn't match colors on filled.contour figure. line close, not matching figure (and crossing on contour filled.contour plot). ideas why happening? aa <- c(0.05843150, 0.11300040, 0.15280030, 0.183524400, 0.20772430, 0.228121000) bb <- c(0.01561055, 0.06520635, 0.10196237, 0.130127650, 0.15314544, 0.172292410) cc <- c(-0.02166599, 0.02306650, 0.05619421, 0.082193680, 0.10334837, 0.121156780) dd <- c(-0.05356592, -0.01432910, 0.01546647, 0.039156660, 0.05858709, 0.074953650) ee <- c(-0.08071987, -0.04654243, -0.02011676, 0.000977798, 0.01855881, 0.033651089) ff <- c(-0.10343798, -0.07416114, -0.05111547, -0.032481132, -0.01683215, -0.003636035) gg <- c(-0.12237798, -0.09753544, -0.07785126, -0.061607548, -0.04788856, -0.036169540) hh <-rbind(...

python - PyMongo: Access fields returned from document within array resulting from find() query -

i executing query on mongodb collection: cursor = collection.find({"activityarray":{"$elemmatch":{"sport":0}}},{"activityarray.sport" : 1, "activityarray\|here result object .id":1, "endo" : 1}) |20166249 result_object in cursor[0:1]: |here result object print "here result object" |20166249 |here result object print result_object["endo"] |20166249 # print result_object["activityarray.sport"] # print result_object["activityarray"]["sport"] # ...

c# - Return barcode location in the image while decoding with zxing -

in current project, need know how location of barcode in image zxing, in pixel or range of pixels. image source kinect v2. main purpose associate barcode body frame, requires location information. i'm using standard kinect v2 sdk , visual studio 2013, in c#. feel it's not difficult, need guidance. thank in advance! it looks me (referencing posts such this ) resultfound action should pass result including resultpoints , each x , y value. it seems of details of points depend on type of barcode being parsed, i'd start. depending on you're trying location, may need use coordinatemapper correct coordinate system.

ruby on rails - how to properly create a between clause on mongo mapper -

i'm trying create query this user.find_each(created_at: [1.day.ago.utc, date.now]) |user| but didn't worked. return 0 users, have users created in 1 day timeframe. believe i'm doing query wrong, mongo mapper documentation says nothing this. ideas? activate profiling db.setprofilinglevel(2) . rerun code. get query sent mongodb in system.profile collection. run query in mongoshell check what's wrong. update code send command want.

elasticsearch - Difference between Elastic Search and Google Search Appliance page ranking -

how page ranking in elastic search work. once create index there underlying intelligent layer creates metadata repository , provides results query based on relevance. have created several indices , want know how results ordered once query provided. , there way influence these results based on relationships between different records. do mean how documents scored in elasticsearch? or talking 'page-rank' in elasticsearch? documents scored based on how query matches document. approach based on tf-idf concept term frequency–inverse document frequency . there is, however, no 'page-rank' in elasticsearch. 'page-rank' takes consideration how many documents point towards given document. document many in-links weighted higher other. meant reflect fact whether document authoritative or not. in elasticsearch, however, relations between documents not taken account when comes scoring.

python - .dropna doesn't work as expected -

i seeing odd behaviour when using .dropna on dataframe named lcd within ipython notebook: in[1] print "before %f" % lcd.last_pymnt_date.isnull().sum() lcd.last_pymnt_date.dropna(inplace=true) print "after %f" % lcd.last_pymnt_date.isnull().sum() out[1] before 84.0000 after 0.0 in[2] print lcd.last_pymnt_date.isnull().sum() out[2] 84.0000

c - How do I free the standard icons and cursors (those loaded with LoadIcon/Cursor(NULL, IDI/IDC_WHATEVER))? -

another quick question time: dll handles ui stuff has uninit() function should called before program terminates frees resources (unregisters window classes, deletes private heap, etc.). required call unloading idi_application , idc_arrow , , other system icons , cursors loaded loadicon / cursor(null, idi / idc_whatever) ? closest can gather msdn deleteobject() should not called on these icons; there no such function, in case? thanks. you don't unload system-defined icons or cursors. documentation destroyicon , instance, says ( emphasis added ): it necessary call destroyicon icons , cursors created following functions: createiconfromresourceex (if called without lr_shared flag), createiconindirect , , copyicon . do not use function destroy shared icon. shared icon valid long module loaded remains in memory. following functions obtain shared icon. loadicon loadimage (if use lr_shared flag) copyimage (if use lr_copyreturnorg flag , himage paramet...

node.js - Check existing user node-mysql -

so have following query check if user exists in database connectdb.query("select account_id registration account_id = '"+ useraccnt +"'", function(err, result, field){ if(result.lenght === 0){ //new user logic }else{ //existing user, redirect page } } so still hit new user logic every time when useraccnt value exists in database? point out if missing something? actually figured out going wrong, usraccnt variable being read in string rather integer hence query failing. account_id in database set int type

javascript - Event listener code won't execute function as expected -

i trying write small javascript function takes data opensignal , displays in html table. this worked fine until point tried make user friendly adding in html form accept postcodes input. tried avoid using php client won't have installed. i adding event listener submit button detect when form data has been submitted. taking , validating string contains valid postcode(s). if they're invalid program spits out alert says "sorry seem have entered incorrect postcode.". if not taking postcodes , passing them function processpostcodesonserver(). thing doesn't work inside event listener. when pass postcodes in manually using javascript arrays , call function outside of event listener works fine. when put in event listener doesn't work. have checked inputs function correct , have stepped through whole program numerous times , cannot find out causing problem. seems me case of javascripts random behaviour. can help?? html , javascript files (i using ...

visual studio 2010 - Linking lib in C++ project. VS2010 -

sorry basic question :) i have simple project 1 cpp file: #include <iostream> #include <glfw/glfw3.h> int main() { glfwinit(); return 0; } i added path of .h file proj-> properties-> c/c++-> additional include directories i added path of .lib file proj-> properties-> linker-> general-> additional library directories i added name of lib file proj-> properties-> linker-> input-> additional dependencies but doesn't work :( i can't build theproject. the error : "error 1 error lnk2019: unresolved external symbol _glfwinit referenced in function _main ...\ogl\first.obj ogl " what problem ? thank !

objective c - Transparent UINavigationBar in UITableViewController in iOS 8 -

Image
i have view controllers set navigation bar transparent this: viewcontroller.navigationcontroller.navigationbar.translucent = yes; viewcontroller.edgesforextendedlayout = uirectedgenone; [viewcontroller.navigationcontroller.navigationbar setbackgroundimage:[uiimage new] forbarmetrics:uibarmetricsdefault]; for uiviewcontroller works fine , able this: however, when using uitableviewcontroller doesn't quite work , this: it't grey background in navigation bar can't rid of. experiencing issue in ios 8.3. have tested in ios 7.1 , there works fine. edit: i have tried setting following without success: tableviewcontroller.navigationcontroller.navigationbar.shadowimage = [uiimage new]; tableviewcontroller.navigationcontroller.navigationbar.backgroundcolor = [uicolor clearcolor]; tableviewcontroller.tableview.backgroundcolor = [uicolor clearcolor]; there 2 ways it: 1 . can override navigation controller class , in viewdidload method of view controllo...

ruby on rails - undefined method `fetch_value' for nil:NilClass when using Roo -

i trying use roo import data excel spreadsheet table (data_points) in rails app. i getting error: undefined method `fetch_value' nil:nilclass and error references data_point.rb file @ line (see below full code excerpt): data_point.save! the "application trace" says: app/models/data_point.rb:29:in `block in import' app/models/data_point.rb:19:in `import' app/controllers/data_points_controller.rb:65:in `import' i puzzled because "find all" in entire app shows no instance of fetch_value here other code in app: in model, data_point.rb: class datapoint < activerecord::base attr_accessor :annual_income, :income_percentile, :years_education def initialize(annual_income, income_percentile, years_education) @annual_income = annual_income @income_percentile = income_percentile @years_education = years_education end def self.import(file) spreadsheet = open_spreadsheet(file) header = spreadsheet.row(1) (2..11)...

Passing query variables to the ContentProvider in Android -

i'm wanting know correct way of passing parameters database query using contentprovider pattern is. is follow - i.e. & args in update method. getcontentresolver().update(uri, cv,where, args); or appending values @ end of uri - in example in docs - see case 2? public class exampleprovider extends contentprovider { ...... ...... // implements contentprovider.query() public cursor query( uri uri, string[] projection,string selection, string[] selectionargs, string sortorder) { switch (surimatcher.match(uri)) { case 1: if (textutils.isempty(sortorder)) sortorder = "_id asc"; break; case 2: selection = selection + "_id = " uri.getlastpathsegment(); break; and of these approaches best. i've seen both used, unsure of respective merits.

c++ - IMG_Load doesn't work -

i watching series = https://www.youtube.com/watch?v=2nvghrofneg , reason guy in video code works me compiles fine doesn't load image. don't know do. #include "sdl.h" #include <iostream> #include "sdl_image.h" sdl_texture *loadtexture(std::string filepath, sdl_renderer *rendertarget) //texture optimization function { sdl_texture *texture = nullptr; sdl_surface *surface = img_load(filepath.c_str()); if (surface == null) std::cout << "error 1" << std::endl; else { texture = sdl_createtexturefromsurface(rendertarget, surface); if (texture == null) std::cout << "error 2" << std::endl; } sdl_freesurface(surface); return texture; } int main(int, char *argv[]) { const int fps = 144; int frametime = 0; sdl_window *window = nullptr; sdl_texture *currentimage= nullptr; sdl_renderer *rendertarget = nullptr; sdl_...

adobe - Link textboxes in InDesign so that resizing one moves the others -

i working in adobe indesign. if have textbox below textbox, there way link them or if adjust top text box, bottom 1 moves or down keep same distance between , top one? thanks! anchor second 1 in first 1 , set second frame anchored settings custom can relocate frame reference first frame. way, resizing first frame move second frame accordingly ;)

Searching Python dictionary for matching key -

i want search python dictionary key matches initial sequence of letters. however, it's bit more complicated , lost myself midway in confusion. example: have string "abstthgihg" , want search dictionary key matches last 9 letters of string. if none found want search dictionary key matches last 8 letters of string. i have no idea how match specific number of letters (here " the last x letters ") key (or how search key) have hopes here can perhaps name function enables me or can up. there no code can present since first thing program does. can specify " the last 9 letters " x = string[1:] ? idea have how specify letters of string use search. since dictionaries hashed tables, can't them last bit of key whole key. instead have iterate on keys for key in dictionary.keys(): if key[-9:] == 'bstthgihg': print('i found it!!') break note use of key[-9:]

ios - library not found for -lPods-AFNetworking -

i getting following error when using afnetworking: ''library not found -lpods-afnetworking'' "linker command failed exit code 1 (use -v see invocation)." i checked missing frameworks,and present .additionally project works other people(we pulled github) , i'm person whom not work.(its joint project) we use xcode 6.2. not understand wrong or went missing. tried pulling using command line,sourcetree , xcode git source control. i tried different versions of xcode. other teamates using xcode 6.2, using now. it used work before, stopped working. any ideas welcome,thank you! following detailed errors: ld: warning: directory not found option '-l/users/ramapriyasridharan/documents/rama-3:06:2015-ios/mapbox' ld: warning: directory not found option '-l/users/ramapriyasridharan/documents/rama-3:06:2015-ios/pods/build/debug-iphoneos' ld: library not found -lpods-afnetworking clang: error: linker comma...

vba - 2 queries in 1 report group both by date Access -

i have 2 queries , list fields end (as opposed links, there 6 tables linked in first one) 1) qryemployee_order employee_id operation_date "employee name" "order name" "model name" "operation name" "wage rate" "quantity produced" 2) qryemployee_work employee_id work_date "employee name" "work name" "wage rate" "hours worked" basically there 3 types of employees in business work for. don't know proper english terms these, explain them.: the ones paid amount produce the ones paid hours work for mix of 1) , 2) first query (qryemployee_order) first category, paid amount produce (irrelevant of hours takes). second query (qryemployee_work) second type of employees (hourly wage based). my current report shows monthly report qryemployee_order employee_id filter correct employee , operation_date header in report under else grouped (ie. produced employee on given date). ...

lookup tables - How to change an integer into a specific string in a data.frame in R -

i guess simple question reason i'm stuck on it. have data frame 2 columns. second column contains integers. more precisely contains 0,1,2,3 , na's. this: id1 0 id2 1 id3 0 id4 2 id5 3 id6 1 id7 2 id8 na what i'm searching command changes 0 zzt 1 zzu , on. na's should stay na's. how work? i tried loop in combination if-statements doesn't work. know such changing thinks pretty easy in r seems have block in brain. you can map values using mapvalues function plyr package. using example data mike wise's answer: library(plyr) df$val2 <- mapvalues(df$val, = c(0,1,2,3,na), = c("zzt", "zzu", "zzv", "zzw", na)) if have dplyr package loaded (the successor plyr), call function using plyr::mapvalues() loading plyr on top of dplyr problematic.

css - Overriding bootstrap rules -

i load css in order <link href="bootstrap.min.css" rel="stylesheet"> <link href="print.css" media="print" rel="stylesheet"> from bootstrap.css: @media (min-width: 768px) { .modal-dialog { width: 600px; } } from print.css: .modal-dialog { width: 100% !important; } but still in print preview width 600px! everything else overridable, paddings etc not width of div. the bootstrap css media query, more specific print css wrote. specific media query styles elements fit tablet or larger screen - screen size larger 768px. because parent element bootstrap modal doesn't have explicit width set, setting print css width 100% you're telling block element use default behavior, take full width of container. width explicitly set 600px in bootstrap css, that's you'll need override. in general, setting width: 100% block elements redundant, since that's default behavior. re...