Posts

Showing posts from April, 2011

c - Stack frame NULL in backtrace log -

c - Stack frame NULL in backtrace log - my application receiving segmentation fault. trace log - program received signal sigsev, segmentation fault. 0x00000000004a5c03 in engine_unlocked_finish () (gdb) bt #0 0x00000000004a5c03 in engine_unlocked_finish () #1 0x00000000004a5d71 in engine_finish () #2 0x000000000046a537 in evp_pkey_free_it () #3 0x000000000046a91b in evp_pkey_free () #4 0x00000000004b231a in pubkey_cb () #5 0x0000000000470c97 in asn1_item_combine_free () #6 0x0000000000750f70 in x509_cinf_seq_tt () #7 0x00000000010f7d90 in ?? () #8 0x00000000010f7cf0 in ?? () #9 0x0000000000000000 in ?? () the stackframe @ #9 interesting. it's address 0x0000000000000000 . mean stack got corrupted before getting engine_unlocked_finish () ? the stackframe @ #9 interesting. not really. what's happening x509_cinf_seq_tt hand-coded assembly, , lacks right unwind descriptors, after in stack trace bogus. in fact, looking @ source, x509_cinf_seq

javascript - Cannot scroll horizontally with iScroll -

javascript - Cannot scroll horizontally with iScroll - i want scroll horizontally inner divs in next html: <div id="outer"> <div id="inner"> <div class="cell"> cell 1 </div> <div class="cell"> cell 2 </div> <div class="cell"> cell 3 </div> </div> </div> im using iscroll this. however, im not able scroll, though scrollstart event triggered seek scroll. jsfiddle here. ideas? you can without using iscroll. in css, alter #outer overflow value "scroll" below #outer{ ... overflow:scroll; } javascript iscroll

c# - How to instantiate object class that contains GameObject? -

c# - How to instantiate object class that contains GameObject? - i attempting instantiate big number of "particles" using c# script in unity. have created particle class contains creation of corresponding gameobject. gameobject within each particle instance sphere. when attempting instantiate new particle (particle p = new particle(...)) unity warning 'new' keyword should not used. "you trying create monobehaviour using 'new' keyword. not allowed. monobehaviours can added using addcomponent(). alternatively, script can inherit scriptableobject or no base of operations class @ unityengine.monobehaviour:.ctor()" what proper way instantiate number of instances of particle class (each containing singular sphere gameobject)? particle class: public class particle : monobehaviour { vector3 position = new vector3(); vector3 velocity = new vector3(); vector3 forcefulness = new vector3(); vector3 gravity = new vector3(0,-9.

Ruby Twitter how to authorize user? -

Ruby Twitter how to authorize user? - i have app must tweet in user's page. using gem twitter i have action must create stuff. def phone call client = set_client client.token client.update!("i'm tweeting @gem!") end this method create client using api def set_client twitter::rest::client.new |config| config.consumer_key = "****" config.consumer_secret = "****" config.access_token = "****" config.access_token_secret = "****" end end if think right need user's access_token , authorize him permissions. in app's setting can token page only. how can realize feature, when i'm getting user's access_token , access_token_secret? to access token , secret user, need finish twitter's 3-legged authorization. gem omniauth-twitter makes process easy, , explained in nice railscasts tutorial assuming have omniauth configured , userscontroller

c++ - QLibrary - import a class -

c++ - QLibrary - import a class - i have qt library , want import in project. now, since want that, when modify library, other project not need compiled again, started using qlibrary. but... can't import class. or better, can import class, can't access methods. this illustration made. this class declaration: class testdll_libshared_export testdll_lib { public: testdll_lib(); int a; int b; int c; int getvalues(); }; and implementation: #include "testdll_lib.h" testdll_lib::testdll_lib() { = 10; b = 20; c = 30; } int testdll_lib::getvalues() { homecoming a+b+c; } extern "c" testdll_libshared_export testdll_lib* create_testdll_lib() { homecoming new testdll_lib(); } while main file, in other project: #include <testdll_lib.h> #include <qdebug> #include <qlibrary> int main(int argc, char *argv[]) { qlibrary library("testdll_lib"); if (library.load())

ios - beginner xcode swift sprite kit - remove sprite by name crash -

ios - beginner xcode swift sprite kit - remove sprite by name crash - i'm trying remove sprites when nail bottom. works if don't check name removes background too. when seek add together name if crashes. func checkifbotsreachbottom() { kid in self.children { if (child.position.y == 0 && child.name == "botone") { self.removechildreninarray([child]) } } } this crashes, if remove child.name part doesn't. self.children returns [anyobject] . if cast [sknode] should fine: func checkifbotsreachbottom(){ kid in self.children [sknode] { if (child.position.y == 0 && child.name == "botone") { self.removechildreninarray([child]) } } } ios xcode swift sprite

c++ - How can I use cin only once? -

c++ - How can I use cin only once? - i want multiple numbers user, in 1 line, , store in vector. how doing it: vector<int> numbers; int x; while (cin >> x) numbers.push_back(x); however, after entering numbers , pressing enter, so: 1 2 3 4 5 it puts numbers in vector, , awaits more input, meaning have come in ctrl+z exit loop. how automatically exit loop after getting 1 line of integers, don't have come in ctrl+z ? the simplest way accomplish using string stream : #include <sstream> //.... std::string str; std::getline( std::cin, str ); // entire line string std::istringstream ss(str); while ( ss >> x ) // grab integers numbers.push_back(x); to validate input, after loop can do: if( !ss.eof() ) { // invalid input, throw exception, etc } c++

sockets - what is parameter level in getsockopt? -

sockets - what is parameter level in getsockopt? - luckily got link here [sol_socket in getsockopt() but confusing me. one replied "sol_socket" socket layer? what socket layer? is there other options available parameter? what happens if pass parameter sol_socket , sol stands for? i using unix. "socket layers" refers socket abstraction of operative system. options can set independently of type of socket handling. in practice, may interested in tcp/ip sockets, there udp/ip sockets, unix domain sockets, , others. options related sol_socket can applied of them. the list provided in reply of other question has of them; in manual page of sockets there more, under "socket options" section. sol_socket constant "protocol number" associated level. other protocols or levels, can utilize getprotoent obtain protocol number name, or check manual of protocol - example, in manual page of ip described constants protocol numbers of i

java - How do I obtain a Structure.ByReference from a Structure using JNA? -

java - How do I obtain a Structure.ByReference from a Structure using JNA? - i have object of construction in java code. jar generated using jnaerator expects structure.byreference info type. there method in jna or code snippet convert construction object structure.byreference object? generally, don't need explicitly specify structure.byreference when passing parameters. if it's parameter, can drop .byreference signature , it'll work fine. if it's field within structure, jna interprets structure value, in case would need provide .byreference explicitly. this 1 way it. class mystructure extends construction { class byreference extends mystructure implements structure.byreference { public byreference() { } public byreference(pointer p) { super(p); read(); } } public mystructure() { } public mystructure(pointer p) { super(p); read(); } } mystructure s; // ... mystructure.byreference ref = new mystructure.byrefer

arrays - Getting wrong result from database - Wrong counting for a specific field in records using PHP -

arrays - Getting wrong result from database - Wrong counting for a specific field in records using PHP - i trying count number of word "saturday" that's been stored in database records using php. it's not counting correctly.i have in column 3 records : saturday saturday sunday when print out $row['repeating'] displays records saturday saturday saturday where's counter saturday must 2 , counter sunday one.my counter not working correctly out set got counter saturday 3 , sunday 3. can't spot error. thought appreciate it. thank $numberofwcounters = mysqli_num_rows($result); $dementiacounter1 = 1; // count saturday. $countersaturday=0; // count sunday $countersunday=0; while( $counter <= $numberofwcounters) { if ($row['day'] ='saturday') { $countersaturday++; } if ($row['repeating'] =

.net - Send associated Objects using SoapClient (PHP) -

.net - Send associated Objects using SoapClient (PHP) - i want send object trough soapclient in php. how handle associations correctly? don't know if right format. on wcf side, null person. lets want send person next construction (capitalized complex info types): person --> personid --> name --> age --> gender --> address --> addressid --> street --> city --> country this how have tried far... $soapclient = getsoapclient(); $person = array( 'personid' => 123, 'name' => 'tom' 'age' => 45 'gender' => 'male', 'address' => array( 'addressid' => 424 'street' => 'washington street 2' 'city' => 'washington' 'country' => 'us' ) ); $soapclient->updateperson($person); php .net wcf soap

excel - How correctly to insert an SQL query inside For statement in a Macro? -

excel - How correctly to insert an SQL query inside For statement in a Macro? - i want pass iterations of statements within query in excel macro: for i=1 9 j=1 3 set rs = conn.execute("select * table_a ref1='i' , ref2='j'") ... next j next i error: "error converting info type varchar bigint" on database values of ref1 , ref2 float. how can insert parameters correctly? you have concat values of i , j . for i=1 9 j=1 3 set rs = conn.execute("select * table_a ref1='" & & "' , ref2='" & j & "'") ... next j next sql excel excel-vba

java - How to make a pair of radio buttons in Vaadin 7 to represent True/False values but localized text? -

java - How to make a pair of radio buttons in Vaadin 7 to represent True/False values but localized text? - i want pair of radio buttons in vaadin 7 represent boolean values each value has textual display such "active" , "inactive". optiongroup widget in vaadin 7, radio buttons handled single widget, instance of optiongroup. widget contains multiple items, , if set single item selection mode, display grouping of radio buttons. item id versus item the tricky part me understanding commands such "additem" bit of misnomer. not pass total item instances. rather, pass object id of item. the additem command takes item id, generates item instance , returns you. documented, took while me sink in. might think obligated track returned item. but, no, can utilize item id later retrieve or compare items within optiongroup. since need not track returned items, can phone call additems (plural) command utilize 1 line of code create multiple i

Incorrect syntax near ';' - Works in SQL Server, not from Servicestack.ORMLite -

Incorrect syntax near ';' - Works in SQL Server, not from Servicestack.ORMLite - i executing sql statement through servicestack.ormlite. statement of next format: with rowdata ( select t1.v1, t1.v2 datakey, t2.v1 datavalue t1 left bring together t2 on t2.rowid = t1.rowid ) select * rowdata pivot ( sum(datavalue) datakey in ([1],[2],[3],[4],[5]) )as pivttable this executes correctly in sql server, , in oracle (with few little changes). however, when executing through servicestack.ormlite using 'db.select (sql)' command, next error: incorrect syntax near keyword 'with'. if statement mutual table expression, xmlnamespaces clause or alter tracking context clause, previous statement must terminated semicolon. terminating semicolon returns next error: incorrect syntax near ';' executing every other 'select' statement works fine, not if begins 'with' or else seems. not appear servicestack.ormlite e

PHP error message on init.php -

PHP error message on init.php - i'm using 000webhost.com , uploaded of coding in it. error shows when seek open website: parse error: syntax error, unexpected t_function, expecting ')' in /home/a4350293/public_html/core/init.php on line 25 this line on init.php: spl_autoload_register(function($class) { require_once 'classes/' . $class . '.php'; }); can tell me error is? can't seem find it. thanks, help appreciated. link website: http://educationexperts.host56.com/ i had quick , appears "000webhost.com" runs php 5.2. reference this not because php 5.2 no longer supported. must find web host supports later version of php. preferably 5.4 5.3 has reached it's eol (end of life). php syntax-error

django - How to connect to server with only username and public ssh key? -

django - How to connect to server with only username and public ssh key? - i want utilize batch file connect amazon server using ssh private or public key. i have tried open sftp://user:password@example.com/ -hostkey="ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx" psftp fred@server.example.com in script not able connect server. getting error. disconnected no supported authentication methods available (server sent publickey) i able connect putty. want batch file connect server , restart django project in that. if able connect need go path of django project , run command manage.py runserver ssh -i privatekey.pem username@server.example.com django ssh amazon-ec2 winscp

Creating a bash script to change file names to lower case -

Creating a bash script to change file names to lower case - i trying write bash script convert file names lowercase, have problem because not work 1 case. when have file1 , file1 , , utilize on file1 replace letters file1. #!/bin/bash testfile="" flag="1" file in * testfile=`echo file | tr '[a-z]' '[a-z]'` file2 in * if [ `echo $testfile` = `echo $file2` ] flag="0" fi done if [ $flag = "1" ] mv $file `echo $file | tr '[a-z]' '[a-z]'` fi flag="1" done looks testfile=`echo file | tr '[a-z]' '[a-z]'` should testfile=`echo "$file" | tr '[a-z]' '[a-z]'` re-writing script prepare other minor things #!/bin/bash testfile= flag=1 file in *; testfile=$(tr '[a-z]' '[a-z]' <<< "$file") file2 in *; if [ "$testfile"

c# - Do I need to wait for asynchronous method to complete before disposing HttpClient? -

c# - Do I need to wait for asynchronous method to complete before disposing HttpClient? - i wonder if code works expected (send string web application): using (httpclient httpclient = util.createhttpclient()) { httpclient.postasjsonasync("theurl", somestr); } since postasjsonasync doesn't finish execution immediately, , httpclient disposed when exiting block, request sent properly? or have wait task this: using (httpclient httpclient = util.createhttpclient()) { httpclient.postasjsonasync("theurl", somestr).wait(); } when using asynchronous api of httpclient , recommended await these methods: using (httpclient httpclient = util.createhttpclient()) { await httpclient.postasjsonasync("theurl", somestr); } that way, ensure completion of asynchronous method , create sure httpclient isn't disposed until request sent. if need synchronous api, consider looking @ webclient . c# .net async-await dotnet-

ruby - Stripe Custom Recurring Donations -

ruby - Stripe Custom Recurring Donations - let me tell first stripe working me sinatra. the thing is, recurring payments, have create plans on stripe. have requirement on donations page. works fixed amounts created plans. my question should when user enters amount $54 don't have plans in stripe? create plans on fly each new donation amount? seems little stretched me. there other way around this? the recommended way stripe people have subscription base of operations amount, , hear via webhooks "invoice created" event. can create invoice item adjust amount depending on user's preferred cost. the invoice send client hr after creation have window in can add together invoice items adjust total. it's explained here... https://support.stripe.com/questions/metered-subscription-billing this not ideal nicer have "set , forget" solution, , seems "creating plans on fly" easier way go. ruby sinatra stripe-payments recurrin

split the string into array using regular expression in php -

split the string into array using regular expression in php - i trying split string , place in array using regular expression. string may alter every time need if string match t: need 4774 4848 if string matches both t: , m:, need result as array( [0] => 4774 4848, [1]=>0448 888 899 ) this code, if (preg_match("/[t:|m:|mob:|phone:]\w(.*)[\w:]/mi", "t: 4774 4848 m: 0448 888 899", $matches)) print_r($matches); here output array ( [0] => t: 4774 4848 m: 0448 888 [1] => 4774 4848 m: 0448 888 ) how can split [1] => 4774 4848 m: 0448 888 [1] => 4774 4848, [2]=>0448 888 899 please help me in getting this. in advance! try matching instead of splitting. utilize preg_match_all global match. preg_match_all("/(?:[tm]:|mob:|phone:)\s*\k.*?(?=\s*[a-z]:|$)/mi", "t: 4774 4848 m: 0448 888 899", $matches); print_r($matches); output: array ( [0] => array (

Lucene fields default value in Sitecore 7 -

Lucene fields default value in Sitecore 7 - is there way forcefulness lucene (in sitecore 7) have default value when there no value associated field? i've been trying empty string or null value comparing on field isn't working. want items particular field not have value excluded result set. thanks you can create computed field based on original field. if it's empty, homecoming default value: class="lang-csharp prettyprint-override"> public class nulloremptycomputedfield : icomputedindexfield { public object computefieldvalue(iindexable indexable) { item item = indexable sitecoreindexableitem; if (item == null) homecoming null; // homecoming default value if target field empty if (string.isnullorempty(item["originalfield"])) homecoming "_empty_"; homecoming item["originalfield"]; } public string fieldname { get; set; publ

excel vba - How to check whether data has 2 different types of data within it? -

excel vba - How to check whether data has 2 different types of data within it? - i want take input checkbox, , check it, whether string having first 5 characters "mpost" , next 8 characters numbers (between 00000000 99999999 ), can please help me out on this? the check "mpost" if left(variable,5) = "mpost" ... check numbers if isnumeric(right(variable,8)) .... excel-vba

sql - MySQL - How to group by on two fields and count -

sql - MySQL - How to group by on two fields and count - create table if not exists `usuarios` ( `id` int(11) not null auto_increment, `user1` varchar(255) default null, `user2` varchar(255) default null, primary key (`id`) ) engine=innodb default charset=utf8 auto_increment=1 ; insert `usuarios` (`id`, `user1`, `user2`) values (1, 'pepe', null), (2, 'pepe', 'juan'), (3, 'juan', null), (4, 'juan', null), (5, 'juan', 'pepe'), (6, null, 'pepe'), (7, 'pepe', 'juan'); i need create query: have done this: select `user1`, count(`id`) total usuarios (`user1` not null) grouping `user1` union select `user2`, count(`id`) total usuarios (`user2` not null) grouping `user2` but result is: user1 total juan 3 pepe 3 juan 2 pepe 2 i need remove duplicate names, add together total , result: user1 total juan 5 pepe 5 or, if less code thang...

php - Is addInCondition() method in CDbCriteria "SQL-injection proof"? -

php - Is addInCondition() method in CDbCriteria "SQL-injection proof"? - i wanna utilize cdbcriteira addincondition() multiple input parameters (number not predefined). method compose parametrized query or not? found controversial thoughts on this: yes - "since uses cdbcriteria assume safe" - quote. no also i've looked @ the addincondition() method specification , couldn't clear though. this part of code: $condition=$column.'='.self::param_prefix.self::$paramcount; $this->params[self::param_prefix.self::$paramcount++]=$value; seems storing parametrized values. then in query builder, utilize them numerated parameters. i way in script made myself, uncertainty qian (or whatever) miss , leave code injection. also, did test it? add together random sql , see if gets escaped. php yii sql-parametrized-query yii-cactiverecord

Java io stream closed error -

Java io stream closed error - so took me while prepare errors debug , run programme wrote intro java class. giving me next error after first input. exception in thread "main" java.io.ioexception: stream closed @ sun.nio.cs.streamdecoder.ensureopen(streamdecoder.java:46) @ sun.nio.cs.streamdecoder.read(streamdecoder.java:148) @ java.io.inputstreamreader.read(inputstreamreader.java:184) @ java.io.bufferedreader.fill(bufferedreader.java:161) @ java.io.bufferedreader.readline(bufferedreader.java:324) @ java.io.bufferedreader.readline(bufferedreader.java:389) @ statsdemo.main(statsdemo.java:54) i wrote below println according comments , instructions. not sure wrong. supposed inquire come in file numbers.txt after come in file, gives me error. import java.text.decimalformat; import java.util.scanner; import java.io.*; public class statsdemo { public static void main(string [] args) throws ioexception { double sum = 0; int count = 0;

asp.net - OWIN token authentication 400 Bad Request on OPTIONS from browser -

asp.net - OWIN token authentication 400 Bad Request on OPTIONS from browser - i using token authentication little project based on article: http://bitoftech.net/2014/06/09/angularjs-token-authentication-using-asp-net-web-api-2-owin-asp-net-identity/ everything seems work fine except 1 thing: owin based token authentication doesn't allow options request on /token endpoint. web api returns 400 bad request , whole browser app stops sending post request obtain token. i have cors enabled in application in sample project. below code might relevant: public class startup { public static oauthbearerauthenticationoptions oauthbeareroptions { get; private set; } public void configuration(iappbuilder app) { arearegistration.registerallareas(); unityconfig.registercomponents(); globalconfiguration.configure(webapiconfig.register); filterconfig.registerglobalfilters(globalfilters.filters); route

c# - Table relation with stored procedure and trigger -

c# - Table relation with stored procedure and trigger - to create simple have this: c# form --> tablea (via stored procedure) what trying achieve: c# form --> tablea --> tableb info sent c# form table a. table want send related column table b tablea (profileid) = table b (userid) so, created trigger on stored procedure connected c# form: alter trigger ids on dbo.userprofile insert declare @profileid int select profileid dbo.userprofile insert dbo.users(users.userid) values(@profileid) go but when stored procedure beingness executed c# form, error: invalid column name 'userid'. thanks in advance. as mentioned in comments on question, improve set inserts transaction in stored proc called, if must trigger, should like. note specific name , insert beingness done inserted table. alter trigger userprofile_createuser on dbo.userprofile insert begin insert dbo.users (userid) select

java - waffle custom error page in spring -

java - waffle custom error page in spring - i using waffle 1.7 + spring 4 + spring security 3.2 + thymeleaf. problem is, unable provide custom error page when fall-back form logging fails. configuration: @override protected void configure(httpsecurity http) throws exception { http.authorizerequests() .antmatchers("/**") .authenticated() .and() .exceptionhandling() .authenticationentrypoint(negotiatesecurityfilterentrypoint()) .accessdeniedpage("/access-denied") .and() .addfilterbefore(wafflenegotiatesecurityfilter(), basicauthenticationfilter.class); } when user uses browser snpengo off , enters wrong credentials, default scheme 500 page appears next information: com.sun.jna.platform.win32.win32exception: logon effort failed. waffle.windows.auth.impl.windowsauthproviderimpl.acceptsecu

Find duplicate object values in an array and merge them - JAVASCRIPT -

Find duplicate object values in an array and merge them - JAVASCRIPT - i have array of objects contain duplicate properties: next array sample: var jsondata = [{x:12, machine1: 7}, {x:15, machine2:7},{x:12, machine2: 8}]; so need merge objects same values of x next array: var jsondata = [{x:12, machine1:7, machine2:8}, {x:15, machine2:7}] i'm not sure if you're looking pure javascript, if are, here's 1 solution. it's bit heavy on nesting, gets job done. // loop through objects in array (var = 0; < jsondata.length; i++) { // loop through of objects beyond // don't increment automatically; later (var j = i+1; j < jsondata.length; ) { // check if our x values match if (jsondata[i].x == jsondata[j].x) { // loop through of keys in our matching object (var key in jsondata[j]) { // ensure key belongs object // avoid prototype inheritance problems if (jsondata[j].hasownproperty(key)) {

ASP.NET C# Personality Test -

ASP.NET C# Personality Test - i thought code personality test in asp.net using c# fine. works , doesn't. i'm not getting syntax errors, , said, works perfectly. there logic error i'm missing? <%@ page language="c#" debug="true" %> <!doctype html> <script runat="server"> public int m_score = 0; public int m_imagescore = 0; //displaying autopostback message selection of worklist drop-down list protected void worklistchanged(object sender, eventargs e) { if (worklist.selecteditem.text == "office work") lblwork.text = "you prefer remain within , code life away."; else if (worklist.selecteditem.text == "outdoor work") lblwork.text = "you enjoy great outdoors."; else if (worklist.selecteditem.text == "investigative work") lblwork.text = "ok, sherlock."; else if (worklist.selecteditem.text == "working people"

sql - Identifying Unique Visits by Customer -

sql - Identifying Unique Visits by Customer - i'm working in sql server , have table of customerid, visitdate, sales, , quantity. i'm trying calculate average check visit, how much client purchase on his/her first repeat purchase, 2nd repeat purchase, etc. also, how much time passes between each purchase. any guidance helpful, thanks! you can utilize row_number() , conditional aggregation. here exaple: select customerid, avg(sales) avgsales, max(case when segnum = 1 sales end) sales_01, max(case when segnum = 2 sales end) sales_02, max(case when segnum = 3 sales end) sales_03 (select t.*, row_number() on (partition customerid order visitdate) segnum table t ) t grouping customerid; by way, question should include sample data, desired results, , table layout, sql sql-server

Jquery Ui tooltip shows only one word -

Jquery Ui tooltip shows only one word - i using jqueryui display tool tip image. see first word in tooltip. may issue? withe below code see tool tip "high" instead of "high priority". return "<img title=high priority src=@url.content(links.content.images.high_png) />"; you missing quotes around title , src attributes. change this return "<img title=high priority src=@url.content(links.content.images.high_png) />"; to this return "<img title='high priority' src='@url.content(links.content.images.high_png)' />"; jquery jquery-ui tooltip

xpath - Look for a defined sequence-pattern in XML -

xpath - Look for a defined sequence-pattern in XML - i thinking how/if xquery can used check whether specific pattern exists in xml file. example: think of (simplified) xml representing process flow (startevent > usertask > autotask > endevent). <process> <startevent id="start1"> <outgoing>flow1</outgoing> </startevent> <usertask id="user1"> <incoming>flow1</incoming> <outgoing>flow2</outgoing> </usertask> <autotask id="auto1"> <incoming>flow2</incoming> <outgoing>flow3</outgoing> </autotask> <endevent id="end1"> <incoming>flow3</incoming> </endevent> <flow id="flow1" source="start1" target="user1"/> <flow id="flow2" source="user1" target="auto1"/> <flow id="flow3" source="auto1" targ

c# - Linq2SQL grouping and ungrouping in the same query -

c# - Linq2SQL grouping and ungrouping in the same query - here's stumper in linq sql: string p = prefix ?? ""; string d = delimiter ?? ""; var filegroups = b in folder.getfiles(data) b.uri.startswith(p) && b.uri.compareto(marker ?? "") >= 0 grouping b data.datacontext.getfilefolder(p, d, b.uri); //var folders = g in filegroups g.key.length > 0 select g; //var files = g in filegroups g.key.length == 0 select g; var files = filegroups.selectmany(g => g.key.length > 0 ? b in g.take(1) select new fileprefix { name = g.key } : b in g select new fileprefix { name = b.uri, original = b }); var retval = files.take(maxresults); folders cannot nested (out of control) filenames can contain slashes , whatever deeper folder construction can emulated folder.getfiles simple linq equiv (iorderedqueryable) select * files folderid=@folderid order uri prefix filter saying homecoming fi

xcode - Pass method to run on NSURLConnection's connectionDidFinishLoading -

xcode - Pass method to run on NSURLConnection's connectionDidFinishLoading - i'm creating app phone call api through function: func servercallapi(function:string, success:((result:nsdictionary) -> void)?) -> void { //code here set request send nsurlconnection allow connection:nsurlconnection = nsurlconnection(request: request, delegate: self, startimmediately: true)! //i want run passed on success function when connectiondidfinishloading called. } i need utilize nsurlconnection update ui when fetching data i might have queue servercallapis waiting in line run, every single own success function. final function needs able that it needs cancel if connection fails. perhaps dispatch or nsoperation? i'm lost on one... :( my problem cannot think of way phone call passed on success function when connectiondidfinishloadi

eclipse - Keep perspective configurations in new instance of Ecplise -

eclipse - Keep perspective configurations in new instance of Ecplise - in eclipse, when utilize window->new window command, new instance of eclipse opened using same workspace. however, 1 perspective available in toolbar (they remain available through menus) , configuration of every perspective (which views displayed , where) reset default values. is there way retain perspective configurations in new instance of eclipse? i found out can save perspective configurations in window->save perspective as. 1 time perspective saved, new window command uses these saved settings in new window. eclipse

python - Minimal developer setup of sorl-thumbnail with Django 1.7 -

python - Minimal developer setup of sorl-thumbnail with Django 1.7 - my initial goal utilize sorl-thumbnail in basic way cache on filesystem cropped images downloaded external sites. don't care performance @ moment , don't want yet setup systems (memcachedb, redis). using development runserver. on 1 hand docs create sound must utilize 1 of these 2 options. sense other places have read can setup not require these kv stores. 1 evidence that, see setting sorl.thumbnail.kvstores.dbm_kvstore.kvstore in reference docs (which says a simple key value store has no dependencies outside standard python library , uses dbm modules store data.), cannot work either (see below). using python 2.7.5, django 1.7.1, pillow 2.6.1, , sorl-thumbnail 12.1c. added sorl.thumbnail part of installed_apps. added settings.py: thumbnail_debug = true import logging sorl.thumbnail.log import thumbnailloghandler handler = thumbnailloghandler() handler.setlevel(logging.debug) logging.getlo

DhcpInfo isn't responding the netmask in Android Lolipop -

DhcpInfo isn't responding the netmask in Android Lolipop - yesterday update nexus 5 lollipop , application stops working, after little investigation found problem dhcpinfo isn't returning null on netmask variable. i couldn't find alternative class. any ideas? regards you can utilize getnetworkprefixlength method of interfaceaddress , networkinterface . returns right value in lollipop. networkinterface networkinterface = networkinterface.getbyinetaddress(ipaddress); (interfaceaddress address : networkinterface.getinterfaceaddresses()) { short netprefix = netaddress.getnetworkprefixlength()); } note: returns network prefix length, you'd have convert (/24 255.255.255.0 etc.) android android-5.0-lollipop netmask

microcontroller - how to find out the architecture of a chip?Pic or AVR? -

microcontroller - how to find out the architecture of a chip?Pic or AVR? - how find out microcontroller pic or avr?is name of microcontroller related it?what if name starts other letters rather pic or @ ? as other chip, if don't recognize family, up. 2 family names mention in particular limited microchip , atmel respectively, , company logo tends huge clue; it's not uncommon companies produce many architectures. instance, pic32 branded chips mips, , atmel create both arm , 8051 chips also, aside having 2 architectures under avr brand (8 , 32 bit). of these processor architectures, in turn tend split classes (often depending on factors programme memory size), , peripheral device setup tends more of import (an xmega far different attiny). microcontroller avr pic

why define android activity result_ok -1 -

why define android activity result_ok -1 - /** standard activity result: operation succeeded. */ public static final int result_ok = -1; why define result_ok -1 in android activity,not 1? as why "-1" chosen, 1 can guess. best guess android trying ensure result_ok not collide user-defined constants. is, when develop activity , define own response codes, chose positive integer values. if result_ok "1", there higher probability app developer might chose well. just theory. android android-activity

In Ruby, what is the difference between a class method and a class's singleton method? -

In Ruby, what is the difference between a class method and a class's singleton method? - i've seen in code before , read in grounded rubyist david a. black, there no examples of utilize cases help me understand why want define singleton method on class this: class vehicle class << self def all_makes # code here end end end how above singleton method on class different usual class method this: class vehicle def self.all_makes # code here end end yehuda katz made first-class writeup of differences (among other things). can find here. to give short summary. when defining class, self keyword refers class itself. so, when self.method defining new method on person class. every class has metaclass, known singleton class, can accessed , modified. in case of class << self opening singleton class , modifying value. functionally, result same, class beingness modified different. ruby singlet

c# - I can not get the date of birth from Google Plus API -

c# - I can not get the date of birth from Google Plus API - i trying user information's google plus api. next link g+ integration. here can information's except dob. must users date of birth. i have check link , this link. still can not dob. i seek alter scope. https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/plus.login but here getting error. the remote server returned error: notfound. please help me dob.. in advance.. update question: if utilize https://www.googleapis.com/plus/v1/people/me?access_token url getting response: { "kind": "plus#person", "etag": "\"vea_b94y77gdggrk7gfnpnolkqw/9l0erpghuny6znrniebs6cghc3y\"", "gender": "male", "emails": [ { "value": "kathir.likes@gmail.com", "type": "account" } ], "objecttype": &q

javascript - jQuery extending $.fn with an object? -

javascript - jQuery extending $.fn with an object? - using difference between jquery.extend , jquery.fn.extend? there way have $('.selector').group.method(); , $('.selector').group.method2(); right have in main script function forty() {}; var 40 = new forty(); (function(site) { $.extend(forty, { getbaseurl: function(extra) { = typeof !== 'undefined' ? : ''; homecoming forty.get('baseurl') + extra; }, get: function($what) { homecoming site[$what]; } }); })(site); then later in file have: $.extend(forty, { flyout: function() { $(this).on('click', function() { $('html').toggleclass('nav-open'); }); } }); and @ end have: $.fn.extend({forty: forty}); right before have line: $('.selector').forty.flyout(); so i'd $('.selector').forty.flyout(); is possible?

jquery - Can I animate the change of a background gradient? -

jquery - Can I animate the change of a background gradient? - i'm trying create gradient fade in background color. $('body').animate({ background: '-webkit-gradient(linear,left top,left bottom,from(#b0c4ff),to(#6289ff)) fixed)' }, 2000, function(){}); http://jsfiddle.net/mylf9o0j/3/ jquery animate backgroundcolor animation in css gradient colors make total page div , add together on background behind other elements. can create animate. check code below: class="snippet-code-js lang-js prettyprint-override"> function goodmorning(){ $('#background').animate({ opacity: 1 }, 2000); } goodmorning(); class="snippet-code-css lang-css prettyprint-override"> body{ background-color: red; } #background{ opacity: 0; position: absolute; top: 0px; bottom: 0px; left: 0px; right: 0px; z-index: -1; background: -webkit-gradient(linear,left to

python - plotting datetime object in matplotlib -

python - plotting datetime object in matplotlib - i have array of datetime objects following dates = [datetime.datetime(1900, 1, 1, 10, 8, 14, 565000), datetime.datetime(1900, 1, 1, 10, 8, 35, 330000), datetime.datetime(1900, 1, 1, 10, 8, 43, 358000), datetime.datetime(1900, 1, 1, 10, 8, 52, 808000)] i tried converting array matplotlib suitable objects using dates = plt.dates.date2num(dates) then tried plot against values using ax1.plot_date(dates, datac) but received errors follows: exception in tkinter callback traceback (most recent phone call last): file "c:\python34\lib\tkinter\__init__.py", line 1487, in __call__ homecoming self.func(*args) file "c:\python34\lib\site-packages\matplotlib\backends\backend_tkagg.py", line 278, in resize self.show() file "c:\python34\lib\site-packages\matplotlib\backends\backend_tkagg.py", line 349, in draw figurecanvasagg.draw(self) file "c:\python34\lib\site-packages\matplot

How to get Thumbnail in facebook status? -

How to get Thumbnail in facebook status? - no thumbnail in facebook status when share website url... please help... screen shot:- http://i.stack.imgur.com/n7o6g.png header meta code <head> <title><?= name_page ?> site name</title> <link rel="stylesheet" href="/frontend/css/style.css" /> <link rel="stylesheet" href="/frontend/css/font-awesome.min.css" /> <link rel="stylesheet" href="/frontend/css/animate.css" /> <link rel="shortcut icon" type="image/x-icon" href="/frontend/images/favicon.ico"> <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /> <link href='http://fonts.googleapis.com/css?family=ubuntu&subset=latin,latin-ext' rel='stylesheet' type='text/css'> <meta charset="utf-8" /> <meta name="viewport"

java - libgdx animation inside of a rectangle - collison detection - rectangles -

java - libgdx animation inside of a rectangle - collison detection - rectangles - i writing rpg game similar style of pokemon (top downwards view). working on issue of collision detection. wanting create collision detection based on rectangles. problem having difficulty drawing rectangle around animation have set. have searched google , youtube answer/tutorial of how handle problem yet found nothing. player.class public class player { public vector2 position; private float movespeed; private spritebatch batch; //animation public animation an; private texture tex; public textureregion currentframe; private textureregion[][] frames; private float frametime; public player(vector2 position){ this.position = position; movespeed = 5f; createplayer(); } public void createplayer(){ tex = new texture("sprites/image.png"); frames = textureregion.split(tex, tex.getwidth()/3, tex.getheight()/4); = new animation(0.10f, frames[0]); } public void