Posts

Showing posts from June, 2013

broadcastreceiver - Need to run my app before the unlock screen in android -

i need run app user clicks on unlock screen. have used action_user_present intent in broadcastreceiver check. used following code. need show app before unlock screen. app visible after unlock screen. appreciated. my broadcastreceiver package com.progressindicator; import android.content.broadcastreceiver; import android.content.context; import android.content.intent; import android.view.windowmanager; public class receive extends broadcastreceiver { @override public void onreceive(context context, intent intent) { // todo auto-generated method stub if (intent.getaction() != null) { if (intent.getaction().equals(intent.action_user_present)) { intent s = new intent(context, progressindicator.class); s.setflags(intent.flag_activity_brought_to_front); // s.setflags(windowmanager.layoutparams.flag_dismiss_keyguard); s.setflags(intent.flag_activity_clear_top); s.a...

Git : Confuse after merge -

this question has answer here: git merge left head marks in files 3 answers i new git. recently, merged code feature master branch. after merging .gitignore file looks this <<<<<<< head gen/ bin/ ======= gen/ >>>>>>> master now question is if want change content of file, should follow special instruction or can change file , commit ? what meaning of sign <<<<<<< head >>>>>>> master ? if remove head , master file. generate error ? it shows in current head , , in master branch. if want choose in head should leave only gen/ bin/ in file. if decide choose in master should ahce only gen/ in file. you may need write here else. after merge file commit now. i believe it's no practical case when not deleted special lines =======

fs - Node.js check exist file -

how check existence of file ? in documentation module fs there's description of method fs.exists(path, callback) . but, understand, checks existence of directories. , need check file ! how can done? why not try opening file ? fs.open('yourfile', 'a', function (err, fd) { ... }) anyway after minute search try : var path = require('path'); path.exists('foo.txt', function(exists) { if (exists) { // } }); // or if (path.existssync('foo.txt')) { // } for node.js v0.12.x , higher both path.exists , fs.exists have been deprecated using fs.stat: fs.stat('foo.txt', function(err, stat) { if(err == null) { console.log('file exists'); } else if(err.code == 'enoent') { // file not exist fs.writefile('log.txt', 'some log\n'); } else { console.log('some other error: ', err.code); } });

php - How do I use regex with vQmod? -

once again, stuck regex , don't know start. i using vqmod build opencart extension , want able search files have code: if (file_exists(dir_template . $this->config->get('config_template') the problem is, code above has more code in line in each file. there regex function lets me search part of line of code vqmod? here have tried far: <search position="before" regex="true"><![cdata[~if \(file_exists\(dir_template . $this->config->get\('config_template'\)~]]></search> thanks, peter to search every catalog controller file (which of these are) use <file name="catalog/controller/*/*.php"> if want search regex, use regex="true" , place regex in cdata tags <search position="before|after|replace" regex="true"><![cdata[~regex-here-including-delimiters~]]></search>

c - I am unable to compile a program which has assembly language instructions -

i compiled c program (which has assembly language instructions) this. tcc -emasm.exe protect.c it gives error unable execute masm.exe . should or can find masm.exe ? you need microsoft assembly compiler, called masm.

Excel VBA timestamp and username -

the code below detects data when inputted column , automatically inserts current user cell right. code add timestamp well. need log user name , time. suggestions? private sub worksheet_change(byval target excel.range) dim rcell range dim rchange range on error goto errhandler set rchange = intersect(target, range("a:a")) if not rchange nothing application.enableevents = false each rcell in rchange if rcell > "" rcell.offset(0, 1) .value = username() end else rcell.offset(0, 1).clear end if next end if exithandler: set rcell = nothing set rchange = nothing application.enableevents = true exit sub errhandler: msgbox err.description resume exithandler end sub public function username() username = environ$("username") end function you use date & " ...

android - How to structure this DB in SQLite? -

i creating form saves input in sqlite database in android. first part relatively simple , common database rows (name, age, occupation, etc.). the last part, however, depends on user's choice. example: if user chooses hobby hiking, form display unique questions unique table entries. if chooses hobby gardening, there different table entries , on. how can achieved in best way? suspect has other tables , foreign keys, can point me in right direction? a simple key value set of tables may easy solution: selected topic | associated question key question key | question # | question this 2 table structure allow based off of selected topic , questions topic. depending on how survey structured, database schema need change (for example multiple different paths, fixed # questions, etc). basic outline should provide basis dynamic form

android - force close bitmap exceeds 32 bits -

first im make app mini 2 , runing when try runing in wonder why got half of screen?, got value of width wonder 420? windowmanager wm = (windowmanager) getapplicationcontext().getsystemservice(context.window_service); // results higher using activity context object or getwindowmanager() shortcut wm.getdefaultdisplay().getmetrics(displaymetrics); wm.getdefaultdisplay().getmetrics(displaymetrics); lebar = displaymetrics.widthpixels; and when trying use lebar = (int) displaymetrics.widthpixels * displaymetrics.densitydpi; i got force close 07-17 22:28:26.994: e/androidruntime(3936): fatal exception: main 07-17 22:28:26.994: e/androidruntime(3936): java.lang.illegalargumentexception: bitmap size exceeds 32bits 07-17 22:28:26.994: e/androidruntime(3936): @ android.graphics.bitmap.nativecreate(native method) 07-17 22:28:26.994: e/androidruntime(3936): @ android.graphics.bitmap.createbitmap(bitmap.java:691) 07-17 22:28:26.994: e/androidruntime(3936): @...

java - How to scale image using getScaledImage? -

this have tried scale image using getscaledinstance(). not scaling image. can correct code? bufferedimage image = imageio.read(new file("img.jpg")); jlabel piclabel = new jlabel(new imageicon(image)); image=(bufferedimage)image.getscaledinstance(50,50, image. scale_smooth); add(piclabel); creating new image not update imageicon. change order of code: //bufferedimage image = imageio.read(new file("img.jpg")); //jlabel piclabel = new jlabel(new imageicon(image)); image image = imageio.read(new file("img.jpg")); image=image.getscaledinstance(50,50, image. scale_smooth); jlabel piclabel = new jlabel(new imageicon(image)); add(piclabel); edit: original code posted doesn't execute. can't cast scaled image bufferedimage. updated code solve execution problem.

c# - TableLayoutPanel with Horizontal Scrollbar and Child Layout Behavior Unexplained -

Image
i seeing weird behavior in tablelayoutpanel trying use vertically stacked panel (no horizontal scroll bar, vertical). i have setup here tablelayoutpanel docked right of form. removed row , column styles created default. column style size type percent (100%). row style size types autosize. i've set autoscroll true, , cellborderstyle single because issue happens when property set. here relevant code buttons: private void button1_click(system.object sender, system.eventargs e) { panel p = new panel(); p.dock = dockstyle.fill; p.borderstyle = borderstyle.fixedsingle; this.tablelayoutpanel1.controls.add(p); } private void button2_click(system.object sender, system.eventargs e) { { this.tablelayoutpanel1.performlayout(); } while (this.tablelayoutpanel1.horizontalscroll.visible); } and here pictures explaining issue. picture 1 - i've clicked button1 once, adding single docked panel tablelayoutpanel. picture 2 - i've clicke...

drupal - jQuery cloned div not reacting on hover function -

i working cms, not have full control on displayed in manner, decided clone container, using code below. clone gets created expected, can see in script (first rows) want have hover effect on it. on original works expected, cloned section not react on hover function, why this? how around it? <script> $(document).ready(function(){ $("section.block-bookoblock").hover(function(){ $(".block-bookoblock ul.menu").css("display","block"); },function(){ $(".block-bookoblock ul.menu").css("display","none"); }); document.oncontextmenu = function() {return false;}; $('#page:not(#newid)').mousedown(function(e){ if( e.button == 2 ) { if ($('#newid').length) { $('#newid').css({ "display": 'block'}); $('#newid').css({ "top": e.pagey +'px'}); $('#newid').css({ "left": e.pagex +'px'}); ...

tornado - MongoDB Order by two columns -

does know how can sort tables 2 values? for example : i have stats collections has columns "_id", "title", "link", "stats", "range". "stats" column consist values ['duration','pace', 'distance'], "range" column consist velues 0-10 km, 20-20 min on depend of stats values. i'd order stats , after range . this link in link above i've sorted stats , want sort range each value of stats! my current code : guides = yield gen.task(guides.objects.find, query={}, limit=20, sort={'stats': 1}) to order documents more 1 field, need compound sort statement , ideally compound index backing it. for compound indexes in mongodb see: http://docs.mongodb.org/manual/tutorial/create-a-compound-index/ your sort like: guides = yield gen.task(guides.objects.find, query={}, limit=20, sort={'stats': 1, 'ran...

css - Hide first <li> element -

my html structure per following: <nav class="main-nav"> <ul> <li class="gallery-collection"> <a href="/">welcome</a> <!-- hide --> </li> <li class="page-collection"> <a href="/about/">about</a> </li> <li class="gallery-collection"> <a href="/support/">support</a> </li> ... how hide first element saying "welcome" using css? note 2 elements have same class here: 'gallery-collection'. max compatibility: .main-nav li { display: none; } .main-nav li + li { display: list-item; } less compatibility, not bad: .main-nav ul li:first-child { display: none; }

wpf - Context menu should appear only on TreeView child nodes -

i have treeview contextmenu on treeviewitems. when right click on treeviewitems, contextmenu appears quite nicely. dont want contextmenu appear on parent items. should appear on child nodes. have 1 hirarchy in treeview i.e. n parents have m children on same level. xaml treeview , contextmenu <treeview margin="2,0,0,0" itemssource="{binding sourcedata}" width="390"> <treeview.itemcontainerstyle > <style targettype="{x:type treeviewitem}"> <setter property="isselected" value="{binding datacontext.isselected, mode=twoway, relativesource={relativesource self}}" /> <setter property="contextmenu"> <setter.value> <contextmenu name="contextmenu" datacontext="{binding placementtarget.datacontext, relativesource={relativesource self}}...

php - `While` Not showing echo -

i'm having trouble getting echo showing up. think there problem while table in mysql should work normally. code <?php $sql = $db->prepare('select topic_id, topic_subject topics topics.topic_id = :topid'); $sql->bindparam(':topid', $_get['id'], pdo::param_int); $sql->execute(); $result = $sql->rowcount(); if($result === false){ echo 'the topic not displayed, please try again later.'; } elseif(count($result) === 0){ echo 'this topic doesn&prime;t exist.'; } else { while($row = $sql->fetch()) { //display post data echo '<table class="topic" border="1"> <tr> <th colspan="2">' . $row['topic_subject'] . '</th> ...

Getting Checkbox value in php when page loads/opens -

how of php diplsy/show value/values of selected (checked) checkboxes. <input type="checkbox" value="3" name="categorybox[]" checked onclick="clickoncategorybox($(this));"> <input type="checkbox" value="4" name="categorybox[]" onclick="clickoncategorybox($(this));"> the page loads 1 or more checkboxes selected. need echo values of selected checkboxes. know how make jquery. wander if possible php. ps: page loads checked checkbox . php sending html client. the checkbox checked because html says should checked via checked attribute. build logic php echo values code determines if checked attribute should set or not.

c++ - Algorithm for a geodesic sphere -

i have make sphere out of smaller uniformely distributed balls. think optimal way build triangle-based geodesic sphere , use vertices middle points of balls. fail write algorithm generating vertices. answer in c++ or pseudo-code better. example of geodesic sphere: http://i.stack.imgur.com/inqfp.png using link @muckle_ewe gave me, able code following algorithm: outside main() class vector3d { // pretty standard vector class public: double x, y, z; ... } void subdivide(const vector3d &v1, const vector3d &v2, const vector3d &v3, vector<vector3d> &sphere_points, const unsigned int depth) { if(depth == 0) { sphere_points.push_back(v1); sphere_points.push_back(v2); sphere_points.push_back(v3); return; } const vector3d v12 = (v1 + v2).norm(); const vector3d v23 = (v2 + v3).norm(); const vector3d v31 = (v3 + v1).norm(); subdivide(v1, v12, v31, sphere_points, depth - 1); subdivide(v2, v2...

maven - Autowiring classes from external jar with Spring -

i'm trying build standalone application (not running inside application server) spring , i'm facing following problem : my standalone application (spring enabled) depending on project (bundled jar) contains lot of services in com.application.service (annotated @service ). there no spring related configuration in external project , standalone application context simple, contains : <context:component-scan base-package="com.application" /> here example of class depends on service can't acquired : @service public class standaloneservice { @autowired private someservice someservice; // ... } standaloneservice contained in standalone application while someservice in external jar. the error : caused by: org.springframework.beans.factory.nosuchbeandefinitionexception: no qualifying bean of type [com.application.someservice] found dependency: expected @ least 1 bean qualifies autowire candidate dependency. dependency annotations: ...

Update feature object's state using Rally PHP -

i'm trying update feature's state using rally php. thought code work : connection::rally()->update('state', '7177179173', array('name' => 'in backlog')); but giving me "not authorized" error : fatal error: uncaught exception 'rallyapierror' message 'not authorized update: state 7177179173' can please me this? thanks! i able figure out. every state has different object id; "in backlog" has object id of : 7177179173. this line of code trick: connection::rally()->update('feature', '12848970281', array('state' => '7177179173')); what means: update state of feature (that has object id of 12848970281) "in backlog" (that has object id of 7177179173)

Java, Webservices: do I need Tomcat/GlassFish or any other server to run a simple "web service" -

i've been looking @ few tutorial on how create webservice , of them using in "web service" side glassfish or tomcat, wondering if essential since run small "web service" in backbround of remote server, server os windows server. thanks luther. as name suggest, web service services exposed , available on web interface. tomcat/glassfish web containers or web servers hosts such services. don't need containers write services code need them deploy web services.

migration - What replaces Java's sun.security packages? -

this question has been asked on oracle forum as, "how replace sun.security packages??" ( https://forums.oracle.com/thread/2560664 ), has not yet received response. we have application makes use of: import sun.security.provider.x509factory; import sun.security.x509.algorithmid; import sun.security.x509.x509certinfo; import sun.security.x509.x509certimpl; import sun.security.x509.certificatealgorithmid; import sun.security.x509.certificatevalidity; import sun.security.x509.certificateserialnumber; import sun.security.x509.certificatesubjectname; import sun.security.x509.certificateissuername; import sun.security.x509.certificatex509key; import sun.security.x509.certificateversion; all of these produce compile time messages containing: "... internal proprietary api , may removed in future release" there java , javax security packages, seem not contain equivalents sun.security.x509 & etc.. ...

java - Play several mp3 files with Jlayer -

i wrote app play mp3 files , have controls , rolling, problem each mp3 file played individually , have trigger play of new file. i want know how can tell (pro grammatically) if player has finished playing file, can move on next one? this thread code @override public void run() { try { system.out.println(filename); fileinputstream fis = new fileinputstream(filename); bufferedinputstream bis = new bufferedinputstream(fis); player = new player(bis); player.play(); } catch (exception e) { system.out.println("problem playing file " + filename); system.out.println(e); } } if not wrong looking for: player.iscomplete() ===> in context of jlayer api while (!player.iscomplete()) { // // } there go: http://www.javazoom.net/javalayer/docs/docs1.0/javazoom/jl/player/player.html#iscomplete%28%29 hope helps.

c# - Instantiating Classes from a Collection of Types -

alright, going take explanation, here goes: i'm making finite state machine video game states objects derive state base class. since states objects, each has instantiated before becomes current state. each state can have sub-states (which still derive state) can entered , i'm having problem. need able store collection of types of each sub-state. concrete example, here how i'm envisioning working (i realize there bad practices in code, example of goal, not code intend use directly): public abstract class state { private type[] substates = new type[0]; private state currentstate; public gotosubstate<t> () t : state, new() { if ( substates.contains(t) ) { currentstate = new t(); } } //... } public class stateone : state { public stateone () { substates = new[] { typeof(substatea), typeof(substateb) }; } //... } public class substatea { //... } public class substateb { ...

xaml - WPF what determines whether scrollviewer and stackpanel give infinite size to a child as opposed to a set size? -

during measure, i'm still confused because results in stackpanel's child (signalgraph) being given (292,infinity) availablesize in measure: <window x:class="paneltesting.window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:wpfexp="clr-namespace:wpfexperimental" title="window1" height="300" width="300"> <stackpanel > <wpfexp:signalgraph/> </stackpanel> </window> while canvas of set size child given (infinity, infinity) available size. assume has interaction window, i'm confused going on. <canvas width="100" height="100"> <stackpanel sizechanged="scrollviewer_sizechanged" > <wpfexp:signalgraph/> </stackpanel> </canvas> the same thing occurs when scrollviewer used. wanted ...

Connecting to Gmail from Python -

i've been trying connect gmail account using python. imap enabled. import imaplib imap_server = imaplib.imap4_ssl("imap.gmail.com",993) # tried imap_server = imaplib.imap4_ssl("imap.gmail.com"), doesnt work. traceback : traceback (most recent call last): file "<pyshell#2>", line 1, in <module> imap_server = imaplib.imap4_ssl("imap.gmail.com",993) file "/library/frameworks/python.framework/versions/3.3/lib/python3.3/imaplib.py", line 1202, in __init__ imap4.__init__(self, host, port) file "/library/frameworks/python.framework/versions/3.3/lib/python3.3/imaplib.py", line 172, in __init__ self.open(host, port) file "/library/frameworks/python.framework/versions/3.3/lib/python3.3/imaplib.py", line 1217, in open imap4.open(self, host, port) file "/library/frameworks/python.framework/versions/3.3/lib/python3.3/imaplib.py", line 248, in open self.sock = se...

jquery - sort object then subsort further - javascript -

okay have object created this: object = {}; object.set_1.date = <date object or unix time stamp> object.set_1.day = "sunday"; object.set_1.total = 12; object.set_2.date = <date object or unix time stamp> object.set_2.day = "sunday"; object.set_2.total = 19; object.set_3.date = <date object or unix time stamp> object.set_3.day = "monday"; object.set_3.total = 15; and fourth. is there way sort these objects day, , sort each day total? i'm sure theres multiple different ways achieve this. 1 this? best way it?. let's take more in-depth @ @yuriygalanter said. let's begin little restructuring: new structure modify old object 9 properties array containing 3 objects 3 properties: objarray = [ { "date": <date object or unix time stamp>, "day": "sunday", "total": 12 }, { "date": <date object or unix time s...

javascript - input propertyChange not working with jQuery datepicker -

i using jquery ui datepicker widget , have script supposed act on inputs when values change. binds 'input propertychange' inputs , 'change' selects. the problem datepicker widgets gets event when user manually types datepicker's text box. if use ui calendar pick date it, input's value indeed change event never fires! then noticed apply 'onselect' option datepicker not seemt o work existing datepicker, so: if (input.hasclass('hasdatepicker')) { input.datepicker({ onselect : function (datetxt, element) { alert('updated '+datetxt); } }); } the alert never comes, guess because expects apply onselect when widget created. but trying create universal script attaches pages required need loosely coupled. way datepicker seems funciton rigid , not lend being flexible. tried adding e...

.htaccess - How to redirect all pages only to index.html using htaccess file and not redirect the image files -

how redirect pages (pages only) index.html using htaccess file , not redirect image files. reason using code , image file on index.html page isn't showing up. rewriteengine on rewritecond %{request_uri} !^/index.html$ rewriterule .* /index.html [l,r=302] try code : rewriteengine on rewritecond %{request_uri} !^/index.html$ rewritecond %{request_uri} !\.(gif|jpe?g|png|css|js)$ rewriterule .* /index.html [l,r=302]

proguard - Android: obfuscating resources in HelloWorld -

even though proguard-project.txt contains lines -adaptresourcefilenames **.png -adaptresourcefilecontents **.xml and though proguard.config uncommented in project.properties (as mentioned in file), running ant release on eclipse's default helloworld project still shows within bin/mainactivity-release.apk lines -rw-rw-rw- 9193 17-jul-2013 14:26:44 res/drawable-hdpi/ic_launcher.png -rw-rw-rw- 5057 17-jul-2013 14:26:44 res/drawable-mdpi/ic_launcher.png -rw-rw-rw- 14068 17-jul-2013 14:26:44 res/drawable-xhdpi/ic_launcher.png in other words, name of png icons not obfuscated. what missing? i not concerned proguard handling png filenames correctly, fact not working reduces confidence resulting classes.dex in apk has been obfuscated. proguard can handle resources files in following ways: rename them follow obfuscated names of corresponding class files (-adaptresourcefilenames), update obfuscated class names in text files (-adap...

Getting "KeyNotFoundException" and "Can not find view for" when trying to start MvvmCross App in Xamarin -

trying follow slodges n-22 tutorial , when trying run app getting keynotfoundexcpetion , message stating "can not find view for...." when try call .start() method. can not find assemblies viewmodels in them? i'm guessing because key not found generic list/dictionary did not filled viewmodels?

python - List comprehension for turning a lists of lists of strings into a list of lists of ints and float -

i have list of lists. sublists each contain 3 strings. bins = [['1', '2', '3.5'], ['4', '5', '6.0']] i need convert lists of lists each sublist consists of 2 integers , float. thinking of list comprehension along lines of: [ [int(start), int(stop), float(value)] bn in bins [start, stop, value] in bn] you're close: [[int(start), int(stop), float(value)] start, stop, value in bins] you don't need bn variable hold each bin or loop iterate through contents; each bin can unpacked directly 3 variables.

Python logging: Per-file/module logger -

i have python code need add logging to. i've preferred nice big c macro looking statements "debug()", "error()", etc logging. feel makes code easier read (no objects) when trace-points visually differentiable actual code. i able set logging levels @ per-module level. how make module called "log" capable of doing (while making use of python std library logging module)? e.g.: file: main.py # imports log_module_name, debug, warn, etc log import * import my_module log_module_name("main") log.set_level("main", log.lvl_debug) log.set_level("my_module", log.lvl_warn) if __name__ == "__main__": foo = my_module.myfunc(2) debug("exiting main.py") file: my_module.py from log import * log_module_name("my_module") def myfunc(x): debug("entering function") if x != 1: warn("i thought 1") debug("exiting function") return x+1...

java - Json : Content Parsing error -

i have json file this [ { "topic": "example1", "ref": { "1": "example topic", "2": "topic" }, "contact": [ { "ref": [ 1 ], "corresponding": true, "name": "xyz" }, { "ref": [ 1 ], "name": "zxy" }, { "ref": [ 1 ], "name": "abc" }, { "ref": [ 1, 2 ], "name":"bca" } ] , "type": "...

regex - How can I isolate specific string patterns from this body of text -

Image
i have following file: 2013-07-17_19-12-42.dcrec how can search , isolate following string pattern in file: new name client 0, keyid = 000000, ip = 000.000.000.000 : somename the client # number, keyid numerical value (there not set length client # or keyid), ip normal ipv4 address , somename username (the username can include special characters such #, ^, @, spaces, etc). looks string 'closed' '^bvs'. here example of 2 of strings (see screenshots) there can number of these strings in each file(s). if search , list instances of these strings in file(s) great. im not grep, etc @ moment or else able on own. appreciated, thanks! $> strings 2013-07-17_19-12-42.dcrec | grep -o -p "new name client [0-9]+, keyid = [0-9]+, ip = [0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3} : [^\ ]+" new name client 7, keyid = 562830, ip = 91.193.208.105 : sobieski new name client 8, keyid = 255344, ip = 63.153.210.124 : cultist ne...

php - Need help about joining tables -

i have mysql database , i'm trying create web interface manage tickets, right i'm trying list tickets so: [title][name of person created ticket][priority][date created][peoples in charge of ticket] so have table named tickets title, id of person created ticket, priority, date. i have table named users can find first , last name , other informations id (you can link 2 tables id) i have table named tickets_users can find id of peoples in charge of tickets my problem don't know how link of in 1 request, simple if 1 people in charge of ticket there can multiple persons, tried queries tickets titles etc in double when there more 1 people in charge of ticket. thanks in advance edit example of tables: tickets: -id = 523 | title = internet explorer | priority = 3 | date = 2013-10-10 11:20:51 users: -id = 25 | firstname = john | lastname = light -id = 35 | firstname = dwight | lastname = night -id = 53 | firstname = maria | lastname = sun tickets_users :...

ruby on rails - How to not require application.css.scss twice? -

Image
just got done basic styling app. using twitter bootstrap.... app deployed heroku , working bootstrap styling updates getting error: actionview::template::error (/app/app/assets/stylesheets/application.css has been required): anyone have ideas be. have been fussing around couple hours now. have tried bunch of stuff. of mentioned here: why actionview::template::error when trying upload app heroku? 2013-07-17t15:12:26.494137+00:00 app[web.1]: started "/" 71.203.124.202 @ 2013-07-17 15:12:26 +0000 2013-07-17t15:12:27.403656+00:00 app[web.1]: 4: %title 2013-07-17t15:12:27.403656+00:00 app[web.1]: 2013-07-17t15:12:27.403656+00:00 app[web.1]: actionview::template::error (/app/app/assets/stylesheets/application.css has been required): 2013-07-17t15:12:27.403656+00:00 app[web.1]: 3: %head 2013-07-17t15:12:27.403656+00:00 app[web.1]: 5: current lines , analysis 2013-07-17t15:12:27.403656+00:00 app[web.1]: 6: = s...

ios - Get and update plist value -

i created plist titled "appdata.plist" in supporting files section of xcode. have key called "keyone" , trying value of it. i'm trying log value console nslog not working. how do this? i've searched google , there lot of way none work me. nsstring *myfile = [[nsbundle mainbundle] pathforresource: @"appdata" oftype: @"plist"]; nsdictionary *mydict = [nsdictionary dictionarywithcontentsoffile:myfile]; nsstring *viewcover = [[nsbundle mainbundle] objectforinfodictionarykey:@"keyone"]; this i've tried whole thing ends in errors, can't log , 'unusable variable' error. the objectforinfodictionarykey method retrieves value app's info.plist file, isn't want -- want retreive dictionary mydict . mentioned value boolean, replace last line with bool viewcover = [[mydict objectforkey:@"keyone"] boolvalue];

Python CSV - Need to sum up values in a column grouped by value in another column -

i have data in csv needs parsed. looks like: date, name, subject, sid, mark 2/2/2013, andy cole, history, 216351, 98 2/2/2013, andy cole, maths, 216351, 87 2/2/2013, andy cole, science, 217387, 21 2/2/2013, bryan carr, maths, 216757, 89 2/2/2013, carl jon, botany, 218382, 78 2/2/2013, bryan carr, biology, 216757, 27 i need have sid key , sum values in mark column using key. output like: sid mark 216351 185 217387 21 216757 116 218382 78 i not have write output on file. need when execute python file. similar question . how should changed skip columns in between? this concept of histogram. use defaultdict(int) collections , iterate through rows. use 'sid' value key dict , add 'mark' value current value. the defaultdict of type int makes sure if key not existing far value becomes initialized 0. from collections import defaultdict d = defaultdict(int) open("data.txt") f: line in f: tokens = [t.strip() t in line.s...

symfony - Install the DoctrineMongoDBBundle with Composer -

i have been trying install doctrinemongodbbundle symfony2. followed reference http://symfony.com/doc/current/bundles/doctrinemongodbbundle/index.html unfortunately getting following error , not find solution. have added php extension mongodb. please give idea ? doctrine/mongodb 1.0.3 requires ext-mongo >=1.2.12,<1.5-dev -> request ed php extension mongo has wrong version (1.2.11) installed. doctrine/mongodb 1.0.2 requires ext-mongo >=1.2.12,<1.4-dev -> request ed php extension mongo has wrong version (1.2.11) installed. doctrine/mongodb 1.0.1 requires ext-mongo >=1.2.12,<1.4-dev -> request ed php extension mongo has wrong version (1.2.11) installed. doctrine/mongodb 1.0.0 requires ext-mongo >=1.2.12,<1.4-dev -> request ed php extension mongo has wrong version (1.2.11) installed. doctrine/mongodb-odm 1.0.0-beta5 requires doctrine/mongodb 1.0.0-beta1 -> no matching package found. you have update php mongodb extension versio...

yii - How can I make a tooltip link to another page? -

in data gridview, able put tooltip ( http://yiibooster.clevertech.biz/javascript.html#tooltips ) using headerhtmloptions , data database. my problem can't find way put link in tooltip. example, "this tooltip. see more.." if 'see more..' clicked should go page. thanks. try changes of script! array( 'header'=>'video url', 'name' => 'video_url', //'value' => 'chtml::link($data->title,$data->video_url, array("target"=>"_blank"))', 'value' => 'chtml::link("view video", $data->video_url, array("target"=>"_blank"))', 'type' => 'raw', ), perhaps missing target_blank

easyphp - Where is "${path}/tmp" pointing in php.ini -

my phpmyadmin on usb drive (i'm using easyphp wamp ) giving following: phpmyadmin - error cannot start session without errors, please check errors given in php and/or webserver log file , configure php installation properly. following cannot start session without errors in phpmyadmin i have cleared browser cache, still not working. want check session.save_path points to. in php.ini see session.save_path = "${path}/tmp" i have wamp on usb key named f:. above in context mean f:/tmp ?

Photoshop CS6 Export Nested Layers to PNG? -

i have psd contains 100s of layers. grouped individual elements within groups (nested). how export png individual groups (with nested layers inside of them)? i don't want run export layers png script, need export individual nested groups (layers) png. i've found few other 3rd party scripts, export everything. need export ones i've selected. thanks in advance this script should want. works when have group want selected (not layer within group) i've not extensively tested , i'm assuming don't have groups within groups (which becomes headache) // export png group srcdoc = app.activedocument; var alllayers = new array(); var selectedlayer = srcdoc.activelayer; var thelayers = collectalllayers(app.activedocument, 0); var groupname = ""; // function collect layers function collectalllayers (theparent, level) { (var m = theparent.layers.length - 1; m >= 0; m--) { var thelayer = theparent.layers[m]; // apply function layer...

javascript - JQuery SlideToggle works locally but not on web server -

i built simple web app scrapes html off table , creates 2 divs each table row: 1 contains name of item, next contains bunch of details. grab content ajax, build out divs. im trying use slidetoggle() toggle details div when name div clicked on. works locally, when deploy sever toggle doesn't want work. here's how i'm building divs (which works both locally , on server: var beerdiv = '<div class="beer"> \ <text class="beername">' + values[4] + '</text> \ </div>'; var beerdetailsdiv = '<div class="beerdetails"> \ <div class="smalldetailblockone"> \ <text class="detaillabel">price:&nbsp;</text> \ <text class="value...

Meteor Autorun() not running when accessing collection.property -

something strange going on; when run following code, works: deps.autorun(function() { var room = rooms.findone({'room_id':session.get('room_id')}); // var p = room.room_id; console.log('autorun'); } however, if uncomment var p line, (the whole block) stops running. what's happening? found in depths of meteor.js documentation: "if initial run of autorun throws exception, computation automatically stopped , won't rerun." on first run of autorun, when page loaded, database hasn't been loaded throws exception when try access room.room_id , , autorun stops running again. fixed adding: if (room) { console.log(room.room_id); ... }

ruby on rails - ActionController::UnknownFormat when sending plain text -

i'm riding rail4 , trying send plain text down request: def get_text respond_to |format| format.text { render :text => "huh" } end end but end actioncontroller::unknownformat have frustrating discovered rails' funny way of saying 406 not acceptable. what going on here? it expecting format json , xml have given text not format. def get_text render :text => "huh" end you can send text this.

How to set value in registry via batch file in Windows? -

i going set value windows registry. want set variable shit stupidms in registry, result wrong. following code. set stupidms=shit echo %stupidms% reg add "hkey_current_user\software\microsoft\windows\currentversion\run" /v "stupidms" /t reg_sz /d ^%stupidms^% i think problem ^%stupidms^% , quite have no idea how correct it. reg add "hkey_current_user\software\microsoft\windows\currentversion\run" /v "stupidms" /t reg_sz /d "%stupidms%"

api - How to Show Map Scale Bar on android v2 map -

i working google api v2 map android, cannot show scale bar on it. please me, there can show scale bar on map? looking it, doesn't help. google removed in v2. removed maps app added lately, don't know when gonna provide developers.

jquery - Javascript multiple class each function get selected class name -

<div class="myclass effect1">bla bla</div> <div class="myclass effect2">bla bla</div> <div class="myclass effect3">bla bla</div> <div class="myclass effect4">bla bla</div> jquery('.effect1, .effect2, .effect3, effect4').each( function() { //i need find class chosen?? var newclass= chosen class here here jquery(this).addclass('animated'); } ); i've added information inside code above. how can make work? in advance within iterator function, this matching dom element. element has classname property space-delimited list of classes on element. there may more one, unless know in markup there one. if one, use this.classname directly. var newclass = this.classname; if more one, may find jquery's hasclass function useful: var $this = $(this); if ($this.hasclass(...

mysql - OpenFire integrating external database -

hi having trouble integrating exsisting openfire installtion existing db. i have 2 database namely (for example purposes) db_mainsite db_openfire inside db_mainsite have table called tbl_user there lies 2 columns namely gw_userunique , gw_password (varchar 255, using sha-1 hashing algo). both database lies within same machine (server) having same physical location. in conf/openfire.xml have set following lines <jive> ... <jdbcprovider> <driver>com.mysql.jdbc.driver</driver> <connectionstring>jdbc:mysql://localhost/db_mainsite?user=username&amp;password=secret</connectionstring> </jdbcprovider> <provider> <auth> <classname>org.jivesoftware.openfire.auth.jdbcauthprovider</classname> </auth> </provider> <jdbcauthprovider> <passwordsql>select password tbl_user gw_userunique=?</passwordsql> <passwordtype>sha1</passwordtype...

c++ - Visual Studio unable to find header file during compile despite include directory have been specified -

after adding include directory of library using. visual studio 2010 able find header files #included source code (intellisense not show errors). when building solution, tells me wasn't able find header file. same property used in previous project not post issue. the solution have use direct address header files library, find irritating so, header files of library cross reference each other , not make sense edit of them. does have idea causing problem? intellisense uses different algorithm when searching include files compared compiler & linker. in particular, can (sometimes) find header files though include directories not specified. i'll assume specified include directories correctly. an idea: there's bug in visual studio 2010 if specify rooted path (ex. \myproject\includes ), when building solution, vs uses drive installed (usually c:) rather drive solution located. if case, you'll have either specify drive (ex. d:\myproject\includes ) or use ...

c# - Button Enablity WPF -

i have usercontrol in have datadrid , in datagrid have 2 comboboxes . want when select item both comboboxes button outside datagrid should enabled. my datagrid bind itemsource comboboxes. i tries use mulidatatriggers failed button outside datagrid comboboxes not available it. <datagrid> <datagrid.columns> <datagridtemplatecolumn width="auto"> <datagridtemplatecolumn.celltemplate> <datatemplate> <combobox name="combo1" itemssource="{binding lst1,mode=twoway,updatesourcetrigger=propertychanged}" displaymemberpath="code1" selectedvalue="{binding codeid1,mode=twoway,updatesourcetrigger=propertychanged}"> <combobox name="combo2" itemssource="{binding lst2,mode=twoway,updatesourcetrigger=propertychanged}" displaymemberpath="code2" selectedvalue="{binding codeid2,mode=twoway,updatesourc...

bash - GCC, what does -&& mean on the command line? -

i execute command this echo 'int main(){printf("%lu\n",sizeof(void));}' | gcc -xc -w -&& ./a.out and can result :1. can not find out -&& means,even after search man page , google!.and try execute without -&& option.it error this: ./a.out:1: error: stray ‘\317’ in program ./a.out:1: error: stray ‘\372’ in program ./a.out:1: error: stray ‘\355’ in program ./a.out:1: error: stray ‘\376’ in program ./a.out:1: error: stray ‘\7’ in program ./a.out:1: error: stray ‘\1’ in program ./a.out:1: error: stray ‘\3’ in program ./a.out:1: error: stray ‘\200’ in program ./a.out:1: error: stray ‘\2’ in program ./a.out:1: error: stray ‘\16’ in program ./a.out:1: error: expected identifier or ‘(’ before numeric constant ./a.out:1: error: stray ‘\6’ in program ./a.out:1: error: stray ‘\205’ in program ./a.out:1: error: stray ‘\31’ in program ./a.out:1: error: stray ‘\1’ in program ./a.out:1: error: stray ‘\31’ in program ./a.out:1: error: stray ‘\2’ ...

Ios label enables with some time delay -

i keeping 2 labels hidden while loading. when pressed button enabled taking 5 secs time delay in ios. suggestions , sample coding regarding this. hide labels this label.hidden = true; and in btn action write code. - (ibaction)btnpressed { [self performselector:@selector(showlabel) afterdelay:5]; } - (void)showlabel { label.hidden = false; }

memory leaks - Java - Full GC (Garbage Collector) happening a lot in short interval causing performance hit -

i seeing abnormal behavior in our prod environment causing high thread count on server running tomcat. heap size of 10,092,544k divided between new generation , tenure generation 2,752,512k + 7,340,032k = 10,092,544k. i confused why gc running multiple times when there enough memory available on heap (new , old gen both) (full gc [psyounggen: 0k->0k(2752512k)] [paroldgen: 2748534k->2748529k(7340032k)] ) as can see 0k->0k young gen , .27g -> .27g old gen means hardly objects getting gc'd , there of memory available. (heap size 10g). since full gc running multiple times during short interval, causing slow performance , hence application can't handle incoming user requests , hence high threads on server , have restart server come out of situation. can please explain happening here. here output on gc.log. . . more...... . . jul 18 14:52:38 fwprodcontent03 gc.log: 3172.122: [gc [psyounggen: 0k->0k(2752512k)] 2750855k->2750855k(10092544k),...