Posts

Showing posts from April, 2014

Wordpress custom menu for different categories -

how different menus different categories? when add new category through admin want custom menu generate dynamically. depending on mean simple , yes, possible , imho , simple . you can not however, afaik , in core wp ui. what need ,is create menus , , use conditionals, in specific is_category() ; in order display them : if( is_category( array( 9, 'food', 'bones' ) ){ // can use either id or slug... wp_nav_menu( 'a') } else if( is_category( array( 99, 'fur', 'flees' ) ) { wp_nav_menu('b') } else if( is_category( array( 'whatever' ) ) { wp_nav_menu('c') } else { wp_nav_menu('x') } please @ wp_nav_menu()

scala - Change language of text in template in play framework 2.1.1 -

i want user of application can change language in play2 (play 2.1.1, scala 2.10.1) web application. use @messages.get(...) in templates i18n. i have application.langs="en,ru" in application.conf. pass "en" or "ru" method: def index = action { ok(views.html.index()) } def changelanguage(lang:string) = action { implicit request => logger.logger.debug("change user lang : " + lang) val referrer = request.headers.get(referer).getorelse(home_url) redirect(referrer).withlang(lang(lang)) } routes: get / controllers.application.index /index controllers.application.changelanguage(lang ?= "ru") the template bunch (views.html.index): @()(implicit l: lang) @import play.i18n.messages ... <a href="/about">@messages.get("about")</li> ... <a href="index?lang=ru" id="ru"></a> <a href="

latex - Best markup language for small articles, letters, resumes -

i have suggestion on right choice markup language. need write short technical articles, business letters , resume. desired output are: pdf html rtf/docx the following other requirements: right alignment of blocks use of symbols (for email, mobile address) table without borders page numbering , footer the following example of letter. language make it? not use word/openoffice because want generate documents starting data in mysql database. @ moment using latex moderncv style not consider tools such latex2word enough make rtf/docx output. -------------------------------------------------------------------------------------------------------------------------------------------------------- mark jeronimo, 54 campb

html5 - UndoManager support in Firefox -

i'm little confused how use undomanager in firefox. according mozilla , firefox 20 has support it, can't figure out where. i've checked under document , objects , etc., can't find anywhere. i'm sure i'm missing obvious, can help? you have set "dom.undo_manager.enabled" preference use it, far, since spec still in flux.

php - Generate CSRF token dependig on datetime -

exists way in symfony 2 generate csrf token @ each rendering of form? in controller tried this: $request = $this->get('request'); if ($request->getmethod() != 'post') { $csrf = $this->get('form.csrf_provider'); $date= new \datetime("now"); $this->date = $date->format('y-m-d h:i:s'); $token = $csrf->generatecsrftoken($this->date); } elseif($request->getmethod() == "post") { $csrf = $this->get('form.csrf_provider'); $token = $csrf->generatecsrftoken($this->date); } $form = $this->createformbuilder() .... ->add('_token','hidden',array( 'data' => $token ))->getform(); if ($request->getmethod() == 'post') { $form->bindrequest($request); if ($form->isvalid()) { } } all time in request right token hash. afte

c++ - Windows Netapi32 -

i accessing windows netapi32 using netapi32.lib , using c++ access api. having trouble retrieving computer name, 1 netfileenum here on file_info_3 structure here . in documentation says, fi3_username pointer string specifies user (on servers have user-level security) or computer (on servers have share-level security) opened resource. note windows not support share-level security.this string unicode if _win32_winnt or force_unicode defined. now, network running script in has indeed share-level security , not sure how list computer name. relevant code library includes: #pragma comment(lib, "netapi32.lib") #include <stdio.h> #include <assert.h> #include <windows.h> #include <lm.h> initiate structure: fstatus defined in code as, net_api_status fstatus , i/o structure. documentation here if fstatus successful return value nerr_success . if function fails, return value can 1 of following error codes. error_acces

c++ - Adjusting contrast and brightness with OpenCV -

so trying increase both contrast , brightness opencv bit. doing: mat image_copy; cvtcolor(image, image_copy, cv_bgra2bgr); image_copy.convertto(image, -1, 1.3, 0.15); image though looks strange. has blue tint. red , blue colours inverted. red jumper blue , blue can on table red. why? i trying achieve same effect when set contrast 30 , brightness 15 here: http://camanjs.com/examples/

ios - Flex AS3 Iphone - How to Open Native Maps Application? -

i have bunch of buttons opens default map application , puts in users system clipboard. works fine on android tablets, iphone nothing when button clicked. here code: case "mapyummyyummy": system.setclipboard( "1665 stelton rd piscataway nj 08901" ) _callurl = "geo: 40.4978922, -74.4488224"; var targeturl:urlrequest = new urlrequest(_callurl); navigatetourl(targeturl); break; does know equivalent work on iphone devices? thanks! have tried setdata method? (i have no experience one, looks viable alternative). http://help.adobe.com/en_us/flashplatform/reference/actionscript/3/flash/desktop/clipboard.html#setdata() ios launch maps via url reference: http://developer.apple.com/library/ios/#featuredarticles/iphoneurlscheme_reference/articles/maplinks.html querying location: http://maps.apple.com/?q=cupertino setting start , end directions: http://maps.apple.com/?daddr=san+francisco,+ca&

javascript - Backbone - sync doesn't detect my collection url -

i have albums , songs relationship. in new album view i'm asking songs @ same time, i'm trying save album model first , save song collection , attach album. my song collection definition: define(function(require){ var song = require('models/songmodel'); songs = backbone.collection.extend({ url: 'songs/', model: song, }); return songs; }); i create song collection this: this.songcollection = new songs(); //in other view saves songs files , returns hash that.songcollection.add({title:file.name,song_file:response['file_hash']}); then save album model , in success try save songs collection adding new album pk models in song collection: that = this; this.model.save(null,{ success: function(model,response){ that.songcollection.each(function(song){ s

php - custom empty() function -

today i've created function called is_empty() . function similar existing empty() function - adds few more checks required script. however, when run script , value not set, the: notice: undefined index notice. default empty() function display notice , assumes value empty, there way configure function same? instead of using isset() is_empty() ? thank much! edit: function here: function is_empty($value, $integer = false){ if($integer){ return empty($value) && !is_numeric($value); } return empty($value); } the notice not come checks inside function. notice comes passing argument function, i.e. before function body executed. therefore, cannot change implementing function in different way.

extjs - Sencha native app error st-res/templates/stbuild_template_sim.app/ does not exists -

i'm trying build native application sencha cmd using sencha app build native , seems work fine until gets part: failed running native packager [err] source directory: st-res/templates/stbuild_template_sim.app/ not exists error copying st-res/templates/stbuild_template_sim.app/ /home/dethstar/public_html/muhapp/build/muhapp/native/muhapp.app/ failed package application but haven't been able find these files, neither online or in touch directories. idea? i had link st-res , stbuild working directory: ln -s /opt/sencha/cmd/4.0.0.203/stbuild/stbuild ln -s /opt/sencha/cmd/4.0.0.203/stbuild/st-res "/opt/sencha/cmd/4.0.0.203/" needs replaced path sencha cmd installation.

java - Import JScience Measure into NetBeans -

Image
i have basic question. trying use measurement functionality in jscience. downloaded .jar files ( http://java.net/projects/jscience/downloads ) created new library of .jar files loaded. my "tree" is: my import statement is: import javax.measure; the compiler complains package javax.measure not exist. doing wrong? thank you the syntax importing in java is: for individual class: import com.mypackage.classname; for entire package: import com.mypackage.*; to import entire measure package, can use: import javax.measure.*; using package members

oracle - SQL Expression missing error -

i trying select table average of columns other tables other tables; schema follows. students ( sid , firstname , l astname , status , gpa , email ) enrollments ( sid , classid , lgrade ) grades ( lgrade , ngrade ) and erroneous query is, select sid, lastname, avg( select g.ngrade grades g, enrollments e e.sid = sid , g.lgrade = e.lgrade , e.lgrade not null , g.ngrade not null) cgpa students order cgpa asc; take semi-colon out of subquery.

php - $_REQUEST['oauth_verifier'] is empty -

i using abraham library codeigniter , having issue. i know twitter has changed api, , i've tried fix mentioned with: $access_token = $connection->getaccesstoken($_request['oauth_verifier']); but script tells me $_request['oauth_verifier'] not set? what going on? site worked fine 4 days ago????? i having similar issue, ios, not php. here details changed last week twitter's api. https://dev.twitter.com/discussions/16443 in context, might want check make sure you're passing valid callback url obtain oauth_verifier string.

Java Collections - Maps and Sets: put cannot be applied -

i'm having trouble code. trying create student database. need create set of students represented course name. course name mapped set of students. i've tried write 'add' method when try .put database error message: put(java.lang.string,java.util.set) in java.util.map> cannot applied (java.lang.integer,studentdatabase.student). appreciated!!!! import java.util.*; public class studentdatabase { private map<string, set<integer>> database = new treemap<string, set<integer>>(); private static class student extends treeset<integer> { public int id; public student(int id){ this.id = id; } } public void add(string coursename, integer student) { /* i've tried use way add database , doesn't work too. set<integer> studentset = database.get(coursename); if (studentset == null){ studentset = new treeset<integer>(); } studentset.add(student); database.put(coursename, s

java - preventing redundant random numbers -

i'm trying random numbers 0 - 499 in sets of 2 based on user inputs. example 234 , 58, , thats 1 set, user may prompt wan 8 sets. im trying make sure redundant number doesnt show up, 234 & 58, 12 & 444, 198 & 58. (58 showed twice.) the way im trying prevent putting found numbers array , when go around next match im checking in array make sure havent been used yet. wondering best way of be. on first go around no numbers have been chosen yet dont need check. next go around if redundant? numbers , check array, , if in array how go , new numbers? while loop maybe? here im doing: //now add specified number of random connections system.out.println(); system.out.println("new connection(s): "); //array keeping track of new connections prevent redundant add's int redundant [] = new int[con*2]; for( int = 1; <= con; i++ ){ random ran = new random(); if( == 1){ int ran1 = ran.nextint(sworld.length-1) + 1;

php - symfony2 syntax error -

i have following code: public function postformaction(request $request) { $cityid = $request->request->get('shopioususerbundle_user')['location']['city']; ..... } for reason giving me syntax error, idea why? when remove array indexing like: $cityid = $request->request->get('shopioususerbundle_user') works fine. array dereferencing result of function call available in php 5.4 or later. see http://php.net/manual/en/language.types.array.php#example-88 if using earlier php version, have following $data = $request->request->get('shopioususerbundle_user'); $cityid = $data['location']['city'];

iphone - How to know, when this block completes execution -

i trying access abaddressbook properties of person based on recordid, each time, try property, null value. this code have tried. abaddressbookref addressbook = null; addressbook = abaddressbookcreatewithoptions(addressbook, nil); abrecordref person = abaddressbookgetpersonwithrecordid(addressbook, (abrecordid) [[object valueforkey:@"recordid"] description]); nsstring *firstname = (__bridge nsstring *)abrecordcopyvalue(person, kabpersonfirstnameproperty); nslog(@"first name %@", firstname); nsstring *lastname = (__bridge nsstring *)abrecordcopyvalue(person, kabpersonlastnameproperty); nsstring *name = [nsstring stringwithformat:@"%@" "%@", lastname, firstname]; nslog(@"full name %@", name); what doing wrong here? edit: have kind of figured out above problem. have used. problem having need reload uitableview when block of code completes execution. not able figure out when block completes executi

php - Image is being save to the folder in db but other information is not being save -

need above code saving image folder(photos) define in above code. other data being post form not being save database...i new php , found code website www.jeasyui.com. try modified fail..as usual.:( if (!isset($_files['image']['tmp_name'])) { echo ""; }else{ $file=$_files['image']['tmp_name']; $image= addslashes(file_get_contents($_files['image']['tmp_name'])); $image_name= addslashes($_files['image']['name']); move_uploaded_file($_files["image"]["tmp_name"],"photos/" . $_files["image"]["name"]); $location="photos/" . $_files["image"]["name"]; $name = $_request['prname']; $code = $_request['prcode']; $type = $_request['prtype']; $weight = $_request['prweight']; $desc = $_request['prdesc']; $machine = $_request['prmachinem

objective c - How do you get that normal style location not available in IOS? -

say turn off location in map. go map. apple pop , says location not available. when user press settings goes settings. how pop message? i know can use uialertview. message seems apple standard. when pressing settings people go setting straight. not see how can make self or can i? it seems apple display pop automatically when try location don't have permission so. well, not in case. in case if app doesn't have permission so, it'll hang waiting permission never come. the first time app wants use location services, system show alert. user has choice enable it, alert not shown again. developer, don't have ability show again. what do, check authorizationstatus on cllocationmanager : if ([cllocationmanager authorizationstatus] != kclauthorizationstatusauthorized) { // show alert telling user enable location services app } you can't directly open settings app though.

How to add a image to dojo datagrid cell -

i can add image dojo datagrid cell adding class cell,but when double click cell images of row clicked lost,so there way add image not being lost. yes there is, simply add an <div class="imagediv"></div> as value of cell , in css file, that: .imagediv{height:20px;width:20px;background-image:url(/path/to/image.png);} if need display image based on cell values, should dojo's layout-formatter functions: http://dojotoolkit.org/reference-guide/1.8/dojox/grid/datagrid.html (search formatter)

jsf - How to upgrade jboss seam from 1.1 to 2.0? -

we have legacy application uses jboss seam 1.1. need move jboss seam 2.0 moving app jsf 1.1 jsf 1.2 (seam 1.1 supports jsf 1.1 , seam 2.0 supports jsf 1.2). what steps required migration? looked docs , on net couldn't find explains migration. see "chapter 4. migrating seam 1.2 seam 2" , "chapter 2. migration" in seam reference guide .

What is the PHP shorthand for: print var if var exist -

we've encountered before, needing print variable in input field not knowing sure whether var set, this. avoid e_warning. <input value='<?php if(isset($var)){print($var);}; ?>'> how can write shorter? i'm okay introducing new function this: <input value='<?php printvar('myvar'); ?>'> but don't succeed in writing printvar() function. my recommendation create issetor function: function issetor(&$var, $default = false) { return isset($var) ? $var : $default; } this takes variable argument , returns it, if exists, or default value, if doesn't. can do: echo issetor($myvar); but use in other cases: $user = issetor($_get['user'], 'guest'); as of php 7 can use null-coalesce operator : $user = $_get['user'] ?? 'guest'; or in usage: <?= $myvar ?? '' ?>

sql server - How to continue cursor loop even error occured in the loop -

i want insert rows of 1 table another. have below procedure. alter procedure loaddata_a begin truncate table stident_a declare @sid int declare @sname varchar(50) declare @sub varchar(50) declare @marks int declare load_data cursor fast_forward select sid,sname,sub,marks student open load_data fetch next load_data @sid,@sname,@sub,@marks while @@fetch_status = 0 begin begin transaction insert stident_a(sid,sname,sub,marks) values (@sid,@sname,@sub,@marks) if @@error != 0 begin rollback transaction return end else begin commit transaction end fetch next load_data @sid,@sname,@sub,@marks end close load_data deallocate load_data end whenever row fails insert, cursor fails , stops there, need continue. how that? apparently, you've got return statement after rollback transaction . have tried removing it? although rewrite body using try/catch instead, this: ... while @@fetch_status =

c# - How to parameterize the Update query in SqlDataSource -

Image
i maintaining old website, code pretty messy. i want use sqldatasource updating, selecting, inserting functions. do not want write back-end code myself. (i have written code, old code messy test , not have comments makes me hard detect bugs are, have discarded back-end code , using sqldatasource) instead, i'd use updatecommand in sqldatasource update. here updating query: update medicarelocalaccounts set account=@account , pwd=@pwd divisionid=@divisionid the data source comes 3 different tables. <asp:gridview id="gv_medicarelocals" runat="server" allowpaging="true" allowsorting="true" autogeneratecolumns="false" datakeynames="ludivisionsuid" clientidmode="static" autogenerateeditbutton="true" enablepersistedselection="true" datasourceid="sqldatasource1"> <columns> <asp:hyperlinkfield datatextfield=&

android intent vs observer -

i wondering when should favour intent based approach on classic oberserver design pattern in android app. would wize use intent's publish events within 1 activity? definition observer maintain list of dependents notify change. on other side intent abstract description of operation. can received same or multiple application perform task. synchronous vs asynchronous observer synchronous changes effect right-way. intent asynchronous. binding observer bindings compile time. on other side intent bindings @ run time secure for internal communication observer secure intent broadcast message , can receive message. intent provide additional functionality on observer on android platform communicating third party application , processes. receive system notification perform task application module reuse third party app. (ex taking pic) intent stays around , app can retrieve data in later time (sticky intent) would wise use intent's publish events

java version of bat algorithm in matlab -

i have matlab code of bat algorithm , write java version of algorithm bat algorithm simple optimization algorithm finding minimum of function here matlab code , java version of code my java version of algorithm can't find optimum result matlab version , can't find mistake in converting code matlab java can me mistake? import java.util.random; public class bat { private int n; private float a, r; private float qmin, qmax; private int d; private int nofgen; private float fmin; private int fminindex; private float fnew; private int loopcounter; private float q[], v[][], sol[][], ul_bound[][], fitness[], s[][], best[]; private random myrand; public bat( int nbats, float loudness, float pulserate, float minfreq, float maxfreq, int nofgeneration, int dimension ) { n = nbats; = loudness; r = pulserate

c# - How to put loading image when something is processing? -

i having page in when click on create button sends web request links mean while takes time links working or not @ time want put image load button id="btnrender" runat="server" text="page render" onclick="btnrender_click" /> <asp:button id="btn_submit" runat="server" text="submit" onclientclick="javascript:finda();" /> <asp:button id="btn_createlink" runat="server" text="create link" onclick="btn_createlink_click" /> i want call on btn_createlink_click" button when user clicks image or text should appear without ajax tool: call loading image on button click , hide image on page load completes. <%@ page language="c#" autoeventwireup="true" codefile="default.aspx.cs" inherits="_default" %> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" &q

javascript - display text in multiline using text area -

this question has answer here: javascript: how add line breaks html textarea? 9 answers i using text area tag in html , have print ingredients in separate lines on using enter key coming in single line when pass value of text area variable , print it. following code snippet : <div data-role="fieldcontain"> <label for="name">ingredients</label> <textarea rows="4" cols="50" id="new_ingredients"> </textarea> </div> $( '#new_recipe' ).live( 'pagebeforeshow',function(event){ var temp1 = $("#new_ingredients").val(); $("#testing").text(temp1); }); <div data-role="page" id="new_recipe"> <div class="content" id="testing" ></div> </div> please me how data in d

haskell - Does Scala continuation plugin support nested shift? -

i going through following shift/reset tutorial: http://www.is.ocha.ac.jp/~asai/cw2011tutorial/main-e.pdf . i got pretty results far in translating ochacaml examples scala (all way section 2.11). seem have hit wall. code paper asai/kiselyov defines following recursive function (this ochacaml - think): (* a_normal : term_t => term_t *) let rec a_normal term = match term var (x) -> var (x) | lam (x, t) -> lam (x, reset (fun () -> a_normal t)) | app (t1, t2) -> shift (fun k -> let t = gensym () in (* generate fresh variable *) app (lam (t, (* let expression *) k (var (t))), (* continue new variable *) app (a_normal t1, a_normal t2))) ;; the function supposed a-normalize lambda expression. scala translation: // section 2.11 object shiftreset extends app { sealed trait term case class var(x: string) extends term case class lam(x: string, t: term) extends term case class app(t1: term, t2: term

c - Converting pixels in this code -

Image
i seem have hit stump in small programming assignment. (please don't tell me how entire problem; want know how set every byte red). the code have following: #include <stdio.h> #include <stdlib.h> #include <cs50.h> #include "bmp.h" int main(int argc, char* argv[]) { // ensure proper usage //if (argc != 3) //{ // printf("usage: copy infile outfile\n"); // return 1; //} // remember filenames //char* infile = argv[1]; //char* outfile = argv[2]; char* infile = getstring(); char* outfile = getstring(); // open input file file* inptr = fopen(infile, "r"); if (inptr == null) { printf("could not open %s.\n", infile); return 2; } // open output file file* outptr = fopen(outfile, "w"); if (outptr == null) { fclose(inptr); fprintf(stderr, "could not create %s.\n", outfile); retur

actionscript 3 - create (webcam capture like youtube) in my website -

i have website working same youtube. @ moment trying create video image captured webcam. video image should saved on computer (by flv format) first , if user satisfied, or can upload on server i trying use actionscript3 in adobe flash cs5 , flash media server4 1- how can that? 2- flash media server needed? please pay attention allow user save video on his/her computer , able uploaded server. many thanks. assuming computer can take overhead of doing encoding on fly (or has enough memory buffer data can run data through encoding process) library mentioned in answer here should work: encode video format .flv format in as3 i believe flash media server necessary in case broadcast. pseudocode example private var cam:camera; public function whatever() { //in constructor addeventlistener(event.enter_frame, grabframe); cam = camera.getcamera(); if (cam != null) { var vid:video = new video(cam.width, cam.height); vid.attachcame

python - tweepy/ twitter api error type -

i using tweepy make twitter application. when users tweet/update profile, etc, errors. want classify error , give user more information. try: tweet/update profile/ follow.... except tweepy.tweeperror, e: if tweepy.tweeperror "account update failed: description long (maximum 160 characters)" if tweepy.tweeperror "failed send request: invalid request url: http://api.twitter.com/1/account/update_profile.json?location=%e5%85%b5%e5%ba%a" if tweepy.tweeperror "[{u'message': u'over capacity', u'code': 130}]" is way classify error compare e string, example, account update failed: description long (maximum 160 characters) ? right, way now. there 1 tweeperror exception defined. it's raised throughout app different text. here's relevant open issue on github. there chance it'll improved in future.

html - Email with anchor link doesn't work on gmail, and indexed my "#" link? -

i designing e-newsletter effect like this per client's instructions. i know there no way use javascript in email, i've tried make in stupid way, using overflow:hidden , anchor tags. when click appropriate link, hidden image scroll visible area. here's code: <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>demot</title> <style type="text/css"> .of { display:block; max-height: 100px; overflow: hidden; white-space:nowrap; } </style> </head> <body> <!-- save web slices (news_letter_artwork.jpg) --> <table id="table_01" width="595" height="434" border="0" cellpadding="0" cellspac

java - build failed while run ant file -

i'm trying run ant build.xml error occur buildfile: d:\projects\obsworkspace\schoolforms\torque\build.xml main: build failed d:\projects\obsworkspace\schoolforms\torque\build.xml:19: following error occurred while executing line: d:\projects\obsworkspace\schoolforms\torque\build-torque.xml:52: d:\projects\obsworkspace\schoolforms\torque\${torque.home}\lib not found. in project ${torque.home} not found directory indicated assume torque.home specified through -d option in ant invocation what -d specified, how find ${torque.home} value? use in way ant build -dtorque.home="value torque.home" . using -d param can pass property command line directly build. if pass value command line build visible in builds if pass invokeall=false . i think here answer how pass parameters eclipse ant ( eclipse->myproject->right click on build.xml->arguments->vm arguments -dapproot=ecm -dappname=esw -dapp.module=fnt -dapp.env=loc -dclon

coldfusion - fusionreactor installation error Backing store not available -

i trying install fusionreactor_windows_4_5_5 on coldfusion 10 / windows 7 (32bit) system. giving me error: setup detected problem please ensure java system preferences backing store has appropriate permission! additional information can found in following documents: http://www.fusion-reactor.com/support/kb/frs-198.cfm http://www.fusion-reactor.com/fr/helpdocs/installation_guide.pdf error reported is: flush(): backing store not available. how solve , install fusionreactor successfully? from fusionreactor support pages found here: fusionreactor technote - frs-198 (this mentioned in error received) how fix it insufficient privileges the runtime user of server on fusionreactor installed requires read/write access java system preferences backing store. depending on operating system, location of data store different. on windows data stored in registry hive hkey_local_machine\software\javasoft\prefs , data belonging fusionreactor in hkey_local_mac

javascript - Undefined symbols for architecture i386 and Terminating app due to uncaught exception in iOS -

i trying develop 1 app phone gap. when try use plugin extractzipfile ios it's throw error: undefined symbols architecture i386: "_main", referenced from: start in crt1.o ld: symbol(s) not found architecture i386 clang: error: linker command failed exit code 1 (use -v see invocation) then seach issue , find 1: "add main.m in compiler source of compiler phrase". and error above fixed. it's throw exeption: terminating app due uncaught exception 'nsinternalinconsistencyexception', reason: 'unable instantiate uiapplication delegate instance. no class named appdelegate loaded.' i using phonegap 2.5.0 , xcode 4.6.1, use iphone simulator 6.1 please, hlep me! new , fool! thanh reading! if sort of thing appearing suddenly, means project missing frameworks needs. libraries , dependent projects can require frameworks, if you've added 1 can cause error. to add frameworks, right click on project name in project view, select

javascript - Combining many JS files with Rails Asset Pipeline -

i making long-overdue upgrade rails 3.0.20 rails 3.1.10. (later i'll upgrade 3.2, want more major changes in 3.1 working codebase first. don't have test suite, please bear me overcome quite bit of technical debt. thankfully, app isn't large or complex.) i've had separate js files various views in app. now, asset pipeline wants combine of 1 file. problem is, lot of variables , function names collide , cause problems. my assumption need use kind of namespacing here, , initialize code in particular namespace on page needs it. is there standard way this? or, there better way overall? one note of clarification: i'm not ready switch coffeescript yet. the keystone of asset pipeline manifest file. default rails creates 1 javascript files at app/assets/javascripts/application.js this manifest uses directives declare dependencies in asset source files. 1 of these directives is require_tree which works require directory, operates recursively requi

c# - Hide the src string of an image tag -

for example have: <img src="http://gateway.com/providername/nameofthesupplier/requestedimg.jpg" /> now customers complaining there customers can see company name in url. because work change structure of gateway use, search way it. is there way can hide src client? example base64, or encryption can decrypt client-side? simple answer: no. long answer: no. technical answer: displayed browser needs translated human readable* text in 1 way. can obfuscate server side though. *) human readable includes short names http://gateway.com/p/n/r.jpg .

How to use Spotify Views API? -

how use spotifies views api right way? https://developer.spotify.com/technologies/apps/docs/preview/views/index.html i trying implement throbber in div, use code: require(['$views/throbber#throbber'], function(throbber) { var favs = document.getelementbyid('favs'); var throbber = throbber.forelement(favs); }); but throwing "referenceerror: require not defined". when use this: var sp = getspotifyapi(); sp.require(['$views/throbber#throbber'], function(throbber) { var favs = document.getelementbyid('favs'); var throbber = throbber.forelement(favs); }); it throwing error." typeerror: object $views/throbber#throbber has no method 'match' ". the throbber component available on 1.x api, using syntax of first code snippet. in order let spotify client know using version of api need specify in manifest.json file using 1.x api adding dependencies attribute in

javascript - Windows Phone 8 Launcher-App submits wrong width and height to the website when set to landscape -

iam working on launcher-app launches website. on mobile internet explorer it's working fine(landscape mode) when try own app, fixed landscape mode , has webbrowser included, webbrowser sends wrong width , height website (480x800) has 800x480 because of landscape. is there solution problem or workaround?

ruby on rails - How to make find_or_initialize case insensitive on a Postgres DB? -

in rails 3.2 app have post model belongs category. in new post form text field assigning category or creating new category. it works via following method on post model def category_name=(name) if name.present? post_cat = category.find_or_initialize_by_name(name) if post_cat.new_record? post_cat.save(:validate => false) self.category = post_cat else self.category = post_cat end end end this more or less working, case sensitive. example, database contains records "featured", "featured" , "featured" categories. how can make above find_or_initialize function behave though case insensitive. using postgres database, , have suspicion not quite easy "making find_or_initialize case insensitive". i'm grateful advice best practice, consider, , useful references. i refer comment above: maybe add second field, containing value of string displayed user, , find_or_initialize name column:

xcode - How to check if any network available in OS X app? -

this question has answer here: how determine internet connection in cocoa? 3 answers in app, wanted check if there type of existing network available in current os x system. ethernet or internet or wifi or 3g-card or other type of network communication. how can achieve that? thank you! https://stackoverflow.com/questions/5662298... thank bdash , cody ! homework , found answer above. iphone, make modification below. - (bool)isanynetworkexist { struct sockaddr_in nulladdress; bzero(&nulladdress, sizeof(nulladdress)); nulladdress.sin_len = sizeof(nulladdress); nulladdress.sin_family = af_inet; scnetworkreachabilityref ref = scnetworkreachabilitycreatewithaddress(kcfallocatordefault, (const struct sockaddr*) &nulladdress); scnetworkreachabilityflags flags; scnetworkreachabilitygetflags(ref, &flags); cfrelease(re